Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2da82c8e
Unverified
提交
2da82c8e
authored
4月 19, 2018
作者:
Noel Grandin
提交者:
GitHub
4月 19, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1080 from grandinj/improve_script_exceptions
Improve script exceptions
上级
e008b6c7
a852e72e
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
218 行增加
和
197 行删除
+218
-197
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
createTrigger.sql
h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql
+4
-4
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
+127
-127
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
2da82c8e
...
...
@@ -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 #1041: Support OR syntax while creating trigger
</li>
<li>
Issue #1023: MVCC and existing page store file
...
...
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
2da82c8e
...
...
@@ -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
)
{
...
...
h2/src/test/org/h2/test/scripts/datatypes/double.sql
浏览文件 @
2da82c8e
...
...
@@ -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
;
...
...
h2/src/test/org/h2/test/scripts/datatypes/enum.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/datatypes/real.sql
浏览文件 @
2da82c8e
...
...
@@ -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
;
...
...
h2/src/test/org/h2/test/scripts/datatypes/time.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/datatypes/timestamp-with-timezone.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/ddl/createAlias.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql
浏览文件 @
2da82c8e
...
...
@@ -10,7 +10,7 @@ CREATE FORCE TRIGGER T_COUNT BEFORE INSERT ON COUNT CALL "com.Unknown";
>
ok
INSERT
INTO
COUNT
VALUES
(
NULL
);
>
exception
>
exception
ERROR_CREATING_TRIGGER_OBJECT_3
DROP
TRIGGER
T_COUNT
;
>
ok
...
...
@@ -22,7 +22,7 @@ insert into items values(DEFAULT);
>
update
count
:
1
DROP
TABLE
COUNT
;
>
exception
>
exception
CANNOT_DROP_2
insert
into
items
values
(
DEFAULT
);
>
update
count
:
1
...
...
@@ -47,7 +47,7 @@ CREATE FORCE TRIGGER T_COUNT BEFORE INSERT OR UPDATE ON COUNT CALL "com.Unknown"
>
ok
INSERT
INTO
COUNT
VALUES
(
NULL
);
>
exception
>
exception
ERROR_CREATING_TRIGGER_OBJECT_3
UPDATE
COUNT
SET
X
=
2
WHERE
X
=
1
;
>
exception
>
exception
ERROR_CREATING_TRIGGER_OBJECT_3
h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql
浏览文件 @
2da82c8e
...
...
@@ -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
h2/src/test/org/h2/test/scripts/derived-column-names.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/dml/error_reporting.sql
浏览文件 @
2da82c8e
...
...
@@ -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
h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql
浏览文件 @
2da82c8e
...
...
@@ -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
h2/src/test/org/h2/test/scripts/functions/numeric/ora-hash.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql
浏览文件 @
2da82c8e
...
...
@@ -4,7 +4,7 @@
--
call
regexp_replace
(
'x'
,
'x'
,
'
\'
);
> exception
> exception
LIKE_ESCAPE_ERROR_1
CALL REGEXP_REPLACE('
abckaboooom
', '
o
+
', '
o
');
>> abckabom
...
...
h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/functions/system/cast.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/functions/timeanddate/date_trunc.sql
浏览文件 @
2da82c8e
...
...
@@ -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
h2/src/test/org/h2/test/scripts/functions/timeanddate/dateadd.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/joins.sql
浏览文件 @
2da82c8e
...
...
@@ -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
;
...
...
h2/src/test/org/h2/test/scripts/range_table.sql
浏览文件 @
2da82c8e
...
...
@@ -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
...
...
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
2da82c8e
...
...
@@ -213,7 +213,7 @@ insert into test values (2, null);
>
update
count
:
1
update
test
set
pid
=
1
where
id
=
2
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
drop
table
test
;
>
ok
...
...
@@ -222,7 +222,7 @@ create table test(name varchar(255));
>
ok
select
*
from
test
union
select
*
from
test
order
by
test
.
name
;
>
exception
>
exception
ORDER_BY_NOT_IN_RESULT
insert
into
test
values
(
'a'
),
(
'b'
),
(
'c'
);
>
update
count
:
3
...
...
@@ -305,7 +305,7 @@ drop table test;
>
ok
select
x
from
dual
order
by
y
.
x
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
create
table
test
(
id
int
primary
key
,
name
varchar
(
255
),
row_number
int
);
>
ok
...
...
@@ -361,7 +361,7 @@ drop table test;
>
ok
select
2
^
2
;
>
exception
>
exception
SYNTAX_ERROR_1
select
*
from
dual
where
x
in
(
select
x
from
dual
group
by
x
order
by
max
(
x
));
>
X
...
...
@@ -370,7 +370,7 @@ select * from dual where x in (select x from dual group by x order by max(x));
>
rows
(
ordered
):
1
create
table
test
(
d
decimal
(
1
,
2
));
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
call
truncate_value
(
'Test 123'
,
4
,
false
);
>
'Test'
...
...
@@ -379,7 +379,7 @@ call truncate_value('Test 123', 4, false);
>
rows
:
1
call
truncate_value
(
1234567890
.
123456789
,
4
,
false
);
>
exception
>
exception
NUMERIC_VALUE_OUT_OF_RANGE_1
call
truncate_value
(
1234567890
.
123456789
,
4
,
true
);
>
1234567890
.
1234567
...
...
@@ -501,7 +501,7 @@ create table test(id x);
>
ok
insert
into
test
values
(
null
);
>
exception
>
exception
NULL_NOT_ALLOWED
drop
table
test
;
>
ok
...
...
@@ -587,7 +587,7 @@ create view x as select * from test;
>
ok
drop
table
test
restrict
;
>
exception
>
exception
CANNOT_DROP_2
drop
table
test
cascade
;
>
ok
...
...
@@ -631,7 +631,7 @@ delete from a where x = 0 and y is null;
>
update
count
:
1
delete
from
a
where
x
=
0
and
y
=
0
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
drop
table
b
;
>
ok
...
...
@@ -648,7 +648,7 @@ create table test(a int primary key, b int references(a));
>
ok
merge
into
test
values
(
1
,
2
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
drop
table
test
;
>
ok
...
...
@@ -825,13 +825,13 @@ create table test(id identity);
>
ok
set
password
test
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
alter
user
sa
set
password
test
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
comment
on
table
test
is
test
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
select
1
from
test
a
where
1
in
(
select
1
from
test
b
where
b
.
id
in
(
select
1
from
test
c
where
c
.
id
=
a
.
id
));
>
1
...
...
@@ -851,7 +851,7 @@ select @n := case when x = 1 then 1 else @n * x end f from system_range(1, 4);
>
rows
:
4
select
*
from
(
select
"x"
from
dual
);
>
exception
>
exception
COLUMN_NOT_FOUND_1
select
*
from
(
select
1
from
system_range
(
1
,
2
)
group
by
sin
(
x
)
order
by
sin
(
x
));
>
1
...
...
@@ -867,13 +867,13 @@ create table child(id int references parent(id)) as select 1;
>
ok
delete
from
parent
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
drop
table
parent
,
child
;
>
ok
create
domain
integer
as
varchar
;
>
exception
>
exception
USER_DATA_TYPE_ALREADY_EXISTS_1
create
domain
int
as
varchar
;
>
ok
...
...
@@ -903,13 +903,13 @@ insert into test values(0, 0), (1, NULL), (2, 1), (3, 3), (4, 3);
>
update
count
:
5
delete
from
test
where
id
=
3
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
delete
from
test
where
id
=
0
;
>
update
count
:
1
delete
from
test
where
id
=
1
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
drop
table
test
;
>
ok
...
...
@@ -986,13 +986,13 @@ select 1 as id, id as b, count(*) from test group by id;
>
rows
:
2
select
id
+
1
as
x
,
count
(
*
)
from
test
group
by
-
x
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
select
id
+
1
as
x
,
count
(
*
)
from
test
group
by
x
having
x
>
2
;
>
exception
>
exception
MUST_GROUP_BY_COLUMN_1
select
id
+
1
as
x
,
count
(
*
)
from
test
group
by
1
;
>
exception
>
exception
MUST_GROUP_BY_COLUMN_1
drop
table
test
;
>
ok
...
...
@@ -1141,7 +1141,7 @@ CREATE ROLE TEST_A;
>
ok
GRANT
TEST_A
TO
TEST_A
;
>
exception
>
exception
ROLE_ALREADY_GRANTED_1
CREATE
ROLE
TEST_B
;
>
ok
...
...
@@ -1150,7 +1150,7 @@ GRANT TEST_A TO TEST_B;
>
ok
GRANT
TEST_B
TO
TEST_A
;
>
exception
>
exception
ROLE_ALREADY_GRANTED_1
DROP
ROLE
TEST_A
;
>
ok
...
...
@@ -1194,7 +1194,7 @@ drop table test;
>
ok
alter
table
information_schema
.
help
rename
to
information_schema
.
help2
;
>
exception
>
exception
FEATURE_NOT_SUPPORTED_1
help
abc
;
>
ID
SECTION
TOPIC
SYNTAX
TEXT
...
...
@@ -1359,7 +1359,7 @@ CREATE ROLE X;
>
ok
GRANT
X
TO
X
;
>
exception
>
exception
ROLE_ALREADY_GRANTED_1
CREATE
ROLE
Y
;
>
ok
...
...
@@ -1374,7 +1374,7 @@ DROP ROLE X;
>
ok
select
top
sum
(
1
)
0
from
dual
;
>
exception
>
exception
SYNTAX_ERROR_1
create
table
test
(
id
int
primary
key
,
name
varchar
)
as
select
1
,
'Hello World'
;
>
ok
...
...
@@ -1389,7 +1389,7 @@ drop table test;
>
ok
select
rtrim
()
from
dual
;
>
exception
>
exception
INVALID_PARAMETER_COUNT_2
CREATE
TABLE
TEST
(
ID
INT
PRIMARY
KEY
,
LABEL
CHAR
(
20
),
LOOKUP
CHAR
(
30
));
>
ok
...
...
@@ -1408,13 +1408,13 @@ DROP TABLE TEST;
>
ok
call
'a'
regexp
'Ho.*
\'
;
> exception
> exception
LIKE_ESCAPE_ERROR_1
set @t = 0;
> ok
call set(1, 2);
> exception
> exception
CAN_ONLY_ASSIGN_TO_VARIABLE_1
select x, set(@t, ifnull(@t, 0) + x) from system_range(1, 3);
> X SET(@T, (IFNULL(@T, 0) + X))
...
...
@@ -1516,7 +1516,7 @@ CREATE TABLE TEST(ID INTEGER NOT NULL, ID2 INTEGER DEFAULT 0);
> ok
ALTER TABLE test ALTER COLUMN ID2 RENAME TO ID;
> exception
> exception
DUPLICATE_COLUMN_NAME_1
drop table test;
> ok
...
...
@@ -1603,7 +1603,7 @@ select * from dual where x = 1000000000000000000000;
> rows: 0
select * from dual where x = '
Hello
';
> exception
> exception
DATA_CONVERSION_ERROR_1
create table test(id smallint primary key);
> ok
...
...
@@ -1765,7 +1765,7 @@ ALTER TABLE A SET REFERENTIAL_INTEGRITY FALSE;
> ok
ALTER TABLE A SET REFERENTIAL_INTEGRITY TRUE CHECK;
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DROP TABLE A;
> ok
...
...
@@ -1786,7 +1786,7 @@ INSERT INTO CHILD VALUES(2);
> update count: 1
ALTER TABLE CHILD ADD CONSTRAINT CP FOREIGN KEY(PID) REFERENCES PARENT(ID);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
UPDATE CHILD SET PID=1;
> update count: 1
...
...
@@ -1804,7 +1804,7 @@ INSERT INTO A VALUES(1, 2);
> update count: 1
ALTER TABLE A ADD CONSTRAINT AC FOREIGN KEY(SK) REFERENCES A(ID);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DROP TABLE A;
> ok
...
...
@@ -1816,7 +1816,7 @@ INSERT INTO TEST VALUES(0), (1), (100);
> update count: 3
ALTER TABLE TEST ADD CONSTRAINT T CHECK ID<100;
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
UPDATE TEST SET ID=20 WHERE ID=100;
> update count: 1
...
...
@@ -1882,7 +1882,7 @@ insert into test values(1, 1);
> update count: 1
insert into test values(2, 3);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
set autocommit false;
> ok
...
...
@@ -1900,7 +1900,7 @@ set referential_integrity true;
> ok
insert into test values(7, 7), (8, 9);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
set autocommit true;
> ok
...
...
@@ -2053,7 +2053,7 @@ create table d(d double, r real);
> ok
insert into d(d, d, r) values(1.1234567890123456789, 1.1234567890123456789, 3);
> exception
> exception
DUPLICATE_COLUMN_NAME_1
insert into d values(1.1234567890123456789, 1.1234567890123456789);
> update count: 1
...
...
@@ -2239,7 +2239,7 @@ drop all objects;
> ok
call abc;
> exception
> exception
COLUMN_NOT_FOUND_1
create table FOO(id integer primary key);
> ok
...
...
@@ -2254,7 +2254,7 @@ truncate table bar;
> ok
truncate table foo;
> exception
> exception
CANNOT_TRUNCATE_1
drop table bar, foo;
> ok
...
...
@@ -2528,7 +2528,7 @@ insert into content values(0, 0), (0, 0);
> update count: 2
insert into content values(0, 1);
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
insert into content values(1, 1), (2, 2);
> update count: 2
...
...
@@ -2537,7 +2537,7 @@ insert into content values(2, 1);
> update count: 1
insert into content values(2, 3);
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
drop table content;
> ok
...
...
@@ -2613,7 +2613,7 @@ select id/(10*100) from test group by id/(10*100);
> rows: 1
select id/1000 from test group by id/100;
> exception
> exception
MUST_GROUP_BY_COLUMN_1
drop table test;
> ok
...
...
@@ -2697,7 +2697,7 @@ insert into test values(null);
> update count: 1
insert into test values('
aa
');
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
insert into test values('
AA
');
> update count: 1
...
...
@@ -2726,13 +2726,13 @@ insert into address(id, name, name2) values(1, 'test@abc', 'test@gmail.com');
> update count: 1
insert into address(id, name, name2) values(2, '
test
@
abc
', '
test
@
acme
');
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
insert into address(id, name, name2) values(3, '
test_abc
', '
test
@
gmail
');
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
insert into address2(name) values('
test
@
abc
');
> exception
> exception
TABLE_OR_VIEW_NOT_FOUND_1
CREATE DOMAIN STRING AS VARCHAR(255) DEFAULT
''
NOT NULL;
> ok
...
...
@@ -2825,7 +2825,7 @@ create force view address_view as select * from address;
> ok
create table address(id identity, name varchar check instr(value, '
@
') > 1);
> exception
> exception
COLUMN_NOT_FOUND_1
create table address(id identity, name varchar check instr(name, '
@
') > 1);
> ok
...
...
@@ -2855,7 +2855,7 @@ create table c();
> ok
drop table information_schema.columns;
> exception
> exception
CANNOT_DROP_TABLE_1
create table columns as select * from information_schema.columns;
> ok
...
...
@@ -3079,7 +3079,7 @@ INSERT INTO TEST2 VALUES(2, 'World');
> update count: 1
INSERT INTO TEST2 VALUES(3, '
WoRlD
');
> exception
> exception
DUPLICATE_KEY_1
drop index idx_test2_name;
> ok
...
...
@@ -3325,7 +3325,7 @@ create force view t1 as select * from t1;
> ok
select * from t1;
> exception
> exception
VIEW_IS_INVALID_2
drop table t1;
> ok
...
...
@@ -3506,10 +3506,10 @@ select count(*) from test where id in ((select id from test));
> rows: 1
select count(*) from test where id = ((select id from test));
> exception
> exception
SCALAR_SUBQUERY_CONTAINS_MORE_THAN_ONE_ROW
select count(*) from test where id = ((select id from test), 1);
> exception
> exception
COMPARING_ARRAY_TO_SCALAR
select (select id from test where 1=0) from test;
> SELECT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan: FALSE */ WHERE FALSE
...
...
@@ -3561,7 +3561,7 @@ insert into test values(6, 'F');
> update count: 1
select max(id) from test where id = max(id) group by id;
> exception
> exception
INVALID_USE_OF_AGGREGATE_FUNCTION_1
select * from test where a=TRUE=a;
> ID A
...
...
@@ -3636,13 +3636,13 @@ create table test (id identity, value int not null);
> ok
create primary key on test(id);
> exception
> exception
SECOND_PRIMARY_KEY
alter table test drop primary key;
> ok
alter table test drop primary key;
> exception
> exception
INDEX_NOT_FOUND_1
create primary key on test(id, id, id);
> ok
...
...
@@ -3799,7 +3799,7 @@ select test."ID" from test;
> rows: 0
select test."id" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
select "TEST"."ID" from test;
> ID
...
...
@@ -3807,7 +3807,7 @@ select "TEST"."ID" from test;
> rows: 0
select "test"."ID" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
select public."TEST".id from test;
> ID
...
...
@@ -3825,7 +3825,7 @@ select public."TEST"."ID" from test;
> rows: 0
select public."test"."ID" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
select "PUBLIC"."TEST".id from test;
> ID
...
...
@@ -3843,7 +3843,7 @@ select public."TEST"."ID" from test;
> rows: 0
select "public"."TEST"."ID" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
drop table test;
> ok
...
...
@@ -4026,7 +4026,7 @@ create table test(ID INT default next value for seq1);
> ok
drop sequence seq1;
> exception
> exception
CANNOT_DROP_2
alter table test add column name varchar;
> ok
...
...
@@ -4127,7 +4127,7 @@ INSERT INTO CHILD VALUES(1, '1');
> update count: 1
INSERT INTO CHILD VALUES(2, '
Hello
');
> exception
> exception
DATA_CONVERSION_ERROR_1
DROP TABLE IF EXISTS CHILD;
> ok
...
...
@@ -4295,13 +4295,13 @@ INSERT INTO label VALUES ( 0, 0, 0, 'TEST');
> update count: 1
INSERT INTO label VALUES ( 1, 0, 0, '
TEST
');
> exception
> exception
DUPLICATE_KEY_1
INSERT INTO label VALUES ( 1, 0, 0, '
TEST1
');
> update count: 1
INSERT INTO label VALUES ( 2, 2, 1, '
TEST
');
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
drop table label;
> ok
...
...
@@ -4430,7 +4430,7 @@ TRUNCATE TABLE CHILD;
> ok
TRUNCATE TABLE PARENT;
> exception
> exception
CANNOT_TRUNCATE_1
DROP TABLE CHILD;
> ok
...
...
@@ -4522,19 +4522,19 @@ EXPLAIN MERGE INTO TEST(ID, NAME) KEY(ID) VALUES(3, 'How do you do');
> rows: 1
MERGE INTO TEST(ID, NAME) KEY(NAME) VALUES(3, '
Fine
');
> exception
> exception
LOCK_TIMEOUT_1
MERGE INTO TEST(ID, NAME) KEY(NAME) VALUES(4, '
Fine
!
');
> update count: 1
MERGE INTO TEST(ID, NAME) KEY(NAME) VALUES(4, '
Fine
!
And
you
');
> exception
> exception
LOCK_TIMEOUT_1
MERGE INTO TEST(ID, NAME) KEY(NAME, ID) VALUES(5, '
I
''
m
ok
');
> update count: 1
MERGE INTO TEST(ID, NAME) KEY(NAME, ID) VALUES(5, '
Oh
,
fine
');
> exception
> exception
DUPLICATE_KEY_1
MERGE INTO TEST(ID, NAME) VALUES(6, '
Oh
,
fine
.
');
> update count: 1
...
...
@@ -4953,7 +4953,7 @@ select * from test;
> rows: 4
UPDATE test SET name='
Hi
';
> exception
> exception
DUPLICATE_KEY_1
select * from test;
> ID NAME B
...
...
@@ -5254,7 +5254,7 @@ CREATE UNIQUE INDEX IDX_NAME_ID ON TEST(ID, NAME);
> ok
ALTER TABLE TEST DROP COLUMN NAME;
> exception
> exception
COLUMN_IS_REFERENCED_1
DROP INDEX IDX_NAME_ID;
> ok
...
...
@@ -5982,7 +5982,7 @@ DROP VIEW CHILDREN_CLASSES;
> ok
DROP VIEW CHILDREN_CLASS12;
> exception
> exception
VIEW_NOT_FOUND_1
CREATE VIEW V_UNION AS SELECT * FROM CHILDREN UNION ALL SELECT * FROM CHILDREN;
> ok
...
...
@@ -6143,7 +6143,7 @@ DROP TABLE TEST_B cascade;
> ok
DROP VIEW TEST_ALL;
> exception
> exception
VIEW_NOT_FOUND_1
DROP VIEW IF EXISTS TEST_ALL;
> ok
...
...
@@ -6176,7 +6176,7 @@ INSERT INTO TEST VALUES(2, 'World');
> update count: 1
ROLLBACK TO SAVEPOINT NOT_EXISTING;
> exception
> exception
SAVEPOINT_IS_INVALID_1
ROLLBACK TO SAVEPOINT TEST;
> ok
...
...
@@ -6256,16 +6256,16 @@ DROP TABLE TEST;
--- syntax errors ----------------------------------------------------------------------------------------------
CREATE SOMETHING STRANGE;
> exception
> exception
SYNTAX_ERROR_2
SELECT T1.* T2;
> exception
> exception
SYNTAX_ERROR_1
select replace('
abchihihi
', '
i
', '
o
') abcehohoho, replace('
this
is
tom
', '
i
') 1e_th_st_om from test;
> exception
> exception
SYNTAX_ERROR_1
select monthname(date )'
005
-
0
E9
-
12
') d_set fm test;
> exception
> exception
SYNTAX_ERROR_1
call substring('
bob
', 2, -1);
>
''
...
...
@@ -6436,10 +6436,10 @@ SELECT * FROM TEST;
> rows: 1
DROP_ TABLE_ TEST_T;
> exception
> exception
SYNTAX_ERROR_2
DROP TABLE TEST /*;
> exception
> exception
SYNTAX_ERROR_1
DROP TABLE TEST;
> ok
...
...
@@ -6541,13 +6541,13 @@ select 1 from test, test where 1 in (select 1 from test where id=1);
> rows: 9
select * from test, test where id=id;
> exception
> exception
AMBIGUOUS_COLUMN_NAME_1
select 1 from test, test where id=id;
> exception
> exception
AMBIGUOUS_COLUMN_NAME_1
select 1 from test where id in (select id from test, test);
> exception
> exception
AMBIGUOUS_COLUMN_NAME_1
DROP TABLE TEST;
> ok
...
...
@@ -6656,13 +6656,13 @@ INSERT INTO TEST VALUES(0, '0:0:0','1-2-3','2-3-4 0:0:0');
>
update
count
:
1
INSERT
INTO
TEST
VALUES
(
1
,
'01:02:03'
,
'2001-02-03'
,
'2001-02-29 0:0:0'
);
>
exception
>
exception
INVALID_DATETIME_CONSTANT_2
INSERT
INTO
TEST
VALUES
(
1
,
'24:62:03'
,
'2001-02-03'
,
'2001-02-01 0:0:0'
);
>
exception
>
exception
INVALID_DATETIME_CONSTANT_2
INSERT
INTO
TEST
VALUES
(
1
,
'23:02:03'
,
'2001-04-31'
,
'2001-02-01 0:0:0'
);
>
exception
>
exception
INVALID_DATETIME_CONSTANT_2
INSERT
INTO
TEST
VALUES
(
1
,
'1:2:3'
,
'4-5-6'
,
'7-8-9 0:1:2'
);
>
update
count
:
1
...
...
@@ -6937,25 +6937,25 @@ SELECT 2/3 FROM TEST WHERE ID=1;
>
rows
:
1
SELECT
ID
/
ID
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XT
/
XT
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
X_SM
/
X_SM
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XB
/
XB
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XD
/
XD
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XD2
/
XD2
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XR
/
XR
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
ID
++
0
,
-
X1
,
-
XT
,
-
X_SM
,
-
XB
,
-
XD
,
-
XD2
,
-
XR
FROM
TEST
;
>
ID
+
0
-
X1
-
XT
-
X_SM
-
XB
-
XD
-
XD2
-
XR
...
...
@@ -7623,7 +7623,7 @@ CREATE TABLE TEST(ID INT, CONSTRAINT PK PRIMARY KEY(ID), NAME VARCHAR, PARENT IN
>
ok
ALTER
TABLE
TEST
DROP
PRIMARY
KEY
;
>
exception
>
exception
INDEX_BELONGS_TO_CONSTRAINT_2
ALTER
TABLE
TEST
DROP
CONSTRAINT
PK
;
>
ok
...
...
@@ -7638,7 +7638,7 @@ INSERT INTO TEST VALUES(3, 'Karin', 2);
>
update
count
:
1
INSERT
INTO
TEST
VALUES
(
4
,
'Joe'
,
5
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
INSERT
INTO
TEST
VALUES
(
4
,
'Joe'
,
3
);
>
update
count
:
1
...
...
@@ -7656,7 +7656,7 @@ ALTER TABLE TEST DROP PRIMARY KEY;
>
ok
ALTER
TABLE
TEST
DROP
PRIMARY
KEY
;
>
exception
>
exception
INDEX_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
CONSTRAINT
A_UNIQUE
;
>
ok
...
...
@@ -7677,7 +7677,7 @@ ALTER TABLE TEST DROP CONSTRAINT C1;
>
ok
ALTER
TABLE
TEST
DROP
CONSTRAINT
C1
;
>
exception
>
exception
CONSTRAINT_NOT_FOUND_1
DROP
TABLE
TEST
;
>
ok
...
...
@@ -7698,16 +7698,16 @@ ALTER TABLE A_TEST ADD CONSTRAINT DATE_UNIQUE_2 UNIQUE(A_DATE);
>
ok
INSERT
INTO
A_TEST
VALUES
(
NULL
,
NULL
,
NULL
,
NULL
);
>
exception
>
exception
NULL_NOT_ALLOWED
INSERT
INTO
A_TEST
VALUES
(
1
,
'A'
,
NULL
,
NULL
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
INSERT
INTO
A_TEST
VALUES
(
1
,
'AB'
,
NULL
,
NULL
);
>
update
count
:
1
INSERT
INTO
A_TEST
VALUES
(
1
,
'AB'
,
NULL
,
NULL
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
A_TEST
VALUES
(
2
,
'AB'
,
NULL
,
NULL
);
>
update
count
:
1
...
...
@@ -7716,7 +7716,7 @@ INSERT INTO A_TEST VALUES(3, 'AB', '2004-01-01', NULL);
>
update
count
:
1
INSERT
INTO
A_TEST
VALUES
(
4
,
'AB'
,
'2004-01-01'
,
NULL
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
A_TEST
VALUES
(
5
,
'ABC'
,
'2004-01-02'
,
NULL
);
>
update
count
:
1
...
...
@@ -7734,10 +7734,10 @@ ALTER TABLE B_TEST ADD PRIMARY KEY(B_INT);
>
ok
INSERT
INTO
B_TEST
VALUES
(
10
,
'X'
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
INSERT
INTO
B_TEST
VALUES
(
1
,
'X'
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
INSERT
INTO
B_TEST
VALUES
(
1
,
'XX'
);
>
update
count
:
1
...
...
@@ -7764,7 +7764,7 @@ ALTER TABLE B_TEST ADD CONSTRAINT C2 FOREIGN KEY(B_INT) REFERENCES A_TEST(A_INT)
>
ok
UPDATE
A_TEST
SET
A_INT
=
A_INT
*
10
;
>
exception
>
exception
NULL_NOT_ALLOWED
SELECT
*
FROM
B_TEST
;
>
B_INT
B_VARCHAR
...
...
@@ -7862,7 +7862,7 @@ INSERT INTO FAMILY VALUES(1, 'Capone');
>
update
count
:
1
INSERT
INTO
CHILD
VALUES
(
100
,
1
,
1
,
'early'
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
INSERT
INTO
PARENT
VALUES
(
1
,
1
,
'Sue'
);
>
update
count
:
1
...
...
@@ -7895,7 +7895,7 @@ SELECT * FROM CHILD;
>
rows
:
4
UPDATE
CHILD
SET
PARENTID
=-
1
WHERE
PARENTID
IS
NOT
NULL
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DELETE
FROM
PARENT
WHERE
ID
=
2
;
>
update
count
:
1
...
...
@@ -7995,7 +7995,7 @@ INSERT INTO INVOICE_LINE VALUES(1, 100, 10, 'Apples', 20.35), (1, 100, 20, 'Pape
>
update
count
:
4
INSERT
INTO
INVOICE_LINE
VALUES
(
1
,
102
,
20
,
'Nothing'
,
30
.
00
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DELETE
FROM
INVOICE
WHERE
ID
=
100
;
>
update
count
:
1
...
...
@@ -8277,13 +8277,13 @@ drop table test;
>
ok
select
0
from
((
select
0
as
f
from
dual
u1
where
null
in
(
?
,
?
,
?
,
?
,
?
)
select
0
as
f
from
dual
u1
where
null
in
(
?
,
?
,
?
,
?
,
?
)
)
union
all
(
select
u2
.
f
from
(
select
0
as
f
from
(
select
0
from
dual
u2f1f1
where
now
()
=
?
)
u2f1
)
u2
select
u2
.
f
from
(
select
0
as
f
from
(
select
0
from
dual
u2f1f1
where
now
()
=
?
)
u2f1
)
u2
))
where
f
=
12345
;
{
11
,
22
,
33
,
44
,
55
,
null
...
...
@@ -8303,7 +8303,7 @@ alter table if exists x add column a varchar;
>
ok
alter
table
if
exists
x
add
column
a
varchar
;
>
exception
>
exception
DUPLICATE_COLUMN_NAME_1
alter
table
if
exists
y
alter
column
a
rename
to
b
;
>
ok
...
...
@@ -8312,7 +8312,7 @@ alter table if exists x alter column a rename to b;
>
ok
alter
table
if
exists
x
alter
column
a
rename
to
b
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
alter
table
if
exists
y
alter
column
b
set
default
'a'
;
>
ok
...
...
@@ -8345,7 +8345,7 @@ alter table if exists x alter column b set not null;
>
ok
insert
into
x
(
id
)
values
(
1
);
>
exception
>
exception
NULL_NOT_ALLOWED
alter
table
if
exists
y
alter
column
b
drop
not
null
;
>
ok
...
...
@@ -8372,13 +8372,13 @@ alter table if exists x add constraint x_pk primary key (id);
>
ok
alter
table
if
exists
x
add
constraint
x_pk
primary
key
(
id
);
>
exception
>
exception
CONSTRAINT_ALREADY_EXISTS_1
insert
into
x
(
id
)
values
(
1
);
>
update
count
:
1
insert
into
x
(
id
)
values
(
1
);
>
exception
>
exception
DUPLICATE_KEY_1
delete
from
x
;
>
update
count
:
1
...
...
@@ -8390,10 +8390,10 @@ alter table if exists x add constraint x_check check (b = 'a');
>
ok
alter
table
if
exists
x
add
constraint
x_check
check
(
b
=
'a'
);
>
exception
>
exception
CONSTRAINT_ALREADY_EXISTS_1
insert
into
x
(
id
,
b
)
values
(
1
,
'b'
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
alter
table
if
exists
y
rename
constraint
x_check
to
x_check1
;
>
ok
...
...
@@ -8402,7 +8402,7 @@ alter table if exists x rename constraint x_check to x_check1;
>
ok
alter
table
if
exists
x
rename
constraint
x_check
to
x_check1
;
>
exception
>
exception
CONSTRAINT_NOT_FOUND_1
alter
table
if
exists
y
drop
constraint
x_check1
;
>
ok
...
...
@@ -8432,13 +8432,13 @@ alter table if exists z add constraint z_uk unique (b);
>
ok
alter
table
if
exists
z
add
constraint
z_uk
unique
(
b
);
>
exception
>
exception
CONSTRAINT_ALREADY_EXISTS_1
insert
into
z
(
id
,
b
)
values
(
1
,
'b'
);
>
update
count
:
1
insert
into
z
(
id
,
b
)
values
(
1
,
'b'
);
>
exception
>
exception
DUPLICATE_KEY_1
delete
from
z
;
>
update
count
:
1
...
...
@@ -8450,7 +8450,7 @@ alter table if exists z drop column b;
>
ok
alter
table
if
exists
z
drop
column
b
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
alter
table
if
exists
y
drop
primary
key
;
>
ok
...
...
@@ -8459,7 +8459,7 @@ alter table if exists z drop primary key;
>
ok
alter
table
if
exists
z
drop
primary
key
;
>
exception
>
exception
INDEX_NOT_FOUND_1
create
table
x
(
id
int
not
null
primary
key
);
>
ok
...
...
@@ -8471,10 +8471,10 @@ alter table if exists z add constraint z_fk foreign key (id) references x (id);
>
ok
alter
table
if
exists
z
add
constraint
z_fk
foreign
key
(
id
)
references
x
(
id
);
>
exception
>
exception
CONSTRAINT_ALREADY_EXISTS_1
insert
into
z
(
id
)
values
(
1
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
alter
table
if
exists
y
drop
foreign
key
z_fk
;
>
ok
...
...
@@ -8483,7 +8483,7 @@ alter table if exists z drop foreign key z_fk;
>
ok
alter
table
if
exists
z
drop
foreign
key
z_fk
;
>
exception
>
exception
CONSTRAINT_NOT_FOUND_1
insert
into
z
(
id
)
values
(
1
);
>
update
count
:
1
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论