Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
236daa35
提交
236daa35
authored
6 年前
作者:
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
...
@@ -21,6 +21,8 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul>
<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>
Issue #1003: Decrypting database with incorrect password renders the database corrupt
</li>
</li>
<li>
Issue #873: No error when `=` in equal condition when column is not of array type
<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;
...
@@ -11,6 +11,8 @@ import java.io.InputStream;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.io.LineNumberReader
;
import
java.io.LineNumberReader
;
import
java.io.PrintStream
;
import
java.io.PrintStream
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
...
@@ -18,7 +20,10 @@ import java.sql.ResultSetMetaData;
...
@@ -18,7 +20,10 @@ import java.sql.ResultSetMetaData;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Random
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.SysProperties
;
import
org.h2.engine.SysProperties
;
import
org.h2.test.TestAll
;
import
org.h2.test.TestAll
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
...
@@ -454,16 +459,30 @@ public class TestScript extends TestBase {
...
@@ -454,16 +459,30 @@ public class TestScript extends TestBase {
return
buff
.
toString
();
return
buff
.
toString
();
}
}
private
void
writeException
(
String
sql
,
SQLException
e
)
throws
Exception
{
/** Convert the error code to a symbolic name from ErrorCode. */
writeResult
(
sql
,
"exception"
,
e
);
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
{
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
x
)
throws
Exception
{
writeResult
(
sql
,
s
,
e
,
"> "
);
writeResult
(
sql
,
s
,
e
x
,
"> "
);
}
}
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
,
String
prefix
)
throws
Exception
{
private
void
writeResult
(
String
sql
,
String
s
,
SQLException
e
x
,
String
prefix
)
throws
Exception
{
assertKnownException
(
sql
,
e
);
assertKnownException
(
sql
,
e
x
);
s
=
(
prefix
+
s
).
trim
();
s
=
(
prefix
+
s
).
trim
();
String
compare
=
readLine
();
String
compare
=
readLine
();
if
(
compare
!=
null
&&
compare
.
startsWith
(
">"
))
{
if
(
compare
!=
null
&&
compare
.
startsWith
(
">"
))
{
...
@@ -472,11 +491,11 @@ public class TestScript extends TestBase {
...
@@ -472,11 +491,11 @@ public class TestScript extends TestBase {
return
;
return
;
}
}
errors
.
append
(
fileName
).
append
(
'\n'
);
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
(
"exp: "
).
append
(
compare
).
append
(
'\n'
);
errors
.
append
(
"got: "
).
append
(
s
).
append
(
'\n'
);
errors
.
append
(
"got: "
).
append
(
s
).
append
(
'\n'
);
if
(
e
!=
null
)
{
if
(
e
x
!=
null
)
{
TestBase
.
logError
(
"script"
,
e
);
TestBase
.
logError
(
"script"
,
e
x
);
}
}
TestBase
.
logErrorMessage
(
errors
.
toString
());
TestBase
.
logErrorMessage
(
errors
.
toString
());
if
(
failFast
)
{
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),
...
@@ -7,7 +7,7 @@ CREATE MEMORY TABLE TEST(D1 DOUBLE, D2 DOUBLE PRECISION, D3 FLOAT, D4 FLOAT(25),
>
ok
>
ok
ALTER
TABLE
TEST
ADD
COLUMN
D6
FLOAT
(
54
);
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
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
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;
...
@@ -73,13 +73,13 @@ select * from card where rank = 5;
--- ENUM edge cases
--- ENUM edge cases
insert
into
card
(
rank
,
suit
)
values
(
6
,
' '
);
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'
);
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'
,
''
);
alter
table
card
alter
column
suit
enum
(
'hearts'
,
'clubs'
,
'spades'
,
'diamonds'
,
''
);
>
exception
>
exception
ENUM_EMPTY
drop
table
card
;
drop
table
card
;
>
ok
>
ok
...
@@ -118,7 +118,7 @@ insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts'), (1, 'clubs');
...
@@ -118,7 +118,7 @@ insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts'), (1, 'clubs');
>
update
count
:
3
>
update
count
:
3
insert
into
card
(
rank
,
suit
)
values
(
0
,
'clubs'
);
insert
into
card
(
rank
,
suit
)
values
(
0
,
'clubs'
);
>
exception
>
exception
DUPLICATE_KEY_1
select
rank
from
card
where
suit
=
'clubs'
;
select
rank
from
card
where
suit
=
'clubs'
;
>
RANK
>
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));
...
@@ -7,7 +7,7 @@ CREATE MEMORY TABLE TEST(D1 REAL, D2 FLOAT4, D3 FLOAT(0), D4 FLOAT(24));
>
ok
>
ok
ALTER
TABLE
TEST
ADD
COLUMN
D5
FLOAT
(
-
1
);
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
SELECT
COLUMN_NAME
,
DATA_TYPE
,
TYPE_NAME
,
COLUMN_TYPE
FROM
INFORMATION_SCHEMA
.
COLUMNS
WHERE
TABLE_NAME
=
'TEST'
ORDER
BY
ORDINAL_POSITION
;
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
...
@@ -37,7 +37,7 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_SCALE FROM INFORM
>
rows
(
ordered
):
4
>
rows
(
ordered
):
4
ALTER
TABLE
TEST
ADD
T5
TIME
(
10
);
ALTER
TABLE
TEST
ADD
T5
TIME
(
10
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
DROP
TABLE
TEST
;
DROP
TABLE
TEST
;
>
ok
>
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
...
@@ -49,7 +49,7 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_SCALE FROM INFORM
>
rows
(
ordered
):
3
>
rows
(
ordered
):
3
ALTER
TABLE
TEST
ADD
T4
TIMESTAMP
(
10
)
WITH
TIME
ZONE
;
ALTER
TABLE
TEST
ADD
T4
TIMESTAMP
(
10
)
WITH
TIME
ZONE
;
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
DROP
TABLE
TEST
;
DROP
TABLE
TEST
;
>
ok
>
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
...
@@ -34,13 +34,13 @@ SELECT COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_TYPE, NUMERIC_SCALE FROM INFORM
>
rows
(
ordered
):
8
>
rows
(
ordered
):
8
ALTER
TABLE
TEST
ADD
T5
TIMESTAMP
(
10
);
ALTER
TABLE
TEST
ADD
T5
TIMESTAMP
(
10
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
ALTER
TABLE
TEST
ADD
DT4
DATETIME
(
10
);
ALTER
TABLE
TEST
ADD
DT4
DATETIME
(
10
);
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
ALTER
TABLE
TEST
ADD
STD2
SMALLDATETIME
(
1
);
ALTER
TABLE
TEST
ADD
STD2
SMALLDATETIME
(
1
);
>
exception
>
exception
SYNTAX_ERROR_1
DROP
TABLE
TEST
;
DROP
TABLE
TEST
;
>
ok
>
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);
...
@@ -52,7 +52,7 @@ CREATE TABLE TEST(A INT NOT NULL, B INT);
-- column B may be null
-- column B may be null
ALTER
TABLE
TEST
ADD
(
CONSTRAINT
PK_B
PRIMARY
KEY
(
B
));
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
));
ALTER
TABLE
TEST
ADD
(
CONSTRAINT
PK_A
PRIMARY
KEY
(
A
));
>
ok
>
ok
...
@@ -70,16 +70,16 @@ SELECT * FROM TEST;
...
@@ -70,16 +70,16 @@ SELECT * FROM TEST;
>
rows
:
1
>
rows
:
1
INSERT
INTO
TEST
VALUES
(
11
,
20
,
30
,
40
);
INSERT
INTO
TEST
VALUES
(
11
,
20
,
30
,
40
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
12
,
30
,
40
);
INSERT
INTO
TEST
VALUES
(
10
,
12
,
30
,
40
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
20
,
1
,
40
);
INSERT
INTO
TEST
VALUES
(
10
,
20
,
1
,
40
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
20
,
30
,
14
);
INSERT
INTO
TEST
VALUES
(
10
,
20
,
30
,
14
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
TEST
VALUES
(
10
,
20
,
30
,
40
);
INSERT
INTO
TEST
VALUES
(
10
,
20
,
30
,
40
);
>
update
count
:
1
>
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;
...
@@ -16,7 +16,7 @@ ALTER TABLE IF EXISTS TEST DROP COLUMN A;
>
ok
>
ok
ALTER
TABLE
TEST
DROP
COLUMN
A
;
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
);
CREATE
TABLE
TEST
(
A
INT
,
B
INT
,
C
INT
,
D
INT
,
E
INT
,
F
INT
,
G
INT
,
H
INT
,
I
INT
,
J
INT
);
>
ok
>
ok
...
@@ -25,7 +25,7 @@ ALTER TABLE TEST DROP COLUMN IF EXISTS J;
...
@@ -25,7 +25,7 @@ ALTER TABLE TEST DROP COLUMN IF EXISTS J;
>
ok
>
ok
ALTER
TABLE
TEST
DROP
COLUMN
J
;
ALTER
TABLE
TEST
DROP
COLUMN
J
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
COLUMN
B
;
ALTER
TABLE
TEST
DROP
COLUMN
B
;
>
ok
>
ok
...
@@ -39,7 +39,7 @@ SELECT * FROM TEST;
...
@@ -39,7 +39,7 @@ SELECT * FROM TEST;
>
rows
:
0
>
rows
:
0
ALTER
TABLE
TEST
DROP
COLUMN
B
,
D
;
ALTER
TABLE
TEST
DROP
COLUMN
B
,
D
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
COLUMN
IF
EXISTS
B
,
D
;
ALTER
TABLE
TEST
DROP
COLUMN
IF
EXISTS
B
,
D
;
>
ok
>
ok
...
@@ -58,7 +58,7 @@ SELECT * FROM TEST;
...
@@ -58,7 +58,7 @@ SELECT * FROM TEST;
>
rows
:
0
>
rows
:
0
ALTER
TABLE
TEST
DROP
COLUMN
(
B
,
H
);
ALTER
TABLE
TEST
DROP
COLUMN
(
B
,
H
);
>
exception
>
exception
COLUMN_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
COLUMN
IF
EXISTS
(
B
,
H
);
ALTER
TABLE
TEST
DROP
COLUMN
IF
EXISTS
(
B
,
H
);
>
ok
>
ok
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/createAlias.sql
浏览文件 @
236daa35
...
@@ -4,13 +4,13 @@
...
@@ -4,13 +4,13 @@
--
--
create
alias
"SYSDATE"
for
"java.lang.Integer.parseInt(java.lang.String)"
;
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)"
;
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)"
;
create
alias
"CAST"
for
"java.lang.Integer.parseInt(java.lang.String)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
--- function alias ---------------------------------------------------------------------------------------------
--- function alias ---------------------------------------------------------------------------------------------
CREATE
ALIAS
MY_SQRT
FOR
"java.lang.Math.sqrt"
;
CREATE
ALIAS
MY_SQRT
FOR
"java.lang.Math.sqrt"
;
...
@@ -54,13 +54,13 @@ CREATE SCHEMA TEST_SCHEMA;
...
@@ -54,13 +54,13 @@ CREATE SCHEMA TEST_SCHEMA;
>
ok
>
ok
CREATE
ALIAS
TRUNC
FOR
"java.lang.Math.floor(double)"
;
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)"
;
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)"
;
CREATE
ALIAS
TEST_SCHEMA
.
TRUNC
FOR
"java.lang.Math.round(double)"
;
>
exception
>
exception
FUNCTION_ALIAS_ALREADY_EXISTS_1
SET
BUILTIN_ALIAS_OVERRIDE
=
1
;
SET
BUILTIN_ALIAS_OVERRIDE
=
1
;
>
ok
>
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();
...
@@ -16,7 +16,7 @@ CREATE TABLE TEST_SCHEMA.TEST();
>
ok
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
>
ok
...
@@ -28,7 +28,7 @@ CREATE VIEW TEST_SCHEMA.TEST AS SELECT 1;
...
@@ -28,7 +28,7 @@ CREATE VIEW TEST_SCHEMA.TEST AS SELECT 1;
>
ok
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
>
ok
...
@@ -43,7 +43,7 @@ CREATE SYNONYM TEST_SCHEMA.TEST FOR PUBLIC.SRC;
...
@@ -43,7 +43,7 @@ CREATE SYNONYM TEST_SCHEMA.TEST FOR PUBLIC.SRC;
>
ok
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
>
ok
...
@@ -58,7 +58,7 @@ CREATE SEQUENCE TEST_SCHEMA.TEST;
...
@@ -58,7 +58,7 @@ CREATE SEQUENCE TEST_SCHEMA.TEST;
>
ok
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
>
ok
...
@@ -70,7 +70,7 @@ CREATE CONSTANT TEST_SCHEMA.TEST VALUE 1;
...
@@ -70,7 +70,7 @@ CREATE CONSTANT TEST_SCHEMA.TEST VALUE 1;
>
ok
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
>
ok
...
@@ -82,7 +82,7 @@ CREATE ALIAS TEST_SCHEMA.TEST FOR "java.lang.System.currentTimeMillis";
...
@@ -82,7 +82,7 @@ CREATE ALIAS TEST_SCHEMA.TEST FOR "java.lang.System.currentTimeMillis";
>
ok
>
ok
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
DROP
SCHEMA
TEST_SCHEMA
RESTRICT
;
>
exception
>
exception
CANNOT_DROP_2
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
DROP
SCHEMA
TEST_SCHEMA
CASCADE
;
>
ok
>
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;
...
@@ -34,16 +34,16 @@ SELECT A AS A1, B AS B1 FROM (VALUES(1, 2)) AS T(A, B) WHERE A <> B;
>
rows
:
1
>
rows
:
1
SELECT
A
AS
A1
,
B
AS
B1
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
,
B
)
WHERE
A1
<>
B1
;
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
);
SELECT
*
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
);
>
exception
>
exception
COLUMN_COUNT_DOES_NOT_MATCH
SELECT
*
FROM
(
VALUES
(
1
,
2
))
AS
T
(
A
,
a
);
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
);
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
;
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
>
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);
...
@@ -7,7 +7,7 @@ CREATE TABLE test (id INT NOT NULL, name VARCHAR);
>
ok
>
ok
select
*
from
test
where
id
=
(
1
,
2
);
select
*
from
test
where
id
=
(
1
,
2
);
>
exception
>
exception
COMPARING_ARRAY_TO_SCALAR
drop
table
test
;
drop
table
test
;
>
ok
>
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);
...
@@ -13,7 +13,7 @@ INSERT INTO TEST VALUES (1, 10), (2, 20), (3, 30), (4, 40);
>
update
count
:
4
>
update
count
:
4
INSERT
INTO
TEST
VALUES
(
3
,
31
),
(
5
,
51
);
INSERT
INTO
TEST
VALUES
(
3
,
31
),
(
5
,
51
);
>
exception
>
exception
DUPLICATE_KEY_1
SELECT
*
FROM
TEST
ORDER
BY
ID
;
SELECT
*
FROM
TEST
ORDER
BY
ID
;
>
ID
VALUE
>
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 @@
...
@@ -4,7 +4,7 @@
--
--
call
hash
(
'SHA256'
,
'Hello'
,
0
);
call
hash
(
'SHA256'
,
'Hello'
,
0
);
>
exception
>
exception
INVALID_VALUE_2
call
hash
(
'SHA256'
,
'Hello'
);
call
hash
(
'SHA256'
,
'Hello'
);
>>
185
f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
>>
185
f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
...
@@ -22,4 +22,4 @@ CALL HASH('SHA256', STRINGTOUTF8('Password'), 1000);
...
@@ -22,4 +22,4 @@ CALL HASH('SHA256', STRINGTOUTF8('Password'), 1000);
>>
c644a176ce920bde361ac336089b06cc2f1514dfa95ba5aabfe33f9a22d577f0
>>
c644a176ce920bde361ac336089b06cc2f1514dfa95ba5aabfe33f9a22d577f0
call
hash
(
'unknown'
,
'Hello'
,
1
);
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);
...
@@ -16,7 +16,7 @@ SELECT ORA_HASH(1);
>>
3509391659
>>
3509391659
SELECT
ORA_HASH
(
1
,
-
1
);
SELECT
ORA_HASH
(
1
,
-
1
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
ORA_HASH
(
1
,
0
);
SELECT
ORA_HASH
(
1
,
0
);
>>
0
>>
0
...
@@ -28,7 +28,7 @@ SELECT ORA_HASH(1, 4294967296)
...
@@ -28,7 +28,7 @@ SELECT ORA_HASH(1, 4294967296)
>
exception
>
exception
SELECT
ORA_HASH
(
1
,
4294967295
,
-
1
);
SELECT
ORA_HASH
(
1
,
4294967295
,
-
1
);
>
exception
>
exception
SYNTAX_ERROR_1
SELECT
ORA_HASH
(
1
,
4294967295
,
0
);
SELECT
ORA_HASH
(
1
,
4294967295
,
0
);
>>
3509391659
>>
3509391659
...
@@ -40,7 +40,7 @@ SELECT ORA_HASH(1, 4294967295, 4294967295);
...
@@ -40,7 +40,7 @@ SELECT ORA_HASH(1, 4294967295, 4294967295);
>>
3501171530
>>
3501171530
SELECT
ORA_HASH
(
1
,
4294967295
,
4294967296
);
SELECT
ORA_HASH
(
1
,
4294967295
,
4294967296
);
>
exception
>
exception
INVALID_VALUE_2
CREATE
TABLE
TEST
(
I
BINARY
,
B
BLOB
,
S
VARCHAR
,
C
CLOB
);
CREATE
TABLE
TEST
(
I
BINARY
,
B
BLOB
,
S
VARCHAR
,
C
CLOB
);
>
ok
>
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 @@
...
@@ -4,7 +4,7 @@
--
--
call
regexp_replace
(
'x'
,
'x'
,
'
\'
);
call
regexp_replace
(
'x'
,
'x'
,
'
\'
);
> exception
> exception
LIKE_ESCAPE_ERROR_1
CALL REGEXP_REPLACE('
abckaboooom
', '
o
+
', '
o
');
CALL REGEXP_REPLACE('
abckaboooom
', '
o
+
', '
o
');
>> abckabom
>> 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 @@
...
@@ -4,7 +4,7 @@
--
--
call
select
1
from
dual
where
regexp_like
(
'x'
,
'x'
,
'
\'
);
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
');
select x from dual where REGEXP_LIKE('
A
', '
[
a
-
z
]
', '
i
');
>> 1
>> 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);
...
@@ -89,7 +89,7 @@ select cast(cast('01020304-0506-0708-090a-0b0c0d0e0f00' as uuid) as binary);
>>
0102030405060708090
a0b0c0d0e0f00
>>
0102030405060708090
a0b0c0d0e0f00
call
cast
(
'null'
as
uuid
);
call
cast
(
'null'
as
uuid
);
>
exception
>
exception
DATA_CONVERSION_ERROR_1
select
cast
(
'12345678123456781234567812345678'
as
uuid
);
select
cast
(
'12345678123456781234567812345678'
as
uuid
);
>>
12345678
-
1234
-
5678
-
1234
-
567812345678
>>
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');
...
@@ -1063,14 +1063,14 @@ SELECT DATE_TRUNC('MILLENNIUM', '2000-05-29 15:14:13');
-- Test unhandled time unit and bad date
-- Test unhandled time unit and bad date
--
--
SELECT
DATE_TRUNC
(
'---'
,
'2015-05-29 15:14:13'
);
SELECT
DATE_TRUNC
(
'---'
,
'2015-05-29 15:14:13'
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATE_TRUNC
(
''
,
'2015-05-29 15:14:13'
);
SELECT
DATE_TRUNC
(
''
,
'2015-05-29 15:14:13'
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATE_TRUNC
(
''
,
''
);
SELECT
DATE_TRUNC
(
''
,
''
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATE_TRUNC
(
'YEAR'
,
''
);
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');
...
@@ -88,7 +88,7 @@ SELECT DATEADD('MINUTE', 30, TIME '12:30:55');
>>
13
:
00
:
55
>>
13
:
00
:
55
SELECT
DATEADD
(
'DAY'
,
1
,
TIME
'12:30:55'
);
SELECT
DATEADD
(
'DAY'
,
1
,
TIME
'12:30:55'
);
>
exception
>
exception
INVALID_VALUE_2
SELECT
DATEADD
(
'QUARTER'
,
1
,
DATE
'2010-11-16'
);
SELECT
DATEADD
(
'QUARTER'
,
1
,
DATE
'2010-11-16'
);
>>
2011
-
02
-
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);
...
@@ -84,7 +84,7 @@ INSERT INTO PARENT VALUES(1);
>
update
count
:
1
>
update
count
:
1
SELECT
*
FROM
PARENT
P
LEFT
OUTER
JOIN
CHILD
C
ON
C
.
PARENTID
=
P
.
ID
;
SELECT
*
FROM
PARENT
P
LEFT
OUTER
JOIN
CHILD
C
ON
C
.
PARENTID
=
P
.
ID
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
DROP
TABLE
PARENT
,
CHILD
;
DROP
TABLE
PARENT
,
CHILD
;
>
ok
>
ok
...
@@ -380,7 +380,7 @@ select * from left_hand left join right_hand on left_hand.id=right_hand.id where
...
@@ -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
-- 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
;
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
-- 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
;
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);
...
@@ -182,16 +182,16 @@ SELECT COUNT(*) FROM SYSTEM_RANGE(2, 1, 2);
>>
0
>>
0
SELECT
*
FROM
SYSTEM_RANGE
(
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
);
SELECT
COUNT
(
*
)
FROM
SYSTEM_RANGE
(
1
,
2
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
*
FROM
SYSTEM_RANGE
(
2
,
1
,
0
);
SELECT
*
FROM
SYSTEM_RANGE
(
2
,
1
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
COUNT
(
*
)
FROM
SYSTEM_RANGE
(
2
,
1
,
0
);
SELECT
COUNT
(
*
)
FROM
SYSTEM_RANGE
(
2
,
1
,
0
);
>
exception
>
exception
STEP_SIZE_MUST_NOT_BE_ZERO
SELECT
*
FROM
SYSTEM_RANGE
(
1
,
8
,
2
);
SELECT
*
FROM
SYSTEM_RANGE
(
1
,
8
,
2
);
>
X
>
X
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
236daa35
...
@@ -213,7 +213,7 @@ insert into test values (2, null);
...
@@ -213,7 +213,7 @@ insert into test values (2, null);
>
update
count
:
1
>
update
count
:
1
update
test
set
pid
=
1
where
id
=
2
;
update
test
set
pid
=
1
where
id
=
2
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
drop
table
test
;
drop
table
test
;
>
ok
>
ok
...
@@ -222,7 +222,7 @@ create table test(name varchar(255));
...
@@ -222,7 +222,7 @@ create table test(name varchar(255));
>
ok
>
ok
select
*
from
test
union
select
*
from
test
order
by
test
.
name
;
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'
);
insert
into
test
values
(
'a'
),
(
'b'
),
(
'c'
);
>
update
count
:
3
>
update
count
:
3
...
@@ -305,7 +305,7 @@ drop table test;
...
@@ -305,7 +305,7 @@ drop table test;
>
ok
>
ok
select
x
from
dual
order
by
y
.
x
;
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
);
create
table
test
(
id
int
primary
key
,
name
varchar
(
255
),
row_number
int
);
>
ok
>
ok
...
@@ -361,7 +361,7 @@ drop table test;
...
@@ -361,7 +361,7 @@ drop table test;
>
ok
>
ok
select
2
^
2
;
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
));
select
*
from
dual
where
x
in
(
select
x
from
dual
group
by
x
order
by
max
(
x
));
>
X
>
X
...
@@ -370,7 +370,7 @@ select * from dual where x in (select x from dual group by x order by max(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
>
rows
(
ordered
):
1
create
table
test
(
d
decimal
(
1
,
2
));
create
table
test
(
d
decimal
(
1
,
2
));
>
exception
>
exception
INVALID_VALUE_SCALE_PRECISION
call
truncate_value
(
'Test 123'
,
4
,
false
);
call
truncate_value
(
'Test 123'
,
4
,
false
);
>
'Test'
>
'Test'
...
@@ -379,7 +379,7 @@ call truncate_value('Test 123', 4, false);
...
@@ -379,7 +379,7 @@ call truncate_value('Test 123', 4, false);
>
rows
:
1
>
rows
:
1
call
truncate_value
(
1234567890
.
123456789
,
4
,
false
);
call
truncate_value
(
1234567890
.
123456789
,
4
,
false
);
>
exception
>
exception
NUMERIC_VALUE_OUT_OF_RANGE_1
call
truncate_value
(
1234567890
.
123456789
,
4
,
true
);
call
truncate_value
(
1234567890
.
123456789
,
4
,
true
);
>
1234567890
.
1234567
>
1234567890
.
1234567
...
@@ -501,7 +501,7 @@ create table test(id x);
...
@@ -501,7 +501,7 @@ create table test(id x);
>
ok
>
ok
insert
into
test
values
(
null
);
insert
into
test
values
(
null
);
>
exception
>
exception
NULL_NOT_ALLOWED
drop
table
test
;
drop
table
test
;
>
ok
>
ok
...
@@ -587,7 +587,7 @@ create view x as select * from test;
...
@@ -587,7 +587,7 @@ create view x as select * from test;
>
ok
>
ok
drop
table
test
restrict
;
drop
table
test
restrict
;
>
exception
>
exception
CANNOT_DROP_2
drop
table
test
cascade
;
drop
table
test
cascade
;
>
ok
>
ok
...
@@ -631,7 +631,7 @@ delete from a where x = 0 and y is null;
...
@@ -631,7 +631,7 @@ delete from a where x = 0 and y is null;
>
update
count
:
1
>
update
count
:
1
delete
from
a
where
x
=
0
and
y
=
0
;
delete
from
a
where
x
=
0
and
y
=
0
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
drop
table
b
;
drop
table
b
;
>
ok
>
ok
...
@@ -648,7 +648,7 @@ create table test(a int primary key, b int references(a));
...
@@ -648,7 +648,7 @@ create table test(a int primary key, b int references(a));
>
ok
>
ok
merge
into
test
values
(
1
,
2
);
merge
into
test
values
(
1
,
2
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
drop
table
test
;
drop
table
test
;
>
ok
>
ok
...
@@ -825,13 +825,13 @@ create table test(id identity);
...
@@ -825,13 +825,13 @@ create table test(id identity);
>
ok
>
ok
set
password
test
;
set
password
test
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
alter
user
sa
set
password
test
;
alter
user
sa
set
password
test
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
comment
on
table
test
is
test
;
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
));
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
>
1
...
@@ -851,7 +851,7 @@ select @n := case when x = 1 then 1 else @n * x end f from system_range(1, 4);
...
@@ -851,7 +851,7 @@ select @n := case when x = 1 then 1 else @n * x end f from system_range(1, 4);
>
rows
:
4
>
rows
:
4
select
*
from
(
select
"x"
from
dual
);
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
));
select
*
from
(
select
1
from
system_range
(
1
,
2
)
group
by
sin
(
x
)
order
by
sin
(
x
));
>
1
>
1
...
@@ -867,13 +867,13 @@ create table child(id int references parent(id)) as select 1;
...
@@ -867,13 +867,13 @@ create table child(id int references parent(id)) as select 1;
>
ok
>
ok
delete
from
parent
;
delete
from
parent
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
drop
table
parent
,
child
;
drop
table
parent
,
child
;
>
ok
>
ok
create
domain
integer
as
varchar
;
create
domain
integer
as
varchar
;
>
exception
>
exception
USER_DATA_TYPE_ALREADY_EXISTS_1
create
domain
int
as
varchar
;
create
domain
int
as
varchar
;
>
ok
>
ok
...
@@ -903,13 +903,13 @@ insert into test values(0, 0), (1, NULL), (2, 1), (3, 3), (4, 3);
...
@@ -903,13 +903,13 @@ insert into test values(0, 0), (1, NULL), (2, 1), (3, 3), (4, 3);
>
update
count
:
5
>
update
count
:
5
delete
from
test
where
id
=
3
;
delete
from
test
where
id
=
3
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
delete
from
test
where
id
=
0
;
delete
from
test
where
id
=
0
;
>
update
count
:
1
>
update
count
:
1
delete
from
test
where
id
=
1
;
delete
from
test
where
id
=
1
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1
drop
table
test
;
drop
table
test
;
>
ok
>
ok
...
@@ -986,13 +986,13 @@ select 1 as id, id as b, count(*) from test group by id;
...
@@ -986,13 +986,13 @@ select 1 as id, id as b, count(*) from test group by id;
>
rows
:
2
>
rows
:
2
select
id
+
1
as
x
,
count
(
*
)
from
test
group
by
-
x
;
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
;
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
;
select
id
+
1
as
x
,
count
(
*
)
from
test
group
by
1
;
>
exception
>
exception
MUST_GROUP_BY_COLUMN_1
drop
table
test
;
drop
table
test
;
>
ok
>
ok
...
@@ -1141,7 +1141,7 @@ CREATE ROLE TEST_A;
...
@@ -1141,7 +1141,7 @@ CREATE ROLE TEST_A;
>
ok
>
ok
GRANT
TEST_A
TO
TEST_A
;
GRANT
TEST_A
TO
TEST_A
;
>
exception
>
exception
ROLE_ALREADY_GRANTED_1
CREATE
ROLE
TEST_B
;
CREATE
ROLE
TEST_B
;
>
ok
>
ok
...
@@ -1150,7 +1150,7 @@ GRANT TEST_A TO TEST_B;
...
@@ -1150,7 +1150,7 @@ GRANT TEST_A TO TEST_B;
>
ok
>
ok
GRANT
TEST_B
TO
TEST_A
;
GRANT
TEST_B
TO
TEST_A
;
>
exception
>
exception
ROLE_ALREADY_GRANTED_1
DROP
ROLE
TEST_A
;
DROP
ROLE
TEST_A
;
>
ok
>
ok
...
@@ -1194,7 +1194,7 @@ drop table test;
...
@@ -1194,7 +1194,7 @@ drop table test;
>
ok
>
ok
alter
table
information_schema
.
help
rename
to
information_schema
.
help2
;
alter
table
information_schema
.
help
rename
to
information_schema
.
help2
;
>
exception
>
exception
FEATURE_NOT_SUPPORTED_1
help
abc
;
help
abc
;
>
ID
SECTION
TOPIC
SYNTAX
TEXT
>
ID
SECTION
TOPIC
SYNTAX
TEXT
...
@@ -1359,7 +1359,7 @@ CREATE ROLE X;
...
@@ -1359,7 +1359,7 @@ CREATE ROLE X;
>
ok
>
ok
GRANT
X
TO
X
;
GRANT
X
TO
X
;
>
exception
>
exception
ROLE_ALREADY_GRANTED_1
CREATE
ROLE
Y
;
CREATE
ROLE
Y
;
>
ok
>
ok
...
@@ -1374,7 +1374,7 @@ DROP ROLE X;
...
@@ -1374,7 +1374,7 @@ DROP ROLE X;
>
ok
>
ok
select
top
sum
(
1
)
0
from
dual
;
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'
;
create
table
test
(
id
int
primary
key
,
name
varchar
)
as
select
1
,
'Hello World'
;
>
ok
>
ok
...
@@ -1389,7 +1389,7 @@ drop table test;
...
@@ -1389,7 +1389,7 @@ drop table test;
>
ok
>
ok
select
rtrim
()
from
dual
;
select
rtrim
()
from
dual
;
>
exception
>
exception
INVALID_PARAMETER_COUNT_2
CREATE
TABLE
COUNT
(
X
INT
);
CREATE
TABLE
COUNT
(
X
INT
);
>
ok
>
ok
...
@@ -1398,7 +1398,7 @@ CREATE FORCE TRIGGER T_COUNT BEFORE INSERT ON COUNT CALL "com.Unknown";
...
@@ -1398,7 +1398,7 @@ CREATE FORCE TRIGGER T_COUNT BEFORE INSERT ON COUNT CALL "com.Unknown";
>
ok
>
ok
INSERT
INTO
COUNT
VALUES
(
NULL
);
INSERT
INTO
COUNT
VALUES
(
NULL
);
>
exception
>
exception
ERROR_CREATING_TRIGGER_OBJECT_3
DROP
TRIGGER
T_COUNT
;
DROP
TRIGGER
T_COUNT
;
>
ok
>
ok
...
@@ -1410,7 +1410,7 @@ insert into items values(DEFAULT);
...
@@ -1410,7 +1410,7 @@ insert into items values(DEFAULT);
>
update
count
:
1
>
update
count
:
1
DROP
TABLE
COUNT
;
DROP
TABLE
COUNT
;
>
exception
>
exception
CANNOT_DROP_2
insert
into
items
values
(
DEFAULT
);
insert
into
items
values
(
DEFAULT
);
>
update
count
:
1
>
update
count
:
1
...
@@ -1435,13 +1435,13 @@ DROP TABLE TEST;
...
@@ -1435,13 +1435,13 @@ DROP TABLE TEST;
>
ok
>
ok
call
'a'
regexp
'Ho.*
\'
;
call
'a'
regexp
'Ho.*
\'
;
> exception
> exception
LIKE_ESCAPE_ERROR_1
set @t = 0;
set @t = 0;
> ok
> ok
call set(1, 2);
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);
select x, set(@t, ifnull(@t, 0) + x) from system_range(1, 3);
> X SET(@T, (IFNULL(@T, 0) + X))
> X SET(@T, (IFNULL(@T, 0) + X))
...
@@ -1543,7 +1543,7 @@ CREATE TABLE TEST(ID INTEGER NOT NULL, ID2 INTEGER DEFAULT 0);
...
@@ -1543,7 +1543,7 @@ CREATE TABLE TEST(ID INTEGER NOT NULL, ID2 INTEGER DEFAULT 0);
> ok
> ok
ALTER TABLE test ALTER COLUMN ID2 RENAME TO ID;
ALTER TABLE test ALTER COLUMN ID2 RENAME TO ID;
> exception
> exception
DUPLICATE_COLUMN_NAME_1
drop table test;
drop table test;
> ok
> ok
...
@@ -1630,7 +1630,7 @@ select * from dual where x = 1000000000000000000000;
...
@@ -1630,7 +1630,7 @@ select * from dual where x = 1000000000000000000000;
> rows: 0
> rows: 0
select * from dual where x = '
Hello
';
select * from dual where x = '
Hello
';
> exception
> exception
DATA_CONVERSION_ERROR_1
create table test(id smallint primary key);
create table test(id smallint primary key);
> ok
> ok
...
@@ -1792,7 +1792,7 @@ ALTER TABLE A SET REFERENTIAL_INTEGRITY FALSE;
...
@@ -1792,7 +1792,7 @@ ALTER TABLE A SET REFERENTIAL_INTEGRITY FALSE;
> ok
> ok
ALTER TABLE A SET REFERENTIAL_INTEGRITY TRUE CHECK;
ALTER TABLE A SET REFERENTIAL_INTEGRITY TRUE CHECK;
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DROP TABLE A;
DROP TABLE A;
> ok
> ok
...
@@ -1813,7 +1813,7 @@ INSERT INTO CHILD VALUES(2);
...
@@ -1813,7 +1813,7 @@ INSERT INTO CHILD VALUES(2);
> update count: 1
> update count: 1
ALTER TABLE CHILD ADD CONSTRAINT CP FOREIGN KEY(PID) REFERENCES PARENT(ID);
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 CHILD SET PID=1;
> update count: 1
> update count: 1
...
@@ -1831,7 +1831,7 @@ INSERT INTO A VALUES(1, 2);
...
@@ -1831,7 +1831,7 @@ INSERT INTO A VALUES(1, 2);
> update count: 1
> update count: 1
ALTER TABLE A ADD CONSTRAINT AC FOREIGN KEY(SK) REFERENCES A(ID);
ALTER TABLE A ADD CONSTRAINT AC FOREIGN KEY(SK) REFERENCES A(ID);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DROP TABLE A;
DROP TABLE A;
> ok
> ok
...
@@ -1843,7 +1843,7 @@ INSERT INTO TEST VALUES(0), (1), (100);
...
@@ -1843,7 +1843,7 @@ INSERT INTO TEST VALUES(0), (1), (100);
> update count: 3
> update count: 3
ALTER TABLE TEST ADD CONSTRAINT T CHECK ID<100;
ALTER TABLE TEST ADD CONSTRAINT T CHECK ID<100;
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
UPDATE TEST SET ID=20 WHERE ID=100;
UPDATE TEST SET ID=20 WHERE ID=100;
> update count: 1
> update count: 1
...
@@ -1909,7 +1909,7 @@ insert into test values(1, 1);
...
@@ -1909,7 +1909,7 @@ insert into test values(1, 1);
> update count: 1
> update count: 1
insert into test values(2, 3);
insert into test values(2, 3);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
set autocommit false;
set autocommit false;
> ok
> ok
...
@@ -1927,7 +1927,7 @@ set referential_integrity true;
...
@@ -1927,7 +1927,7 @@ set referential_integrity true;
> ok
> ok
insert into test values(7, 7), (8, 9);
insert into test values(7, 7), (8, 9);
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
set autocommit true;
set autocommit true;
> ok
> ok
...
@@ -2080,7 +2080,7 @@ create table d(d double, r real);
...
@@ -2080,7 +2080,7 @@ create table d(d double, r real);
> ok
> ok
insert into d(d, d, r) values(1.1234567890123456789, 1.1234567890123456789, 3);
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);
insert into d values(1.1234567890123456789, 1.1234567890123456789);
> update count: 1
> update count: 1
...
@@ -2266,7 +2266,7 @@ drop all objects;
...
@@ -2266,7 +2266,7 @@ drop all objects;
> ok
> ok
call abc;
call abc;
> exception
> exception
COLUMN_NOT_FOUND_1
create table FOO(id integer primary key);
create table FOO(id integer primary key);
> ok
> ok
...
@@ -2281,7 +2281,7 @@ truncate table bar;
...
@@ -2281,7 +2281,7 @@ truncate table bar;
> ok
> ok
truncate table foo;
truncate table foo;
> exception
> exception
CANNOT_TRUNCATE_1
drop table bar, foo;
drop table bar, foo;
> ok
> ok
...
@@ -2555,7 +2555,7 @@ insert into content values(0, 0), (0, 0);
...
@@ -2555,7 +2555,7 @@ insert into content values(0, 0), (0, 0);
> update count: 2
> update count: 2
insert into content values(0, 1);
insert into content values(0, 1);
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
insert into content values(1, 1), (2, 2);
insert into content values(1, 1), (2, 2);
> update count: 2
> update count: 2
...
@@ -2564,7 +2564,7 @@ insert into content values(2, 1);
...
@@ -2564,7 +2564,7 @@ insert into content values(2, 1);
> update count: 1
> update count: 1
insert into content values(2, 3);
insert into content values(2, 3);
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
drop table content;
drop table content;
> ok
> ok
...
@@ -2640,7 +2640,7 @@ select id/(10*100) from test group by id/(10*100);
...
@@ -2640,7 +2640,7 @@ select id/(10*100) from test group by id/(10*100);
> rows: 1
> rows: 1
select id/1000 from test group by id/100;
select id/1000 from test group by id/100;
> exception
> exception
MUST_GROUP_BY_COLUMN_1
drop table test;
drop table test;
> ok
> ok
...
@@ -2724,7 +2724,7 @@ insert into test values(null);
...
@@ -2724,7 +2724,7 @@ insert into test values(null);
> update count: 1
> update count: 1
insert into test values('
aa
');
insert into test values('
aa
');
> exception
> exception
CHECK_CONSTRAINT_VIOLATED_1
insert into test values('
AA
');
insert into test values('
AA
');
> update count: 1
> update count: 1
...
@@ -2753,13 +2753,13 @@ insert into address(id, name, name2) values(1, 'test@abc', 'test@gmail.com');
...
@@ -2753,13 +2753,13 @@ insert into address(id, name, name2) values(1, 'test@abc', 'test@gmail.com');
> update count: 1
> update count: 1
insert into address(id, name, name2) values(2, '
test
@
abc
', '
test
@
acme
');
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
');
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
');
insert into address2(name) values('
test
@
abc
');
> exception
> exception
TABLE_OR_VIEW_NOT_FOUND_1
CREATE DOMAIN STRING AS VARCHAR(255) DEFAULT
''
NOT NULL;
CREATE DOMAIN STRING AS VARCHAR(255) DEFAULT
''
NOT NULL;
> ok
> ok
...
@@ -2852,7 +2852,7 @@ create force view address_view as select * from address;
...
@@ -2852,7 +2852,7 @@ create force view address_view as select * from address;
> ok
> ok
create table address(id identity, name varchar check instr(value, '
@
') > 1);
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);
create table address(id identity, name varchar check instr(name, '
@
') > 1);
> ok
> ok
...
@@ -2882,7 +2882,7 @@ create table c();
...
@@ -2882,7 +2882,7 @@ create table c();
> ok
> ok
drop table information_schema.columns;
drop table information_schema.columns;
> exception
> exception
CANNOT_DROP_TABLE_1
create table columns as select * from information_schema.columns;
create table columns as select * from information_schema.columns;
> ok
> ok
...
@@ -3106,7 +3106,7 @@ INSERT INTO TEST2 VALUES(2, 'World');
...
@@ -3106,7 +3106,7 @@ INSERT INTO TEST2 VALUES(2, 'World');
> update count: 1
> update count: 1
INSERT INTO TEST2 VALUES(3, '
WoRlD
');
INSERT INTO TEST2 VALUES(3, '
WoRlD
');
> exception
> exception
DUPLICATE_KEY_1
drop index idx_test2_name;
drop index idx_test2_name;
> ok
> ok
...
@@ -3352,7 +3352,7 @@ create force view t1 as select * from t1;
...
@@ -3352,7 +3352,7 @@ create force view t1 as select * from t1;
> ok
> ok
select * from t1;
select * from t1;
> exception
> exception
VIEW_IS_INVALID_2
drop table t1;
drop table t1;
> ok
> ok
...
@@ -3533,10 +3533,10 @@ select count(*) from test where id in ((select id from test));
...
@@ -3533,10 +3533,10 @@ select count(*) from test where id in ((select id from test));
> rows: 1
> rows: 1
select count(*) from test where id = ((select id from test));
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);
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 (select id from test where 1=0) from test;
> SELECT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan: FALSE */ WHERE FALSE
> SELECT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan: FALSE */ WHERE FALSE
...
@@ -3588,7 +3588,7 @@ insert into test values(6, 'F');
...
@@ -3588,7 +3588,7 @@ insert into test values(6, 'F');
> update count: 1
> update count: 1
select max(id) from test where id = max(id) group by id;
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;
select * from test where a=TRUE=a;
> ID A
> ID A
...
@@ -3663,13 +3663,13 @@ create table test (id identity, value int not null);
...
@@ -3663,13 +3663,13 @@ create table test (id identity, value int not null);
> ok
> ok
create primary key on test(id);
create primary key on test(id);
> exception
> exception
SECOND_PRIMARY_KEY
alter table test drop primary key;
alter table test drop primary key;
> ok
> ok
alter table test drop primary key;
alter table test drop primary key;
> exception
> exception
INDEX_NOT_FOUND_1
create primary key on test(id, id, id);
create primary key on test(id, id, id);
> ok
> ok
...
@@ -3826,7 +3826,7 @@ select test."ID" from test;
...
@@ -3826,7 +3826,7 @@ select test."ID" from test;
> rows: 0
> rows: 0
select test."id" from test;
select test."id" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
select "TEST"."ID" from test;
select "TEST"."ID" from test;
> ID
> ID
...
@@ -3834,7 +3834,7 @@ select "TEST"."ID" from test;
...
@@ -3834,7 +3834,7 @@ select "TEST"."ID" from test;
> rows: 0
> rows: 0
select "test"."ID" from test;
select "test"."ID" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
select public."TEST".id from test;
select public."TEST".id from test;
> ID
> ID
...
@@ -3852,7 +3852,7 @@ select public."TEST"."ID" from test;
...
@@ -3852,7 +3852,7 @@ select public."TEST"."ID" from test;
> rows: 0
> rows: 0
select public."test"."ID" from test;
select public."test"."ID" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
select "PUBLIC"."TEST".id from test;
select "PUBLIC"."TEST".id from test;
> ID
> ID
...
@@ -3870,7 +3870,7 @@ select public."TEST"."ID" from test;
...
@@ -3870,7 +3870,7 @@ select public."TEST"."ID" from test;
> rows: 0
> rows: 0
select "public"."TEST"."ID" from test;
select "public"."TEST"."ID" from test;
> exception
> exception
COLUMN_NOT_FOUND_1
drop table test;
drop table test;
> ok
> ok
...
@@ -4053,7 +4053,7 @@ create table test(ID INT default next value for seq1);
...
@@ -4053,7 +4053,7 @@ create table test(ID INT default next value for seq1);
> ok
> ok
drop sequence seq1;
drop sequence seq1;
> exception
> exception
CANNOT_DROP_2
alter table test add column name varchar;
alter table test add column name varchar;
> ok
> ok
...
@@ -4154,7 +4154,7 @@ INSERT INTO CHILD VALUES(1, '1');
...
@@ -4154,7 +4154,7 @@ INSERT INTO CHILD VALUES(1, '1');
> update count: 1
> update count: 1
INSERT INTO CHILD VALUES(2, '
Hello
');
INSERT INTO CHILD VALUES(2, '
Hello
');
> exception
> exception
DATA_CONVERSION_ERROR_1
DROP TABLE IF EXISTS CHILD;
DROP TABLE IF EXISTS CHILD;
> ok
> ok
...
@@ -4322,13 +4322,13 @@ INSERT INTO label VALUES ( 0, 0, 0, 'TEST');
...
@@ -4322,13 +4322,13 @@ INSERT INTO label VALUES ( 0, 0, 0, 'TEST');
> update count: 1
> update count: 1
INSERT INTO label VALUES ( 1, 0, 0, '
TEST
');
INSERT INTO label VALUES ( 1, 0, 0, '
TEST
');
> exception
> exception
DUPLICATE_KEY_1
INSERT INTO label VALUES ( 1, 0, 0, '
TEST1
');
INSERT INTO label VALUES ( 1, 0, 0, '
TEST1
');
> update count: 1
> update count: 1
INSERT INTO label VALUES ( 2, 2, 1, '
TEST
');
INSERT INTO label VALUES ( 2, 2, 1, '
TEST
');
> exception
> exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
drop table label;
drop table label;
> ok
> ok
...
@@ -4457,7 +4457,7 @@ TRUNCATE TABLE CHILD;
...
@@ -4457,7 +4457,7 @@ TRUNCATE TABLE CHILD;
> ok
> ok
TRUNCATE TABLE PARENT;
TRUNCATE TABLE PARENT;
> exception
> exception
CANNOT_TRUNCATE_1
DROP TABLE CHILD;
DROP TABLE CHILD;
> ok
> ok
...
@@ -4549,19 +4549,19 @@ EXPLAIN MERGE INTO TEST(ID, NAME) KEY(ID) VALUES(3, 'How do you do');
...
@@ -4549,19 +4549,19 @@ EXPLAIN MERGE INTO TEST(ID, NAME) KEY(ID) VALUES(3, 'How do you do');
> rows: 1
> rows: 1
MERGE INTO TEST(ID, NAME) KEY(NAME) VALUES(3, '
Fine
');
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
!
');
MERGE INTO TEST(ID, NAME) KEY(NAME) VALUES(4, '
Fine
!
');
> update count: 1
> update count: 1
MERGE INTO TEST(ID, NAME) KEY(NAME) VALUES(4, '
Fine
!
And
you
');
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
');
MERGE INTO TEST(ID, NAME) KEY(NAME, ID) VALUES(5, '
I
''
m
ok
');
> update count: 1
> update count: 1
MERGE INTO TEST(ID, NAME) KEY(NAME, ID) VALUES(5, '
Oh
,
fine
');
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
.
');
MERGE INTO TEST(ID, NAME) VALUES(6, '
Oh
,
fine
.
');
> update count: 1
> update count: 1
...
@@ -4980,7 +4980,7 @@ select * from test;
...
@@ -4980,7 +4980,7 @@ select * from test;
> rows: 4
> rows: 4
UPDATE test SET name='
Hi
';
UPDATE test SET name='
Hi
';
> exception
> exception
DUPLICATE_KEY_1
select * from test;
select * from test;
> ID NAME B
> ID NAME B
...
@@ -5281,7 +5281,7 @@ CREATE UNIQUE INDEX IDX_NAME_ID ON TEST(ID, NAME);
...
@@ -5281,7 +5281,7 @@ CREATE UNIQUE INDEX IDX_NAME_ID ON TEST(ID, NAME);
> ok
> ok
ALTER TABLE TEST DROP COLUMN NAME;
ALTER TABLE TEST DROP COLUMN NAME;
> exception
> exception
COLUMN_IS_REFERENCED_1
DROP INDEX IDX_NAME_ID;
DROP INDEX IDX_NAME_ID;
> ok
> ok
...
@@ -6009,7 +6009,7 @@ DROP VIEW CHILDREN_CLASSES;
...
@@ -6009,7 +6009,7 @@ DROP VIEW CHILDREN_CLASSES;
> ok
> ok
DROP VIEW CHILDREN_CLASS12;
DROP VIEW CHILDREN_CLASS12;
> exception
> exception
VIEW_NOT_FOUND_1
CREATE VIEW V_UNION AS SELECT * FROM CHILDREN UNION ALL SELECT * FROM CHILDREN;
CREATE VIEW V_UNION AS SELECT * FROM CHILDREN UNION ALL SELECT * FROM CHILDREN;
> ok
> ok
...
@@ -6170,7 +6170,7 @@ DROP TABLE TEST_B cascade;
...
@@ -6170,7 +6170,7 @@ DROP TABLE TEST_B cascade;
> ok
> ok
DROP VIEW TEST_ALL;
DROP VIEW TEST_ALL;
> exception
> exception
VIEW_NOT_FOUND_1
DROP VIEW IF EXISTS TEST_ALL;
DROP VIEW IF EXISTS TEST_ALL;
> ok
> ok
...
@@ -6203,7 +6203,7 @@ INSERT INTO TEST VALUES(2, 'World');
...
@@ -6203,7 +6203,7 @@ INSERT INTO TEST VALUES(2, 'World');
> update count: 1
> update count: 1
ROLLBACK TO SAVEPOINT NOT_EXISTING;
ROLLBACK TO SAVEPOINT NOT_EXISTING;
> exception
> exception
SAVEPOINT_IS_INVALID_1
ROLLBACK TO SAVEPOINT TEST;
ROLLBACK TO SAVEPOINT TEST;
> ok
> ok
...
@@ -6283,16 +6283,16 @@ DROP TABLE TEST;
...
@@ -6283,16 +6283,16 @@ DROP TABLE TEST;
--- syntax errors ----------------------------------------------------------------------------------------------
--- syntax errors ----------------------------------------------------------------------------------------------
CREATE SOMETHING STRANGE;
CREATE SOMETHING STRANGE;
> exception
> exception
SYNTAX_ERROR_2
SELECT T1.* T2;
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;
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;
select monthname(date )'
005
-
0
E9
-
12
') d_set fm test;
> exception
> exception
SYNTAX_ERROR_1
call substring('
bob
', 2, -1);
call substring('
bob
', 2, -1);
>
''
>
''
...
@@ -6463,10 +6463,10 @@ SELECT * FROM TEST;
...
@@ -6463,10 +6463,10 @@ SELECT * FROM TEST;
> rows: 1
> rows: 1
DROP_ TABLE_ TEST_T;
DROP_ TABLE_ TEST_T;
> exception
> exception
SYNTAX_ERROR_2
DROP TABLE TEST /*;
DROP TABLE TEST /*;
> exception
> exception
SYNTAX_ERROR_1
DROP TABLE TEST;
DROP TABLE TEST;
> ok
> ok
...
@@ -6568,13 +6568,13 @@ select 1 from test, test where 1 in (select 1 from test where id=1);
...
@@ -6568,13 +6568,13 @@ select 1 from test, test where 1 in (select 1 from test where id=1);
> rows: 9
> rows: 9
select * from test, test where id=id;
select * from test, test where id=id;
> exception
> exception
AMBIGUOUS_COLUMN_NAME_1
select 1 from test, test where id=id;
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);
select 1 from test where id in (select id from test, test);
> exception
> exception
AMBIGUOUS_COLUMN_NAME_1
DROP TABLE TEST;
DROP TABLE TEST;
> ok
> ok
...
@@ -6683,13 +6683,13 @@ INSERT INTO TEST VALUES(0, '0:0:0','1-2-3','2-3-4 0:0:0');
...
@@ -6683,13 +6683,13 @@ INSERT INTO TEST VALUES(0, '0:0:0','1-2-3','2-3-4 0:0:0');
>
update
count
:
1
>
update
count
:
1
INSERT
INTO
TEST
VALUES
(
1
,
'01:02:03'
,
'2001-02-03'
,
'2001-02-29 0:0:0'
);
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'
);
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'
);
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'
);
INSERT
INTO
TEST
VALUES
(
1
,
'1:2:3'
,
'4-5-6'
,
'7-8-9 0:1:2'
);
>
update
count
:
1
>
update
count
:
1
...
@@ -6964,25 +6964,25 @@ SELECT 2/3 FROM TEST WHERE ID=1;
...
@@ -6964,25 +6964,25 @@ SELECT 2/3 FROM TEST WHERE ID=1;
>
rows
:
1
>
rows
:
1
SELECT
ID
/
ID
FROM
TEST
;
SELECT
ID
/
ID
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XT
/
XT
FROM
TEST
;
SELECT
XT
/
XT
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
X_SM
/
X_SM
FROM
TEST
;
SELECT
X_SM
/
X_SM
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XB
/
XB
FROM
TEST
;
SELECT
XB
/
XB
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XD
/
XD
FROM
TEST
;
SELECT
XD
/
XD
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XD2
/
XD2
FROM
TEST
;
SELECT
XD2
/
XD2
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
XR
/
XR
FROM
TEST
;
SELECT
XR
/
XR
FROM
TEST
;
>
exception
>
exception
DIVISION_BY_ZERO_1
SELECT
ID
++
0
,
-
X1
,
-
XT
,
-
X_SM
,
-
XB
,
-
XD
,
-
XD2
,
-
XR
FROM
TEST
;
SELECT
ID
++
0
,
-
X1
,
-
XT
,
-
X_SM
,
-
XB
,
-
XD
,
-
XD2
,
-
XR
FROM
TEST
;
>
ID
+
0
-
X1
-
XT
-
X_SM
-
XB
-
XD
-
XD2
-
XR
>
ID
+
0
-
X1
-
XT
-
X_SM
-
XB
-
XD
-
XD2
-
XR
...
@@ -7650,7 +7650,7 @@ CREATE TABLE TEST(ID INT, CONSTRAINT PK PRIMARY KEY(ID), NAME VARCHAR, PARENT IN
...
@@ -7650,7 +7650,7 @@ CREATE TABLE TEST(ID INT, CONSTRAINT PK PRIMARY KEY(ID), NAME VARCHAR, PARENT IN
>
ok
>
ok
ALTER
TABLE
TEST
DROP
PRIMARY
KEY
;
ALTER
TABLE
TEST
DROP
PRIMARY
KEY
;
>
exception
>
exception
INDEX_BELONGS_TO_CONSTRAINT_2
ALTER
TABLE
TEST
DROP
CONSTRAINT
PK
;
ALTER
TABLE
TEST
DROP
CONSTRAINT
PK
;
>
ok
>
ok
...
@@ -7665,7 +7665,7 @@ INSERT INTO TEST VALUES(3, 'Karin', 2);
...
@@ -7665,7 +7665,7 @@ INSERT INTO TEST VALUES(3, 'Karin', 2);
>
update
count
:
1
>
update
count
:
1
INSERT
INTO
TEST
VALUES
(
4
,
'Joe'
,
5
);
INSERT
INTO
TEST
VALUES
(
4
,
'Joe'
,
5
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
INSERT
INTO
TEST
VALUES
(
4
,
'Joe'
,
3
);
INSERT
INTO
TEST
VALUES
(
4
,
'Joe'
,
3
);
>
update
count
:
1
>
update
count
:
1
...
@@ -7683,7 +7683,7 @@ ALTER TABLE TEST DROP PRIMARY KEY;
...
@@ -7683,7 +7683,7 @@ ALTER TABLE TEST DROP PRIMARY KEY;
>
ok
>
ok
ALTER
TABLE
TEST
DROP
PRIMARY
KEY
;
ALTER
TABLE
TEST
DROP
PRIMARY
KEY
;
>
exception
>
exception
INDEX_NOT_FOUND_1
ALTER
TABLE
TEST
DROP
CONSTRAINT
A_UNIQUE
;
ALTER
TABLE
TEST
DROP
CONSTRAINT
A_UNIQUE
;
>
ok
>
ok
...
@@ -7704,7 +7704,7 @@ ALTER TABLE TEST DROP CONSTRAINT C1;
...
@@ -7704,7 +7704,7 @@ ALTER TABLE TEST DROP CONSTRAINT C1;
>
ok
>
ok
ALTER
TABLE
TEST
DROP
CONSTRAINT
C1
;
ALTER
TABLE
TEST
DROP
CONSTRAINT
C1
;
>
exception
>
exception
CONSTRAINT_NOT_FOUND_1
DROP
TABLE
TEST
;
DROP
TABLE
TEST
;
>
ok
>
ok
...
@@ -7725,16 +7725,16 @@ ALTER TABLE A_TEST ADD CONSTRAINT DATE_UNIQUE_2 UNIQUE(A_DATE);
...
@@ -7725,16 +7725,16 @@ ALTER TABLE A_TEST ADD CONSTRAINT DATE_UNIQUE_2 UNIQUE(A_DATE);
>
ok
>
ok
INSERT
INTO
A_TEST
VALUES
(
NULL
,
NULL
,
NULL
,
NULL
);
INSERT
INTO
A_TEST
VALUES
(
NULL
,
NULL
,
NULL
,
NULL
);
>
exception
>
exception
NULL_NOT_ALLOWED
INSERT
INTO
A_TEST
VALUES
(
1
,
'A'
,
NULL
,
NULL
);
INSERT
INTO
A_TEST
VALUES
(
1
,
'A'
,
NULL
,
NULL
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
INSERT
INTO
A_TEST
VALUES
(
1
,
'AB'
,
NULL
,
NULL
);
INSERT
INTO
A_TEST
VALUES
(
1
,
'AB'
,
NULL
,
NULL
);
>
update
count
:
1
>
update
count
:
1
INSERT
INTO
A_TEST
VALUES
(
1
,
'AB'
,
NULL
,
NULL
);
INSERT
INTO
A_TEST
VALUES
(
1
,
'AB'
,
NULL
,
NULL
);
>
exception
>
exception
DUPLICATE_KEY_1
INSERT
INTO
A_TEST
VALUES
(
2
,
'AB'
,
NULL
,
NULL
);
INSERT
INTO
A_TEST
VALUES
(
2
,
'AB'
,
NULL
,
NULL
);
>
update
count
:
1
>
update
count
:
1
...
@@ -7743,7 +7743,7 @@ INSERT INTO A_TEST VALUES(3, 'AB', '2004-01-01', NULL);
...
@@ -7743,7 +7743,7 @@ INSERT INTO A_TEST VALUES(3, 'AB', '2004-01-01', NULL);
>
update
count
:
1
>
update
count
:
1
INSERT
INTO
A_TEST
VALUES
(
4
,
'AB'
,
'2004-01-01'
,
NULL
);
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
);
INSERT
INTO
A_TEST
VALUES
(
5
,
'ABC'
,
'2004-01-02'
,
NULL
);
>
update
count
:
1
>
update
count
:
1
...
@@ -7761,10 +7761,10 @@ ALTER TABLE B_TEST ADD PRIMARY KEY(B_INT);
...
@@ -7761,10 +7761,10 @@ ALTER TABLE B_TEST ADD PRIMARY KEY(B_INT);
>
ok
>
ok
INSERT
INTO
B_TEST
VALUES
(
10
,
'X'
);
INSERT
INTO
B_TEST
VALUES
(
10
,
'X'
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
INSERT
INTO
B_TEST
VALUES
(
1
,
'X'
);
INSERT
INTO
B_TEST
VALUES
(
1
,
'X'
);
>
exception
>
exception
CHECK_CONSTRAINT_VIOLATED_1
INSERT
INTO
B_TEST
VALUES
(
1
,
'XX'
);
INSERT
INTO
B_TEST
VALUES
(
1
,
'XX'
);
>
update
count
:
1
>
update
count
:
1
...
@@ -7791,7 +7791,7 @@ ALTER TABLE B_TEST ADD CONSTRAINT C2 FOREIGN KEY(B_INT) REFERENCES A_TEST(A_INT)
...
@@ -7791,7 +7791,7 @@ ALTER TABLE B_TEST ADD CONSTRAINT C2 FOREIGN KEY(B_INT) REFERENCES A_TEST(A_INT)
>
ok
>
ok
UPDATE
A_TEST
SET
A_INT
=
A_INT
*
10
;
UPDATE
A_TEST
SET
A_INT
=
A_INT
*
10
;
>
exception
>
exception
NULL_NOT_ALLOWED
SELECT
*
FROM
B_TEST
;
SELECT
*
FROM
B_TEST
;
>
B_INT
B_VARCHAR
>
B_INT
B_VARCHAR
...
@@ -7889,7 +7889,7 @@ INSERT INTO FAMILY VALUES(1, 'Capone');
...
@@ -7889,7 +7889,7 @@ INSERT INTO FAMILY VALUES(1, 'Capone');
>
update
count
:
1
>
update
count
:
1
INSERT
INTO
CHILD
VALUES
(
100
,
1
,
1
,
'early'
);
INSERT
INTO
CHILD
VALUES
(
100
,
1
,
1
,
'early'
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
INSERT
INTO
PARENT
VALUES
(
1
,
1
,
'Sue'
);
INSERT
INTO
PARENT
VALUES
(
1
,
1
,
'Sue'
);
>
update
count
:
1
>
update
count
:
1
...
@@ -7922,7 +7922,7 @@ SELECT * FROM CHILD;
...
@@ -7922,7 +7922,7 @@ SELECT * FROM CHILD;
>
rows
:
4
>
rows
:
4
UPDATE
CHILD
SET
PARENTID
=-
1
WHERE
PARENTID
IS
NOT
NULL
;
UPDATE
CHILD
SET
PARENTID
=-
1
WHERE
PARENTID
IS
NOT
NULL
;
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
DELETE
FROM
PARENT
WHERE
ID
=
2
;
DELETE
FROM
PARENT
WHERE
ID
=
2
;
>
update
count
:
1
>
update
count
:
1
...
@@ -8022,7 +8022,7 @@ INSERT INTO INVOICE_LINE VALUES(1, 100, 10, 'Apples', 20.35), (1, 100, 20, 'Pape
...
@@ -8022,7 +8022,7 @@ INSERT INTO INVOICE_LINE VALUES(1, 100, 10, 'Apples', 20.35), (1, 100, 20, 'Pape
>
update
count
:
4
>
update
count
:
4
INSERT
INTO
INVOICE_LINE
VALUES
(
1
,
102
,
20
,
'Nothing'
,
30
.
00
);
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
;
DELETE
FROM
INVOICE
WHERE
ID
=
100
;
>
update
count
:
1
>
update
count
:
1
...
@@ -8304,13 +8304,13 @@ drop table test;
...
@@ -8304,13 +8304,13 @@ drop table test;
>
ok
>
ok
select
0
from
((
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
(
)
union
all
(
select
u2
.
f
from
(
select
u2
.
f
from
(
select
0
as
f
from
(
select
0
as
f
from
(
select
0
from
dual
u2f1f1
where
now
()
=
?
select
0
from
dual
u2f1f1
where
now
()
=
?
)
u2f1
)
u2f1
)
u2
)
u2
))
where
f
=
12345
;
))
where
f
=
12345
;
{
{
11
,
22
,
33
,
44
,
55
,
null
11
,
22
,
33
,
44
,
55
,
null
...
@@ -8330,7 +8330,7 @@ alter table if exists x add column a varchar;
...
@@ -8330,7 +8330,7 @@ alter table if exists x add column a varchar;
>
ok
>
ok
alter
table
if
exists
x
add
column
a
varchar
;
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
;
alter
table
if
exists
y
alter
column
a
rename
to
b
;
>
ok
>
ok
...
@@ -8339,7 +8339,7 @@ alter table if exists x alter column a rename to b;
...
@@ -8339,7 +8339,7 @@ alter table if exists x alter column a rename to b;
>
ok
>
ok
alter
table
if
exists
x
alter
column
a
rename
to
b
;
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'
;
alter
table
if
exists
y
alter
column
b
set
default
'a'
;
>
ok
>
ok
...
@@ -8372,7 +8372,7 @@ alter table if exists x alter column b set not null;
...
@@ -8372,7 +8372,7 @@ alter table if exists x alter column b set not null;
>
ok
>
ok
insert
into
x
(
id
)
values
(
1
);
insert
into
x
(
id
)
values
(
1
);
>
exception
>
exception
NULL_NOT_ALLOWED
alter
table
if
exists
y
alter
column
b
drop
not
null
;
alter
table
if
exists
y
alter
column
b
drop
not
null
;
>
ok
>
ok
...
@@ -8399,13 +8399,13 @@ alter table if exists x add constraint x_pk primary key (id);
...
@@ -8399,13 +8399,13 @@ alter table if exists x add constraint x_pk primary key (id);
>
ok
>
ok
alter
table
if
exists
x
add
constraint
x_pk
primary
key
(
id
);
alter
table
if
exists
x
add
constraint
x_pk
primary
key
(
id
);
>
exception
>
exception
CONSTRAINT_ALREADY_EXISTS_1
insert
into
x
(
id
)
values
(
1
);
insert
into
x
(
id
)
values
(
1
);
>
update
count
:
1
>
update
count
:
1
insert
into
x
(
id
)
values
(
1
);
insert
into
x
(
id
)
values
(
1
);
>
exception
>
exception
DUPLICATE_KEY_1
delete
from
x
;
delete
from
x
;
>
update
count
:
1
>
update
count
:
1
...
@@ -8417,10 +8417,10 @@ alter table if exists x add constraint x_check check (b = 'a');
...
@@ -8417,10 +8417,10 @@ alter table if exists x add constraint x_check check (b = 'a');
>
ok
>
ok
alter
table
if
exists
x
add
constraint
x_check
check
(
b
=
'a'
);
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'
);
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
;
alter
table
if
exists
y
rename
constraint
x_check
to
x_check1
;
>
ok
>
ok
...
@@ -8429,7 +8429,7 @@ alter table if exists x rename constraint x_check to x_check1;
...
@@ -8429,7 +8429,7 @@ alter table if exists x rename constraint x_check to x_check1;
>
ok
>
ok
alter
table
if
exists
x
rename
constraint
x_check
to
x_check1
;
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
;
alter
table
if
exists
y
drop
constraint
x_check1
;
>
ok
>
ok
...
@@ -8459,13 +8459,13 @@ alter table if exists z add constraint z_uk unique (b);
...
@@ -8459,13 +8459,13 @@ alter table if exists z add constraint z_uk unique (b);
>
ok
>
ok
alter
table
if
exists
z
add
constraint
z_uk
unique
(
b
);
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'
);
insert
into
z
(
id
,
b
)
values
(
1
,
'b'
);
>
update
count
:
1
>
update
count
:
1
insert
into
z
(
id
,
b
)
values
(
1
,
'b'
);
insert
into
z
(
id
,
b
)
values
(
1
,
'b'
);
>
exception
>
exception
DUPLICATE_KEY_1
delete
from
z
;
delete
from
z
;
>
update
count
:
1
>
update
count
:
1
...
@@ -8477,7 +8477,7 @@ alter table if exists z drop column b;
...
@@ -8477,7 +8477,7 @@ alter table if exists z drop column b;
>
ok
>
ok
alter
table
if
exists
z
drop
column
b
;
alter
table
if
exists
z
drop
column
b
;
>
exception
>
exception
COLUMN_NOT_FOUND_1
alter
table
if
exists
y
drop
primary
key
;
alter
table
if
exists
y
drop
primary
key
;
>
ok
>
ok
...
@@ -8486,7 +8486,7 @@ alter table if exists z drop primary key;
...
@@ -8486,7 +8486,7 @@ alter table if exists z drop primary key;
>
ok
>
ok
alter
table
if
exists
z
drop
primary
key
;
alter
table
if
exists
z
drop
primary
key
;
>
exception
>
exception
INDEX_NOT_FOUND_1
create
table
x
(
id
int
not
null
primary
key
);
create
table
x
(
id
int
not
null
primary
key
);
>
ok
>
ok
...
@@ -8498,10 +8498,10 @@ alter table if exists z add constraint z_fk foreign key (id) references x (id);
...
@@ -8498,10 +8498,10 @@ alter table if exists z add constraint z_fk foreign key (id) references x (id);
>
ok
>
ok
alter
table
if
exists
z
add
constraint
z_fk
foreign
key
(
id
)
references
x
(
id
);
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
);
insert
into
z
(
id
)
values
(
1
);
>
exception
>
exception
REFERENTIAL_INTEGRITY_VIOLATED_PARENT_MISSING_1
alter
table
if
exists
y
drop
foreign
key
z_fk
;
alter
table
if
exists
y
drop
foreign
key
z_fk
;
>
ok
>
ok
...
@@ -8510,7 +8510,7 @@ alter table if exists z drop foreign key z_fk;
...
@@ -8510,7 +8510,7 @@ alter table if exists z drop foreign key z_fk;
>
ok
>
ok
alter
table
if
exists
z
drop
foreign
key
z_fk
;
alter
table
if
exists
z
drop
foreign
key
z_fk
;
>
exception
>
exception
CONSTRAINT_NOT_FOUND_1
insert
into
z
(
id
)
values
(
1
);
insert
into
z
(
id
)
values
(
1
);
>
update
count
:
1
>
update
count
:
1
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论