Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2b2adb7c
提交
2b2adb7c
authored
17 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
dd54730f
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
91 行增加
和
4 行删除
+91
-4
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+17
-0
ConstraintUnique.java
h2/src/main/org/h2/constraint/ConstraintUnique.java
+1
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+32
-0
FunctionAlias.java
h2/src/main/org/h2/engine/FunctionAlias.java
+8
-0
RightOwner.java
h2/src/main/org/h2/engine/RightOwner.java
+7
-0
Session.java
h2/src/main/org/h2/engine/Session.java
+7
-0
CompareLike.java
h2/src/main/org/h2/expression/CompareLike.java
+8
-0
Comparison.java
h2/src/main/org/h2/expression/Comparison.java
+1
-1
Function.java
h2/src/main/org/h2/expression/Function.java
+9
-1
TableFunction.java
h2/src/main/org/h2/expression/TableFunction.java
+1
-1
没有找到文件。
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
2b2adb7c
...
@@ -70,10 +70,27 @@ public class ConstraintReferential extends Constraint {
...
@@ -70,10 +70,27 @@ public class ConstraintReferential extends Constraint {
}
}
}
}
/**
* Create the SQL statement of this object so a copy of the table can be made.
*
* @param table the table to create the object for
* @param quotedName the name of this object (quoted if necessary)
* @return the SQL statement
*/
public
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
)
{
public
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
)
{
return
getCreateSQLForCopy
(
table
,
refTable
,
quotedName
,
true
);
return
getCreateSQLForCopy
(
table
,
refTable
,
quotedName
,
true
);
}
}
int
test
;
/**
* Create the SQL statement of this object so a copy of the table can be made.
*
* @param table the table to create the object for
* @param refTable the referenced table
* @param quotedName the name of this object (quoted if necessary)
* @param internalIndex add the index name to the statement
* @return the SQL statement
*/
public
String
getCreateSQLForCopy
(
Table
table
,
Table
refTable
,
String
quotedName
,
boolean
internalIndex
)
{
public
String
getCreateSQLForCopy
(
Table
table
,
Table
refTable
,
String
quotedName
,
boolean
internalIndex
)
{
StringBuffer
buff
=
new
StringBuffer
();
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"ALTER TABLE "
);
buff
.
append
(
"ALTER TABLE "
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/constraint/ConstraintUnique.java
浏览文件 @
2b2adb7c
...
@@ -40,7 +40,7 @@ public class ConstraintUnique extends Constraint {
...
@@ -40,7 +40,7 @@ public class ConstraintUnique extends Constraint {
return
getCreateSQLForCopy
(
table
,
quotedName
,
true
);
return
getCreateSQLForCopy
(
table
,
quotedName
,
true
);
}
}
p
ublic
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
,
boolean
internalIndex
)
{
p
rivate
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
,
boolean
internalIndex
)
{
StringBuffer
buff
=
new
StringBuffer
();
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"ALTER TABLE "
);
buff
.
append
(
"ALTER TABLE "
);
buff
.
append
(
table
.
getSQL
());
buff
.
append
(
table
.
getSQL
());
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
2b2adb7c
...
@@ -1088,6 +1088,13 @@ public class Database implements DataHandler {
...
@@ -1088,6 +1088,13 @@ public class Database implements DataHandler {
addMeta
(
session
,
obj
);
addMeta
(
session
,
obj
);
}
}
/**
* Rename a schema object.
*
* @param session the session
* @param obj the object
* @param newName the new name
*/
public
synchronized
void
renameSchemaObject
(
Session
session
,
SchemaObject
obj
,
String
newName
)
throws
SQLException
{
public
synchronized
void
renameSchemaObject
(
Session
session
,
SchemaObject
obj
,
String
newName
)
throws
SQLException
{
obj
.
getSchema
().
rename
(
obj
,
newName
);
obj
.
getSchema
().
rename
(
obj
,
newName
);
updateWithChildren
(
session
,
obj
);
updateWithChildren
(
session
,
obj
);
...
@@ -1109,6 +1116,13 @@ public class Database implements DataHandler {
...
@@ -1109,6 +1116,13 @@ public class Database implements DataHandler {
}
}
}
}
/**
* Rename a database object.
*
* @param session the session
* @param obj the object
* @param newName the new name
*/
public
synchronized
void
renameDatabaseObject
(
Session
session
,
DbObject
obj
,
String
newName
)
throws
SQLException
{
public
synchronized
void
renameDatabaseObject
(
Session
session
,
DbObject
obj
,
String
newName
)
throws
SQLException
{
int
type
=
obj
.
getType
();
int
type
=
obj
.
getType
();
HashMap
map
=
getMap
(
type
);
HashMap
map
=
getMap
(
type
);
...
@@ -1177,6 +1191,14 @@ public class Database implements DataHandler {
...
@@ -1177,6 +1191,14 @@ public class Database implements DataHandler {
}
}
}
}
/**
* Get or create the specified storage object.
*
* @param reader the record reader
* @param id the object id
* @param dataFile true if the data is in the data file
* @return the storage
*/
public
Storage
getStorage
(
RecordReader
reader
,
int
id
,
boolean
dataFile
)
{
public
Storage
getStorage
(
RecordReader
reader
,
int
id
,
boolean
dataFile
)
{
DiskFile
file
;
DiskFile
file
;
if
(
dataFile
)
{
if
(
dataFile
)
{
...
@@ -1421,6 +1443,16 @@ public class Database implements DataHandler {
...
@@ -1421,6 +1443,16 @@ public class Database implements DataHandler {
}
}
}
}
/**
* Set the progress of a long running operation.
* This method calls the {@link DatabaseEventListener} if one is registered.
*
* @param state the {@link DatabaseEventListener} state
* @param name the object name
* @param x the current position
* @param max the highest value
*/
public
void
setProgress
(
int
state
,
String
name
,
int
x
,
int
max
)
{
public
void
setProgress
(
int
state
,
String
name
,
int
x
,
int
max
)
{
if
(
eventListener
!=
null
)
{
if
(
eventListener
!=
null
)
{
try
{
try
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/FunctionAlias.java
浏览文件 @
2b2adb7c
...
@@ -153,6 +153,14 @@ public class FunctionAlias extends DbObjectBase {
...
@@ -153,6 +153,14 @@ public class FunctionAlias extends DbObjectBase {
return
getValue
(
session
,
args
,
false
);
return
getValue
(
session
,
args
,
false
);
}
}
/**
* Call the user defined function and return the value.
*
* @param session the session
* @param args the argument list
* @param columnList true if the function should only return the column list
* @return the value
*/
public
synchronized
Value
getValue
(
Session
session
,
Expression
[]
args
,
boolean
columnList
)
throws
SQLException
{
public
synchronized
Value
getValue
(
Session
session
,
Expression
[]
args
,
boolean
columnList
)
throws
SQLException
{
load
();
load
();
Class
[]
paramClasses
=
javaMethod
.
getParameterTypes
();
Class
[]
paramClasses
=
javaMethod
.
getParameterTypes
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/RightOwner.java
浏览文件 @
2b2adb7c
...
@@ -94,6 +94,13 @@ public abstract class RightOwner extends DbObjectBase {
...
@@ -94,6 +94,13 @@ public abstract class RightOwner extends DbObjectBase {
}
}
}
}
/**
* Grant a role to this object.
*
* @param session the session
* @param role the role
* @param right the right to grant
*/
public
void
grantRole
(
Session
session
,
Role
role
,
Right
right
)
{
public
void
grantRole
(
Session
session
,
Role
role
,
Right
right
)
{
if
(
grantedRoles
==
null
)
{
if
(
grantedRoles
==
null
)
{
grantedRoles
=
new
HashMap
();
grantedRoles
=
new
HashMap
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Session.java
浏览文件 @
2b2adb7c
...
@@ -358,6 +358,13 @@ public class Session implements SessionInterface {
...
@@ -358,6 +358,13 @@ public class Session implements SessionInterface {
locks
.
add
(
table
);
locks
.
add
(
table
);
}
}
/**
* Add an undo log entry to this session.
*
* @param table the table
* @param type the operation type (see {@link UndoLogRecord})
* @param row the row
*/
public
void
log
(
Table
table
,
short
type
,
Row
row
)
throws
SQLException
{
public
void
log
(
Table
table
,
short
type
,
Row
row
)
throws
SQLException
{
log
(
new
UndoLogRecord
(
table
,
type
,
row
));
log
(
new
UndoLogRecord
(
table
,
type
,
row
));
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/CompareLike.java
浏览文件 @
2b2adb7c
...
@@ -259,6 +259,14 @@ public class CompareLike extends Condition {
...
@@ -259,6 +259,14 @@ public class CompareLike extends Condition {
return
si
==
sLen
;
return
si
==
sLen
;
}
}
/**
* Test if the value matches the pattern.
*
* @param pattern the pattern
* @param value the value
* @param escape the escape character
* @return true if the value matches
*/
public
boolean
test
(
String
pattern
,
String
value
,
char
escape
)
throws
SQLException
{
public
boolean
test
(
String
pattern
,
String
value
,
char
escape
)
throws
SQLException
{
initPattern
(
pattern
,
escape
);
initPattern
(
pattern
,
escape
);
return
compareAt
(
value
,
0
,
0
,
value
.
length
());
return
compareAt
(
value
,
0
,
0
,
value
.
length
());
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/Comparison.java
浏览文件 @
2b2adb7c
...
@@ -176,7 +176,7 @@ public class Comparison extends Condition {
...
@@ -176,7 +176,7 @@ public class Comparison extends Condition {
return
ValueBoolean
.
get
(
result
);
return
ValueBoolean
.
get
(
result
);
}
}
public
static
boolean
compareNotNull
(
Database
database
,
Value
l
,
Value
r
,
int
compareType
)
throws
SQLException
{
static
boolean
compareNotNull
(
Database
database
,
Value
l
,
Value
r
,
int
compareType
)
throws
SQLException
{
boolean
result
;
boolean
result
;
switch
(
compareType
)
{
switch
(
compareType
)
{
case
EQUAL:
case
EQUAL:
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/Function.java
浏览文件 @
2b2adb7c
...
@@ -379,7 +379,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -379,7 +379,7 @@ public class Function extends Expression implements FunctionCall {
return
null
;
return
null
;
}
}
p
ublic
Value
getSimpleValue
(
Session
session
,
Value
v0
,
Expression
[]
args
)
throws
SQLException
{
p
rivate
Value
getSimpleValue
(
Session
session
,
Value
v0
,
Expression
[]
args
)
throws
SQLException
{
Value
result
;
Value
result
;
switch
(
info
.
type
)
{
switch
(
info
.
type
)
{
case
ABS:
case
ABS:
...
@@ -1558,6 +1558,14 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1558,6 +1558,14 @@ public class Function extends Expression implements FunctionCall {
}
}
}
}
/**
* Set the result data type of this function.
*
* @param dataType the data type
* @param precision the precision
* @param scale the scale
* @param displaySize the display size
*/
public
void
setDataType
(
int
dataType
,
long
precision
,
int
scale
,
int
displaySize
)
{
public
void
setDataType
(
int
dataType
,
long
precision
,
int
scale
,
int
displaySize
)
{
this
.
dataType
=
dataType
;
this
.
dataType
=
dataType
;
this
.
precision
=
precision
;
this
.
precision
=
precision
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/TableFunction.java
浏览文件 @
2b2adb7c
...
@@ -93,7 +93,7 @@ public class TableFunction extends Function implements FunctionCall {
...
@@ -93,7 +93,7 @@ public class TableFunction extends Function implements FunctionCall {
columns
.
toArray
(
columnList
);
columns
.
toArray
(
columnList
);
}
}
p
ublic
ValueResultSet
getTable
(
Session
session
,
Expression
[]
args
,
boolean
onlyColumnList
,
boolean
distinct
)
throws
SQLException
{
p
rivate
ValueResultSet
getTable
(
Session
session
,
Expression
[]
args
,
boolean
onlyColumnList
,
boolean
distinct
)
throws
SQLException
{
int
len
=
columnList
.
length
;
int
len
=
columnList
.
length
;
Expression
[]
header
=
new
Expression
[
len
];
Expression
[]
header
=
new
Expression
[
len
];
Database
db
=
session
.
getDatabase
();
Database
db
=
session
.
getDatabase
();
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论