Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c9a74ee4
提交
c9a74ee4
authored
3月 26, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Return JDBC 4.1 from JdbcDatabaseMetaData.getJDBC*Version()
上级
a2bc5e97
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
14 行删除
+9
-14
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+5
-10
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+4
-4
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
c9a74ee4
...
@@ -290,8 +290,6 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -290,8 +290,6 @@ public class JdbcDatabaseMetaData extends TraceObject implements
* <li>SOURCE_DATA_TYPE (short) null</li>
* <li>SOURCE_DATA_TYPE (short) null</li>
* <li>IS_AUTOINCREMENT (String) "NO" or "YES"</li>
* <li>IS_AUTOINCREMENT (String) "NO" or "YES"</li>
* <li>IS_GENERATEDCOLUMN (String) "NO" or "YES"</li>
* <li>IS_GENERATEDCOLUMN (String) "NO" or "YES"</li>
* <li>SCOPE_CATLOG (String) always null (the typo is on purpose,
* for compatibility with the JDBC specification prior to 4.1)</li>
* </ol>
* </ol>
*
*
* @param catalogPattern null (to get all objects) or the catalog name
* @param catalogPattern null (to get all objects) or the catalog name
...
@@ -344,8 +342,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -344,8 +342,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements
+
"SCOPE_TABLE, "
+
"SCOPE_TABLE, "
+
"SOURCE_DATA_TYPE, "
+
"SOURCE_DATA_TYPE, "
+
"IS_AUTOINCREMENT, "
+
"IS_AUTOINCREMENT, "
+
"IS_GENERATEDCOLUMN, "
+
"IS_GENERATEDCOLUMN "
+
"SCOPE_CATLOG "
+
"FROM ("
+
"FROM ("
+
"SELECT "
+
"SELECT "
+
"s.SYNONYM_CATALOG TABLE_CAT, "
+
"s.SYNONYM_CATALOG TABLE_CAT, "
...
@@ -373,8 +370,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -373,8 +370,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements
+
"CASE WHEN c.SEQUENCE_NAME IS NULL THEN "
+
"CASE WHEN c.SEQUENCE_NAME IS NULL THEN "
+
"CAST(?1 AS VARCHAR) ELSE CAST(?2 AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CAST(?1 AS VARCHAR) ELSE CAST(?2 AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CASE WHEN c.IS_COMPUTED THEN "
+
"CASE WHEN c.IS_COMPUTED THEN "
+
"CAST(?2 AS VARCHAR) ELSE CAST(?1 AS VARCHAR) END IS_GENERATEDCOLUMN, "
+
"CAST(?2 AS VARCHAR) ELSE CAST(?1 AS VARCHAR) END IS_GENERATEDCOLUMN "
+
"CAST(c.SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG "
+
"FROM INFORMATION_SCHEMA.COLUMNS c JOIN INFORMATION_SCHEMA.SYNONYMS s ON "
+
"FROM INFORMATION_SCHEMA.COLUMNS c JOIN INFORMATION_SCHEMA.SYNONYMS s ON "
+
"s.SYNONYM_FOR = c.TABLE_NAME "
+
"s.SYNONYM_FOR = c.TABLE_NAME "
+
"AND s.SYNONYM_FOR_SCHEMA = c.TABLE_SCHEMA "
+
"AND s.SYNONYM_FOR_SCHEMA = c.TABLE_SCHEMA "
...
@@ -410,8 +406,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -410,8 +406,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements
+
"CASE WHEN SEQUENCE_NAME IS NULL THEN "
+
"CASE WHEN SEQUENCE_NAME IS NULL THEN "
+
"CAST(?1 AS VARCHAR) ELSE CAST(?2 AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CAST(?1 AS VARCHAR) ELSE CAST(?2 AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CASE WHEN IS_COMPUTED THEN "
+
"CASE WHEN IS_COMPUTED THEN "
+
"CAST(?2 AS VARCHAR) ELSE CAST(?1 AS VARCHAR) END IS_GENERATEDCOLUMN, "
+
"CAST(?2 AS VARCHAR) ELSE CAST(?1 AS VARCHAR) END IS_GENERATEDCOLUMN "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"WHERE TABLE_CATALOG LIKE ?3 ESCAPE ?7 "
+
"WHERE TABLE_CATALOG LIKE ?3 ESCAPE ?7 "
+
"AND TABLE_SCHEMA LIKE ?4 ESCAPE ?7 "
+
"AND TABLE_SCHEMA LIKE ?4 ESCAPE ?7 "
...
@@ -3058,12 +3053,12 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -3058,12 +3053,12 @@ public class JdbcDatabaseMetaData extends TraceObject implements
/**
/**
* Gets the minor version of the supported JDBC API.
* Gets the minor version of the supported JDBC API.
*
*
* @return the minor version (
0
)
* @return the minor version (
1
)
*/
*/
@Override
@Override
public
int
getJDBCMinorVersion
()
{
public
int
getJDBCMinorVersion
()
{
debugCodeCall
(
"getJDBCMinorVersion"
);
debugCodeCall
(
"getJDBCMinorVersion"
);
return
0
;
return
1
;
}
}
/**
/**
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
c9a74ee4
...
@@ -423,7 +423,7 @@ public class TestMetaData extends TestBase {
...
@@ -423,7 +423,7 @@ public class TestMetaData extends TestBase {
meta
.
getDriverMinorVersion
());
meta
.
getDriverMinorVersion
());
int
majorVersion
=
4
;
int
majorVersion
=
4
;
assertEquals
(
majorVersion
,
meta
.
getJDBCMajorVersion
());
assertEquals
(
majorVersion
,
meta
.
getJDBCMajorVersion
());
assertEquals
(
0
,
meta
.
getJDBCMinorVersion
());
assertEquals
(
1
,
meta
.
getJDBCMinorVersion
());
assertEquals
(
"H2"
,
meta
.
getDatabaseProductName
());
assertEquals
(
"H2"
,
meta
.
getDatabaseProductName
());
assertEquals
(
Connection
.
TRANSACTION_READ_COMMITTED
,
assertEquals
(
Connection
.
TRANSACTION_READ_COMMITTED
,
meta
.
getDefaultTransactionIsolation
());
meta
.
getDefaultTransactionIsolation
());
...
@@ -723,20 +723,20 @@ public class TestMetaData extends TestBase {
...
@@ -723,20 +723,20 @@ public class TestMetaData extends TestBase {
Constants
.
SCHEMA_MAIN
,
"TEST"
,
"TABLE"
,
""
}
});
Constants
.
SCHEMA_MAIN
,
"TEST"
,
"TABLE"
,
""
}
});
trace
(
"getColumns"
);
trace
(
"getColumns"
);
rs
=
meta
.
getColumns
(
null
,
null
,
"TEST"
,
null
);
rs
=
meta
.
getColumns
(
null
,
null
,
"TEST"
,
null
);
assertResultSetMeta
(
rs
,
2
5
,
new
String
[]
{
"TABLE_CAT"
,
"TABLE_SCHEM"
,
assertResultSetMeta
(
rs
,
2
4
,
new
String
[]
{
"TABLE_CAT"
,
"TABLE_SCHEM"
,
"TABLE_NAME"
,
"COLUMN_NAME"
,
"DATA_TYPE"
,
"TYPE_NAME"
,
"TABLE_NAME"
,
"COLUMN_NAME"
,
"DATA_TYPE"
,
"TYPE_NAME"
,
"COLUMN_SIZE"
,
"BUFFER_LENGTH"
,
"DECIMAL_DIGITS"
,
"COLUMN_SIZE"
,
"BUFFER_LENGTH"
,
"DECIMAL_DIGITS"
,
"NUM_PREC_RADIX"
,
"NULLABLE"
,
"REMARKS"
,
"COLUMN_DEF"
,
"NUM_PREC_RADIX"
,
"NULLABLE"
,
"REMARKS"
,
"COLUMN_DEF"
,
"SQL_DATA_TYPE"
,
"SQL_DATETIME_SUB"
,
"CHAR_OCTET_LENGTH"
,
"SQL_DATA_TYPE"
,
"SQL_DATETIME_SUB"
,
"CHAR_OCTET_LENGTH"
,
"ORDINAL_POSITION"
,
"IS_NULLABLE"
,
"SCOPE_CATALOG"
,
"ORDINAL_POSITION"
,
"IS_NULLABLE"
,
"SCOPE_CATALOG"
,
"SCOPE_SCHEMA"
,
"SCOPE_TABLE"
,
"SOURCE_DATA_TYPE"
,
"SCOPE_SCHEMA"
,
"SCOPE_TABLE"
,
"SOURCE_DATA_TYPE"
,
"IS_AUTOINCREMENT"
,
"IS_GENERATEDCOLUMN"
,
"SCOPE_CATLOG"
},
new
int
[]
{
"IS_AUTOINCREMENT"
,
"IS_GENERATEDCOLUMN"
},
new
int
[]
{
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
INTEGER
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
SMALLINT
,
Types
.
VARCHAR
,
Types
.
VARCHAR
,
Types
.
VARCHAR
},
Types
.
VARCHAR
,
Types
.
SMALLINT
,
Types
.
VARCHAR
,
Types
.
VARCHAR
},
null
,
null
);
null
,
null
);
assertResultSetOrdered
(
rs
,
new
String
[][]
{
assertResultSetOrdered
(
rs
,
new
String
[][]
{
{
CATALOG
,
Constants
.
SCHEMA_MAIN
,
"TEST"
,
"ID"
,
{
CATALOG
,
Constants
.
SCHEMA_MAIN
,
"TEST"
,
"ID"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论