Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
6dc3587d
提交
6dc3587d
authored
15 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Issue 119: JaQu creates wrong WHERE condition on some inputs.
上级
07c5a909
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
52 行增加
和
6 行删除
+52
-6
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-0
AliasMapTest.java
h2/src/test/org/h2/test/jaqu/AliasMapTest.java
+45
-0
SamplesTest.java
h2/src/test/org/h2/test/jaqu/SamplesTest.java
+1
-1
Query.java
h2/src/tools/org/h2/jaqu/Query.java
+2
-4
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
6dc3587d
...
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
SELECT COUNT(*) FROM SYSTEM_RANGE(...) returned the wrong result. Fixed.
<ul><li>
Issue 119: JaQu creates wrong WHERE condition on some inputs.
</li><li>
SELECT COUNT(*) FROM SYSTEM_RANGE(...) returned the wrong result. Fixed.
</li><li>
The Recover tool now also processes the log files, however applying those changes
is still a manual process.
</li><li>
New sample application that shows how to pass data to a trigger.
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
6dc3587d
...
...
@@ -60,6 +60,7 @@ import org.h2.test.db.TestTransaction;
import
org.h2.test.db.TestTriggersConstraints
;
import
org.h2.test.db.TestTwoPhaseCommit
;
import
org.h2.test.db.TestView
;
import
org.h2.test.jaqu.AliasMapTest
;
import
org.h2.test.jaqu.SamplesTest
;
import
org.h2.test.jdbc.TestBatchUpdates
;
import
org.h2.test.jdbc.TestCallableStatement
;
...
...
@@ -521,6 +522,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new
TestView
().
runTest
(
this
);
// jaqu
new
AliasMapTest
().
runTest
(
this
);
new
SamplesTest
().
runTest
(
this
);
// jdbc
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/jaqu/AliasMapTest.java
0 → 100644
浏览文件 @
6dc3587d
/*
* Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
jaqu
;
import
java.util.List
;
import
org.h2.jaqu.Db
;
import
org.h2.test.TestBase
;
/**
* Tests that columns (p.unitsInStock) are not compared by value with the value
* (9), but by reference (using an identity hash map).
* See http://code.google.com/p/h2database/issues/detail?id=119
*
* @author d moebius at scoop slash gmbh dot de
*/
public
class
AliasMapTest
extends
TestBase
{
/**
* This method is called when executing this application from the command
* line.
*
* @param args the command line parameters
*/
public
static
void
main
(
String
[]
args
)
throws
Exception
{
new
AliasMapTest
().
test
();
}
public
void
test
()
throws
Exception
{
Db
db
=
Db
.
open
(
"jdbc:h2:mem:"
,
"sa"
,
"sa"
);
db
.
insertAll
(
Product
.
getList
());
Product
p
=
new
Product
();
List
<
Product
>
products
=
db
.
from
(
p
)
.
where
(
p
.
unitsInStock
).
is
(
9
)
.
orderBy
(
p
.
productId
).
select
();
assertEquals
(
"[]"
,
products
.
toString
());
}
}
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/jaqu/SamplesTest.java
浏览文件 @
6dc3587d
...
...
@@ -27,6 +27,7 @@ import org.h2.test.TestBase;
* no more SQL injection.</p>
*/
public
class
SamplesTest
extends
TestBase
{
/**
* This object represents a database (actually a connection to the database).
*/
...
...
@@ -141,7 +142,6 @@ public class SamplesTest extends TestBase {
expensiveInStockProducts
.
toString
());
}
private
void
testWhereSimple4
()
{
// var waCustomers =
...
...
This diff is collapsed.
Click to expand it.
h2/src/tools/org/h2/jaqu/Query.java
浏览文件 @
6dc3587d
...
...
@@ -11,12 +11,10 @@ import java.lang.reflect.Field;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.
Identity
HashMap
;
import
java.util.List
;
import
org.h2.jaqu.util.ClassReader
;
import
org.h2.jaqu.util.Utils
;
//## Java 1.5 end ##
/**
* This class represents a query.
...
...
@@ -30,7 +28,7 @@ public class Query<T> {
private
SelectTable
<
T
>
from
;
private
ArrayList
<
Token
>
conditions
=
Utils
.
newArrayList
();
private
ArrayList
<
SelectTable
<
?
>>
joins
=
Utils
.
newArrayList
();
private
final
HashMap
<
Object
,
SelectColumn
<
T
>>
aliasMap
=
Utils
.
new
HashMap
();
private
final
IdentityHashMap
<
Object
,
SelectColumn
<
T
>>
aliasMap
=
Utils
.
newIdentity
HashMap
();
private
ArrayList
<
OrderExpression
<
T
>>
orderByList
=
Utils
.
newArrayList
();
private
Object
[]
groupByExpressions
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论