Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b0206a3b
提交
b0206a3b
authored
4月 16, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
H2 Console: the auto-complete feature didn't quote column names that need quoting. Issue 186.
上级
07ba5508
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
38 行增加
和
2 行删除
+38
-2
changelog.html
h2/src/docsrc/html/changelog.html
+3
-1
DbContents.java
h2/src/main/org/h2/server/web/DbContents.java
+28
-0
DbContextRule.java
h2/src/main/org/h2/server/web/DbContextRule.java
+7
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
b0206a3b
...
...
@@ -18,7 +18,9 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
The experimental LOB storage mechanism now supports all features of the
<ul><li>
H2 Console: the auto-complete feature didn't quote column names
that need quoting. Issue 186.
</li><li>
The experimental LOB storage mechanism now supports all features of the
old one. To use it, set the system property "h2.lobInDatabase" to "true".
</li><li>
The functions isBeforeFirst() and isAfterLast() were not compliant to the
JDBC spec. If the ResultSet contains no rows, they must return false. Fixed.
...
...
h2/src/main/org/h2/server/web/DbContents.java
浏览文件 @
b0206a3b
...
...
@@ -72,6 +72,12 @@ public class DbContents {
*/
boolean
isSQLite
;
/**
* True if the unquoted names are stored as upper case.
* False for MySQL and PostgreSQL.
*/
boolean
storedUpperCaseIdentifiers
;
/**
* Get the column index of a column in a result set. If the column is not
* found, the default column index is returned.
...
...
@@ -119,6 +125,7 @@ public class DbContents {
isDerby
=
url
.
startsWith
(
"jdbc:derby:"
);
isFirebird
=
url
.
startsWith
(
"jdbc:firebirdsql:"
);
}
storedUpperCaseIdentifiers
=
meta
.
storesUpperCaseIdentifiers
();
String
defaultSchemaName
=
getDefaultSchemaName
(
meta
);
String
[]
schemaNames
=
getSchemaNames
(
meta
);
schemas
=
new
DbSchema
[
schemaNames
.
length
];
...
...
@@ -227,4 +234,25 @@ public class DbContents {
return
StringUtils
.
toUpperEnglish
(
identifier
);
}
/**
* Check whether an identifier from the database meta data needs to be
* quoted. This depends on how the database stores the identifiers ("test"
* doesn't need to be quoted if the database stores identifiers lowercase)
*
* @param identifier the identifier
* @return true if the identifier needs to be quoted
*/
boolean
needsQuotes
(
String
identifier
)
{
if
(
storedUpperCaseIdentifiers
)
{
if
(
identifier
.
equals
(
identifier
.
toUpperCase
()))
{
return
false
;
}
}
else
{
if
(
identifier
.
equals
(
identifier
.
toLowerCase
()))
{
return
false
;
}
}
return
true
;
}
}
h2/src/main/org/h2/server/web/DbContextRule.java
浏览文件 @
b0206a3b
...
...
@@ -259,7 +259,13 @@ public class DbContextRule implements Rule {
continue
;
}
if
(
columnPattern
.
length
()
<
columnName
.
length
())
{
sentence
.
add
(
columnName
,
columnName
.
substring
(
columnPattern
.
length
()),
Sentence
.
CONTEXT
);
String
sub
=
columnName
.
substring
(
columnPattern
.
length
());
if
(
sub
.
equals
(
columnName
)
&&
contents
.
needsQuotes
(
columnName
))
{
columnName
=
StringUtils
.
quoteIdentifier
(
columnName
);
sub
=
columnName
;
}
System
.
out
.
println
(
"add "
+
columnName
+
" "
+
columnName
.
substring
(
columnPattern
.
length
()));
sentence
.
add
(
columnName
,
sub
,
Sentence
.
CONTEXT
);
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论