Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1b972af6
提交
1b972af6
authored
14 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Issue 323: NullPointerException when using IN(...) with a function table.
上级
53530856
master
noel-pr1
plus33-master
pr/267
stumc-Issue#576
version-1.4.198
version-1.4.197
version-1.4.196
version-1.4.195
version-1.4.194
version-1.4.193
version-1.4.192
version-1.4.191
version-1.4.190
version-1.4.188
version-1.4.187
version-1.4.186
version-1.4.185
version-1.4.184
version-1.4.183
version-1.4.182
version-1.4.181
version-1.4.178
version-1.4.177
version-1.3
version-1.2
version-1.1
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
28 行增加
和
4 行删除
+28
-4
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
CreateView.java
h2/src/main/org/h2/command/ddl/CreateView.java
+1
-1
IndexCondition.java
h2/src/main/org/h2/index/IndexCondition.java
+1
-1
PageStore.java
h2/src/main/org/h2/store/PageStore.java
+1
-1
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+23
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
1b972af6
...
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Clob.toString() and Blob.toString() now include the trace identifier.
<ul><li>
Issue 323: NullPointerException when using IN(...) with a function table.
</li><li>
Clob.toString() and Blob.toString() now include the trace identifier.
</li><li>
The SQL parser silently ignored characters such as '^' or '\'.
Now a syntax error is thrown.
</li><li>
ROUND(..) now also works with just one parameter.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/ddl/CreateView.java
浏览文件 @
1b972af6
...
...
@@ -79,7 +79,7 @@ public class CreateView extends SchemaCommand {
if
(
ifNotExists
)
{
return
0
;
}
if
(!
orReplace
||
!
old
.
getTableType
().
equals
(
Table
.
VIEW
))
{
if
(!
orReplace
||
!
Table
.
VIEW
.
equals
(
old
.
getTableType
()
))
{
throw
DbException
.
get
(
ErrorCode
.
VIEW_ALREADY_EXISTS_1
,
viewName
);
}
view
=
(
TableView
)
old
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/IndexCondition.java
浏览文件 @
1b972af6
...
...
@@ -224,7 +224,7 @@ public class IndexCondition {
case
Comparison
.
IN_LIST
:
case
Comparison
.
IN_QUERY
:
if
(
indexConditions
.
size
()
>
1
)
{
if
(!
column
.
getTable
().
getTableType
().
equals
(
Table
.
TABLE
))
{
if
(!
Table
.
TABLE
.
equals
(
column
.
getTable
().
getTableType
()
))
{
// if combined with other conditions,
// IN(..) can only be used for regular tables
// test case:
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/PageStore.java
浏览文件 @
1b972af6
...
...
@@ -518,7 +518,7 @@ public class PageStore implements CacheWriter {
recordPageReads
=
true
;
Session
s
=
database
.
getSystemSession
();
for
(
Table
table
:
tables
)
{
if
(!
table
.
isTemporary
()
&&
table
.
getTableType
().
equals
(
Table
.
TABLE
))
{
if
(!
table
.
isTemporary
()
&&
Table
.
TABLE
.
equals
(
table
.
getTableType
()
))
{
Index
scanIndex
=
table
.
getScanIndex
(
s
);
Cursor
cursor
=
scanIndex
.
find
(
s
,
null
,
null
);
while
(
cursor
.
next
())
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
1b972af6
...
...
@@ -51,6 +51,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
public
void
test
()
throws
Exception
{
deleteDb
(
"functions"
);
testFunctionTable
();
testArrayParameters
();
testDefaultConnection
();
testFunctionInSchema
();
...
...
@@ -74,6 +75,28 @@ public class TestFunctions extends TestBase implements AggregateFunction {
IOUtils
.
deleteRecursive
(
TEMP_DIR
,
true
);
}
private
void
testFunctionTable
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"functions"
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create alias simple_function_table for \""
+
TestFunctions
.
class
.
getName
()
+
".simpleFunctionTable\""
);
stat
.
execute
(
"select * from simple_function_table() where a>0 and b in ('x', 'y')"
);
conn
.
close
();
}
/**
* This method is called via reflection from the database.
*
* @param conn the connection
* @return a result set
*/
public
static
ResultSet
simpleFunctionTable
(
Connection
conn
)
{
SimpleResultSet
result
=
new
SimpleResultSet
();
result
.
addColumn
(
"A"
,
Types
.
INTEGER
,
0
,
0
);
result
.
addColumn
(
"B"
,
Types
.
CHAR
,
0
,
0
);
result
.
addRow
(
42
,
'X'
);
return
result
;
}
private
void
testNvl2
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"functions"
);
Statement
stat
=
conn
.
createStatement
();
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论