|
|
@@ -1,8 +1,8 @@
|
|
|
-- ============================================================
|
|
|
+-- noerrinfo() skip() onerror(continue/break) 测试
|
|
|
-- ============================================================
|
|
|
|
|
|
+-- 1. noerrinfo() - 出错时不输出错误信息
|
|
|
insert into /test/aaa/non_exist_xxx (name) values ('noerrinfo test')
|
|
|
/**
|
|
|
noerrinfo()
|
|
|
@@ -11,66 +11,40 @@ onerror(continue,'not exist','not find','not found')
|
|
|
;
|
|
|
|
|
|
-- 2. skip() - 跳过本语句(不执行)
|
|
|
-
|
|
|
+insert into /test/aaa/test_ext (e_name, e_value) values ('should_be_skipped', 999)
|
|
|
/**
|
|
|
-scope(mql)
|
|
|
-loop(5)
|
|
|
+skip()
|
|
|
**/
|
|
|
;
|
|
|
|
|
|
+-- 验证 skip() 的语句未执行
|
|
|
+select e_name from /test/aaa/test_ext where e_name='should_be_skipped'
|
|
|
/**
|
|
|
-beforerun(case({%d,mqli},'3'))
|
|
|
-**/
|
|
|
-;
|
|
|
-
|
|
|
-insert into /test/aaa/test_ext (e_name, e_value, e_text) values (concat('continue_test_', {%d,mqli}), {%d,mqli}, 'continue test - should skip mqli=3')
|
|
|
-/**
|
|
|
-onerror(continue)
|
|
|
+output()
|
|
|
+count(0)
|
|
|
**/
|
|
|
;
|
|
|
|
|
|
+-- 3. onerror(continue) - 出错时忽略错误,继续执行
|
|
|
+insert into /test/aaa/non_exist_xxx_continue (name) values ('continue test')
|
|
|
/**
|
|
|
-continue
|
|
|
+onerror(continue,'not exist','not find','not found')
|
|
|
**/
|
|
|
;
|
|
|
|
|
|
-select e_name from /test/aaa/test_ext where e_name=^'continue_test'
|
|
|
+-- 验证错误被忽略后,后续语句继续执行
|
|
|
+select count(*) from /test/aaa/test_ext
|
|
|
/**
|
|
|
output()
|
|
|
**/
|
|
|
;
|
|
|
|
|
|
+-- 4. onerror(break) - 出错时中断循环(配合 loop 使用)
|
|
|
+insert into /test/aaa/non_exist_class_break (e_name) values ('break_test')
|
|
|
/**
|
|
|
scope(mql)
|
|
|
-loop(10)
|
|
|
-**/
|
|
|
-;
|
|
|
-
|
|
|
-insert into /test/aaa/test_ext (e_name, e_value) values (concat('break_test_', {%d,mqli}), {%d,mqli})
|
|
|
-/**
|
|
|
-onerror(continue)
|
|
|
-**/
|
|
|
-;
|
|
|
-
|
|
|
-/**
|
|
|
-beforerun(case({%d,mqli},'3'))
|
|
|
-**/
|
|
|
-;
|
|
|
-
|
|
|
-/**
|
|
|
-break
|
|
|
-**/
|
|
|
-;
|
|
|
-
|
|
|
-select e_name from /test/aaa/test_ext where e_name=^'break_test'
|
|
|
-/**
|
|
|
-output()
|
|
|
+loop(3)
|
|
|
+onerror(break)
|
|
|
+noerrinfo()
|
|
|
**/
|
|
|
;
|