Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
0ff58e70
提交
0ff58e70
authored
2月 04, 2015
作者:
noelgrandin@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix missing "column" type in right-hand parameter in ConditionIn. Patch by Arnaud Thimel.
上级
ddc90b86
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
37 行增加
和
0 行删除
+37
-0
changelog.html
h2/src/docsrc/html/changelog.html
+1
-0
ConditionIn.java
h2/src/main/org/h2/expression/ConditionIn.java
+4
-0
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+32
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
0ff58e70
...
@@ -37,6 +37,7 @@ Change Log
...
@@ -37,6 +37,7 @@ Change Log
</li><li>
Make the planner use indexes for sorting when doing a GROUP BY where
</li><li>
Make the planner use indexes for sorting when doing a GROUP BY where
all of the GROUP BY columns are not mentioned in the select. Patch by Frederico (zepfred).
all of the GROUP BY columns are not mentioned in the select. Patch by Frederico (zepfred).
</li><li>
PostgreSQL compatibility: generate_series (as an alias for system_range). Patch by litailang.
</li><li>
PostgreSQL compatibility: generate_series (as an alias for system_range). Patch by litailang.
</li><li>
Fix missing "column" type in right-hand parameter in ConditionIn. Patch by Arnaud Thimel.
</li></ul>
</li></ul>
<h2>
Version 1.4.185 Beta (2015-01-16)
</h2>
<h2>
Version 1.4.185 Beta (2015-01-16)
</h2>
...
...
h2/src/main/org/h2/expression/ConditionIn.java
浏览文件 @
0ff58e70
...
@@ -94,6 +94,10 @@ public class ConditionIn extends Condition {
...
@@ -94,6 +94,10 @@ public class ConditionIn extends Condition {
if
(
allValuesConstant
&&
!
e
.
isConstant
())
{
if
(
allValuesConstant
&&
!
e
.
isConstant
())
{
allValuesConstant
=
false
;
allValuesConstant
=
false
;
}
}
if
(
left
instanceof
ExpressionColumn
&&
e
instanceof
Parameter
)
{
((
Parameter
)
e
)
.
setColumn
(((
ExpressionColumn
)
left
).
getColumn
());
}
valueList
.
set
(
i
,
e
);
valueList
.
set
(
i
,
e
);
}
}
if
(
constant
&&
allValuesConstant
)
{
if
(
constant
&&
allValuesConstant
)
{
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
0ff58e70
...
@@ -92,6 +92,8 @@ public class TestPreparedStatement extends TestBase {
...
@@ -92,6 +92,8 @@ public class TestPreparedStatement extends TestBase {
testBlob
(
conn
);
testBlob
(
conn
);
testClob
(
conn
);
testClob
(
conn
);
testParameterMetaData
(
conn
);
testParameterMetaData
(
conn
);
testColumnMetaDataWithEquals
(
conn
);
testColumnMetaDataWithIn
(
conn
);
conn
.
close
();
conn
.
close
();
testPreparedStatementWithLiteralsNone
();
testPreparedStatementWithLiteralsNone
();
deleteDb
(
"preparedStatement"
);
deleteDb
(
"preparedStatement"
);
...
@@ -1023,6 +1025,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -1023,6 +1025,7 @@ public class TestPreparedStatement extends TestBase {
prep
.
executeUpdate
();
prep
.
executeUpdate
();
assertFalse
(
prep
.
getMoreResults
());
assertFalse
(
prep
.
getMoreResults
());
assertEquals
(-
1
,
prep
.
getUpdateCount
());
assertEquals
(-
1
,
prep
.
getUpdateCount
());
stat
.
execute
(
"DROP TABLE TEST"
);
}
}
private
void
testObject
(
Connection
conn
)
throws
SQLException
{
private
void
testObject
(
Connection
conn
)
throws
SQLException
{
...
@@ -1362,4 +1365,33 @@ public class TestPreparedStatement extends TestBase {
...
@@ -1362,4 +1365,33 @@ public class TestPreparedStatement extends TestBase {
assertTrue
(!
rs
.
next
());
assertTrue
(!
rs
.
next
());
}
}
private
void
testColumnMetaDataWithEquals
(
Connection
conn
)
throws
SQLException
{
Statement
stmt
=
conn
.
createStatement
();
stmt
.
execute
(
"CREATE TABLE TEST( id INT, someColumn INT )"
);
PreparedStatement
ps
=
conn
.
prepareStatement
(
"INSERT INTO TEST VALUES(?,?)"
);
ps
.
setInt
(
1
,
0
);
ps
.
setInt
(
2
,
999
);
ps
.
execute
();
ps
=
conn
.
prepareStatement
(
"SELECT * FROM TEST WHERE someColumn = ?"
);
assertEquals
(
Types
.
INTEGER
,
ps
.
getParameterMetaData
().
getParameterType
(
1
));
stmt
.
execute
(
"DROP TABLE TEST"
);
}
private
void
testColumnMetaDataWithIn
(
Connection
conn
)
throws
SQLException
{
Statement
stmt
=
conn
.
createStatement
();
stmt
.
execute
(
"CREATE TABLE TEST( id INT, someColumn INT )"
);
PreparedStatement
ps
=
conn
.
prepareStatement
(
"INSERT INTO TEST VALUES( ? , ? )"
);
ps
.
setInt
(
1
,
0
);
ps
.
setInt
(
2
,
999
);
ps
.
execute
();
ps
=
conn
.
prepareStatement
(
"SELECT * FROM TEST WHERE someColumn IN (?,?)"
);
assertEquals
(
Types
.
INTEGER
,
ps
.
getParameterMetaData
().
getParameterType
(
1
));
stmt
.
execute
(
"DROP TABLE TEST"
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论