2 次代码提交 1ec054ef28 ... d3f955b7e5

作者 SHA1 备注 提交日期
  wecisecode d3f955b7e5 aaa test 1 周之前
  wecisecode 542f1ea2fd mql 1 周之前

+ 1 - 1
go.mod

@@ -5,7 +5,7 @@ go 1.24.0
 toolchain go1.24.5
 
 require (
-	git.wecise.com/wecise/odb-go v0.0.0-20260521084720-e749f7113979
+	git.wecise.com/wecise/odb-go v0.0.0-20260722103146-3e5a516fedcb
 	gitee.com/wecisecode/util v0.9.0
 	github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e
 	github.com/spf13/cast v1.7.1

+ 2 - 2
go.sum

@@ -1,7 +1,7 @@
 git.wecise.com/wecise/common v0.0.0-20260521084905-b0dfcd2113fd h1:g2TnNvYCq/oLl10dKOAsNd/O7jjYOcI6LWvMqFht8h0=
 git.wecise.com/wecise/common v0.0.0-20260521084905-b0dfcd2113fd/go.mod h1:J0P6J1koMGFqUV5ZJdxFn97LFO8btrO6Nvei62iDX9I=
-git.wecise.com/wecise/odb-go v0.0.0-20260521084720-e749f7113979 h1:fNDgTLiKUvgXqUky+86cT8JGiWLkLhYpBznQvzfJVg4=
-git.wecise.com/wecise/odb-go v0.0.0-20260521084720-e749f7113979/go.mod h1:LDfoIJF3rTAGEEIhWmObFj9OJ59YOUGm0GhGfAX0t2Q=
+git.wecise.com/wecise/odb-go v0.0.0-20260722103146-3e5a516fedcb h1:KGfIGbfCenSSo8gAkeefeoJLZjIKXLEnnk/kT+kePDA=
+git.wecise.com/wecise/odb-go v0.0.0-20260722103146-3e5a516fedcb/go.mod h1:LDfoIJF3rTAGEEIhWmObFj9OJ59YOUGm0GhGfAX0t2Q=
 git.wecise.com/wecise/util v0.0.0-20260521072333-deebc20dd231 h1:bsL0Bh2/WwWpAhZEswu6BmQgCokkMgTfKawcG5gbrQ4=
 git.wecise.com/wecise/util v0.0.0-20260521072333-deebc20dd231/go.mod h1:86Qz15Bb08gzbz0f0hpjx8m7QFDC7DS1DhrQLicAIek=
 gitee.com/wecisecode/util v0.9.0 h1:aEtF2FcTzvvwnLLjdnZDVG7ZV6dsraQ3RiX4SAtsGzo=

+ 3 - 0
odbctest/mql/aaa/10class/00init.mql

@@ -2,3 +2,6 @@
 
 create class if not exists /test() with namespace="test"
 ;
+
+create class if not exists /test/aaa()
+;

+ 3 - 3
odbctest/mql/aaa/10class/10create.mql

@@ -25,7 +25,7 @@ create class if not exists /test/aaa/test_class (
     keys(name)
 )
 /**
-schema(/test/aaa/test_class)
+schema('/test/aaa/test_class')
 **/
 ;
 
@@ -81,7 +81,7 @@ create class if not exists /test/aaa/test_class_key (
     data    text,
 
     keys(id, name)
-) with key=name
+) with nickname='test_class_key'
 ;
 
 -- 8. 创建带 partition 的 class
@@ -92,7 +92,7 @@ create class if not exists /test/aaa/test_class_partition (
 
     indexes(id, name, val),
     keys(id, name)
-) with partition=id
+) with partition=id, nickname='test_class_partition'
 ;
 
 -- 9. 创建带 cache=all 的 class

+ 10 - 3
odbctest/mql/aaa/10class/12drop.mql

@@ -8,7 +8,7 @@ create class if not exists /test/aaa/test_drop (
     value   int,
 
     keys(name)
-)
+) with nickname='test_drop'
 ;
 
 -- 2. drop class 前插入数据验证
@@ -21,7 +21,13 @@ output()
 **/
 ;
 
+-- 3. 删除数据后 drop class
+delete from /test/aaa/test_drop with version
+/**
+onerror(continue,'not exist','not find','not found')
+**/
+;
+
 drop class if exists /test/aaa/test_drop
 ;
 
@@ -54,13 +60,13 @@ drop class if exists /test/aaa/test_drop_alias
 create class if not exists /test/aaa/test_batch_drop_1 (
     id int,
     keys(id)
-)
+) with nickname='test_batch_drop_1'
 ;
 
 create class if not exists /test/aaa/test_batch_drop_2 (
     id int,
     keys(id)
-)
+) with nickname='test_batch_drop_2'
 ;
 
 drop class if exists /test/aaa/test_batch_drop_1

+ 1 - 1
odbctest/mql/aaa/11data_crud/00init.mql

@@ -22,5 +22,5 @@ create class if not exists /test/aaa/test_basic_ver (
     name    varchar,
     value   int,
     keys(name)
-) with version=true
+) with version=true, nickname='test_basic_ver'
 ;

+ 0 - 2
odbctest/mql/aaa/11data_crud/11insert.mql

@@ -7,7 +7,6 @@ insert into /test/aaa/test_basic (name, v_text, v_int, v_bigint, v_float, v_doub
 values ('insert_001', 'hello world 测试数据', 100, 1234567890123456789, 3.14, 3.141592653589793, true, 1711641600000, 'hello')
 /**
 output()
-count(1)
 **/
 ;
 
@@ -16,7 +15,6 @@ insert into /test/aaa/test_basic (name, v_text, v_int, v_float, v_double, v_bool
 values ('insert_002', 'boolean false test', -50, -1.5, 0.0001, false)
 /**
 output()
-count(1)
 **/
 ;
 

+ 1 - 1
odbctest/mql/aaa/14bucket/00init.mql

@@ -22,7 +22,7 @@ create class if not exists /test/aaa/test_bucket_tsdb (
     ts      timestamp,
 
     keys(name)
-) with bucket=tsdb
+) with bucket=tsdb, nickname='test_bucket_tsdb'
 ;
 
 create class if not exists /test/aaa/test_bucket_promdb (

+ 6 - 0
odbctest/odbcmql/mqls_action.go

@@ -12,6 +12,7 @@ import (
 	"git.wecise.com/wecise/odb-go/odb/mql/parser"
 	"git.wecise.com/wecise/odb-go/odb/mql/qstru"
 	"gitee.com/wecisecode/util/cast"
+	"gitee.com/wecisecode/util/merrs"
 	"gitee.com/wecisecode/util/mfmt"
 	"gitee.com/wecisecode/util/set/strset"
 	"gitee.com/wecisecode/util/sortedmap"
@@ -72,6 +73,11 @@ type ActionExprs struct {
 }
 
 func getActionExprs(mqlstr string, staticactions map[int]*Action) (actionexprs *ActionExprs, err error) {
+	defer func() {
+		if err != nil {
+			err = merrs.New(err, merrs.Map{"mql": mqlstr})
+		}
+	}()
 	actionexprs = &ActionExprs{
 		LinkedMap: sortedmap.NewLinkedMap(),
 		onerrorOption: &OnErrorOption{