Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e2304cb7
提交
e2304cb7
authored
9月 18, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
e422af10
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
61 行增加
和
25 行删除
+61
-25
history.html
h2/src/docsrc/html/history.html
+5
-0
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-4
Comparison.java
h2/src/main/org/h2/expression/Comparison.java
+15
-4
TableView.java
h2/src/main/org/h2/table/TableView.java
+11
-0
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+0
-8
TestCrashAPI.java
h2/src/test/org/h2/test/synth/TestCrashAPI.java
+8
-8
test.in.txt
h2/src/test/org/h2/test/test.in.txt
+12
-1
testSimple.in.txt
h2/src/test/org/h2/test/testSimple.in.txt
+9
-0
没有找到文件。
h2/src/docsrc/html/history.html
浏览文件 @
e2304cb7
...
...
@@ -39,6 +39,11 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0.58 (2007-09-15)
</h3><ul>
<li>
Views with subqueries as tables and queries with nested subqueries as tables did not always work. Fixed.
</li><li>
Compatibility: comparing columns with constants that are out of range does not throw an exception.
</li></ul>
<h3>
Version 1.0.58 (2007-09-15)
</h3><ul>
<li>
System.exit is no longer called by the WebServer, the Console and the Server tool
(except to set the exit code if required). This is important when using OSGi.
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
e2304cb7
...
...
@@ -814,11 +814,8 @@ public class Parser {
TableView
v
=
new
TableView
(
mainSchema
,
0
,
tempViewName
,
querySQL
,
query
.
getParameters
(),
null
,
s
,
false
);
v
.
setOwner
(
session
.
getUser
());
v
.
setTemporary
(
true
);
table
=
v
;
if
(
s
!=
database
.
getSystemSession
())
{
table
.
setOnCommitDrop
(
true
);
}
s
.
addLocalTempTable
(
table
);
read
(
")"
);
}
else
{
TableFilter
top
=
readTableFilter
(
fromOuter
);
...
...
h2/src/main/org/h2/expression/Comparison.java
浏览文件 @
e2304cb7
...
...
@@ -95,10 +95,21 @@ public class Comparison extends Condition {
dataType
=
left
.
getType
();
}
else
{
right
=
right
.
optimize
(
session
);
if
(
left
instanceof
ExpressionColumn
&&
right
.
isConstant
())
{
right
=
getCast
(
right
,
left
.
getType
(),
left
.
getPrecision
(),
left
.
getScale
(),
session
);
}
else
if
(
right
instanceof
ExpressionColumn
&&
left
.
isConstant
())
{
left
=
getCast
(
left
,
right
.
getType
(),
right
.
getPrecision
(),
right
.
getScale
(),
session
);
try
{
if
(
left
instanceof
ExpressionColumn
&&
right
.
isConstant
())
{
right
=
getCast
(
right
,
left
.
getType
(),
left
.
getPrecision
(),
left
.
getScale
(),
session
);
}
else
if
(
right
instanceof
ExpressionColumn
&&
left
.
isConstant
())
{
left
=
getCast
(
left
,
right
.
getType
(),
right
.
getPrecision
(),
right
.
getScale
(),
session
);
}
}
catch
(
SQLException
e
)
{
int
code
=
e
.
getErrorCode
();
switch
(
code
)
{
case
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE
:
// WHERE ID=100000000000
return
ValueExpression
.
get
(
ValueBoolean
.
get
(
false
));
default
:
throw
e
;
}
}
int
lt
=
left
.
getType
(),
rt
=
right
.
getType
();
if
(
lt
==
rt
)
{
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
e2304cb7
...
...
@@ -215,6 +215,17 @@ public class TableView extends Table {
index
=
null
;
invalidate
();
}
public
String
getSQL
()
{
if
(
getTemporary
())
{
StringBuffer
buff
=
new
StringBuffer
(
querySQL
.
length
());
buff
.
append
(
"("
);
buff
.
append
(
querySQL
);
buff
.
append
(
")"
);
return
buff
.
toString
();
}
return
super
.
getSQL
();
}
public
Index
getScanIndex
(
Session
session
)
throws
SQLException
{
if
(
createException
!=
null
)
{
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
e2304cb7
...
...
@@ -143,14 +143,6 @@ java org.h2.test.TestAll timer
/*
DROP TABLE IF EXISTS TEST;
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255));
INSERT INTO TEST VALUES(1, 'Hello');
INSERT INTO TEST VALUES(2, 'World');
SELECT * FROM TEST WHERE ID=10000000000;
select * from test where id = 'Hello'; (works in some databases)
Sorry.... I just read the doc and it says using LOG=0 can lead to
corruption...
...
...
h2/src/test/org/h2/test/synth/TestCrashAPI.java
浏览文件 @
e2304cb7
...
...
@@ -59,11 +59,11 @@ public class TestCrashAPI extends TestBase {
// the database in the finalize method
String
add
=
""
;
// ";STORAGE=TEXT";
int
testing
;
//
int testing;
// add = ";STORAGE=TEXT";
if
(
openCount
>=
33
)
{
System
.
exit
(
1
);
}
//
if (openCount >= 33) {
//
System.exit(1);
//
}
// add = ";LOG=2";
// System.out.println("now open " + openCount);
// add += ";TRACE_LEVEL_FILE=3";
...
...
@@ -96,10 +96,10 @@ public class TestCrashAPI extends TestBase {
String
sql
=
(
String
)
statements
.
get
(
i
);
try
{
if
(
openCount
==
32
&&
i
==
1219
)
{
int
test
;
System
.
out
.
println
(
"stop!"
);
}
//
if(openCount == 32 && i == 1219) {
//
int test;
//
System.out.println("stop!");
//
}
stat
.
execute
(
sql
);
}
catch
(
Throwable
t
)
{
printIfBad
(
seed
,
-
i
,
-
1
,
t
);
...
...
h2/src/test/org/h2/test/test.in.txt
浏览文件 @
e2304cb7
--- special grammar and test cases ---------------------------------------------------------------------------------------------
select * from dual where x = 1000000000000000000000;
> X
> -
> rows: 0
select * from dual where x = 'Hello';
> exception
CREATE TABLE PARENT(ID INT PRIMARY KEY);
> ok
...
...
@@ -48,7 +56,10 @@ explain select * from test where id = 3;
> rows: 1
explain select * from test where id = 255;
> exception
> PLAN
> -------------------------------------------------------------------------------
> SELECT TEST.ID FROM PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN: FALSE */ WHERE FALSE
> rows: 1
drop table test;
> ok
...
...
h2/src/test/org/h2/test/testSimple.in.txt
浏览文件 @
e2304cb7
select * from (select x from (select x from dual)) where 1=x;
> 1;
CREATE VIEW TEST_VIEW AS SELECT X FROM (SELECT X FROM DUAL);
SELECT * FROM TEST_VIEW;
> 1;
SELECT * FROM TEST_VIEW;
> 1;
DROP VIEW TEST_VIEW;
SELECT X FROM (SELECT X, X AS "XY" FROM DUAL) WHERE X=1;
> 1;
SELECT X FROM (SELECT X, X AS "X Y" FROM DUAL) WHERE X=1;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论