wecisecode 1 settimana fa
parent
commit
696bd51bcb

+ 2 - 1
odbctest/mql/aaa/01clear/1_drop_all.mql

@@ -1,5 +1,5 @@
 -- 清除 /test/aaa/ 下的所有测试数据
+-- 使用 onerror(continue,'has version data') 忽略类不存在的错误
 
 -- 删除所有测试 class 数据
 delete from /test/aaa/test_basic with version
@@ -140,7 +140,7 @@ drop class if exists /test/aaa/test_mpartition
 
 drop class if exists /test/aaa/test_conflict force
 /**
-onerror(continue)
+onerror(continue,'has version data','not exist','not find','not found')
 **/
 ;
 

+ 2 - 5
odbctest/mql/aaa/15cypher/11create.mql

@@ -2,46 +2,38 @@
 -- Cypher 创建图和关系测试
 -- ============================================================
 
 match (n:/test/aaa/test_graph) return n.g_name, n.g_type, n.g_value
 /**
-onerror(continue)
+onerror(continue,'unsupport single node')
 output()
 **/
 ;
 
 match (a:test_graph) where a.g_type='type_a' return a.g_name, a.g_type, a.g_value
 /**
-onerror(continue)
+onerror(continue,'expected [ \t\r\n\f]')
 output()
 **/
 ;
 
 match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_b'
 create (a) -[:connect]-> (b)
 /**
-onerror(continue)
 **/
 ;
 
 match (a:test_graph), (b:test_graph) where a.g_name='node_c' and b.g_name='node_d'
 create (a) -[:connect]-> (b)
 /**
-onerror(continue)
 **/
 ;
 
 match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_c'
 create (a) -[:connect]-> (b)
 /**
-onerror(continue)
 **/
 ;
 
 match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
 /**
 output()

+ 2 - 1
odbctest/mql/aaa/15cypher/12match.mql

@@ -2,15 +2,13 @@
 -- Cypher match 查询测试
 -- ============================================================
 
 match (n:test_graph) return n.g_name, n.g_type, n.g_value
 /**
-onerror(continue)
+onerror(continue,'unsupport single node')
 output()
 **/
 ;
 
 match (n:test_graph) where n.g_value > 25 return n.g_name, n.g_type, n.g_value
 /**
 onerror(continue)
@@ -18,7 +16,6 @@ output()
 **/
 ;
 
 match (n:test_graph) where n.g_type='type_a' and n.g_value>=10 return n.g_name, n.g_type, n.g_value
 /**
 onerror(continue)
@@ -26,21 +23,19 @@ output()
 **/
 ;
 
 match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
 /**
 output()
 **/
 ;
 
 match (a:test_graph where a.g_name='node_a') -[:connect]-> (b:test_graph) return a, b
 /**
+onerror(continue)
 output()
 **/
 ;
 
 match (n:test_graph) where n.g_name='node_e' return n.g_name, n.g_type, n.g_value
 /**
 onerror(continue)
@@ -48,7 +43,6 @@ output()
 **/
 ;
 
 match (n:test_graph) return n.g_name, n.g_value
 /**
 onerror(continue)

+ 7 - 4
odbctest/mql/aaa/15cypher/13subquery.mql

@@ -5,31 +5,31 @@
 -- 1. Cypher 子查询 - where in match (已知解析器不支持 CypherCtrl 级别的 where + 子查询)
 match (a:test_graph) -[:connect]-> (b:test_graph) where a.g_name in (match (n:test_graph) where n.g_type='type_a' return n.g_name) return a, b
 /**
-onerror(continue)
+onerror(continue,'expected [')
 output()
 **/
 ;
 
+-- 2. Cypher 嵌套子查询 (已知服务端单节点cypher不支持)
 match (a:test_graph) where a.g_value = (match (n:test_graph) where n.g_name='node_c' return max(n.g_value)) return a.g_name, a.g_type, a.g_value
 /**
-onerror(continue)
+onerror(continue,'unsupport single node','expected')
 output()
 **/
 ;
 
+-- 3. Cypher 聚合子查询 (已知服务端单节点cypher不支持)
 match (a:test_graph) where a.g_type='type_a' return a.g_type, count(*)
 /**
-onerror(continue)
+onerror(continue,'unsupport single node')
 output()
 **/
 ;
 
+-- 4. Cypher 带 limit 的子查询 (已知服务端单节点cypher不支持)
 match (a:test_graph) return a.g_name, a.g_type, a.g_value limit 3
 /**
-onerror(continue)
+onerror(continue,'unsupport single node')
 output()
 **/
 ;

+ 1 - 1
odbctest/mql/aaa/17conflict/11upsert.mql

@@ -25,7 +25,7 @@ output()
 -- 3. upsert - 累加 c_count (已知新版server on conflict 表达式读取已有值问题)
 insert into /test/aaa/test_conflict (c_name, c_value, c_count) values ('conflict_002', 200, 5) on conflict update c_count=c_count+c_count
 /**
-onerror(continue)
+onerror(continue,'ReviseFieldValue')
 **/
 ;
 

+ 1 - 1
odbctest/mql/aaa/17conflict/12conflict_update.mql

@@ -5,7 +5,7 @@
 -- 1. 条件更新 (已知新版server on conflict 表达式读取已有值问题)
 insert into /test/aaa/test_conflict (c_name, c_value, c_count) values ('conflict_update_001', 100, 1) on conflict update c_value=200, c_count=c_count+1
 /**
-onerror(continue)
+onerror(continue,'ReviseFieldValue')
 **/
 ;
 

+ 1 - 1
odbctest/mql/aaa/17conflict/13concurrent.mql

@@ -12,6 +12,6 @@ parallel(5)
 -- 并发 upsert 操作 (已知新版server on conflict 表达式读取已有值问题)
 insert into /test/aaa/test_conflict (c_name, c_value, c_count) values ('conflict_concurrent', 1, 1) on conflict update c_count=c_count+1, c_value=c_value+1
 /**
-onerror(continue)
+onerror(continue,'ReviseFieldValue')
 **/
 ;

+ 1 - 1
odbctest/mql/aaa/18prepare/13prepare_delete.mql

@@ -19,7 +19,7 @@ params("prep_delete_001")
 select * from /test/aaa/test_prepare where p_name='prep_delete_001'
 /**
 output()
-onerror(continue)
+onerror(continue,'not find')
 **/
 ;
 

+ 1 - 1
odbctest/mql/aaa/18prepare/14prepare_batch.mql

@@ -14,7 +14,7 @@ beforerun(set(prep_name, concat('prep_batch_', mqli)), set(prep_val, mqli))
 insert into /test/aaa/test_prepare (p_name, p_int) values (?, ?)
 /**
 params(prep_name, prep_val)
-onerror(continue)
+onerror(continue,'invalid value for int field')
 **/
 ;
 

+ 1 - 1
odbctest/mql/aaa/19extensions/17beforerun.mql

@@ -11,7 +11,7 @@ beforerun(set(myvar, 'hello_mql'))
 -- 使用变量插入
 insert into /test/aaa/test_ext (e_name, e_value, e_text) values ('beforerun_set', 1, {%s,myvar})
 /**
-onerror(continue)
+onerror(continue,'JsonKeyValue')
 **/
 ;
 

+ 2 - 2
odbctest/mql/aaa/19extensions/18variable.mql

@@ -5,7 +5,7 @@
 -- 1. {%t,now} 当前时间戳 (已知新版工具变量替换格式问题)
 insert into /test/aaa/test_ext (e_name, e_value, e_text) values ('var_now', 1, {%t,now})
 /**
-onerror(continue)
+onerror(continue,'expected [0-9]')
 **/
 ;
 
@@ -60,7 +60,7 @@ beforerun(set(my_time, '2024-06-15 12:30:45'))
 
 insert into /test/aaa/test_ext (e_name, e_text) values ('var_time_fmt', {%t,my_time})
 /**
-onerror(continue)
+onerror(continue,'JsonKeyValue')
 **/
 ;
 

+ 1 - 1
odbctest/mql/aaa/19extensions/19format_escape.mql

@@ -10,7 +10,7 @@ beforerun(set(my_str, 'formatted_string_value'))
 
 insert into /test/aaa/test_ext (e_name, e_text) values ('var_str_fmt', {%s,my_str})
 /**
-onerror(continue)
+onerror(continue,'JsonKeyValue')
 **/
 ;