Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4832cdea
提交
4832cdea
authored
3月 31, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DatabaseMetaData.getCrossReference now also lists the name of the primary index (PK_NAME).
上级
48bce83f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
13 行删除
+25
-13
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+1
-1
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+2
-2
test-1.3.txt
h2/src/test/org/h2/test/test-1.3.txt
+22
-10
没有找到文件。
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
4832cdea
...
...
@@ -1334,7 +1334,7 @@ public class MetaTable extends Table {
// FK_NAME
identifier
(
ref
.
getName
()),
// PK_NAME
null
,
identifier
(
ref
.
getUniqueIndex
().
getName
())
,
// DEFERRABILITY
""
+
DatabaseMetaData
.
importedKeyNotDeferrable
);
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
4832cdea
...
...
@@ -366,10 +366,10 @@ public class TestMetaData extends TestBase {
assertResultSetOrdered
(
rs
,
new
String
[][]
{
{
catalog
,
Constants
.
SCHEMA_MAIN
,
"PARENT"
,
"A"
,
catalog
,
Constants
.
SCHEMA_MAIN
,
"CHILD"
,
"PA"
,
"1"
,
""
+
DatabaseMetaData
.
importedKeyRestrict
,
""
+
DatabaseMetaData
.
importedKeyRestrict
,
"AB"
,
null
,
""
+
DatabaseMetaData
.
importedKeyNotDeferrable
},
"PRIMARY_KEY_8"
,
""
+
DatabaseMetaData
.
importedKeyNotDeferrable
},
{
catalog
,
Constants
.
SCHEMA_MAIN
,
"PARENT"
,
"B"
,
catalog
,
Constants
.
SCHEMA_MAIN
,
"CHILD"
,
"PB"
,
"2"
,
""
+
DatabaseMetaData
.
importedKeyRestrict
,
""
+
DatabaseMetaData
.
importedKeyRestrict
,
"AB"
,
null
,
""
+
DatabaseMetaData
.
importedKeyNotDeferrable
}
});
"PRIMARY_KEY_8"
,
""
+
DatabaseMetaData
.
importedKeyNotDeferrable
}
});
}
private
void
testTempTable
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/test-1.3.txt
浏览文件 @
4832cdea
...
...
@@ -439,6 +439,18 @@ show columns from test;
> X INTEGER(10) YES NULL
> rows: 3
show columns from catalogs from information_schema;
> FIELD TYPE NULL KEY DEFAULT
> ------------ ------------------- ---- --- -------
> CATALOG_NAME VARCHAR(2147483647) YES NULL
> rows: 1
show columns from information_schema.catalogs;
> FIELD TYPE NULL KEY DEFAULT
> ------------ ------------------- ---- --- -------
> CATALOG_NAME VARCHAR(2147483647) YES NULL
> rows: 1
drop table test;
> ok
...
...
@@ -2347,18 +2359,18 @@ CREATE TABLE child(parentid int REFERENCES parent);
> ok
select * from INFORMATION_SCHEMA.CROSS_REFERENCES;
> PKTABLE_CATALOG PKTABLE_SCHEMA PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CATALOG FKTABLE_SCHEMA FKTABLE_NAME FKCOLUMN_NAME ORDINAL_POSITION UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY
> --------------- -------------- ------------ ------------- --------------- -------------- ------------ ------------- ---------------- ----------- ----------- ------------ ------- -------------
> SCRIPT PUBLIC PARENT ID SCRIPT PUBLIC CHILD PARENTID 1 1 1 CONSTRAINT_3
null
7
> PKTABLE_CATALOG PKTABLE_SCHEMA PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CATALOG FKTABLE_SCHEMA FKTABLE_NAME FKCOLUMN_NAME ORDINAL_POSITION UPDATE_RULE DELETE_RULE FK_NAME PK_NAME
DEFERRABILITY
> --------------- -------------- ------------ ------------- --------------- -------------- ------------ ------------- ---------------- ----------- ----------- ------------ -------
------
-------------
> SCRIPT PUBLIC PARENT ID SCRIPT PUBLIC CHILD PARENTID 1 1 1 CONSTRAINT_3
PRIMARY_KEY_8
7
> rows: 1
ALTER TABLE parent ADD COLUMN name varchar;
> ok
select * from INFORMATION_SCHEMA.CROSS_REFERENCES;
> PKTABLE_CATALOG PKTABLE_SCHEMA PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CATALOG FKTABLE_SCHEMA FKTABLE_NAME FKCOLUMN_NAME ORDINAL_POSITION UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY
> --------------- -------------- ------------ ------------- --------------- -------------- ------------ ------------- ---------------- ----------- ----------- ------------ ------- -------------
> SCRIPT PUBLIC PARENT ID SCRIPT PUBLIC CHILD PARENTID 1 1 1 CONSTRAINT_3
null
7
> PKTABLE_CATALOG PKTABLE_SCHEMA PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CATALOG FKTABLE_SCHEMA FKTABLE_NAME FKCOLUMN_NAME ORDINAL_POSITION UPDATE_RULE DELETE_RULE FK_NAME PK_NAME
DEFERRABILITY
> --------------- -------------- ------------ ------------- --------------- -------------- ------------ ------------- ---------------- ----------- ----------- ------------ -------
------
-------------
> SCRIPT PUBLIC PARENT ID SCRIPT PUBLIC CHILD PARENTID 1 1 1 CONSTRAINT_3
PRIMARY_KEY_1
7
> rows: 1
drop table parent, child;
...
...
@@ -8098,10 +8110,10 @@ CREATE TABLE CHILD(ID INT PRIMARY KEY, PA INT, PB INT, CONSTRAINT AB FOREIGN KEY
> ok
SELECT * FROM INFORMATION_SCHEMA.CROSS_REFERENCES;
> PKTABLE_CATALOG PKTABLE_SCHEMA PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CATALOG FKTABLE_SCHEMA FKTABLE_NAME FKCOLUMN_NAME ORDINAL_POSITION UPDATE_RULE DELETE_RULE FK_NAME PK_NAME DEFERRABILITY
> --------------- -------------- ------------ ------------- --------------- -------------- ------------ ------------- ---------------- ----------- ----------- ------- ------- -------------
> SCRIPT PUBLIC PARENT A SCRIPT PUBLIC CHILD PA 1 1 1 AB
null
7
> SCRIPT PUBLIC PARENT B SCRIPT PUBLIC CHILD PB 2 1 1 AB
null
7
> PKTABLE_CATALOG PKTABLE_SCHEMA PKTABLE_NAME PKCOLUMN_NAME FKTABLE_CATALOG FKTABLE_SCHEMA FKTABLE_NAME FKCOLUMN_NAME ORDINAL_POSITION UPDATE_RULE DELETE_RULE FK_NAME PK_NAME
DEFERRABILITY
> --------------- -------------- ------------ ------------- --------------- -------------- ------------ ------------- ---------------- ----------- ----------- ------- -------
------
-------------
> SCRIPT PUBLIC PARENT A SCRIPT PUBLIC CHILD PA 1 1 1 AB
PRIMARY_KEY_8
7
> SCRIPT PUBLIC PARENT B SCRIPT PUBLIC CHILD PB 2 1 1 AB
PRIMARY_KEY_8
7
> rows: 2
DROP TABLE PARENT;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论