Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7eb40855
提交
7eb40855
authored
17 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
7430fb79
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
60 行增加
和
34 行删除
+60
-34
history.html
h2/src/docsrc/html/history.html
+3
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+56
-32
没有找到文件。
h2/src/docsrc/html/history.html
浏览文件 @
7eb40855
...
...
@@ -37,7 +37,9 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0 / TODO (Build TODO)
</h3><ul>
<li>
If large result sets (backed by a temporary file) where not closed, the file was not deleted.
<li>
New column ID for INFORMATION_SCHEMA.INDEXES, SEQUENCES, USERS, ROLES, RIGHTS,
FUNCTION_ALIASES, SCHEMATA, VIEWS, CONSTRAINTS, CONSTANTS, DOMAINS, TRIGGERS.
</li><li>
If large result sets (backed by a temporary file) where not closed, the file was not deleted.
Now, the default result set type is FETCH_FORWARD. This means temp files are deleted
automatically (without having to close the result set explicitly). But it also means
ResultSet.beforeFirst can only be called for scrollable result sets. To create a scrollable resut set,
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
7eb40855
...
...
@@ -614,7 +614,7 @@ public class Database implements DataHandler {
}
private
void
addMetaData
(
int
type
)
throws
SQLException
{
MetaTable
m
=
new
MetaTable
(
infoSchema
,
type
);
MetaTable
m
=
new
MetaTable
(
infoSchema
,
-
1
-
type
,
type
);
infoSchema
.
add
(
m
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
7eb40855
...
...
@@ -71,9 +71,9 @@ public class MetaTable extends Table {
private
MetaIndex
index
;
private
int
indexColumn
;
public
MetaTable
(
Schema
schema
,
int
type
)
throws
SQLException
{
public
MetaTable
(
Schema
schema
,
int
id
,
int
type
)
throws
SQLException
{
// tableName will be set later
super
(
schema
,
0
,
null
,
true
);
super
(
schema
,
id
,
null
,
true
);
this
.
type
=
type
;
Column
[]
cols
;
String
indexColumnName
=
null
;
...
...
@@ -139,7 +139,8 @@ public class MetaTable extends Table {
"ASC_OR_DESC"
,
"PAGES INT"
,
"FILTER_CONDITION"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
indexColumnName
=
"TABLE_NAME"
;
break
;
...
...
@@ -197,7 +198,8 @@ public class MetaTable extends Table {
"CURRENT_VALUE BIGINT"
,
"INCREMENT BIGINT"
,
"IS_GENERATED BIT"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
break
;
case
USERS:
...
...
@@ -205,14 +207,16 @@ public class MetaTable extends Table {
cols
=
createColumns
(
new
String
[]{
"NAME"
,
"ADMIN"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
break
;
case
ROLES:
setObjectName
(
"ROLES"
);
cols
=
createColumns
(
new
String
[]{
"NAME"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
break
;
case
RIGHTS:
...
...
@@ -223,7 +227,8 @@ public class MetaTable extends Table {
"GRANTEDROLE"
,
"RIGHTS"
,
"TABLE_SCHEMA"
,
"TABLE_NAME"
"TABLE_NAME"
,
"ID INT"
});
indexColumnName
=
"TABLE_NAME"
;
break
;
...
...
@@ -238,7 +243,8 @@ public class MetaTable extends Table {
"DATA_TYPE INT"
,
"COLUMN_COUNT INT"
,
"RETURNS_RESULT SMALLINT"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
break
;
case
FUNCTION_COLUMNS:
...
...
@@ -270,7 +276,8 @@ public class MetaTable extends Table {
"DEFAULT_CHARACTER_SET_NAME"
,
"DEFAULT_COLLATION_NAME"
,
"IS_DEFAULT BIT"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
break
;
case
TABLE_PRIVILEGES:
...
...
@@ -317,7 +324,8 @@ public class MetaTable extends Table {
"CHECK_OPTION"
,
"IS_UPDATABLE"
,
"STATUS"
,
"REMARKS"
"REMARKS"
,
"ID INT"
});
indexColumnName
=
"TABLE_NAME"
;
break
;
...
...
@@ -362,6 +370,7 @@ public class MetaTable extends Table {
"COLUMN_LIST"
,
"REMARKS"
,
"SQL"
,
"ID INT"
});
indexColumnName
=
"TABLE_NAME"
;
break
;
...
...
@@ -374,6 +383,7 @@ public class MetaTable extends Table {
"DATA_TYPE SMALLINT"
,
"REMARKS"
,
"SQL"
,
"ID INT"
});
break
;
case
DOMAINS:
...
...
@@ -392,6 +402,7 @@ public class MetaTable extends Table {
"CHECK_CONSTRAINT"
,
"REMARKS"
,
"SQL"
,
"ID INT"
});
break
;
case
TRIGGERS:
...
...
@@ -410,6 +421,7 @@ public class MetaTable extends Table {
"NO_WAIT BIT"
,
"REMARKS"
,
"SQL"
,
"ID INT"
});
break
;
default
:
...
...
@@ -614,7 +626,8 @@ public class MetaTable extends Table {
"A"
,
// ASC_OR_DESC
"0"
,
// PAGES
""
,
// FILTER_CONDITION
replaceNullWithEmpty
(
index
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
index
.
getComment
()),
// REMARKS
""
+
index
.
getId
()
// ID
});
}
}
...
...
@@ -760,7 +773,8 @@ public class MetaTable extends Table {
String
.
valueOf
(
s
.
getCurrentValue
()),
// CURRENT_VALUE
String
.
valueOf
(
s
.
getIncrement
()),
// INCREMENT
s
.
getBelongsToTable
()
?
"TRUE"
:
"FALSE"
,
// IS_GENERATED
replaceNullWithEmpty
(
s
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
s
.
getComment
()),
// REMARKS
""
+
s
.
getId
()
// ID
});
}
break
;
...
...
@@ -772,7 +786,8 @@ public class MetaTable extends Table {
add
(
rows
,
new
String
[]{
identifier
(
u
.
getName
()),
// NAME
String
.
valueOf
(
u
.
getAdmin
()),
// ADMIN
replaceNullWithEmpty
(
u
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
u
.
getComment
()),
// REMARKS
""
+
u
.
getId
()
//
});
}
break
;
...
...
@@ -783,7 +798,8 @@ public class MetaTable extends Table {
Role
r
=
(
Role
)
roles
.
get
(
i
);
add
(
rows
,
new
String
[]{
identifier
(
r
.
getName
()),
// NAME
replaceNullWithEmpty
(
r
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
r
.
getComment
()),
// REMARKS
""
+
r
.
getId
()
// ID
});
}
break
;
...
...
@@ -792,7 +808,6 @@ public class MetaTable extends Table {
ObjectArray
rights
=
database
.
getAllRights
();
for
(
int
i
=
0
;
i
<
rights
.
size
();
i
++)
{
Right
r
=
(
Right
)
rights
.
get
(
i
);
// "GRANTEE", "GRANTEETYPE", "GRANTEDROLE", "RIGHTS", "TABLE"
Role
role
=
r
.
getGrantedRole
();
DbObject
grantee
=
r
.
getGrantee
();
String
type
=
grantee
.
getType
()
==
DbObject
.
USER
?
"USER"
:
"ROLE"
;
...
...
@@ -803,21 +818,23 @@ public class MetaTable extends Table {
continue
;
}
add
(
rows
,
new
String
[]{
identifier
(
grantee
.
getName
()),
type
,
""
,
r
.
getRights
(),
identifier
(
granted
.
getSchema
().
getName
()),
identifier
(
granted
.
getName
())
identifier
(
grantee
.
getName
()),
// GRANTEE
type
,
// GRANTEETYPE
""
,
// GRANTEDROLE
r
.
getRights
(),
// RIGHTS
identifier
(
granted
.
getSchema
().
getName
()),
// TABLE_SCHEMA
identifier
(
granted
.
getName
()),
// TABLE_NAME
""
+
r
.
getId
()
// ID
});
}
else
{
add
(
rows
,
new
String
[]{
identifier
(
grantee
.
getName
()),
type
,
identifier
(
role
.
getName
()),
""
,
""
,
""
identifier
(
grantee
.
getName
()),
// GRANTEE
type
,
// GRANTEETYPE
identifier
(
role
.
getName
()),
// GRANTEDROLE
""
,
// RIGHTS
""
,
// TABLE_SCHEMA
""
,
// TABLE_NAME
""
+
r
.
getId
()
// ID
});
}
}
...
...
@@ -837,7 +854,8 @@ public class MetaTable extends Table {
""
+
DataType
.
convertTypeToSQLType
(
alias
.
getDataType
()),
// DATA_TYPE
""
+
alias
.
getColumnClasses
().
length
,
// COLUMN_COUNT INT
""
+
returnsResult
,
// RETURNS_RESULT SMALLINT
replaceNullWithEmpty
(
alias
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
alias
.
getComment
()),
// REMARKS
""
+
alias
.
getId
()
// ID
});
}
break
;
...
...
@@ -885,7 +903,8 @@ public class MetaTable extends Table {
Constants
.
CHARACTER_SET_NAME
,
// DEFAULT_CHARACTER_SET_NAME
collation
,
// DEFAULT_COLLATION_NAME
Constants
.
SCHEMA_MAIN
.
equals
(
schema
.
getName
())
?
"TRUE"
:
"FALSE"
,
// IS_DEFAULT
replaceNullWithEmpty
(
schema
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
schema
.
getComment
()),
// REMARKS
""
+
schema
.
getId
()
// ID
});
}
break
;
...
...
@@ -959,7 +978,8 @@ public class MetaTable extends Table {
"NONE"
,
// CHECK_OPTION
"NO"
,
// IS_UPDATABLE
view
.
getInvalid
()
?
"INVALID"
:
"VALID"
,
// STATUS
replaceNullWithEmpty
(
view
.
getComment
())
// REMARKS
replaceNullWithEmpty
(
view
.
getComment
()),
// REMARKS
""
+
view
.
getId
()
// ID
});
}
break
;
...
...
@@ -1056,6 +1076,7 @@ public class MetaTable extends Table {
columnList
,
// COLUMN_LIST
replaceNullWithEmpty
(
constraint
.
getComment
()),
// REMARKS
constraint
.
getCreateSQL
(),
// SQL
""
+
constraint
.
getId
()
// ID
});
}
break
;
...
...
@@ -1072,6 +1093,7 @@ public class MetaTable extends Table {
""
+
DataType
.
convertTypeToSQLType
(
expr
.
getType
()),
// CONSTANT_TYPE
replaceNullWithEmpty
(
constant
.
getComment
()),
// REMARKS
expr
.
getSQL
(),
// SQL
""
+
constant
.
getId
()
// ID
});
}
break
;
...
...
@@ -1094,7 +1116,8 @@ public class MetaTable extends Table {
""
+
col
.
getSelectivity
(),
// SELECTIVITY INT
""
+
col
.
getCheckConstraintSQL
(
session
,
"VALUE"
),
// CHECK_CONSTRAINT
replaceNullWithEmpty
(
dt
.
getComment
()),
// REMARKS
""
+
dt
.
getCreateSQL
()
// SQL
""
+
dt
.
getCreateSQL
(),
// SQL
""
+
dt
.
getId
()
// ID
});
}
break
;
...
...
@@ -1117,7 +1140,8 @@ public class MetaTable extends Table {
""
+
trigger
.
getQueueSize
(),
// QUEUE_SIZE INT
""
+
trigger
.
getNoWait
(),
// NO_WAIT BIT
replaceNullWithEmpty
(
trigger
.
getComment
()),
// REMARKS
trigger
.
getSQL
()
// SQL
trigger
.
getSQL
(),
// SQL
""
+
trigger
.
getId
()
// ID
});
}
break
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论