Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a5e72ddc
提交
a5e72ddc
authored
3月 25, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not pass duplicate parameters to query in getColumns()
上级
935dd554
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
27 行删除
+14
-27
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+14
-27
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
a5e72ddc
...
@@ -303,13 +303,13 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -303,13 +303,13 @@ public class JdbcDatabaseMetaData extends TraceObject implements
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, "
+
"SOURCE_DATA_TYPE, "
+
"SOURCE_DATA_TYPE, "
+
"CASE WHEN SEQUENCE_NAME IS NULL THEN "
+
"CASE WHEN SEQUENCE_NAME IS NULL THEN "
+
"CAST(?
AS VARCHAR) ELSE CAST(?
AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CAST(?
1 AS VARCHAR) ELSE CAST(?2
AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG "
+
"CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"WHERE TABLE_CATALOG LIKE ?
ESCAPE ?
"
+
"WHERE TABLE_CATALOG LIKE ?
3 ESCAPE ?7
"
+
"AND TABLE_SCHEMA LIKE ?
ESCAPE ?
"
+
"AND TABLE_SCHEMA LIKE ?
4 ESCAPE ?7
"
+
"AND TABLE_NAME LIKE ?
ESCAPE ?
"
+
"AND TABLE_NAME LIKE ?
5 ESCAPE ?7
"
+
"AND COLUMN_NAME LIKE ?
ESCAPE ?
"
+
"AND COLUMN_NAME LIKE ?
6 ESCAPE ?7
"
+
"ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION"
;
+
"ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION"
;
String
synonymSql
=
"SELECT "
String
synonymSql
=
"SELECT "
+
"s.SYNONYM_CATALOG TABLE_CAT, "
+
"s.SYNONYM_CATALOG TABLE_CAT, "
...
@@ -335,15 +335,15 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -335,15 +335,15 @@ public class JdbcDatabaseMetaData extends TraceObject implements
+
"CAST(c.SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, "
+
"CAST(c.SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, "
+
"c.SOURCE_DATA_TYPE, "
+
"c.SOURCE_DATA_TYPE, "
+
"CASE WHEN c.SEQUENCE_NAME IS NULL THEN "
+
"CASE WHEN c.SEQUENCE_NAME IS NULL THEN "
+
"CAST(?
AS VARCHAR) ELSE CAST(?
AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CAST(?
1 AS VARCHAR) ELSE CAST(?2
AS VARCHAR) END IS_AUTOINCREMENT, "
+
"CAST(c.SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG "
+
"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 "
+
"WHERE s.SYNONYM_CATALOG LIKE ?
ESCAPE ?
"
+
"WHERE s.SYNONYM_CATALOG LIKE ?
3 ESCAPE ?7
"
+
"AND s.SYNONYM_SCHEMA LIKE ?
ESCAPE ?
"
+
"AND s.SYNONYM_SCHEMA LIKE ?
4 ESCAPE ?7
"
+
"AND s.SYNONYM_NAME LIKE ?
ESCAPE ?
"
+
"AND s.SYNONYM_NAME LIKE ?
5 ESCAPE ?7
"
+
"AND c.COLUMN_NAME LIKE ?
ESCAPE ?
"
;
+
"AND c.COLUMN_NAME LIKE ?
6 ESCAPE ?7
"
;
PreparedStatement
prep
=
conn
.
prepareAutoCloseStatement
(
"SELECT "
PreparedStatement
prep
=
conn
.
prepareAutoCloseStatement
(
"SELECT "
+
"TABLE_CAT, "
+
"TABLE_CAT, "
+
"TABLE_SCHEM, "
+
"TABLE_SCHEM, "
...
@@ -374,23 +374,10 @@ public class JdbcDatabaseMetaData extends TraceObject implements
...
@@ -374,23 +374,10 @@ public class JdbcDatabaseMetaData extends TraceObject implements
prep
.
setString
(
1
,
"NO"
);
prep
.
setString
(
1
,
"NO"
);
prep
.
setString
(
2
,
"YES"
);
prep
.
setString
(
2
,
"YES"
);
prep
.
setString
(
3
,
getCatalogPattern
(
catalogPattern
));
prep
.
setString
(
3
,
getCatalogPattern
(
catalogPattern
));
prep
.
setString
(
4
,
"\\"
);
prep
.
setString
(
4
,
getSchemaPattern
(
schemaPattern
));
prep
.
setString
(
5
,
getSchemaPattern
(
schemaPattern
));
prep
.
setString
(
5
,
getPattern
(
tableNamePattern
));
prep
.
setString
(
6
,
"\\"
);
prep
.
setString
(
6
,
getPattern
(
columnNamePattern
));
prep
.
setString
(
7
,
getPattern
(
tableNamePattern
));
prep
.
setString
(
7
,
"\\"
);
prep
.
setString
(
8
,
"\\"
);
prep
.
setString
(
9
,
getPattern
(
columnNamePattern
));
prep
.
setString
(
10
,
"\\"
);
prep
.
setString
(
11
,
"NO"
);
prep
.
setString
(
12
,
"YES"
);
prep
.
setString
(
13
,
getCatalogPattern
(
catalogPattern
));
prep
.
setString
(
14
,
"\\"
);
prep
.
setString
(
15
,
getSchemaPattern
(
schemaPattern
));
prep
.
setString
(
16
,
"\\"
);
prep
.
setString
(
17
,
getPattern
(
tableNamePattern
));
prep
.
setString
(
18
,
"\\"
);
prep
.
setString
(
19
,
getPattern
(
columnNamePattern
));
prep
.
setString
(
20
,
"\\"
);
return
prep
.
executeQuery
();
return
prep
.
executeQuery
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
throw
logAndConvert
(
e
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论