Ver código fonte

problem prepare

lizg 2 semanas atrás
pai
commit
0d0c3fc8a9

+ 22 - 0
odbctest/mql/problem/basic/36prepare/10class.mql

@@ -0,0 +1,22 @@
+
+create class if not exists /test/prepare (
+		
+		v_varchar		varchar,
+		v_text			text,
+		v_int			int,
+		v_bigint		bigint,
+		v_smalldouble	double,
+		v_double		double,
+		v_float			float,
+		v_bool			bool,
+		v_timestamp		timestamp,
+		v_blob			blob,
+		
+		indexes(v_varchar, v_text, v_int, v_bigint, v_double, v_float, v_smalldouble, v_bool, v_timestamp),
+		keys(v_varchar, v_text)
+	)
+;
+
+
+delete from /test/prepare with version
+;

Diferenças do arquivo suprimidas por serem muito extensas
+ 310 - 0
odbctest/mql/problem/basic/36prepare/11data.mql


+ 36 - 0
odbctest/mql/problem/basic/36prepare/12valid.mql

@@ -0,0 +1,36 @@
+
+select * from /test/prepare
+/**
+matchcount(v_varchar, "*abc*", v_text, `hello word 2003 123-456-789 中华人民共和国是中国的唯一合法政府,台湾是中国一部分。  Mercury, Venus2,Earch%。Mars$Uranus CeresAndJupiterOrSaturn #Neptune Pluto_Charon"\""`, 1)
+**/
+;
+
+select _group from /test/prepare where v_varchar=='*abc*'
+/**
+count(1)
+matchcount(_group, {
+  "_all": [
+    "aaa"
+  ]
+}, 1)
+**/
+;
+
+select class from / where id='3991197448023402669'
+/**
+count(1)
+**/
+;
+
+select class from /test/ where id='3991197448023402669'
+/**
+count(1)
+**/
+;
+
+select class from /test/ where id='3991197448023402669' limit ?
+/**
+params(10)
+count(1)
+**/
+;

+ 43 - 0
odbctest/mql/problem/basic/36prepare/13int.mql

@@ -0,0 +1,43 @@
+
+select count(*) as count from /test/prepare where v_int = 1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_int > 0
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_int < 2
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_int >= 1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_int <= 1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_int >= 1.1
+/**
+matchcount("count", 0, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_int > 1
+/**
+matchcount("count", 0, 1)
+**/
+;
+

+ 12 - 0
odbctest/mql/problem/basic/36prepare/14bool.mql

@@ -0,0 +1,12 @@
+
+select count(*) as count from /test/prepare where v_bool = true
+/**
+matchcount("count", 2, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_bool = false
+/**
+matchcount("count", 1, 1)
+**/
+;

+ 30 - 0
odbctest/mql/problem/basic/36prepare/15float.mql

@@ -0,0 +1,30 @@
+
+select count(*) as count from /test/prepare where v_float >= 1.1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_float > 1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_float = 1.1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_float < 2
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_float <= 1.1
+/**
+matchcount("count", 3, 1)
+**/
+;

+ 36 - 0
odbctest/mql/problem/basic/36prepare/16double.mql

@@ -0,0 +1,36 @@
+
+select * from /test/prepare where v_double >= 1.1234567890123456
+/**
+count(3)
+**/
+;
+
+select * from /test/prepare where v_smalldouble >= 1.123456
+/**
+count(3)
+**/
+;
+
+select count(*) as count from /test/prepare where v_double > 1
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_double = 1.1234567890123456
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_double < 2
+/**
+matchcount("count", 3, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_double <= 1.1234567890123456
+/**
+matchcount("count", 3, 1)
+**/
+;

+ 30 - 0
odbctest/mql/problem/basic/36prepare/17prefix.mql

@@ -0,0 +1,30 @@
+
+select count(*) as count from /test/prepare where v_text=^'hell'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='*20*'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='*123-456*'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='*中*'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='*magni*'
+/**
+matchcount("count", 1, 1)
+**/
+;

+ 30 - 0
odbctest/mql/problem/basic/36prepare/18fullsearch.mql

@@ -0,0 +1,30 @@
+
+select count(*) as count from /test/prepare where v_text='hello'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='2003'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='123-456-789'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='中国'
+/**
+matchcount("count", 1, 1)
+**/
+;
+
+select count(*) as count from /test/prepare where v_text='magnitude'
+/**
+matchcount("count", 1, 1)
+**/
+;

+ 6 - 0
odbctest/mql/problem/basic/36prepare/19notin.mql

@@ -0,0 +1,6 @@
+
+select count(*) as count from /test/prepare where v_varchar not in('2', '3')
+/**
+matchcount("count", 1, 1)
+**/
+;