Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
236daa35
提交
236daa35
authored
7 年前
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve the script-based unit testing to check the error code of the exception thrown.
上级
7db8f19e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
216 行增加
和
195 行删除
+216
-195
changelog.html
h2/src/docsrc/html/changelog.html
+2
-0
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+28
-9
double.sql
h2/src/test/org/h2/test/scripts/datatypes/double.sql
+1
-1
enum.sql
h2/src/test/org/h2/test/scripts/datatypes/enum.sql
+4
-4
real.sql
h2/src/test/org/h2/test/scripts/datatypes/real.sql
+1
-1
time.sql
h2/src/test/org/h2/test/scripts/datatypes/time.sql
+1
-1
timestamp-with-timezone.sql
...org/h2/test/scripts/datatypes/timestamp-with-timezone.sql
+1
-1
timestamp.sql
h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql
+3
-3
alterTableAdd.sql
h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql
+5
-5
alterTableDropColumn.sql
h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql
+4
-4
createAlias.sql
h2/src/test/org/h2/test/scripts/ddl/createAlias.sql
+6
-6
dropSchema.sql
h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql
+6
-6
derived-column-names.sql
h2/src/test/org/h2/test/scripts/derived-column-names.sql
+4
-4
error_reporting.sql
h2/src/test/org/h2/test/scripts/dml/error_reporting.sql
+1
-1
insertIgnore.sql
h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql
+1
-1
hash.sql
h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql
+2
-2
ora-hash.sql
...c/test/org/h2/test/scripts/functions/numeric/ora-hash.sql
+3
-3
regex-replace.sql
...st/org/h2/test/scripts/functions/string/regex-replace.sql
+1
-1
regexp-like.sql
...test/org/h2/test/scripts/functions/string/regexp-like.sql
+1
-1
cast.sql
h2/src/test/org/h2/test/scripts/functions/system/cast.sql
+1
-1
date_trunc.sql
.../org/h2/test/scripts/functions/timeanddate/date_trunc.sql
+4
-4
dateadd.sql
...est/org/h2/test/scripts/functions/timeanddate/dateadd.sql
+1
-1
joins.sql
h2/src/test/org/h2/test/scripts/joins.sql
+2
-2
range_table.sql
h2/src/test/org/h2/test/scripts/range_table.sql
+4
-4
testScript.sql
h2/src/test/org/h2/test/scripts/testScript.sql
+129
-129
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
236daa35
...
...
@@ -21,6 +21,8 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<ul>
<li>
Improve the script-based unit testing to check the error code of the exception thrown.
</li>
<li>
Issue #1003: Decrypting database with incorrect password renders the database corrupt
</li>
<li>
Issue #873: No error when `=` in equal condition when column is not of array type
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
236daa35
...
...
@@ -11,6 +11,8 @@ import java.io.InputStream;
import
java.io.InputStreamReader
;
import
java.io.LineNumberReader
;
import
java.io.PrintStream
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
...
...
@@ -18,7 +20,10 @@ import java.sql.ResultSetMetaData;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.SysProperties
;
import
org.h2.test.TestAll
;
import
org.h2.test.TestBase
;
...
...
@@ -454,16 +459,30 @@ public class TestScript extends TestBase {
return
buff
.
toString
();
}
private
void
writeException
(
String
sql
,
SQLException
e
)
throws
Exception
{
writeResult
(
sql
,
"exception"
,
e
);
/** Convert the error code to a symbolic name from ErrorCode. */
private
static
final
Map
<
Integer
,
String
>
ERROR_CODE_TO_NAME
=
new
HashMap
<>();
static
{
try
{
for
(
Field
field
:
ErrorCode
.
class
.
getDeclaredFields
())
{
if
(
Modifier
.
isStatic
(
field
.
getModifiers
()))
{
ERROR_CODE_TO_NAME
.
put
(
field
.
getInt
(
null
),
field
.
getName
());
}
}
}
catch
(
IllegalAccessException
ex
)
{
throw
new
RuntimeException
(
ex
);
}
}
private
void
writeException
(
String
sql
,
SQLException
ex
)
throws
Exception
{
writeResult
(
sql
,
"exception "
+
ERROR_CODE_TO_NAME
.
get
(
ex
.
getErrorCode
()),
ex
);
}
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
)
throws
Exception
{
writeResult
(
sql
,
s
,
e
,
"> "
);
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
x
)
throws
Exception
{
writeResult
(
sql
,
s
,
e
x
,
"> "
);
}
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
,
String
prefix
)
throws
Exception
{
assertKnownException
(
sql
,
e
);
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
x
,
String
prefix
)
throws
Exception
{
assertKnownException
(
sql
,
e
x
);
s
=
(
prefix
+
s
).
trim
();
String
compare
=
readLine
();
if
(
compare
!=
null
&&
compare
.
startsWith
(
">"
))
{
...
...
@@ -472,11 +491,11 @@ public class TestScript extends TestBase {
return
;
}
errors
.
append
(
fileName
).
append
(
'\n'
);
errors
.
append
(
"line: "
).
append
(
outputLineNo
).
append
(
'\n'
);
errors
.
append
(
"line: "
).
append
(
in
.
getLineNumber
()
).
append
(
'\n'
);
errors
.
append
(
"exp: "
).
append
(
compare
).
append
(
'\n'
);
errors
.
append
(
"got: "
).
append
(
s
).
append
(
'\n'
);
if
(
e
!=
null
)
{
TestBase
.
logError
(
"script"
,
e
);
if
(
e
x
!=
null
)
{
TestBase
.
logError
(
"script"
,
e
x
);
}
TestBase
.
logErrorMessage
(
errors
.
toString
());
if
(
failFast
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/datatypes/double.sql
浏览文件 @
236daa35
...
...
@@ -7,7 +7,7 @@ CREATE MEMORY TABLE TEST(D1 DOUBLE, D2 DOUBLE PRECISION, D3 FLOAT, D4 FLOAT(25),
>
ok
ALTER
TABLE
TEST
ADD
COLUMN
D6
FLOAT
(
54
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/datatypes/enum.sql
浏览文件 @
236daa35
...
...
@@ -73,13 +73,13 @@ select * from card where rank = 5;
--- ENUM edge cases
insert
into
card
(
rank
,
suit
)
values
(
6
,
' '
);
>
exception
>
exception
ENUM_VALUE_NOT_PERMITTED
alter
table
card
alter
column
suit
enum
(
'hearts'
,
'clubs'
,
'spades'
,
'diamonds'
,
'clubs'
);
>
exception
>
exception
ENUM_DUPLICATE
alter
table
card
alter
column
suit
enum
(
'hearts'
,
'clubs'
,
'spades'
,
'diamonds'
,
''
);
>
exception
>
exception
ENUM_EMPTY
drop
table
card
;
>
ok
...
...
@@ -118,7 +118,7 @@ insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts'), (1, 'clubs');
>
update
count
:
3
insert
into
card
(
rank
,
suit
)
values
(
0
,
'clubs'
);
>
exception
>
exception
DUPLICATE_KEY_1
select
rank
from
card
where
suit
=
'clubs'
;
>
RANK
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/datatypes/real.sql
浏览文件 @
236daa35
...
...
@@ -7,7 +7,7 @@ CREATE MEMORY TABLE TEST(D1 REAL, D2 FLOAT4, D3 FLOAT(0), D4 FLOAT(24));
>
ok
ALTER
TABLE
TEST
ADD
COLUMN
D5
FLOAT
(
-
1
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/datatypes/time.sql
浏览文件 @
236daa35
...
...
@@ -37,7 +37,7 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_SCALE FROM INFORM
>
rows
(
ordered
):
4
ALTER
TABLE
TEST
ADD
T5
TIME
(
10
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
DROP
TABLE
TEST
;
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/datatypes/timestamp-with-timezone.sql
浏览文件 @
236daa35
...
...
@@ -49,7 +49,7 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_SCALE FROM INFORM
>
rows
(
ordered
):
3
ALTER
TABLE
TEST
ADD
T4
TIMESTAMP
(
10
)
WITH
TIME
ZONE
;
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
DROP
TABLE
TEST
;
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql
浏览文件 @
236daa35
...
...
@@ -34,13 +34,13 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_SCALE FROM INFORM
>
rows
(
ordered
):
8
ALTER
TABLE
TEST
ADD
T5
TIMESTAMP
(
10
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
ALTER
TABLE
TEST
ADD
DT4
DATETIME
(
10
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
ALTER
TABLE
TEST
ADD
STD2
SMALLDATETIME
(
1
);
>
exception
>
exception
SYNTAX_ERROR_1
DROP
TABLE
TEST
;
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql
浏览文件 @
236daa35
...
...
@@ -52,7 +52,7 @@ CREATE TABLE TEST(A INT NOT NULL, B INT);
-- column B may be null
ALTER
TABLE
TEST
ADD
(
CONSTRAINT
PK_B
PRIMARY
KEY
(
B
));
>
exception
>
exception
COLUMN_MUST_NOT_BE_NULLABLE_1
ALTER
TABLE
TEST
ADD
(
CONSTRAINT
PK_A
PRIMARY
KEY
(
A
));
>
ok
...
...
@@ -70,16 +70,16 @@ SELECT * FROM TEST;
>
rows
:
1
INSERT
INTO
TEST
VALUES
(
11
,
20
,
30
,
40
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
12
,
30
,
40
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
20
,
1
,
40
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
20
,
30
,
14
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
20
,
30
,
40
);
>
update
count
:
1
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql
浏览文件 @
236daa35
...
...
@@ -16,7 +16,7 @@ ALTER TABLE IF EXISTS TEST DROP COLUMN A;
>
ok
ALTER
TABLE
TEST
DROP
COLUMN
A
;
>
exception
>
exception
TABLE_OR_VIEW_NOT_FOUND_1
CREATE
TABLE
TEST
(
A
INT
,
B
INT
,
C
INT
,
D
INT
,
E
INT
,
F
INT
,
G
INT
,
H
INT
,
I
INT
,
J
INT
);
>
ok
...
...
@@ -25,7 +25,7 @@ ALTER TABLE TEST DROP COLUMN IF EXISTS J;
>
ok
ALTER
TABLE
TEST
DROP
COLUMN
J
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
COLUMN
B
;
>
ok
...
...
@@ -39,7 +39,7 @@ SELECT * FROM TEST;
>
rows
:
0
ALTER
TABLE
TEST
DROP
COLUMN
B
,
D
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
COLUMN
IF
EXISTS
B
,
D
;
>
ok
...
...
@@ -58,7 +58,7 @@ SELECT * FROM TEST;
>
rows
:
0
ALTER
TABLE
TEST
DROP
COLUMN
(
B
,
H
);
>
exception
>
exception
COLUMN_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
COLUMN
IF
EXISTS
(
B
,
H
);
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/createAlias.sql
浏览文件 @
236daa35
...
...
@@ -4,13 +4,13 @@
--
create
alias
"SYSDATE"
for
"java.lang.Integer.parseInt(java.lang.String)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
create
alias
"MIN"
for
"java.lang.Integer.parseInt(java.lang.String)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
create
alias
"CAST"
for
"java.lang.Integer.parseInt(java.lang.String)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
--- function alias ---------------------------------------------------------------------------------------------
CREATE
ALIAS
MY_SQRT
FOR
"java.lang.Math.sqrt"
;
...
...
@@ -54,13 +54,13 @@ CREATE SCHEMA TEST_SCHEMA;
>
ok
CREATE
ALIAS
TRUNC
FOR
"java.lang.Math.floor(double)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
CREATE
ALIAS
PUBLIC
.
TRUNC
FOR
"java.lang.Math.floor(double)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
CREATE
ALIAS
TEST_SCHEMA
.
TRUNC
FOR
"java.lang.Math.round(double)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
SET
BUILTIN_ALIAS_OVERRIDE
=
1
;
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql
浏览文件 @
236daa35
...
...
@@ -16,7 +16,7 @@ CREATE TABLE TEST_SCHEMA.TEST();
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
...
...
@@ -28,7 +28,7 @@ CREATE VIEW TEST_SCHEMA.TEST AS SELECT 1;
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
...
...
@@ -43,7 +43,7 @@ CREATE SYNONYM TEST_SCHEMA.TEST FOR PUBLIC.SRC;
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
...
...
@@ -58,7 +58,7 @@ CREATE SEQUENCE TEST_SCHEMA.TEST;
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
...
...
@@ -70,7 +70,7 @@ CREATE CONSTANT TEST_SCHEMA.TEST VALUE 1;
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
...
...
@@ -82,7 +82,7 @@ CREATE ALIAS TEST_SCHEMA.TEST FOR "java.lang.System.currentTimeMillis";
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/derived-column-names.sql
浏览文件 @
236daa35
...
...
@@ -34,16 +34,16 @@ SELECT A AS A1, B AS B1 FROM (VALUES(1, 2)) AS T(A, B) WHERE A <> B;
>
rows
:
1
SELECT
A
AS
A1
,
B
AS
B1
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
,
B
)
WHERE
A1
<>
B1
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
SELECT
*
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
);
>
exception
>
exception
COLUMN_COUNT_DOES_NOT_MATCH
SELECT
*
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
,
a
);
>
exception
>
exception
DUPLICATE_COLUMN_NAME_1
SELECT
*
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
,
B
,
C
);
>
exception
>
exception
COLUMN_COUNT_DOES_NOT_MATCH
SELECT
V
AS
V1
,
A
AS
A1
,
B
AS
B1
FROM
(
VALUES
(
1
))
T1
(
V
)
INNER
JOIN
(
VALUES
(
1
,
2
))
T2
(
A
,
B
)
ON
V
=
A
;
>
V1
A1
B1
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/dml/error_reporting.sql
浏览文件 @
236daa35
...
...
@@ -7,7 +7,7 @@ CREATE TABLE test (id INT NOT NULL, name VARCHAR);
>
ok
select
*
from
test
where
id
=
(
1
,
2
);
>
exception
>
exception
COMPARING_ARRAY_TO_SCALAR
drop
table
test
;
>
ok
\ No newline at end of file
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql
浏览文件 @
236daa35
...
...
@@ -13,7 +13,7 @@ INSERT INTO TEST VALUES (1, 10), (2, 20), (3, 30), (4, 40);
>
update
count
:
4
INSERT
INTO
TEST
VALUES
(
3
,
31
),
(
5
,
51
);
>
exception
>
exception
DUPLICATE_KEY_1
SELECT
*
FROM
TEST
ORDER
BY
ID
;
>
ID
VALUE
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql
浏览文件 @
236daa35
...
...
@@ -4,7 +4,7 @@
--
call
hash
(
'SHA256'
,
'Hello'
,
0
);
>
exception
>
exception
INVALID_VALUE_2
call
hash
(
'SHA256'
,
'Hello'
);
>>
185
f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
...
...
@@ -22,4 +22,4 @@ CALL HASH('SHA256', STRINGTOUTF8('Password'), 1000);
>>
c644a176ce920bde361ac336089b06cc2f1514dfa95ba5aabfe33f9a22d577f0
call
hash
(
'unknown'
,
'Hello'
,
1
);
>
exception
>
exception
INVALID_VALUE_2
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/numeric/ora-hash.sql
浏览文件 @
236daa35
...
...
@@ -16,7 +16,7 @@ SELECT ORA_HASH(1);
>>
3509391659
SELECT
ORA_HASH
(
1
,
-
1
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
ORA_HASH
(
1
,
0
);
>>
0
...
...
@@ -28,7 +28,7 @@ SELECT ORA_HASH(1, 4294967296)
>
exception
SELECT
ORA_HASH
(
1
,
4294967295
,
-
1
);
>
exception
>
exception
SYNTAX_ERROR_1
SELECT
ORA_HASH
(
1
,
4294967295
,
0
);
>>
3509391659
...
...
@@ -40,7 +40,7 @@ SELECT ORA_HASH(1, 4294967295, 4294967295);
>>
3501171530
SELECT
ORA_HASH
(
1
,
4294967295
,
4294967296
);
>
exception
>
exception
INVALID_VALUE_2
CREATE
TABLE
TEST
(
I
BINARY
,
B
BLOB
,
S
VARCHAR
,
C
CLOB
);
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql
浏览文件 @
236daa35
...
...
@@ -4,7 +4,7 @@
--
call
regexp_replace
(
'x'
,
'x'
,
'
\'
);
> exception
> exception
LIKE_ESCAPE_ERROR_1
CALL REGEXP_REPLACE('
abckaboooom
', '
o
+
', '
o
');
>> abckabom
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql
浏览文件 @
236daa35
...
...
@@ -4,7 +4,7 @@
--
call
select
1
from
dual
where
regexp_like
(
'x'
,
'x'
,
'
\'
);
> exception
> exception
INVALID_VALUE_2
select x from dual where REGEXP_LIKE('
A
', '
[
a
-
z
]
', '
i
');
>> 1
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/system/cast.sql
浏览文件 @
236daa35
...
...
@@ -89,7 +89,7 @@ select cast(cast('01020304-0506-0708-090a-0b0c0d0e0f00' as uuid) as binary);
>>
0102030405060708090
a0b0c0d0e0f00
call
cast
(
'null'
as
uuid
);
>
exception
>
exception
DATA_CONVERSION_ERROR_1
select
cast
(
'12345678123456781234567812345678'
as
uuid
);
>>
12345678
-
1234
-
5678
-
1234
-
567812345678
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/timeanddate/date_trunc.sql
浏览文件 @
236daa35
...
...
@@ -1063,14 +1063,14 @@ SELECT DATE_TRUNC('MILLENNIUM', '2000-05-29 15:14:13');
-- Test unhandled time unit and bad date
--
SELECT
DATE_TRUNC
(
'---'
,
'2015-05-29 15:14:13'
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATE_TRUNC
(
''
,
'2015-05-29 15:14:13'
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATE_TRUNC
(
''
,
''
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATE_TRUNC
(
'YEAR'
,
''
);
>
exception
>
exception
INVALID_DATETIME_CONSTANT_2
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/functions/timeanddate/dateadd.sql
浏览文件 @
236daa35
...
...
@@ -88,7 +88,7 @@ SELECT DATEADD('MINUTE', 30, TIME '12:30:55');
>>
13
:
00
:
55
SELECT
DATEADD
(
'DAY'
,
1
,
TIME
'12:30:55'
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATEADD
(
'QUARTER'
,
1
,
DATE
'2010-11-16'
);
>>
2011
-
02
-
16
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/joins.sql
浏览文件 @
236daa35
...
...
@@ -84,7 +84,7 @@ INSERT INTO PARENT VALUES(1);
>
update
count
:
1
SELECT
*
FROM
PARENT
P
LEFT
OUTER
JOIN
CHILD
C
ON
C
.
PARENTID
=
P
.
ID
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
DROP
TABLE
PARENT
,
CHILD
;
>
ok
...
...
@@ -380,7 +380,7 @@ select * from left_hand left join right_hand on left_hand.id=right_hand.id where
-- h2: 0 (2 cols); postgresql: 0 (1 col), mysql: exception; derby, hsqldb: no natural join
select
*
from
left_hand
natural
join
right_hand
where
left_hand
.
id
=
1
having
right_hand
.
id
=
2
;
>
exception
>
exception
MUST_GROUP_BY_COLUMN_1
-- h2, mysql, hsqldb: 0 rows; postgresql, derby: exception
select
*
from
left_hand
left
outer
join
right_hand
on
left_hand
.
id
=
right_hand
.
id
where
left_hand
.
id
=
1
group
by
left_hand
.
id
having
right_hand
.
id
=
2
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/range_table.sql
浏览文件 @
236daa35
...
...
@@ -182,16 +182,16 @@ SELECT COUNT(*) FROM SYSTEM_RANGE(2, 1, 2);
>>
0
SELECT
*
FROM
SYSTEM_RANGE
(
1
,
2
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
COUNT
(
*
)
FROM
SYSTEM_RANGE
(
1
,
2
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
*
FROM
SYSTEM_RANGE
(
2
,
1
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
COUNT
(
*
)
FROM
SYSTEM_RANGE
(
2
,
1
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
*
FROM
SYSTEM_RANGE
(
1
,
8
,
2
);
>
X
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
236daa35
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论