Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
658da47a
提交
658da47a
authored
7月 12, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Test and document rollback triggers.
上级
f17573bf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
1 行删除
+20
-1
help.csv
h2/src/docsrc/help/help.csv
+6
-1
TestFullText.java
h2/src/test/org/h2/test/db/TestFullText.java
+11
-0
TestTriggersConstraints.java
h2/src/test/org/h2/test/db/TestTriggersConstraints.java
+3
-0
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
658da47a
...
...
@@ -608,13 +608,18 @@ null and length constraint checks have been made;
but before other constraints have been checked.
If there are multiple triggers, the order in which they are called is undefined.
Only row based AFTER trigger can be called on
rollback
.
Only row based AFTER trigger can be called on
ROLLBACK
.
Exceptions that occur within such triggers are ignored.
As the operations that occur within a trigger are part of the transaction,
ROLLBACK triggers are only required if an operation communicates outside of the database.
INSTEAD OF triggers are implicitly row based and behave like BEFORE triggers.
Only the first such trigger is called. Such triggers on views are supported.
They can be used to make views updatable.
A BEFORE SELECT trigger can be used to update a table on demand.
The trigger is called with both 'old' and 'new' set to null.
The MERGE statement will call both INSERT and UPDATE triggers.
Not supported are SELECT triggers with the option FOR EACH ROW,
and AFTER SELECT triggers.
...
...
h2/src/test/org/h2/test/db/TestFullText.java
浏览文件 @
658da47a
...
...
@@ -131,8 +131,19 @@ public class TestFullText extends TestBase {
assertEquals
(
"TEST"
,
rs
.
getString
(
2
));
assertEquals
(
"(ID)"
,
rs
.
getString
(
3
));
assertEquals
(
"(1)"
,
rs
.
getString
(
4
));
rs
=
stat
.
executeQuery
(
"SELECT * FROM FT_SEARCH('this', 0, 0)"
);
assertFalse
(
rs
.
next
());
conn
.
setAutoCommit
(
false
);
stat
.
execute
(
"delete from test"
);
rs
=
stat
.
executeQuery
(
"SELECT * FROM FT_SEARCH_DATA('Welcome', 0, 0)"
);
assertFalse
(
rs
.
next
());
conn
.
rollback
();
rs
=
stat
.
executeQuery
(
"SELECT * FROM FT_SEARCH_DATA('Welcome', 0, 0)"
);
assertTrue
(
rs
.
next
());
conn
.
setAutoCommit
(
true
);
conn
.
close
();
}
...
...
h2/src/test/org/h2/test/db/TestTriggersConstraints.java
浏览文件 @
658da47a
...
...
@@ -256,6 +256,9 @@ public class TestTriggersConstraints extends TestBase implements Trigger {
}
public
void
fire
(
Connection
conn
,
Object
[]
oldRow
,
Object
[]
newRow
)
throws
SQLException
{
if
(
oldRow
!=
null
||
newRow
!=
null
)
{
throw
new
SQLException
(
"old and new must be null"
);
}
conn
.
createStatement
().
execute
(
"delete from meta_tables"
);
prepMeta
.
execute
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论