Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
40f0e66b
提交
40f0e66b
authored
16 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fulltext search did not support table names with a backslash.
上级
046bca7e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
26 行增加
和
7 行删除
+26
-7
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+11
-3
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+15
-4
没有找到文件。
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
40f0e66b
...
@@ -693,7 +693,10 @@ public class FullText {
...
@@ -693,7 +693,10 @@ public class FullText {
setting
=
FullTextSettings
.
getInstance
(
conn
);
setting
=
FullTextSettings
.
getInstance
(
conn
);
ArrayList
keyList
=
new
ArrayList
();
ArrayList
keyList
=
new
ArrayList
();
DatabaseMetaData
meta
=
conn
.
getMetaData
();
DatabaseMetaData
meta
=
conn
.
getMetaData
();
ResultSet
rs
=
meta
.
getColumns
(
null
,
schemaName
,
tableName
,
null
);
ResultSet
rs
=
meta
.
getColumns
(
null
,
JdbcUtils
.
escapeMetaDataPattern
(
schemaName
),
JdbcUtils
.
escapeMetaDataPattern
(
tableName
),
null
);
ArrayList
columnList
=
new
ArrayList
();
ArrayList
columnList
=
new
ArrayList
();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
columnList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
columnList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
...
@@ -704,12 +707,17 @@ public class FullText {
...
@@ -704,12 +707,17 @@ public class FullText {
index
.
table
=
tableName
;
index
.
table
=
tableName
;
index
.
columns
=
new
String
[
columnList
.
size
()];
index
.
columns
=
new
String
[
columnList
.
size
()];
columnList
.
toArray
(
index
.
columns
);
columnList
.
toArray
(
index
.
columns
);
rs
=
meta
.
getColumns
(
null
,
schemaName
,
tableName
,
null
);
rs
=
meta
.
getColumns
(
null
,
JdbcUtils
.
escapeMetaDataPattern
(
schemaName
),
JdbcUtils
.
escapeMetaDataPattern
(
tableName
),
null
);
for
(
int
i
=
0
;
rs
.
next
();
i
++)
{
for
(
int
i
=
0
;
rs
.
next
();
i
++)
{
columnTypes
[
i
]
=
rs
.
getInt
(
"DATA_TYPE"
);
columnTypes
[
i
]
=
rs
.
getInt
(
"DATA_TYPE"
);
}
}
if
(
keyList
.
size
()
==
0
)
{
if
(
keyList
.
size
()
==
0
)
{
rs
=
meta
.
getPrimaryKeys
(
null
,
schemaName
,
tableName
);
rs
=
meta
.
getPrimaryKeys
(
null
,
JdbcUtils
.
escapeMetaDataPattern
(
schemaName
),
tableName
);
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
keyList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
keyList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
40f0e66b
...
@@ -38,6 +38,7 @@ import org.h2.expression.ExpressionColumn;
...
@@ -38,6 +38,7 @@ import org.h2.expression.ExpressionColumn;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.store.fs.FileSystem
;
import
org.h2.store.fs.FileSystem
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
//## Java 1.4 end ##
//## Java 1.4 end ##
...
@@ -368,7 +369,10 @@ public class FullTextLucene extends FullText {
...
@@ -368,7 +369,10 @@ public class FullTextLucene extends FullText {
this
.
indexModifier
=
getIndexModifier
(
conn
);
this
.
indexModifier
=
getIndexModifier
(
conn
);
ArrayList
keyList
=
new
ArrayList
();
ArrayList
keyList
=
new
ArrayList
();
DatabaseMetaData
meta
=
conn
.
getMetaData
();
DatabaseMetaData
meta
=
conn
.
getMetaData
();
ResultSet
rs
=
meta
.
getColumns
(
null
,
schemaName
,
tableName
,
null
);
ResultSet
rs
=
meta
.
getColumns
(
null
,
JdbcUtils
.
escapeMetaDataPattern
(
schemaName
),
JdbcUtils
.
escapeMetaDataPattern
(
tableName
),
null
);
ArrayList
columnList
=
new
ArrayList
();
ArrayList
columnList
=
new
ArrayList
();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
columnList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
columnList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
...
@@ -376,12 +380,17 @@ public class FullTextLucene extends FullText {
...
@@ -376,12 +380,17 @@ public class FullTextLucene extends FullText {
columnTypes
=
new
int
[
columnList
.
size
()];
columnTypes
=
new
int
[
columnList
.
size
()];
columns
=
new
String
[
columnList
.
size
()];
columns
=
new
String
[
columnList
.
size
()];
columnList
.
toArray
(
columns
);
columnList
.
toArray
(
columns
);
rs
=
meta
.
getColumns
(
null
,
schemaName
,
tableName
,
null
);
rs
=
meta
.
getColumns
(
null
,
JdbcUtils
.
escapeMetaDataPattern
(
schemaName
),
JdbcUtils
.
escapeMetaDataPattern
(
tableName
),
null
);
for
(
int
i
=
0
;
rs
.
next
();
i
++)
{
for
(
int
i
=
0
;
rs
.
next
();
i
++)
{
columnTypes
[
i
]
=
rs
.
getInt
(
"DATA_TYPE"
);
columnTypes
[
i
]
=
rs
.
getInt
(
"DATA_TYPE"
);
}
}
if
(
keyList
.
size
()
==
0
)
{
if
(
keyList
.
size
()
==
0
)
{
rs
=
meta
.
getPrimaryKeys
(
null
,
schemaName
,
tableName
);
rs
=
meta
.
getPrimaryKeys
(
null
,
JdbcUtils
.
escapeMetaDataPattern
(
schemaName
),
tableName
);
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
keyList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
keyList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
}
}
...
@@ -390,7 +399,9 @@ public class FullTextLucene extends FullText {
...
@@ -390,7 +399,9 @@ public class FullTextLucene extends FullText {
throw
new
SQLException
(
"No primary key for table "
+
tableName
);
throw
new
SQLException
(
"No primary key for table "
+
tableName
);
}
}
ArrayList
indexList
=
new
ArrayList
();
ArrayList
indexList
=
new
ArrayList
();
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT COLUMNS FROM "
+
SCHEMA
+
".INDEXES WHERE SCHEMA=? AND TABLE=?"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT COLUMNS FROM "
+
SCHEMA
+
".INDEXES WHERE SCHEMA=? AND TABLE=?"
);
prep
.
setString
(
1
,
schemaName
);
prep
.
setString
(
1
,
schemaName
);
prep
.
setString
(
2
,
tableName
);
prep
.
setString
(
2
,
tableName
);
rs
=
prep
.
executeQuery
();
rs
=
prep
.
executeQuery
();
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论