Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
31d87e12
提交
31d87e12
authored
6 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix failure after reconnection in envelope.sql
上级
36b9166f
master
version-1.4.198
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
38 行增加
和
14 行删除
+38
-14
changelog.html
h2/src/docsrc/html/changelog.html
+2
-0
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+19
-14
createAlias.sql
h2/src/test/org/h2/test/scripts/ddl/createAlias.sql
+2
-0
dropSchema.sql
h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql
+2
-0
envelope.sql
...test/org/h2/test/scripts/functions/aggregate/envelope.sql
+8
-0
rand.sql
h2/src/test/org/h2/test/scripts/functions/numeric/rand.sql
+2
-0
set.sql
h2/src/test/org/h2/test/scripts/functions/system/set.sql
+3
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
31d87e12
...
...
@@ -21,6 +21,8 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<ul>
<li>
Issue #1499: TestScript::envelope.sql failure in “big” mode
</li>
<li>
Issue #1495: MERGE statement doesn't affect any rows when Oracle UPDATE .. WHERE .. DELETE .. WHERE is used
</li>
<li>
Issue #1493: MERGE statement fails when it updates more than one row
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
31d87e12
...
...
@@ -234,11 +234,7 @@ public class TestScript extends TestDb {
stat
=
conn
.
createStatement
();
out
=
new
PrintStream
(
new
FileOutputStream
(
outFile
));
errors
=
new
StringBuilder
();
testFile
(
BASE_DIR
+
scriptFileName
,
!
scriptFileName
.
equals
(
"functions/numeric/rand.sql"
)
&&
!
scriptFileName
.
equals
(
"functions/system/set.sql"
)
&&
!
scriptFileName
.
equals
(
"ddl/createAlias.sql"
)
&&
!
scriptFileName
.
equals
(
"ddl/dropSchema.sql"
));
testFile
(
BASE_DIR
+
scriptFileName
);
conn
.
close
();
out
.
close
();
if
(
errors
.
length
()
>
0
)
{
...
...
@@ -297,7 +293,7 @@ public class TestScript extends TestDb {
putBack
.
addLast
(
line
);
}
private
void
testFile
(
String
inFile
,
boolean
allowReconnect
)
throws
Exception
{
private
void
testFile
(
String
inFile
)
throws
Exception
{
InputStream
is
=
getClass
().
getClassLoader
().
getResourceAsStream
(
inFile
);
if
(
is
==
null
)
{
throw
new
IOException
(
"could not find "
+
inFile
);
...
...
@@ -305,11 +301,8 @@ public class TestScript extends TestDb {
fileName
=
inFile
;
in
=
new
LineNumberReader
(
new
InputStreamReader
(
is
,
StandardCharsets
.
UTF_8
));
StringBuilder
buff
=
new
StringBuilder
();
while
(
true
)
{
String
sql
=
readLine
();
if
(
sql
==
null
)
{
break
;
}
boolean
allowReconnect
=
true
;
for
(
String
sql
;
(
sql
=
readLine
())
!=
null
;)
{
if
(
sql
.
startsWith
(
"--"
))
{
write
(
sql
);
}
else
if
(
sql
.
startsWith
(
">"
))
{
...
...
@@ -320,13 +313,25 @@ public class TestScript extends TestDb {
sql
=
buff
.
toString
();
buff
.
setLength
(
0
);
process
(
sql
,
allowReconnect
);
}
else
if
(
sql
.
equals
(
"@reconnect
"
))
{
}
else
if
(
sql
.
startsWith
(
"@
"
))
{
if
(
buff
.
length
()
>
0
)
{
addWriteResultError
(
"<command>"
,
sql
);
}
else
{
switch
(
sql
)
{
case
"@reconnect"
:
if
(!
config
.
memory
)
{
reconnect
(
conn
.
getAutoCommit
());
}
break
;
case
"@reconnect on"
:
allowReconnect
=
true
;
break
;
case
"@reconnect off"
:
allowReconnect
=
false
;
break
;
default
:
addWriteResultError
(
"<command>"
,
sql
);
}
}
}
else
{
write
(
sql
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/createAlias.sql
浏览文件 @
31d87e12
...
...
@@ -12,6 +12,8 @@ create alias "MIN" for "java.lang.Integer.parseInt(java.lang.String)";
create
alias
"CAST"
for
"java.lang.Integer.parseInt(java.lang.String)"
;
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
@
reconnect
off
--- function alias ---------------------------------------------------------------------------------------------
CREATE
ALIAS
MY_SQRT
FOR
"java.lang.Math.sqrt"
;
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql
浏览文件 @
31d87e12
...
...
@@ -3,6 +3,8 @@
-- Initial Developer: H2 Group
--
@
reconnect
off
CREATE
SCHEMA
TEST_SCHEMA
;
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/aggregate/envelope.sql
浏览文件 @
31d87e12
...
...
@@ -69,12 +69,16 @@ SELECT ENVELOPE(V) FROM TEST;
SELECT
ESTIMATED_ENVELOPE
(
'TEST'
,
'V'
);
>>
null
@
reconnect
off
SELECT
RAND
(
1000
)
*
0
;
>>
0
.
0
INSERT
INTO
TEST
SELECT
CAST
(
'POINT('
||
CAST
(
RAND
()
*
100000
AS
INT
)
||
' '
||
CAST
(
RAND
()
*
100000
AS
INT
)
||
')'
AS
GEOMETRY
)
FROM
SYSTEM_RANGE
(
1
,
1000
);
>
update
count
:
1000
@
reconnect
on
-- Without index
SELECT
ENVELOPE
(
N
)
FROM
(
SELECT
V
AS
N
FROM
TEST
);
>>
POLYGON
((
68
78
,
68
99951
,
99903
99951
,
99903
78
,
68
78
))
...
...
@@ -90,6 +94,8 @@ SELECT ESTIMATED_ENVELOPE('TEST', 'V');
TRUNCATE
TABLE
TEST
;
>
ok
@
reconnect
off
SELECT
RAND
(
1000
)
*
0
;
>>
0
.
0
...
...
@@ -97,6 +103,8 @@ INSERT INTO TEST SELECT CAST('POINT(' || (CAST(RAND() * 100000 AS INT) * 0.00000
||
(
CAST
(
RAND
()
*
100000
AS
INT
)
*
0
.
000000001
+
1
)
||
')'
AS
GEOMETRY
)
FROM
SYSTEM_RANGE
(
1
,
1000
);
>
update
count
:
1000
@
reconnect
on
-- Without index
SELECT
ENVELOPE
(
N
)
FROM
(
SELECT
V
AS
N
FROM
TEST
);
>>
POLYGON
((
1
.
000000068
1
.
000000078
,
1
.
000000068
1
.
000099951
,
1
.
000099903
1
.
000099951
,
1
.
000099903
1
.
000000078
,
1
.
000000068
1
.
000000078
))
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/numeric/rand.sql
浏览文件 @
31d87e12
...
...
@@ -9,6 +9,8 @@ create memory table test(id int primary key, name varchar(255));
insert
into
test
values
(
1
,
'Hello'
);
>
update
count
:
1
@
reconnect
off
select
rand
(
1
)
e
,
random
()
f
from
test
;
>
E
F
>
------------------ -------------------
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/system/set.sql
浏览文件 @
31d87e12
...
...
@@ -2,6 +2,9 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
@
reconnect
off
-- Try a custom column naming rules setup
SET
COLUMN_NAME_RULES
=
MAX_IDENTIFIER_LENGTH
=
30
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论