Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
bbd5fa8b
提交
bbd5fa8b
authored
7月 02, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
H2 Console autocomplete: the autocomplete feature didn't support quoted names.
上级
412311f3
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
32 行增加
和
10 行删除
+32
-10
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
DbColumn.java
h2/src/main/org/h2/server/web/DbColumn.java
+8
-1
DbContextRule.java
h2/src/main/org/h2/server/web/DbContextRule.java
+14
-4
DbTableOrView.java
h2/src/main/org/h2/server/web/DbTableOrView.java
+1
-1
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+7
-3
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
bbd5fa8b
...
@@ -18,7 +18,8 @@ Change Log
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
It is now longer allowed to create an index on a CLOB or BLOB column
<ul><li>
H2 Console autocomplete: the autocomplete feature didn't support quoted names.
</li><li>
It is now longer allowed to create an index on a CLOB or BLOB column
(except for in-memory databases or indexes), because recovery doesn't work
(except for in-memory databases or indexes), because recovery doesn't work
on such columns. Fulltext indexes on such column are still supported of course.
on such columns. Fulltext indexes on such column are still supported of course.
</li><li>
The PUBLIC schema could be renamed, which could result in a database that
</li><li>
The PUBLIC schema could be renamed, which could result in a database that
...
...
h2/src/main/org/h2/server/web/DbColumn.java
浏览文件 @
bbd5fa8b
...
@@ -21,16 +21,23 @@ class DbColumn {
...
@@ -21,16 +21,23 @@ class DbColumn {
*/
*/
String
name
;
String
name
;
/**
* The quoted table name.
*/
String
quotedName
;
/**
/**
* The data type name (including precision and the NOT NULL flag if
* The data type name (including precision and the NOT NULL flag if
* applicable).
* applicable).
*/
*/
String
dataType
;
String
dataType
;
DbColumn
(
ResultSet
rs
,
boolean
isSQLite
)
throws
SQLException
{
DbColumn
(
DbContents
contents
,
ResultSet
rs
)
throws
SQLException
{
name
=
rs
.
getString
(
"COLUMN_NAME"
);
name
=
rs
.
getString
(
"COLUMN_NAME"
);
quotedName
=
contents
.
quoteIdentifier
(
name
);
String
type
=
rs
.
getString
(
"TYPE_NAME"
);
String
type
=
rs
.
getString
(
"TYPE_NAME"
);
int
size
=
rs
.
getInt
(
DbContents
.
findColumn
(
rs
,
"COLUMN_SIZE"
,
7
));
int
size
=
rs
.
getInt
(
DbContents
.
findColumn
(
rs
,
"COLUMN_SIZE"
,
7
));
boolean
isSQLite
=
contents
.
isSQLite
;
if
(
size
>
0
&&
!
isSQLite
)
{
if
(
size
>
0
&&
!
isSQLite
)
{
type
+=
"("
+
size
;
type
+=
"("
+
size
;
int
prec
=
rs
.
getInt
(
DbContents
.
findColumn
(
rs
,
"DECIMAL_DIGITS"
,
9
));
int
prec
=
rs
.
getInt
(
DbContents
.
findColumn
(
rs
,
"DECIMAL_DIGITS"
,
9
));
...
...
h2/src/main/org/h2/server/web/DbContextRule.java
浏览文件 @
bbd5fa8b
...
@@ -79,13 +79,18 @@ public class DbContextRule implements Rule {
...
@@ -79,13 +79,18 @@ public class DbContextRule implements Rule {
String
best
=
null
;
String
best
=
null
;
DbTableOrView
bestTable
=
null
;
DbTableOrView
bestTable
=
null
;
for
(
DbTableOrView
table
:
tables
)
{
for
(
DbTableOrView
table
:
tables
)
{
String
compare
=
up
;
String
name
=
StringUtils
.
toUpperEnglish
(
table
.
name
);
String
name
=
StringUtils
.
toUpperEnglish
(
table
.
name
);
if
(
up
.
startsWith
(
name
))
{
if
(
table
.
quotedName
.
length
()
>
name
.
length
())
{
name
=
table
.
quotedName
;
compare
=
query
;
}
if
(
compare
.
startsWith
(
name
))
{
if
(
best
==
null
||
name
.
length
()
>
best
.
length
())
{
if
(
best
==
null
||
name
.
length
()
>
best
.
length
())
{
best
=
name
;
best
=
name
;
bestTable
=
table
;
bestTable
=
table
;
}
}
}
else
if
(
s
.
length
()
==
0
||
name
.
startsWith
(
up
))
{
}
else
if
(
s
.
length
()
==
0
||
name
.
startsWith
(
compare
))
{
if
(
s
.
length
()
<
name
.
length
())
{
if
(
s
.
length
()
<
name
.
length
())
{
sentence
.
add
(
table
.
quotedName
,
table
.
quotedName
.
substring
(
s
.
length
()),
Sentence
.
CONTEXT
);
sentence
.
add
(
table
.
quotedName
,
table
.
quotedName
.
substring
(
s
.
length
()),
Sentence
.
CONTEXT
);
}
}
...
@@ -131,12 +136,17 @@ public class DbContextRule implements Rule {
...
@@ -131,12 +136,17 @@ public class DbContextRule implements Rule {
DbTableOrView
last
=
sentence
.
getLastMatchedTable
();
DbTableOrView
last
=
sentence
.
getLastMatchedTable
();
if
(
last
!=
null
&&
last
.
columns
!=
null
)
{
if
(
last
!=
null
&&
last
.
columns
!=
null
)
{
for
(
DbColumn
column
:
last
.
columns
)
{
for
(
DbColumn
column
:
last
.
columns
)
{
String
compare
=
up
;
String
name
=
StringUtils
.
toUpperEnglish
(
column
.
name
);
String
name
=
StringUtils
.
toUpperEnglish
(
column
.
name
);
if
(
up
.
startsWith
(
name
))
{
if
(
column
.
quotedName
.
length
()
>
name
.
length
())
{
name
=
column
.
quotedName
;
compare
=
query
;
}
if
(
compare
.
startsWith
(
name
))
{
String
b
=
s
.
substring
(
name
.
length
());
String
b
=
s
.
substring
(
name
.
length
());
if
(
best
==
null
||
b
.
length
()
<
best
.
length
())
{
if
(
best
==
null
||
b
.
length
()
<
best
.
length
())
{
best
=
b
;
best
=
b
;
}
else
if
(
s
.
length
()
==
0
||
name
.
startsWith
(
up
))
{
}
else
if
(
s
.
length
()
==
0
||
name
.
startsWith
(
compare
))
{
if
(
s
.
length
()
<
name
.
length
())
{
if
(
s
.
length
()
<
name
.
length
())
{
sentence
.
add
(
column
.
name
,
column
.
name
.
substring
(
s
.
length
()),
Sentence
.
CONTEXT
);
sentence
.
add
(
column
.
name
,
column
.
name
.
substring
(
s
.
length
()),
Sentence
.
CONTEXT
);
}
}
...
...
h2/src/main/org/h2/server/web/DbTableOrView.java
浏览文件 @
bbd5fa8b
...
@@ -60,7 +60,7 @@ public class DbTableOrView {
...
@@ -60,7 +60,7 @@ public class DbTableOrView {
ResultSet
rs
=
meta
.
getColumns
(
null
,
schema
.
name
,
name
,
null
);
ResultSet
rs
=
meta
.
getColumns
(
null
,
schema
.
name
,
name
,
null
);
ArrayList
<
DbColumn
>
list
=
New
.
arrayList
();
ArrayList
<
DbColumn
>
list
=
New
.
arrayList
();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
DbColumn
column
=
new
DbColumn
(
rs
,
schema
.
contents
.
isSQLite
);
DbColumn
column
=
new
DbColumn
(
schema
.
contents
,
rs
);
list
.
add
(
column
);
list
.
add
(
column
);
}
}
rs
.
close
();
rs
.
close
();
...
...
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
bbd5fa8b
...
@@ -475,7 +475,7 @@ public class WebApp {
...
@@ -475,7 +475,7 @@ public class WebApp {
columnsBuffer
.
append
(
' '
);
columnsBuffer
.
append
(
' '
);
}
}
columnsBuffer
.
append
(
column
.
name
);
columnsBuffer
.
append
(
column
.
name
);
String
col
=
StringUtils
.
urlEncode
(
PageParser
.
escapeJavaScript
(
column
.
name
)
);
String
col
=
escapeIdentifier
(
column
.
name
);
String
level
=
mainSchema
?
", 1, 1"
:
", 2, 2"
;
String
level
=
mainSchema
?
", 1, 1"
:
", 2, 2"
;
buff
.
append
(
"setNode("
+
treeIndex
+
level
+
", 'column', '"
+
PageParser
.
escapeJavaScript
(
column
.
name
)
buff
.
append
(
"setNode("
+
treeIndex
+
level
+
", 'column', '"
+
PageParser
.
escapeJavaScript
(
column
.
name
)
+
"', 'javascript:ins(\\'"
+
col
+
"\\')');\n"
);
+
"', 'javascript:ins(\\'"
+
col
+
"\\')');\n"
);
...
@@ -489,6 +489,10 @@ public class WebApp {
...
@@ -489,6 +489,10 @@ public class WebApp {
return
treeIndex
;
return
treeIndex
;
}
}
private
static
String
escapeIdentifier
(
String
name
)
{
return
StringUtils
.
urlEncode
(
PageParser
.
escapeJavaScript
(
name
)).
replace
(
'+'
,
' '
);
}
/**
/**
* This class represents index information for the GUI.
* This class represents index information for the GUI.
*/
*/
...
@@ -595,7 +599,7 @@ public class WebApp {
...
@@ -595,7 +599,7 @@ public class WebApp {
if
(!
mainSchema
)
{
if
(!
mainSchema
)
{
tab
=
schema
.
quotedName
+
"."
+
tab
;
tab
=
schema
.
quotedName
+
"."
+
tab
;
}
}
tab
=
StringUtils
.
urlEncode
(
PageParser
.
escapeJavaScript
(
tab
)
);
tab
=
escapeIdentifier
(
tab
);
buff
.
append
(
"setNode("
+
treeIndex
+
indentation
+
" 'table', '"
+
PageParser
.
escapeJavaScript
(
table
.
name
)
buff
.
append
(
"setNode("
+
treeIndex
+
indentation
+
" 'table', '"
+
PageParser
.
escapeJavaScript
(
table
.
name
)
+
"', 'javascript:ins(\\'"
+
tab
+
"\\',true)');\n"
);
+
"', 'javascript:ins(\\'"
+
tab
+
"\\',true)');\n"
);
treeIndex
++;
treeIndex
++;
...
@@ -619,7 +623,7 @@ public class WebApp {
...
@@ -619,7 +623,7 @@ public class WebApp {
if
(!
mainSchema
)
{
if
(!
mainSchema
)
{
tab
=
view
.
schema
.
quotedName
+
"."
+
tab
;
tab
=
view
.
schema
.
quotedName
+
"."
+
tab
;
}
}
tab
=
StringUtils
.
urlEncode
(
PageParser
.
escapeJavaScript
(
tab
)
);
tab
=
escapeIdentifier
(
tab
);
buff
.
append
(
"setNode("
+
treeIndex
+
indentation
+
" 'view', '"
+
PageParser
.
escapeJavaScript
(
view
.
name
)
buff
.
append
(
"setNode("
+
treeIndex
+
indentation
+
" 'view', '"
+
PageParser
.
escapeJavaScript
(
view
.
name
)
+
"', 'javascript:ins(\\'"
+
tab
+
"\\',true)');\n"
);
+
"', 'javascript:ins(\\'"
+
tab
+
"\\',true)');\n"
);
treeIndex
++;
treeIndex
++;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论