Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
bc93aee3
提交
bc93aee3
authored
4月 19, 2018
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/master' into improve_script_exceptions
上级
236daa35
e008b6c7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
69 行增加
和
34 行删除
+69
-34
changelog.html
h2/src/docsrc/html/changelog.html
+4
-0
Parser.java
h2/src/main/org/h2/command/Parser.java
+3
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+8
-4
DbSettings.java
h2/src/main/org/h2/engine/DbSettings.java
+0
-1
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+1
-1
createTrigger.sql
h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql
+53
-0
testScript.sql
h2/src/test/org/h2/test/scripts/testScript.sql
+0
-27
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
bc93aee3
...
...
@@ -23,6 +23,10 @@ Change Log
<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
</li>
<li>
Issue #1003: Decrypting database with incorrect password renders the database corrupt
</li>
<li>
Issue #873: No error when `=` in equal condition when column is not of array type
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
bc93aee3
...
...
@@ -5082,7 +5082,9 @@ public class Parser {
}
else
{
throw
getSyntaxError
();
}
}
while
(
readIf
(
","
));
}
while
(
readIf
(
","
)
||
(
database
.
getMode
().
getEnum
()
==
ModeEnum
.
PostgreSQL
&&
readIf
(
"OR"
)));
read
(
"ON"
);
String
tableName
=
readIdentifierWithSchema
();
checkSchema
(
schema
);
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
bc93aee3
...
...
@@ -166,6 +166,7 @@ public class Database implements DataHandler {
private
final
String
cacheType
;
private
final
String
accessModeData
;
private
boolean
referentialIntegrity
=
true
;
/** ie. the MVCC setting */
private
boolean
multiVersion
;
private
DatabaseCloser
closeOnExit
;
private
Mode
mode
=
Mode
.
getRegular
();
...
...
@@ -279,13 +280,13 @@ public class Database implements DataHandler {
TraceSystem
.
DEFAULT_TRACE_LEVEL_SYSTEM_OUT
);
this
.
cacheType
=
StringUtils
.
toUpperEnglish
(
ci
.
removeProperty
(
"CACHE_TYPE"
,
Constants
.
CACHE_TYPE_DEFAULT
));
openDatabase
(
traceLevelFile
,
traceLevelSystemOut
,
closeAtVmShutdown
);
openDatabase
(
traceLevelFile
,
traceLevelSystemOut
,
closeAtVmShutdown
,
ci
);
}
private
void
openDatabase
(
int
traceLevelFile
,
int
traceLevelSystemOut
,
boolean
closeAtVmShutdown
)
{
boolean
closeAtVmShutdown
,
ConnectionInfo
ci
)
{
try
{
open
(
traceLevelFile
,
traceLevelSystemOut
);
open
(
traceLevelFile
,
traceLevelSystemOut
,
ci
);
if
(
closeAtVmShutdown
)
{
try
{
closeOnExit
=
new
DatabaseCloser
(
this
,
0
,
true
);
...
...
@@ -608,7 +609,7 @@ public class Database implements DataHandler {
return
dbSettings
.
databaseToUpper
?
StringUtils
.
toUpperEnglish
(
n
)
:
n
;
}
private
synchronized
void
open
(
int
traceLevelFile
,
int
traceLevelSystemOut
)
{
private
synchronized
void
open
(
int
traceLevelFile
,
int
traceLevelSystemOut
,
ConnectionInfo
ci
)
{
if
(
persistent
)
{
String
dataFileName
=
databaseName
+
Constants
.
SUFFIX_OLD_DATABASE_FILE
;
boolean
existsData
=
FileUtils
.
exists
(
dataFileName
);
...
...
@@ -631,6 +632,9 @@ public class Database implements DataHandler {
}
if
(
existsPage
&&
!
existsMv
)
{
dbSettings
.
mvStore
=
false
;
// Need to re-init this because the first time we do it we don't
// know if we have an mvstore or a pagestore.
multiVersion
=
ci
.
getProperty
(
"MVCC"
,
false
);
}
if
(
readOnly
)
{
if
(
traceLevelFile
>=
TraceSystem
.
DEBUG
)
{
...
...
h2/src/main/org/h2/engine/DbSettings.java
浏览文件 @
bc93aee3
...
...
@@ -6,7 +6,6 @@
package
org
.
h2
.
engine
;
import
java.util.HashMap
;
import
org.h2.message.DbException
;
import
org.h2.util.Utils
;
...
...
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
bc93aee3
...
...
@@ -108,7 +108,7 @@ public class TestScript extends TestBase {
testScript
(
"datatypes/"
+
s
+
".sql"
);
}
for
(
String
s
:
new
String
[]
{
"alterTableAdd"
,
"alterTableDropColumn"
,
"createAlias"
,
"createView"
,
"createTable"
,
"createAlias"
,
"createView"
,
"createTable"
,
"createTrigger"
,
"dropSchema"
})
{
testScript
(
"ddl/"
+
s
+
".sql"
);
}
...
...
h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql
0 → 100644
浏览文件 @
bc93aee3
-- Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
CREATE
TABLE
COUNT
(
X
INT
);
>
ok
CREATE
FORCE
TRIGGER
T_COUNT
BEFORE
INSERT
ON
COUNT
CALL
"com.Unknown"
;
>
ok
INSERT
INTO
COUNT
VALUES
(
NULL
);
>
exception
DROP
TRIGGER
T_COUNT
;
>
ok
CREATE
TABLE
ITEMS
(
ID
INT
CHECK
ID
<
SELECT
MAX
(
ID
)
FROM
COUNT
);
>
ok
insert
into
items
values
(
DEFAULT
);
>
update
count
:
1
DROP
TABLE
COUNT
;
>
exception
insert
into
items
values
(
DEFAULT
);
>
update
count
:
1
drop
table
items
,
count
;
>
ok
-- ---------------------------------------------------------------------------
-- PostgreSQL syntax tests
-- ---------------------------------------------------------------------------
set
mode
postgresql
;
>
ok
CREATE
TABLE
COUNT
(
X
INT
);
>
ok
INSERT
INTO
COUNT
VALUES
(
1
);
>
update
count
:
1
CREATE
FORCE
TRIGGER
T_COUNT
BEFORE
INSERT
OR
UPDATE
ON
COUNT
CALL
"com.Unknown"
;
>
ok
INSERT
INTO
COUNT
VALUES
(
NULL
);
>
exception
UPDATE
COUNT
SET
X
=
2
WHERE
X
=
1
;
>
exception
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
bc93aee3
...
...
@@ -1391,33 +1391,6 @@ drop table test;
select
rtrim
()
from
dual
;
>
exception
INVALID_PARAMETER_COUNT_2
CREATE
TABLE
COUNT
(
X
INT
);
>
ok
CREATE
FORCE
TRIGGER
T_COUNT
BEFORE
INSERT
ON
COUNT
CALL
"com.Unknown"
;
>
ok
INSERT
INTO
COUNT
VALUES
(
NULL
);
>
exception
ERROR_CREATING_TRIGGER_OBJECT_3
DROP
TRIGGER
T_COUNT
;
>
ok
CREATE
TABLE
ITEMS
(
ID
INT
CHECK
ID
<
SELECT
MAX
(
ID
)
FROM
COUNT
);
>
ok
insert
into
items
values
(
DEFAULT
);
>
update
count
:
1
DROP
TABLE
COUNT
;
>
exception
CANNOT_DROP_2
insert
into
items
values
(
DEFAULT
);
>
update
count
:
1
drop
table
items
,
count
;
>
ok
CREATE
TABLE
TEST
(
ID
INT
PRIMARY
KEY
,
LABEL
CHAR
(
20
),
LOOKUP
CHAR
(
30
));
>
ok
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论