Browse Source

Merge branch 'master' of https://git.wecise.com/libf/odbtools

lizg 2 weeks ago
parent
commit
767bef9864

+ 36 - 3
odbctest/mql/basic/10index/88.mql

@@ -40,11 +40,11 @@ create class if not exists /test/性能AaB (
             "version": 1
     },
     keys(主机AaB),
-    indexes(主机AaB )
-)with autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB'
+    indexes(主机AaB,v_date,v_timestamp )
+)with core=cassandraonly, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB'
 ;
 
-insert into /test/性能AaB	 (id,主机AaB) values ('性能AaB:test',"服务器1");
+insert into /test/性能AaB	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
 select count(*) from /test/性能AaB where 主机AaB='服务器1'
 /**
 output()
@@ -59,3 +59,36 @@ match("name", "noindex", "isindex", 0)
 **/
 ;
 
+-- sleep 3s or select with refresh for wait lucene index reday
+/**
+sleep(3s)
+**/
+;
+
+select * from /test/性能AaB where v_date between '2026-04-02' and '2026-04-03' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB where v_date between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB where v_timestamp between '2026-04-02 00:00:00.000' and '2026-04-03 00:00:00.000' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB where v_timestamp between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;

+ 29 - 2
odbctest/mql/basic/10index/88_cache.mql

@@ -39,11 +39,11 @@ create class if not exists /test/性能AaB_Cache (
             "version": 1
     },
     keys(主机AaB),
-    indexes(主机AaB )
+    indexes(主机AaB,v_date,v_timestamp )
 )with core=cacheonly, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_Cache'
 ;
 
-insert into /test/性能AaB_Cache	 (id,主机AaB) values ('性能AaB:test',"服务器1");
+insert into /test/性能AaB_Cache	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
 select count(*) from /test/性能AaB_Cache where 主机AaB='服务器1'
 /**
 output()
@@ -58,3 +58,30 @@ match("name", "noindex", "isindex", 0)
 **/
 ;
 
+select * from /test/性能AaB_Cache where v_date between '2026-04-02' and '2026-04-03' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_Cache where v_date between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_Cache where v_timestamp between '2026-04-02 00:00:00.000' and '2026-04-03 00:00:00.000' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_Cache where v_timestamp between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;

+ 52 - 2
odbctest/mql/basic/10index/88_local.mql

@@ -39,11 +39,11 @@ create class if not exists /test/性能AaB_Local (
             "version": 1
     },
     keys(主机AaB),
-    indexes(主机AaB )
+    indexes(主机AaB,v_date,v_timestamp )
 )with core=local, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_Local'
 ;
 
-insert into /test/性能AaB_Local	 (id,主机AaB) values ('性能AaB:test',"服务器1");
+insert into /test/性能AaB_Local	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
 select count(*) from /test/性能AaB_Local where 主机AaB='服务器1'
 /**
 output()
@@ -58,3 +58,53 @@ match("name", "noindex", "isindex", 0)
 **/
 ;
 
+select * from /test/性能AaB_Local where v_date between '2026-04-02' and '2026-04-03' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_Local where v_timestamp between '2026-04-02 00:00:00.000' and '2026-04-03 00:00:00.000' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;
+
+-- native sql 日期类型保存为 毫秒数
+{"sql":"select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10"}
+/**
+output()
+count(1)
+**/
+;
+
+{"sql":"select \"order\".id from /test/性能AaB_Local \"order\" where \"order\".v_date between 1774972800000 and 1776182400000 limit 10"}
+/**
+output()
+count(1)
+**/
+;
+
+-- native sql 时间戳类型保存为 毫秒数
+{"sql":"select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
+/**
+output()
+count(1)
+**/
+;

+ 52 - 2
odbctest/mql/basic/10index/88_memdb.mql

@@ -40,11 +40,11 @@ create class if not exists /test/性能AaB_MemDB (
             "version": 1
     },
     keys(主机AaB),
-    indexes(主机AaB )
+    indexes(主机AaB,v_date,v_timestamp )
 )with core=memory, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_MemDB'
 ;
 
-insert into /test/性能AaB_MemDB	 (id,主机AaB) values ('性能AaB:test',"服务器1");
+insert into /test/性能AaB_MemDB	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
 select count(*) from /test/性能AaB_MemDB where 主机AaB='服务器1'
 /**
 output()
@@ -59,3 +59,53 @@ match("name", "noindex", "isindex", 0)
 **/
 ;
 
+select * from /test/性能AaB_MemDB where v_date between '2026-04-02' and '2026-04-03' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_MemDB where v_date between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_MemDB where v_timestamp between '2026-04-02 00:00:00.000' and '2026-04-03 00:00:00.000' limit 10
+/**
+output()
+count(1)
+**/
+;
+
+select * from /test/性能AaB_MemDB where v_timestamp between 1774972800000 and 1776182400000 limit 10
+/**
+output()
+count(1)
+**/
+;
+
+-- native sql 日期类型保存为 毫秒数
+{"sql":"select * from /test/性能AaB_MemDB where v_date between 1774972800000 and 1776182400000 limit 10"}
+/**
+output()
+count(1)
+**/
+;
+
+{"sql":"select \"order\".id from /test/性能AaB_MemDB \"order\" where \"order\".v_date between 1774972800000 and 1776182400000 limit 10"}
+/**
+output()
+count(1)
+**/
+;
+
+-- native sql 时间戳类型保存为 毫秒数
+{"sql":"select * from /test/性能AaB_MemDB where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
+/**
+output()
+count(1)
+**/
+;

+ 0 - 74
odbctest/mql/problem/basic/10index/88.mql

@@ -1,74 +0,0 @@
-
-delete 性能备份AaB from /test/性能AaB with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete 性能AaB from /test/性能AaB with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete from /test/性能AaB with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-sleep(3s)
-**/
-;
-
-drop class if exists /test/性能AaB;
-
-create class if not exists /test/性能AaB (
-    主机AaB					varchar,
-	v_date					date,
-	v_timestamp				timestamp,
-	性能备份AaB					bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    noindex				varchar,
-    性能AaB				bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    keys(主机AaB),
-    indexes(主机AaB )
-)with autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB'
-;
-
-insert into /test/性能AaB	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
-select count(*) from /test/性能AaB where 主机AaB='服务器1'
-/**
-output()
-count(1)
-**/
-;
-
-cql: select * from field where namespace='test' and name in ('主机aab','noindex')
-/**
-match("name", "主机aab", "isindex", 1)
-match("name", "noindex", "isindex", 0)
-**/
-;
-
-select * from /test/性能AaB where v_date between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;
-
-select * from /test/性能AaB where v_timestamp between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;

+ 0 - 73
odbctest/mql/problem/basic/10index/88_cache.mql

@@ -1,73 +0,0 @@
-
-delete 性能备份AaB from /test/性能AaB_Cache with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete 性能AaB from /test/性能AaB_Cache with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete from /test/性能AaB_Cache with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-drop class if exists /test/性能AaB_Cache;
-
-create class if not exists /test/性能AaB_Cache (
-    主机AaB					varchar,
-	v_date					date,
-	v_timestamp				timestamp,
-	性能备份AaB					bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    noindex				varchar,
-    性能AaB				bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    keys(主机AaB),
-    indexes(主机AaB )
-)with core=cacheonly, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_Cache'
-;
-
-insert into /test/性能AaB_Cache	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
-select count(*) from /test/性能AaB_Cache where 主机AaB='服务器1'
-/**
-output()
-count(1)
-**/
-;
-
-cql: select * from field where namespace='test' and name in ('主机aab','noindex')
-/**
-match("name", "主机aab", "isindex", 1)
-match("name", "noindex", "isindex", 0)
-**/
-;
-
-select * from /test/性能AaB_Cache where v_date between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;
-
-select * from /test/性能AaB_Cache where v_timestamp between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;

+ 0 - 94
odbctest/mql/problem/basic/10index/88_local.mql

@@ -1,94 +0,0 @@
-
-delete 性能备份AaB from /test/性能AaB_Local with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete 性能AaB from /test/性能AaB_Local with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete from /test/性能AaB_Local with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-drop class if exists /test/性能AaB_Local;
-
-create class if not exists /test/性能AaB_Local (
-    主机AaB					varchar,
-	v_date					date,
-	v_timestamp				timestamp,
-	性能备份AaB					bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    noindex				varchar,
-    性能AaB				bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    keys(主机AaB),
-    indexes(主机AaB )
-)with core=local, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_Local'
-;
-
-insert into /test/性能AaB_Local	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
-select count(*) from /test/性能AaB_Local where 主机AaB='服务器1'
-/**
-output()
-count(1)
-**/
-;
-
-cql: select * from field where namespace='test' and name in ('主机aab','noindex')
-/**
-match("name", "主机aab", "isindex", 1)
-match("name", "noindex", "isindex", 0)
-**/
-;
-
-select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;
-
-select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;
-
-{"sql":"select * from /test/性能AaB_Local where v_date between 1774972800000 and 1776182400000 limit 10"}
-/**
-output()
-count(1)
-**/
-;
-
-{"sql":"select "order".id from /test/性能AaB_Local where v_date "order" between 1774972800000 and 1776182400000 limit 10"}
-/**
-output()
-count(1)
-**/
-;
-
-{"sql":"select * from /test/性能AaB_Local where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
-/**
-output()
-count(1)
-**/
-;

+ 0 - 95
odbctest/mql/problem/basic/10index/88_memdb.mql

@@ -1,95 +0,0 @@
-
-delete 性能备份AaB from /test/性能AaB_MemDB with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete 性能AaB from /test/性能AaB_MemDB with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-**/
-;
-
-delete from /test/性能AaB_MemDB with version
-/**
-onerror(continue,`not exist`,`not find`,`not found`)
-sleep(3s)
-**/
-;
-
-drop class if exists /test/性能AaB_MemDB;
-
-create class if not exists /test/性能AaB_MemDB (
-    主机AaB					varchar,
-	v_date					date,
-	v_timestamp				timestamp,
-	性能备份AaB					bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    noindex				varchar,
-    性能AaB				bucket 		{
-            "dict": true,
-            "slot": 5,
-            "ttl": 2,
-            "type": "promdb",
-            "version": 1
-    },
-    keys(主机AaB),
-    indexes(主机AaB )
-)with core=memory, autosearch=true , version=false , key=manu, alias='性能测试' , nickname='性能AaB_MemDB'
-;
-
-insert into /test/性能AaB_MemDB	 (id,主机AaB,v_date,v_timestamp) values ('性能AaB:test',"服务器1","2026-04-02","2026-04-02 15:55:55");
-select count(*) from /test/性能AaB_MemDB where 主机AaB='服务器1'
-/**
-output()
-count(1)
-**/
-;
-
-cql: select * from field where namespace='test' and name in ('主机aab','noindex')
-/**
-match("name", "主机aab", "isindex", 1)
-match("name", "noindex", "isindex", 0)
-**/
-;
-
-select * from /test/性能AaB_MemDB where v_date between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;
-
-select * from /test/性能AaB_MemDB where v_timestamp between 1774972800000 and 1776182400000 limit 10
-/**
-output()
-count(1)
-**/
-;
-
-{"sql":"select * from /test/性能AaB_MemDB where v_date between 1774972800000 and 1776182400000 limit 10"}
-/**
-output()
-count(1)
-**/
-;
-
-{"sql":"select "order".id from /test/性能AaB_MemDB "order" where v_date between 1774972800000 and 1776182400000 limit 10"}
-/**
-output()
-count(1)
-**/
-;
-
-{"sql":"select * from /test/性能AaB_MemDB where v_timestamp between 1774972800000 and 1776182400000 limit 10"}
-/**
-output()
-count(1)
-**/
-;