test: add case

This commit is contained in:
Shengliang Guan 2022-07-29 18:39:27 +08:00
parent 7693950df7
commit 81d4241907
10 changed files with 822 additions and 1008 deletions

View File

@ -95,7 +95,14 @@
./test.sh -f tsim/parser/between_and.sim
./test.sh -f tsim/parser/binary_escapeCharacter.sim
# TD-17738 ./test.sh -f tsim/parser/col_arithmetic_operation.sim
# TD-17661 ./test.sh -f tsim/parser/columnValue.sim
./test.sh -f tsim/parser/columnValue_bigint.sim
./test.sh -f tsim/parser/columnValue_bool.sim
./test.sh -f tsim/parser/columnValue_double.sim
./test.sh -f tsim/parser/columnValue_float.sim
./test.sh -f tsim/parser/columnValue_int.sim
./test.sh -f tsim/parser/columnValue_smallint.sim
./test.sh -f tsim/parser/columnValue_tinyint.sim
./test.sh -f tsim/parser/columnValue_unsign.sim
./test.sh -f tsim/parser/commit.sim
./test.sh -f tsim/parser/condition.sim
./test.sh -f tsim/parser/constCol.sim
@ -154,7 +161,7 @@
./test.sh -f tsim/parser/slimit.sim
./test.sh -f tsim/parser/slimit1.sim
./test.sh -f tsim/parser/stableOp.sim
# TD-17661 ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
./test.sh -f tsim/parser/tags_filter.sim
./test.sh -f tsim/parser/tbnameIn.sim
./test.sh -f tsim/parser/timestamp.sim

View File

@ -1,22 +0,0 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
run tsim/parser/columnValue_bool.sim
run tsim/parser/columnValue_tinyint.sim
run tsim/parser/columnValue_smallint.sim
run tsim/parser/columnValue_int.sim
run tsim/parser/columnValue_bigint.sim
run tsim/parser/columnValue_float.sim
run tsim/parser/columnValue_double.sim
run tsim/parser/columnValue_unsign.sim
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,5 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
@ -10,78 +17,64 @@ sql create table mt_bigint (ts timestamp, c bigint) tags (tagname bigint)
## case 00: static create table for test tag values
sql create table st_bigint_0 using mt_bigint tags (NULL)
sql select tagname from st_bigint_0
if $data00 != NULL then
sql show tags from st_bigint_0
if $data05 != NULL then
return -1
endi
sql create table st_bigint_1 using mt_bigint tags (NULL)
sql select tagname from st_bigint_1
if $data00 != NULL then
return -1
endi
sql create table st_bigint_2 using mt_bigint tags ('NULL')
sql select tagname from st_bigint_2
if $data00 != NULL then
return -1
endi
sql create table st_bigint_3 using mt_bigint tags ('NULL')
sql select tagname from st_bigint_3
if $data00 != NULL then
return -1
endi
sql create table st_bigint_4 using mt_bigint tags ("NULL")
sql select tagname from st_bigint_4
if $data00 != NULL then
return -1
endi
sql create table st_bigint_5 using mt_bigint tags ("NULL")
sql select tagname from st_bigint_5
if $data00 != NULL then
sql show tags from st_bigint_1
if $data05 != NULL then
return -1
endi
sql_error create table st_bigint_2 using mt_bigint tags ('NULL')
sql_error create table st_bigint_3 using mt_bigint tags ('NULL')
sql_error create table st_bigint_4 using mt_bigint tags ("NULL")
sql_error create table st_bigint_5 using mt_bigint tags ("NULL")
sql create table st_bigint_6 using mt_bigint tags (-9223372036854775807)
sql select tagname from st_bigint_6
if $data00 != -9223372036854775807 then
sql show tags from st_bigint_6
if $data05 != -9223372036854775807 then
return -1
endi
sql create table st_bigint_7 using mt_bigint tags (9223372036854775807)
sql select tagname from st_bigint_7
if $data00 != 9223372036854775807 then
sql show tags from st_bigint_7
if $data05 != 9223372036854775807 then
return -1
endi
sql create table st_bigint_8 using mt_bigint tags (37)
sql select tagname from st_bigint_8
if $data00 != 37 then
sql show tags from st_bigint_8
if $data05 != 37 then
return -1
endi
sql create table st_bigint_9 using mt_bigint tags (-100)
sql select tagname from st_bigint_9
if $data00 != -100 then
sql show tags from st_bigint_9
if $data05 != -100 then
return -1
endi
sql create table st_bigint_10 using mt_bigint tags (+113)
sql select tagname from st_bigint_10
if $data00 != 113 then
sql show tags from st_bigint_10
if $data05 != 113 then
return -1
endi
sql create table st_bigint_11 using mt_bigint tags ('-100')
sql select tagname from st_bigint_11
if $data00 != -100 then
sql show tags from st_bigint_11
if $data05 != -100 then
return -1
endi
sql create table st_bigint_12 using mt_bigint tags ("+78")
sql select tagname from st_bigint_12
if $data00 != 78 then
sql show tags from st_bigint_12
if $data05 != 78 then
return -1
endi
sql create table st_bigint_13 using mt_bigint tags (+0078)
sql select tagname from st_bigint_13
if $data00 != 78 then
sql show tags from st_bigint_13
if $data05 != 78 then
return -1
endi
sql create table st_bigint_14 using mt_bigint tags (-00078)
sql select tagname from st_bigint_14
if $data00 != -78 then
sql show tags from st_bigint_14
if $data05 != -78 then
return -1
endi
@ -102,38 +95,7 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_2 values (now, 'NULL')
sql select * from st_bigint_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_3 values (now, 'NULL')
sql select * from st_bigint_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_4 values (now, "NULL")
sql select * from st_bigint_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_5 values (now, "NULL")
sql select * from st_bigint_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_6 values (now, 9223372036854775807)
sql select * from st_bigint_6
if $rows != 1 then
@ -211,8 +173,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_bigint_16 using mt_bigint tags (NULL) values (now, NULL)
sql select tagname from st_bigint_16
if $data00 != NULL then
sql show tags from st_bigint_16
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_16
@ -221,8 +183,8 @@ if $data01 != NULL then
endi
sql insert into st_bigint_17 using mt_bigint tags (NULL) values (now, NULL)
sql select tagname from st_bigint_17
if $data00 != NULL then
sql show tags from st_bigint_17
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_17
@ -230,8 +192,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_18 using mt_bigint tags ('NULL') values (now, 'NULL')
sql select tagname from st_bigint_18
if $data00 != NULL then
sql show tags from st_bigint_18
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_18
@ -239,8 +201,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_19 using mt_bigint tags ('NULL') values (now, 'NULL')
sql select tagname from st_bigint_19
if $data00 != NULL then
sql show tags from st_bigint_19
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_19
@ -248,8 +210,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_20 using mt_bigint tags ("NULL") values (now, "NULL")
sql select tagname from st_bigint_20
if $data00 != NULL then
sql show tags from st_bigint_20
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_20
@ -257,8 +219,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_21 using mt_bigint tags ("NULL") values (now, "NULL")
sql select tagname from st_bigint_21
if $data00 != NULL then
sql show tags from st_bigint_21
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_21
@ -266,8 +228,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_22 using mt_bigint tags (9223372036854775807) values (now, 9223372036854775807)
sql select tagname from st_bigint_22
if $data00 != 9223372036854775807 then
sql show tags from st_bigint_22
if $data05 != 9223372036854775807 then
return -1
endi
sql select * from st_bigint_22
@ -275,8 +237,8 @@ if $data01 != 9223372036854775807 then
return -1
endi
sql insert into st_bigint_23 using mt_bigint tags (-9223372036854775807) values (now, -9223372036854775807)
sql select tagname from st_bigint_23
if $data00 != -9223372036854775807 then
sql show tags from st_bigint_23
if $data05 != -9223372036854775807 then
return -1
endi
sql select * from st_bigint_23
@ -284,8 +246,8 @@ if $data01 != -9223372036854775807 then
return -1
endi
sql insert into st_bigint_24 using mt_bigint tags (10) values (now, 10)
sql select tagname from st_bigint_24
if $data00 != 10 then
sql show tags from st_bigint_24
if $data05 != 10 then
return -1
endi
sql select * from st_bigint_24
@ -293,8 +255,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_bigint_25 using mt_bigint tags ("-0") values (now, "-0")
sql select tagname from st_bigint_25
if $data00 != 0 then
sql show tags from st_bigint_25
if $data05 != 0 then
return -1
endi
sql select * from st_bigint_25
@ -302,8 +264,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bigint_26 using mt_bigint tags ('123') values (now, '123')
sql select tagname from st_bigint_26
if $data00 != 123 then
sql show tags from st_bigint_26
if $data05 != 123 then
return -1
endi
sql select * from st_bigint_26
@ -311,8 +273,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_bigint_27 using mt_bigint tags (+056) values (now, +00056)
sql select tagname from st_bigint_27
if $data00 != 56 then
sql show tags from st_bigint_27
if $data05 != 56 then
return -1
endi
sql select * from st_bigint_27
@ -320,8 +282,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_bigint_28 using mt_bigint tags (-056) values (now, -0056)
sql select tagname from st_bigint_28
if $data00 != -56 then
sql show tags from st_bigint_28
if $data05 != -56 then
return -1
endi
sql select * from st_bigint_28
@ -331,50 +293,50 @@ endi
### case 03: alter tag values
#sql alter table st_bigint_0 set tag tagname=9223372036854775807
#sql select tagname from st_bigint_0
#if $data00 != 9223372036854775807 then
#sql show tags from st_bigint_0
#if $data05 != 9223372036854775807 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=-9223372036854775807
#sql select tagname from st_bigint_0
#if $data00 != -9223372036854775807 then
#sql show tags from st_bigint_0
#if $data05 != -9223372036854775807 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=+100
#sql select tagname from st_bigint_0
#if $data00 != 100 then
#sql show tags from st_bigint_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=-33
#sql select tagname from st_bigint_0
#if $data00 != -33 then
#sql show tags from st_bigint_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname='+98'
#sql select tagname from st_bigint_0
#if $data00 != 98 then
#sql show tags from st_bigint_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname='-076'
#sql select tagname from st_bigint_0
#if $data00 != -76 then
#sql show tags from st_bigint_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=+0012
#sql select tagname from st_bigint_0
#if $data00 != 12 then
#sql show tags from st_bigint_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=-00063
#sql select tagname from st_bigint_0
#if $data00 != -63 then
#sql show tags from st_bigint_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
################## when overflow, auto set max
sql_error create table st_bigint_e0 using mt_bigint tags (9223372036854775808)
sql_error create table st_bigint_e0_1 using mt_bigint tags (-9223372036854775808)
sql create table st_bigint_e0_1 using mt_bigint tags (-9223372036854775808)
sql_error create table st_bigint_e0_2 using mt_bigint tags (92233720368547758080)
sql_error create table st_bigint_e0_3 using mt_bigint tags (-9223372036854775809)
#sql_error create table st_bigint_e0 using mt_bigint tags (12.80) truncate integer part
@ -384,7 +346,7 @@ sql_error create table st_bigint_e0 using mt_bigint tags ("123abc")
sql_error create table st_bigint_e0 using mt_bigint tags (abc)
sql_error create table st_bigint_e0 using mt_bigint tags ("abc")
sql_error create table st_bigint_e0 using mt_bigint tags (" ")
sql_error create table st_bigint_e0 using mt_bigint tags ('')
sql create table st_bigint_e0_error using mt_bigint tags ('')
sql create table st_bigint_e0 using mt_bigint tags (123)
sql create table st_bigint_e1 using mt_bigint tags (123)
@ -401,9 +363,9 @@ sql create table st_bigint_e11 using mt_bigint tags (123)
sql create table st_bigint_e12 using mt_bigint tags (123)
sql_error insert into st_bigint_e0 values (now, 9223372036854775808)
sql_error insert into st_bigint_e1 values (now, -9223372036854775808)
sql insert into st_bigint_e1 values (now, -9223372036854775808)
sql_error insert into st_bigint_e2 values (now, 9223372036854775809)
sql_error insert into st_bigint_e3 values (now, -9223372036854775808)
sql insert into st_bigint_e3 values (now, -9223372036854775808)
#sql_error insert into st_bigint_e4 values (now, 922337203.6854775808)
#sql_error insert into st_bigint_e5 values (now, -922337203685477580.9)
sql_error insert into st_bigint_e6 values (now, 123abc)
@ -411,10 +373,10 @@ sql_error insert into st_bigint_e7 values (now, "123abc")
sql_error insert into st_bigint_e9 values (now, abc)
sql_error insert into st_bigint_e10 values (now, "abc")
sql_error insert into st_bigint_e11 values (now, " ")
sql_error insert into st_bigint_e12 values (now, '')
sql insert into st_bigint_e12 values (now, '')
sql_error insert into st_bigint_e13 using mt_bigint tags (033) values (now, 9223372036854775808)
sql_error insert into st_bigint_e14 using mt_bigint tags (033) values (now, -9223372036854775808)
sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, -9223372036854775808)
sql_error insert into st_bigint_e15 using mt_bigint tags (033) values (now, 9223372036854775818)
sql_error insert into st_bigint_e16 using mt_bigint tags (033) values (now, -9923372036854775808)
#sql_error insert into st_bigint_e17 using mt_bigint tags (033) values (now, 92233720368547758.08)
@ -424,10 +386,10 @@ sql_error insert into st_bigint_e20 using mt_bigint tags (033) values (now, "123
sql_error insert into st_bigint_e22 using mt_bigint tags (033) values (now, abc)
sql_error insert into st_bigint_e23 using mt_bigint tags (033) values (now, "abc")
sql_error insert into st_bigint_e24 using mt_bigint tags (033) values (now, " ")
sql_error insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
sql_error insert into st_bigint_e13_0 using mt_bigint tags (9223372036854775808) values (now, -033)
sql_error insert into st_bigint_e14_0 using mt_bigint tags (-9223372036854775808) values (now, -033)
sql insert into st_bigint_e14_0 using mt_bigint tags (-9223372036854775808) values (now, -033)
sql_error insert into st_bigint_e15_0 using mt_bigint tags (9223372036854775809) values (now, -033)
sql_error insert into st_bigint_e16_0 using mt_bigint tags (-9223372036854775898) values (now, -033)
#sql_error insert into st_bigint_e17 using mt_bigint tags (12.80) values (now, -033)
@ -437,7 +399,7 @@ sql_error insert into st_bigint_e20 using mt_bigint tags ("123abc") values (now,
sql_error insert into st_bigint_e22 using mt_bigint tags (abc) values (now, -033)
sql_error insert into st_bigint_e23 using mt_bigint tags ("abc") values (now, -033)
sql_error insert into st_bigint_e24 using mt_bigint tags (" ") values (now, -033)
sql_error insert into st_bigint_e25 using mt_bigint tags ('') values (now, -033)
sql insert into st_bigint_e25 using mt_bigint tags ('') values (now, -033)
sql insert into st_bigint_e13 using mt_bigint tags (033) values (now, 00062)
sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, 00062)

View File

@ -1,5 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
@ -10,110 +17,110 @@ sql create table mt_bool (ts timestamp, c bool) tags (tagname bool)
## case 00: static create table for test tag values
sql create table st_bool_0 using mt_bool tags (NULL)
sql select tagname from st_bool_0
if $data00 != NULL then
print ==1== expect: NULL, actually: $data00
sql show tags from st_bool_0
if $data05 != NULL then
print ==1== expect: NULL, actually: $data05
return -1
endi
sql create table st_bool_1 using mt_bool tags (NULL)
sql select tagname from st_bool_1
if $data00 != NULL then
print ==2== expect: NULL, actually: $data00
sql show tags from st_bool_1
if $data05 != NULL then
print ==2== expect: NULL, actually: $data05
return -1
endi
sql create table st_bool_2 using mt_bool tags ('NULL')
sql select tagname from st_bool_2
if $data00 != NULL then
print ==3== expect: NULL, actually: $data00
sql show tags from st_bool_2
if $data05 != false then
print ==3== expect: false, actually: $data05
return -1
endi
sql create table st_bool_3 using mt_bool tags ('NULL')
sql select tagname from st_bool_3
if $data00 != NULL then
print ==4== expect: NULL, actually: $data00
sql show tags from st_bool_3
if $data05 != false then
print ==4== expect: false, actually: $data05
return -1
endi
sql create table st_bool_4 using mt_bool tags ("NULL")
sql select tagname from st_bool_4
if $data00 != NULL then
print ==5== expect: NULL, actually: $data00
sql show tags from st_bool_4
if $data05 != false then
print ==5== expect: false, actually: $data05
return -1
endi
sql create table st_bool_5 using mt_bool tags ("NULL")
sql select tagname from st_bool_5
if $data00 != NULL then
print ==6== expect: NULL, actually: $data00
sql show tags from st_bool_5
if $data05 != false then
print ==6== expect: false, actually: $data05
return -1
endi
sql create table st_bool_6 using mt_bool tags ("true")
sql select tagname from st_bool_6
if $data00 != 1 then
print ==7== expect: 1, actually: $data00
sql show tags from st_bool_6
if $data05 != true then
print ==7== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_7 using mt_bool tags ('true')
sql select tagname from st_bool_7
if $data00 != 1 then
print ==8== expect: 1, actually: $data00
sql show tags from st_bool_7
if $data05 != true then
print ==8== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_8 using mt_bool tags (true)
sql select tagname from st_bool_8
if $data00 != 1 then
print ==9== expect: 1, actually: $data00
sql show tags from st_bool_8
if $data05 != true then
print ==9== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_9 using mt_bool tags ("false")
sql select tagname from st_bool_9
if $data00 != 0 then
print ==10== expect: 0, actually: $data00
sql show tags from st_bool_9
if $data05 != false then
print ==10== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_10 using mt_bool tags ('false')
sql select tagname from st_bool_10
if $data00 != 0 then
print ==11== expect: 0, actually: $data00
sql show tags from st_bool_10
if $data05 != false then
print ==11== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_11 using mt_bool tags (false)
sql select tagname from st_bool_11
if $data00 != 0 then
print ==12== expect: 0, actually: $data00
sql show tags from st_bool_11
if $data05 != false then
print ==12== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_12 using mt_bool tags (0)
sql select tagname from st_bool_12
if $data00 != 0 then
print ==13== expect: 0, actually: $data00
sql show tags from st_bool_12
if $data05 != false then
print ==13== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_13 using mt_bool tags (1)
sql select tagname from st_bool_13
if $data00 != 1 then
print ==14== expect: 1, actually: $data00
sql show tags from st_bool_13
if $data05 != true then
print ==14== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_14 using mt_bool tags (6.9)
sql select tagname from st_bool_14
if $data00 != 1 then
print ==15== expect: 1, actually: $data00
sql show tags from st_bool_14
if $data05 != true then
print ==15== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_15 using mt_bool tags (-3)
sql select tagname from st_bool_15
if $data00 != 1 then
sql show tags from st_bool_15
if $data05 != true then
print ==16== expect: 1, actually: $data00
return -1
endi
sql create table st_bool_15_0 using mt_bool tags (+300)
sql select tagname from st_bool_15_0
if $data00 != 1 then
sql show tags from st_bool_15_0
if $data05 != true then
print ==16== expect: 1, actually: $data00
return -1
endi
sql create table st_bool_15_1 using mt_bool tags (-8.03)
sql select tagname from st_bool_15_1
if $data00 != 1 then
sql show tags from st_bool_15_1
if $data05 != true then
print ==16== expect: 1, actually: $data00
return -1
endi
@ -284,8 +291,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL)
sql select tagname from st_bool_16
if $data00 != NULL then
sql show tags from st_bool_16
if $data05 != NULL then
print ==33== expect: NULL, actually: $data00
return -1
endi
@ -296,8 +303,8 @@ if $data01 != NULL then
endi
sql insert into st_bool_17 using mt_bool tags (NULL) values (now, NULL)
sql select tagname from st_bool_17
if $data00 != NULL then
sql show tags from st_bool_17
if $data05 != NULL then
print ==35== expect: NULL, actually: $data00
return -1
endi
@ -307,8 +314,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL')
sql select tagname from st_bool_18
if $data00 != NULL then
sql show tags from st_bool_18
if $data05 != NULL then
print ==37== expect: NULL, actually: $data00
return -1
endi
@ -318,8 +325,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_19 using mt_bool tags ('NULL') values (now, 'NULL')
sql select tagname from st_bool_19
if $data00 != NULL then
sql show tags from st_bool_19
if $data05 != NULL then
print ==39== expect: NULL, actually: $data00
return -1
endi
@ -329,8 +336,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_20 using mt_bool tags ("NULL") values (now, "NULL")
sql select tagname from st_bool_20
if $data00 != NULL then
sql show tags from st_bool_20
if $data05 != NULL then
print ==41== expect: NULL, actually: $data00
return -1
endi
@ -340,8 +347,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_21 using mt_bool tags ("NULL") values (now, "NULL")
sql select tagname from st_bool_21
if $data00 != NULL then
sql show tags from st_bool_21
if $data05 != NULL then
print ==43== expect: NULL, actually: $data00
return -1
endi
@ -351,8 +358,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_22 using mt_bool tags ("true") values (now, "true")
sql select tagname from st_bool_22
if $data00 != 1 then
sql show tags from st_bool_22
if $data05 != true then
print ==45== expect: 1, actually: $data00
return -1
endi
@ -362,8 +369,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_23 using mt_bool tags ('true') values (now, 'true')
sql select tagname from st_bool_23
if $data00 != 1 then
sql show tags from st_bool_23
if $data05 != true then
print ==47== expect: 1, actually: $data00
return -1
endi
@ -373,8 +380,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_24 using mt_bool tags (true) values (now, true)
sql select tagname from st_bool_24
if $data00 != 1 then
sql show tags from st_bool_24
if $data05 != true then
print ==49== expect: 1, actually: $data00
return -1
endi
@ -384,8 +391,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_25 using mt_bool tags ("false") values (now, "false")
sql select tagname from st_bool_25
if $data00 != 0 then
sql show tags from st_bool_25
if $data05 != false then
print ==51== expect: 0, actually: $data00
return -1
endi
@ -395,8 +402,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_26 using mt_bool tags ('false') values (now, 'false')
sql select tagname from st_bool_26
if $data00 != 0 then
sql show tags from st_bool_26
if $data05 != false then
print ==53== expect: 0, actually: $data00
return -1
endi
@ -406,8 +413,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_27 using mt_bool tags (false) values (now, false)
sql select tagname from st_bool_27
if $data00 != 0 then
sql show tags from st_bool_27
if $data05 != false then
print ==55== expect: 0, actually: $data00
return -1
endi
@ -417,8 +424,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_28 using mt_bool tags (0) values (now, 0)
sql select tagname from st_bool_28
if $data00 != 0 then
sql show tags from st_bool_28
if $data05 != false then
print ==57== expect: 0, actually: $data00
return -1
endi
@ -428,8 +435,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_29 using mt_bool tags (1) values (now, 1)
sql select tagname from st_bool_29
if $data00 != 1 then
sql show tags from st_bool_29
if $data05 != true then
print ==59== expect: 1, actually: $data00
return -1
endi
@ -439,8 +446,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_30 using mt_bool tags (6.9) values (now, 6.9)
sql select tagname from st_bool_30
if $data00 != 1 then
sql show tags from st_bool_30
if $data05 != true then
print ==61== expect: 1, actually: $data00
return -1
endi
@ -450,8 +457,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_31 using mt_bool tags (-3) values (now, -3)
sql select tagname from st_bool_31
if $data00 != 1 then
sql show tags from st_bool_31
if $data05 != true then
print ==63== expect: 1, actually: $data00
return -1
endi
@ -461,8 +468,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_32 using mt_bool tags (+300) values (now, +300)
sql select tagname from st_bool_32
if $data00 != 1 then
sql show tags from st_bool_32
if $data05 != true then
print ==63== expect: 1, actually: $data00
return -1
endi
@ -472,8 +479,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_33 using mt_bool tags (+30.890) values (now, +30.890)
sql select tagname from st_bool_33
if $data00 != 1 then
sql show tags from st_bool_33
if $data05 != true then
print ==63== expect: 1, actually: $data00
return -1
endi
@ -490,140 +497,140 @@ endi
## case 03: alter tag values
#sql alter table st_bool_0 set tag tagname=true
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=NULL
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=false
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=NULL
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='true'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='NULL'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='false'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='NULL'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="true"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="NULL"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="false"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="NULL"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=1
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=0
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=6.9
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=-3
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
# case 04: illegal input
sql_error create table st_bool_e0 using mt_bool tags (123abc)
sql_error create table st_bool_e1 using mt_bool tags ("123abc")
sql_error create table st_bool_e2 using mt_bool tags ("123")
sql create table st_bool_e1 using mt_bool tags ("123abc")
sql create table st_bool_e2 using mt_bool tags ("123")
sql_error create table st_bool_e3 using mt_bool tags (abc)
sql_error create table st_bool_e4 using mt_bool tags ("abc")
sql_error create table st_bool_e5 using mt_bool tags (" ")
sql_error create table st_bool_e6 using mt_bool tags ('')
sql create table st_bool_e4 using mt_bool tags ("abc")
sql create table st_bool_e5 using mt_bool tags (" ")
sql create table st_bool_e6 using mt_bool tags ('')
sql create table st_bool_e0 using mt_bool tags (true)
sql create table st_bool_e1 using mt_bool tags (true)
sql create table st_bool_e2 using mt_bool tags (true)
sql create table st_bool_e3 using mt_bool tags (true)
sql create table st_bool_e4 using mt_bool tags (true)
sql create table st_bool_e5 using mt_bool tags (true)
sql create table st_bool_e6 using mt_bool tags (true)
sql create table st_bool_f0 using mt_bool tags (true)
sql create table st_bool_f1 using mt_bool tags (true)
sql create table st_bool_f2 using mt_bool tags (true)
sql create table st_bool_f3 using mt_bool tags (true)
sql create table st_bool_f4 using mt_bool tags (true)
sql create table st_bool_f5 using mt_bool tags (true)
sql create table st_bool_f6 using mt_bool tags (true)
sql_error insert into st_bool_e0 values (now, 123abc)
sql_error insert into st_bool_e1 values (now, "123abc")
sql_error insert into st_bool_e2 values (now, "123")
sql_error insert into st_bool_e3 values (now, abc)
sql_error insert into st_bool_e4 values (now, "abc")
sql_error insert into st_bool_e5 values (now, " ")
sql_error insert into st_bool_e6 values (now, '')
sql_error insert into st_bool_g0 values (now, 123abc)
sql_error insert into st_bool_g1 values (now, "123abc")
sql_error insert into st_bool_g2 values (now, "123")
sql_error insert into st_bool_g3 values (now, abc)
sql_error insert into st_bool_g4 values (now, "abc")
sql_error insert into st_bool_g5 values (now, " ")
sql_error insert into st_bool_g6 values (now, '')
sql_error insert into st_bool_e10 using mt_bool tags (123abc) values (now, 1)
sql_error insert into st_bool_e11 using mt_bool tags ("123abc") values (now, 1)
sql_error insert into st_bool_e12 using mt_bool tags ("123") values (now, 1)
sql_error insert into st_bool_e13 using mt_bool tags (abc) values (now, 1)
sql_error insert into st_bool_e14 using mt_bool tags ("abc") values (now, 1)
sql_error insert into st_bool_e15 using mt_bool tags (" ") values (now, 1)
sql_error insert into st_bool_e16 using mt_bool tags ('') values (now, 1)
sql_error insert into st_bool_h0 using mt_bool tags (123abc) values (now, 1)
sql_error insert into st_bool_h1 using mt_bool tags ("123abc") values (now, 1)
sql_error insert into st_bool_h2 using mt_bool tags ("123") values (now, 1)
sql_error insert into st_bool_h3 using mt_bool tags (abc) values (now, 1)
sql_error insert into st_bool_h4 using mt_bool tags ("abc") values (now, 1)
sql_error insert into st_bool_h5 using mt_bool tags (" ") values (now, 1)
sql_error insert into st_bool_h6 using mt_bool tags ('') values (now, 1)
sql_error insert into st_bool_e17 using mt_bool tags (1) values (now, 123abc)
sql_error insert into st_bool_e18 using mt_bool tags (1) values (now, "123abc")
sql_error insert into st_bool_e19 using mt_bool tags (1) values (now, "123")
sql_error insert into st_bool_e20 using mt_bool tags (1) values (now, abc)
sql_error insert into st_bool_e21 using mt_bool tags (1) values (now, "abc")
sql_error insert into st_bool_e22 using mt_bool tags (1) values (now, " ")
sql_error insert into st_bool_e23 using mt_bool tags (1) values (now, '')
sql_error insert into st_bool_h0 using mt_bool tags (1) values (now, 123abc)
sql_error insert into st_bool_h1 using mt_bool tags (1) values (now, "123abc")
sql_error insert into st_bool_h2 using mt_bool tags (1) values (now, "123")
sql_error insert into st_bool_h3 using mt_bool tags (1) values (now, abc)
sql_error insert into st_bool_h4 using mt_bool tags (1) values (now, "abc")
sql_error insert into st_bool_h5 using mt_bool tags (1) values (now, " ")
sql_error insert into st_bool_h6 using mt_bool tags (1) values (now, '')
sql insert into st_bool_e10 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e11 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e12 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e13 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e14 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e15 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e16 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i0 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i1 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i2 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i3 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i4 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i5 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i6 using mt_bool tags (1) values (now, 1)
sql_error alter table st_bool_e10 set tag tagname=123abc
sql_error alter table st_bool_e11 set tag tagname="123abc"
sql_error alter table st_bool_e12 set tag tagname="123"
sql_error alter table st_bool_e13 set tag tagname=abc
sql_error alter table st_bool_e14 set tag tagname="abc"
sql_error alter table st_bool_e15 set tag tagname=" "
sql_error alter table st_bool_e16 set tag tagname=''
sql_error alter table st_bool_i0 set tag tagname=123abc
sql alter table st_bool_i1 set tag tagname="123abc"
sql alter table st_bool_i2 set tag tagname="123"
sql_error alter table st_bool_i3 set tag tagname=abc
sql alter table st_bool_i4 set tag tagname="abc"
sql alter table st_bool_i5 set tag tagname=" "
sql alter table st_bool_i6 set tag tagname=''

View File

@ -1,5 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
@ -10,135 +17,135 @@ sql create table mt_double (ts timestamp, c double) tags (tagname double)
## case 00: static create table for test tag values
sql create table st_double_0 using mt_double tags (NULL )
sql select tagname from st_double_0
if $data00 != NULL then
sql show tags from st_double_0
if $data05 != NULL then
return -1
endi
sql create table st_double_1 using mt_double tags (NULL)
sql select tagname from st_double_1
if $data00 != NULL then
sql show tags from st_double_1
if $data05 != NULL then
return -1
endi
sql create table st_double_2 using mt_double tags ('NULL')
sql select tagname from st_double_2
if $data00 != NULL then
sql show tags from st_double_2
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_3 using mt_double tags ('NULL')
sql select tagname from st_double_3
if $data00 != NULL then
sql show tags from st_double_3
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_4 using mt_double tags ("NULL")
sql select tagname from st_double_4
if $data00 != NULL then
sql show tags from st_double_4
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_5 using mt_double tags ("NULL")
sql select tagname from st_double_5
if $data00 != NULL then
sql show tags from st_double_5
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_6 using mt_double tags (-123.321)
sql select tagname from st_double_6
if $data00 != -123.321000000 then
print expect -123.321000000, actual: $data00
sql show tags from st_double_6
if $data05 != -123.321000000 then
print expect -123.321000000, actual: $data05
return -1
endi
sql create table st_double_7 using mt_double tags (+1.567)
sql select tagname from st_double_7
if $data00 != 1.567000000 then
sql show tags from st_double_7
if $data05 != 1.567000000 then
return -1
endi
sql create table st_double_8 using mt_double tags (379.001)
sql select tagname from st_double_8
if $data00 != 379.001000000 then
sql show tags from st_double_8
if $data05 != 379.001000000 then
return -1
endi
sql create table st_double_9 using mt_double tags (1.5e+3)
sql select tagname from st_double_9
if $data00 != 1500.000000000 then
sql show tags from st_double_9
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_10 using mt_double tags (-1.5e-3)
sql select tagname from st_double_10
if $data00 != -0.001500000 then
sql show tags from st_double_10
if $data05 != -0.001500000 then
return -1
endi
sql create table st_double_11 using mt_double tags (+1.5e+3)
sql select tagname from st_double_11
if $data00 != 1500.000000000 then
sql show tags from st_double_11
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_12 using mt_double tags (-1.5e+3)
sql select tagname from st_double_12
if $data00 != -1500.000000000 then
sql show tags from st_double_12
if $data05 != -1500.000000000 then
return -1
endi
sql create table st_double_13 using mt_double tags (1.5e-3)
sql select tagname from st_double_13
if $data00 != 0.001500000 then
sql show tags from st_double_13
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_14 using mt_double tags (1.5E-3)
sql select tagname from st_double_14
if $data00 != 0.001500000 then
sql show tags from st_double_14
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_6_0 using mt_double tags ('-123.321')
sql select tagname from st_double_6_0
if $data00 != -123.321000000 then
sql show tags from st_double_6_0
if $data05 != -123.321000000 then
return -1
endi
sql create table st_double_7_0 using mt_double tags ('+1.567')
sql select tagname from st_double_7_0
if $data00 != 1.567000000 then
sql show tags from st_double_7_0
if $data05 != 1.567000000 then
return -1
endi
sql create table st_double_8_0 using mt_double tags ('379.001')
sql select tagname from st_double_8_0
if $data00 != 379.001000000 then
sql show tags from st_double_8_0
if $data05 != 379.001000000 then
return -1
endi
sql create table st_double_9_0 using mt_double tags ('1.5e+3')
sql select tagname from st_double_9_0
if $data00 != 1500.000000000 then
sql show tags from st_double_9_0
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_10_0 using mt_double tags ('-1.5e-3')
sql select tagname from st_double_10_0
if $data00 != -0.001500000 then
sql show tags from st_double_10_0
if $data05 != -0.001500000 then
return -1
endi
sql create table st_double_11_0 using mt_double tags ('+1.5e+3')
sql select tagname from st_double_11_0
if $data00 != 1500.000000000 then
sql show tags from st_double_11_0
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_12_0 using mt_double tags ('-1.5e+3')
sql select tagname from st_double_12_0
if $data00 != -1500.000000000 then
sql show tags from st_double_12_0
if $data05 != -1500.000000000 then
return -1
endi
sql create table st_double_13_0 using mt_double tags ('1.5e-3')
sql select tagname from st_double_13_0
if $data00 != 0.001500000 then
sql show tags from st_double_13_0
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_14_0 using mt_double tags ('1.5E-3')
sql select tagname from st_double_14_0
if $data00 != 0.001500000 then
sql show tags from st_double_14_0
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_15_0 using mt_double tags (1.7976931348623157e+308)
sql select tagname from st_double_15_0
#if $data00 != 0.001500000 then
sql show tags from st_double_15_0
#if $data05 != 0.001500000 then
# return -1
#endi
sql create table st_double_16_0 using mt_double tags (-1.7976931348623157e+308)
sql select tagname from st_double_16_0
#if $data00 != 0.001500000 then
sql show tags from st_double_16_0
#if $data05 != 0.001500000 then
# return -1
#endi
@ -270,8 +277,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_double_16 using mt_double tags (NULL ) values (now, NULL )
sql select tagname from st_double_16
if $data00 != NULL then
sql show tags from st_double_16
if $data05 != NULL then
return -1
endi
sql select * from st_double_16
@ -280,8 +287,8 @@ if $data01 != NULL then
endi
sql insert into st_double_17 using mt_double tags (NULL) values (now, NULL)
sql select tagname from st_double_17
if $data00 != NULL then
sql show tags from st_double_17
if $data05 != NULL then
return -1
endi
sql select * from st_double_17
@ -289,8 +296,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_18 using mt_double tags ('NULL') values (now, 'NULL')
sql select tagname from st_double_18
if $data00 != NULL then
sql show tags from st_double_18
if $data05 != NULL then
return -1
endi
sql select * from st_double_18
@ -298,8 +305,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_19 using mt_double tags ('NULL') values (now, 'NULL')
sql select tagname from st_double_19
if $data00 != NULL then
sql show tags from st_double_19
if $data05 != NULL then
return -1
endi
sql select * from st_double_19
@ -307,8 +314,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_20 using mt_double tags ("NULL") values (now, "NULL")
sql select tagname from st_double_20
if $data00 != NULL then
sql show tags from st_double_20
if $data05 != NULL then
return -1
endi
sql select * from st_double_20
@ -316,8 +323,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_21 using mt_double tags ("NULL") values (now, "NULL")
sql select tagname from st_double_21
if $data00 != NULL then
sql show tags from st_double_21
if $data05 != NULL then
return -1
endi
sql select * from st_double_21
@ -325,8 +332,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_22 using mt_double tags (127) values (now, 1.7976931348623157e+308)
sql select tagname from st_double_22
#if $data00 != 127 then
sql show tags from st_double_22
#if $data05 != 127 then
# return -1
#endi
sql select * from st_double_22
@ -334,8 +341,8 @@ sql select * from st_double_22
# return -1
#endi
sql insert into st_double_23 using mt_double tags (-127) values (now, -1.7976931348623157e+308)
sql select tagname from st_double_23
#if $data00 != -127 then
sql show tags from st_double_23
#if $data05 != -127 then
# return -1
#endi
sql select * from st_double_23
@ -343,8 +350,8 @@ sql select * from st_double_23
# return -1
#endi
sql insert into st_double_24 using mt_double tags (10) values (now, 10)
sql select tagname from st_double_24
#if $data00 != 10 then
sql show tags from st_double_24
#if $data05 != 10 then
# return -1
#endi
sql select * from st_double_24
@ -352,8 +359,8 @@ sql select * from st_double_24
# return -1
#endi
sql insert into st_double_25 using mt_double tags ("-0") values (now, "-0")
sql select tagname from st_double_25
#if $data00 != 0 then
sql show tags from st_double_25
#if $data05 != 0 then
# return -1
#endi
sql select * from st_double_25
@ -361,8 +368,8 @@ sql select * from st_double_25
# return -1
#endi
sql insert into st_double_26 using mt_double tags ('123') values (now, '12.3')
sql select tagname from st_double_26
#if $data00 != 123 then
sql show tags from st_double_26
#if $data05 != 123 then
# return -1
#endi
sql select * from st_double_26
@ -370,8 +377,8 @@ sql select * from st_double_26
# return -1
#endi
sql insert into st_double_27 using mt_double tags (+056) values (now, +0005.6)
sql select tagname from st_double_27
#if $data00 != 56 then
sql show tags from st_double_27
#if $data05 != 56 then
# return -1
#endi
sql select * from st_double_27
@ -379,8 +386,8 @@ sql select * from st_double_27
# return -1
#endi
sql insert into st_double_28 using mt_double tags (-056) values (now, -005.6)
sql select tagname from st_double_28
#if $data00 != -56 then
sql show tags from st_double_28
#if $data05 != -56 then
# return -1
#endi
sql select * from st_double_28
@ -390,43 +397,43 @@ sql select * from st_double_28
### case 03: alter tag values
#sql alter table st_double_0 set tag tagname=1.7976931348623157e+308
#sql select tagname from st_double_0
##if $data00 != 127 then
#sql show tags from st_double_0
##if $data05 != 127 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=-1.7976931348623157e+308
#sql select tagname from st_double_0
##if $data00 != -127 then
#sql show tags from st_double_0
##if $data05 != -127 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=+10.340
#sql select tagname from st_double_0
##if $data00 != 100 then
#sql show tags from st_double_0
##if $data05 != 100 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=-33.87
#sql select tagname from st_double_0
##if $data00 != -33 then
#sql show tags from st_double_0
##if $data05 != -33 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname='+9.8'
#sql select tagname from st_double_0
##if $data00 != 98 then
#sql show tags from st_double_0
##if $data05 != 98 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname='-07.6'
#sql select tagname from st_double_0
##if $data00 != -76 then
#sql show tags from st_double_0
##if $data05 != -76 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=+0012.871
#sql select tagname from st_double_0
##if $data00 != 12 then
#sql show tags from st_double_0
##if $data05 != 12 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=-00063.582
#sql select tagname from st_double_0
##if $data00 != -63 then
#sql show tags from st_double_0
##if $data05 != -63 then
## return -1
##endi
@ -438,11 +445,11 @@ sql_error create table st_double_e0 using mt_double tags (-31.7976931348623157e+
#sql_error create table st_double_e0 using mt_double tags (12.80) truncate integer part
#sql_error create table st_double_e0 using mt_double tags (-11.80)
sql_error create table st_double_e0 using mt_double tags (123abc)
sql_error create table st_double_e0 using mt_double tags ("123abc")
sql create table st_double_e0_1 using mt_double tags ("123abc")
sql_error create table st_double_e0 using mt_double tags (abc)
sql_error create table st_double_e0 using mt_double tags ("abc")
sql_error create table st_double_e0 using mt_double tags (" ")
sql_error create table st_double_e0 using mt_double tags ('')
sql create table st_double_e0_2 using mt_double tags ("abc")
sql create table st_double_e0_3 using mt_double tags (" ")
sql create table st_double_e0_4 using mt_double tags ('')
sql create table st_double_e0 using mt_double tags (123)
sql create table st_double_e1 using mt_double tags (123)
@ -469,7 +476,7 @@ sql_error insert into st_double_e7 values (now, "123abc")
sql_error insert into st_double_e9 values (now, abc)
sql_error insert into st_double_e10 values (now, "abc")
sql_error insert into st_double_e11 values (now, " ")
sql_error insert into st_double_e12 values (now, '')
sql insert into st_double_e12 values (now, '')
sql_error insert into st_double_e13 using mt_double tags (033) values (now, 11.7976931348623157e+308)
sql_error insert into st_double_e14 using mt_double tags (033) values (now, -11.7976931348623157e+308)
@ -482,7 +489,7 @@ sql_error insert into st_double_e20 using mt_double tags (033) values (now, "123
sql_error insert into st_double_e22 using mt_double tags (033) values (now, abc)
sql_error insert into st_double_e23 using mt_double tags (033) values (now, "abc")
sql_error insert into st_double_e24 using mt_double tags (033) values (now, " ")
sql_error insert into st_double_e25 using mt_double tags (033) values (now, '')
sql insert into st_double_e25_1 using mt_double tags (033) values (now, '')
sql_error insert into st_double_e13 using mt_double tags (31.7976931348623157e+308) values (now, -033)
sql_error insert into st_double_e14 using mt_double tags (-31.7976931348623157e+308) values (now, -033)
@ -495,7 +502,7 @@ sql_error insert into st_double_e20 using mt_double tags ("123abc") values (now,
sql_error insert into st_double_e22 using mt_double tags (abc) values (now, -033)
sql_error insert into st_double_e23 using mt_double tags ("abc") values (now, -033)
sql_error insert into st_double_e24 using mt_double tags (" ") values (now, -033)
sql_error insert into st_double_e25 using mt_double tags ('') values (now, -033)
sql insert into st_double_e25 using mt_double tags ('') values (now, -033)
sql insert into st_double_e13 using mt_double tags (033) values (now, 00062)
sql insert into st_double_e14 using mt_double tags (033) values (now, 00062)
@ -516,8 +523,8 @@ sql_error alter table st_double_e14 set tag tagname=-1.8976931348623157e+308
sql_error alter table st_double_e15 set tag tagname=131.7976931348623157e+308
sql_error alter table st_double_e16 set tag tagname=-131.7976931348623157e+308
sql_error alter table st_double_e19 set tag tagname=123abc
sql_error alter table st_double_e20 set tag tagname="123abc"
sql alter table st_double_e20 set tag tagname="123abc"
sql_error alter table st_double_e22 set tag tagname=abc
sql_error alter table st_double_e23 set tag tagname="abc"
sql_error alter table st_double_e24 set tag tagname=" "
sql_error alter table st_double_e25 set tag tagname=''
sql alter table st_double_e23 set tag tagname="abc"
sql alter table st_double_e24 set tag tagname=" "
sql alter table st_double_e25 set tag tagname=''

View File

@ -1,5 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
@ -10,152 +17,152 @@ sql create table mt_float (ts timestamp, c float) tags (tagname float)
## case 00: static create table for test tag values
sql create table st_float_0 using mt_float tags (NULL)
sql select tagname from st_float_0
if $data00 != NULL then
sql show tags from st_float_0
if $data05 != NULL then
return -1
endi
sql create table st_float_1 using mt_float tags (NULL)
sql select tagname from st_float_1
if $data00 != NULL then
sql show tags from st_float_1
if $data05 != NULL then
return -1
endi
sql create table st_float_2 using mt_float tags ('NULL')
sql select tagname from st_float_2
if $data00 != NULL then
sql show tags from st_float_2
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_3 using mt_float tags ('NULL')
sql select tagname from st_float_3
if $data00 != NULL then
sql show tags from st_float_3
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_4 using mt_float tags ("NULL")
sql select tagname from st_float_4
if $data00 != NULL then
sql show tags from st_float_4
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_5 using mt_float tags ("NULL")
sql select tagname from st_float_5
if $data00 != NULL then
sql show tags from st_float_5
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_6 using mt_float tags (-123.321)
sql select tagname from st_float_6
if $data00 != -123.32100 then
print expect -123.32100, actual: $data00
sql show tags from st_float_6
if $data05 != -123.32100 then
print expect -123.32100, actual: $data05
return -1
endi
sql create table st_float_7 using mt_float tags (+1.567)
sql select tagname from st_float_7
if $data00 != 1.56700 then
print expect 1.56700, actual: $data00
sql show tags from st_float_7
if $data05 != 1.56700 then
print expect 1.56700, actual: $data05
return -1
endi
sql create table st_float_8 using mt_float tags (379.001)
sql select tagname from st_float_8
if $data00 != 379.00101 then
print expect 379.00101, actual: $data00
sql show tags from st_float_8
if $data05 != 379.00101 then
print expect 379.00101, actual: $data05
return -1
endi
sql create table st_float_9 using mt_float tags (1.5e+3)
sql select tagname from st_float_9
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_9
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_10 using mt_float tags (-1.5e-3)
sql select tagname from st_float_10
if $data00 != -0.00150 then
print expect -0.00150, actual: $data00
sql show tags from st_float_10
if $data05 != -0.00150 then
print expect -0.00150, actual: $data05
return -1
endi
sql create table st_float_11 using mt_float tags (+1.5e+3)
sql select tagname from st_float_11
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_11
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_12 using mt_float tags (-1.5e+3)
sql select tagname from st_float_12
if $data00 != -1500.00000 then
print expect -1500.00000, actual: $data00
sql show tags from st_float_12
if $data05 != -1500.00000 then
print expect -1500.00000, actual: $data05
return -1
endi
sql create table st_float_13 using mt_float tags (1.5e-3)
sql select tagname from st_float_13
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_13
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
sql create table st_float_14 using mt_float tags (1.5E-3)
sql select tagname from st_float_14
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_14
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
sql create table st_float_6_0 using mt_float tags ('-123.321')
sql select tagname from st_float_6_0
if $data00 != -123.32100 then
print expect -123.32100, actual: $data00
sql show tags from st_float_6_0
if $data05 != -123.32100 then
print expect -123.32100, actual: $data05
return -1
endi
sql create table st_float_7_0 using mt_float tags ('+1.567')
sql select tagname from st_float_7_0
if $data00 != 1.56700 then
print expect 1.56700, actual: $data00
sql show tags from st_float_7_0
if $data05 != 1.56700 then
print expect 1.56700, actual: $data05
return -1
endi
sql create table st_float_8_0 using mt_float tags ('379.001')
sql select tagname from st_float_8_0
if $data00 != 379.00101 then
print expect 379.00101, actual: $data00
sql show tags from st_float_8_0
if $data05 != 379.00101 then
print expect 379.00101, actual: $data05
return -1
endi
sql create table st_float_9_0 using mt_float tags ('1.5e+3')
sql select tagname from st_float_9_0
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_9_0
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_10_0 using mt_float tags ('-1.5e-3')
sql select tagname from st_float_10_0
if $data00 != -0.00150 then
print expect -0.00150, actual: $data00
sql show tags from st_float_10_0
if $data05 != -0.00150 then
print expect -0.00150, actual: $data05
return -1
endi
sql create table st_float_11_0 using mt_float tags ('+1.5e+3')
sql select tagname from st_float_11_0
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_11_0
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_12_0 using mt_float tags ('-1.5e+3')
sql select tagname from st_float_12_0
if $data00 != -1500.00000 then
print expect -1500.00000, actual: $data00
sql show tags from st_float_12_0
if $data05 != -1500.00000 then
print expect -1500.00000, actual: $data05
return -1
endi
sql create table st_float_13_0 using mt_float tags ('1.5e-3')
sql select tagname from st_float_13_0
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_13_0
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
sql create table st_float_14_0 using mt_float tags ('1.5E-3')
sql select tagname from st_float_14_0
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_14_0
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
#sql create table st_float_15_0 using mt_float tags (3.40282347e+38)
#sql select tagname from st_float_15_0
#if $data00 != 0.001500 then
#sql show tags from st_float_15_0
#if $data05 != 0.001500 then
# return -1
#endi
#sql create table st_float_16_0 using mt_float tags (-3.40282347e+38)
#sql select tagname from st_float_16_0
#if $data00 != 0.001500 then
#sql show tags from st_float_16_0
#if $data05 != 0.001500 then
# return -1
#endi
@ -292,8 +299,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_float_16 using mt_float tags (NULL) values (now, NULL)
sql select tagname from st_float_16
if $data00 != NULL then
sql show tags from st_float_16
if $data05 != NULL then
return -1
endi
sql select * from st_float_16
@ -302,8 +309,8 @@ if $data01 != NULL then
endi
sql insert into st_float_17 using mt_float tags (NULL) values (now, NULL)
sql select tagname from st_float_17
if $data00 != NULL then
sql show tags from st_float_17
if $data05 != NULL then
return -1
endi
sql select * from st_float_17
@ -311,8 +318,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_18 using mt_float tags ('NULL') values (now, 'NULL')
sql select tagname from st_float_18
if $data00 != NULL then
sql show tags from st_float_18
if $data05 != NULL then
return -1
endi
sql select * from st_float_18
@ -320,8 +327,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_19 using mt_float tags ('NULL') values (now, 'NULL')
sql select tagname from st_float_19
if $data00 != NULL then
sql show tags from st_float_19
if $data05 != NULL then
return -1
endi
sql select * from st_float_19
@ -329,8 +336,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_20 using mt_float tags ("NULL") values (now, "NULL")
sql select tagname from st_float_20
if $data00 != NULL then
sql show tags from st_float_20
if $data05 != NULL then
return -1
endi
sql select * from st_float_20
@ -338,8 +345,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_21 using mt_float tags ("NULL") values (now, "NULL")
sql select tagname from st_float_21
if $data00 != NULL then
sql show tags from st_float_21
if $data05 != NULL then
return -1
endi
sql select * from st_float_21
@ -350,9 +357,9 @@ endi
sql_error insert into st_float_22 using mt_float tags (127) values (now, 3.40282347e+38)
sql insert into st_float_22 using mt_float tags (127) values (now, 340282346638528859811704183484516925440.00000)
sql select tagname from st_float_22
if $data00 != 127.00000 then
print expect 127.00000, actual: $data00
sql show tags from st_float_22
if $data05 != 127.00000 then
print expect 127.00000, actual: $data05
return -1
endi
@ -362,14 +369,14 @@ if $data01 != 127.00000 then
endi
sql insert into st_float_23 using mt_float tags (-127) values (now, -340282346638528859811704183484516925440.00000)
sql select tagname from st_float_23
if $data00 != -127.00000 then
sql show tags from st_float_23
if $data05 != -127.00000 then
return -1
endi
sql insert into st_float_24 using mt_float tags (10) values (now, 10)
sql select tagname from st_float_24
if $data00 != 10.00000 then
sql show tags from st_float_24
if $data05 != 10.00000 then
return -1
endi
sql select * from st_float_24
@ -378,9 +385,9 @@ if $data01 != 10.00000 then
endi
sql insert into st_float_25 using mt_float tags ("-0") values (now, "-0")
sql select tagname from st_float_25
if $data00 != -0.00000 then
print expect -0.00000, actual: $data00
sql show tags from st_float_25
if $data05 != -0.00000 then
print expect -0.00000, actual: $data05
return -1
endi
sql select * from st_float_25
@ -388,9 +395,9 @@ if $data01 != -0.00000 then
return -1
endi
sql insert into st_float_26 using mt_float tags ('123') values (now, '12.3')
sql select tagname from st_float_26
if $data00 != 123.00000 then
print expect 123.00000, actual: $data00
sql show tags from st_float_26
if $data05 != 123.00000 then
print expect 123.00000, actual: $data05
return -1
endi
sql select * from st_float_26
@ -398,9 +405,9 @@ if $data01 != 12.30000 then
return -1
endi
sql insert into st_float_27 using mt_float tags (+056) values (now, +0005.6)
sql select tagname from st_float_27
if $data00 != 56.00000 then
print expect 56.00000, actual:$data00
sql show tags from st_float_27
if $data05 != 56.00000 then
print expect 56.00000, actual:$data05
return -1
endi
sql select * from st_float_27
@ -408,8 +415,8 @@ if $data01 != 5.60000 then
return -1
endi
sql insert into st_float_28 using mt_float tags (-056) values (now, -005.6)
sql select tagname from st_float_28
if $data00 != -56.00000 then
sql show tags from st_float_28
if $data05 != -56.00000 then
return -1
endi
sql select * from st_float_28
@ -419,44 +426,44 @@ endi
### case 03: alter tag values
sql alter table st_float_0 set tag tagname=340282346638528859811704183484516925440.00000
sql select tagname from st_float_0
if $data00 != 340282346638528859811704183484516925440.00000 then
sql show tags from st_float_0
if $data05 != 340282346638528859811704183484516925440.00000 then
return -1
endi
sql alter table st_float_0 set tag tagname=-340282346638528859811704183484516925440.00000
sql select tagname from st_float_0
if $data00 != -340282346638528859811704183484516925440.00000 then
sql show tags from st_float_0
if $data05 != -340282346638528859811704183484516925440.00000 then
return -1
endi
sql alter table st_float_0 set tag tagname=+10.340
sql select tagname from st_float_0
if $data00 != 10.34000 then
sql show tags from st_float_0
if $data05 != 10.34000 then
return -1
endi
sql alter table st_float_0 set tag tagname=-33.87
sql select tagname from st_float_0
if $data00 != -33.87000 then
sql show tags from st_float_0
if $data05 != -33.87000 then
return -1
endi
sql alter table st_float_0 set tag tagname='+9.8'
sql select tagname from st_float_0
if $data00 != 9.80000 then
sql show tags from st_float_0
if $data05 != 9.80000 then
return -1
endi
sql alter table st_float_0 set tag tagname='-07.6'
sql select tagname from st_float_0
if $data00 != -7.60000 then
sql show tags from st_float_0
if $data05 != -7.60000 then
return -1
endi
sql alter table st_float_0 set tag tagname=+0012.871
sql select tagname from st_float_0
if $data00 != 12.87100 then
sql show tags from st_float_0
if $data05 != 12.87100 then
return -1
endi
sql alter table st_float_0 set tag tagname=-00063.582
sql select tagname from st_float_0
if $data00 != -63.58200 then
sql show tags from st_float_0
if $data05 != -63.58200 then
return -1
endi
@ -468,11 +475,11 @@ sql_error create table st_float_e0 using mt_float tags (-333.40282347e+38)
#sql_error create table st_float_e0 using mt_float tags (12.80) truncate integer part
#sql_error create table st_float_e0 using mt_float tags (-11.80)
sql_error create table st_float_e0 using mt_float tags (123abc)
sql_error create table st_float_e0 using mt_float tags ("123abc")
sql create table st_float_e0_1 using mt_float tags ("123abc")
sql_error create table st_float_e0 using mt_float tags (abc)
sql_error create table st_float_e0 using mt_float tags ("abc")
sql_error create table st_float_e0 using mt_float tags (" ")
sql_error create table st_float_e0 using mt_float tags ('')
sql create table st_float_e0_2 using mt_float tags ("abc")
sql create table st_float_e0_3 using mt_float tags (" ")
sql create table st_float_e0_4 using mt_float tags ('')
sql create table st_float_e0 using mt_float tags (123)
sql create table st_float_e1 using mt_float tags (123)
@ -499,7 +506,7 @@ sql_error insert into st_float_e7 values (now, "123abc")
sql_error insert into st_float_e9 values (now, abc)
sql_error insert into st_float_e10 values (now, "abc")
sql_error insert into st_float_e11 values (now, " ")
sql_error insert into st_float_e12 values (now, '')
sql insert into st_float_e12 values (now, '')
sql_error insert into st_float_e13 using mt_float tags (033) values (now, 3.50282347e+38)
sql_error insert into st_float_e14 using mt_float tags (033) values (now, -3.50282347e+38)
@ -512,7 +519,7 @@ sql_error insert into st_float_e20 using mt_float tags (033) values (now, "123ab
sql_error insert into st_float_e22 using mt_float tags (033) values (now, abc)
sql_error insert into st_float_e23 using mt_float tags (033) values (now, "abc")
sql_error insert into st_float_e24 using mt_float tags (033) values (now, " ")
sql_error insert into st_float_e25 using mt_float tags (033) values (now, '')
sql insert into st_float_e25_1 using mt_float tags (033) values (now, '')
sql_error insert into st_float_e13 using mt_float tags (3.50282347e+38) values (now, -033)
sql_error insert into st_float_e14 using mt_float tags (-3.50282347e+38) values (now, -033)
@ -525,7 +532,7 @@ sql_error insert into st_float_e20 using mt_float tags ("123abc") values (now, -
sql_error insert into st_float_e22 using mt_float tags (abc) values (now, -033)
sql_error insert into st_float_e23 using mt_float tags ("abc") values (now, -033)
sql_error insert into st_float_e24 using mt_float tags (" ") values (now, -033)
sql_error insert into st_float_e25 using mt_float tags ('') values (now, -033)
sql insert into st_float_e25_3 using mt_float tags ('') values (now, -033)
sql insert into st_float_e13 using mt_float tags (033) values (now, 00062)
sql insert into st_float_e14 using mt_float tags (033) values (now, 00062)
@ -546,8 +553,8 @@ sql_error alter table st_float_e14 set tag tagname=-3.50282347e+38
sql_error alter table st_float_e15 set tag tagname=13.40282347e+38
sql_error alter table st_float_e16 set tag tagname=-13.40282347e+38
sql_error alter table st_float_e19 set tag tagname=123abc
sql_error alter table st_float_e20 set tag tagname="123abc"
sql alter table st_float_e20 set tag tagname="123abc"
sql_error alter table st_float_e22 set tag tagname=abc
sql_error alter table st_float_e23 set tag tagname="abc"
sql_error alter table st_float_e24 set tag tagname=" "
sql_error alter table st_float_e25 set tag tagname=''
sql alter table st_float_e23 set tag tagname="abc"
sql alter table st_float_e24 set tag tagname=" "
sql alter table st_float_e25 set tag tagname=''

View File

@ -1,5 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
@ -10,78 +17,64 @@ sql create table mt_int (ts timestamp, c int) tags (tagname int)
## case 00: static create table for test tag values
sql create table st_int_0 using mt_int tags (NULL)
sql select tagname from st_int_0
if $data00 != NULL then
sql show tags from st_int_0
if $data05 != NULL then
return -1
endi
sql create table st_int_1 using mt_int tags (NULL)
sql select tagname from st_int_1
if $data00 != NULL then
return -1
endi
sql create table st_int_2 using mt_int tags ('NULL')
sql select tagname from st_int_2
if $data00 != NULL then
return -1
endi
sql create table st_int_3 using mt_int tags ('NULL')
sql select tagname from st_int_3
if $data00 != NULL then
return -1
endi
sql create table st_int_4 using mt_int tags ("NULL")
sql select tagname from st_int_4
if $data00 != NULL then
return -1
endi
sql create table st_int_5 using mt_int tags ("NULL")
sql select tagname from st_int_5
if $data00 != NULL then
sql show tags from st_int_1
if $data05 != NULL then
return -1
endi
sql_error create table st_int_2 using mt_int tags ('NULL')
sql_error create table st_int_3 using mt_int tags ('NULL')
sql_error create table st_int_4 using mt_int tags ("NULL")
sql_error create table st_int_5 using mt_int tags ("NULL")
sql create table st_int_6 using mt_int tags (-2147483647)
sql select tagname from st_int_6
if $data00 != -2147483647 then
sql show tags from st_int_6
if $data05 != -2147483647 then
return -1
endi
sql create table st_int_7 using mt_int tags (2147483647)
sql select tagname from st_int_7
if $data00 != 2147483647 then
sql show tags from st_int_7
if $data05 != 2147483647 then
return -1
endi
sql create table st_int_8 using mt_int tags (37)
sql select tagname from st_int_8
if $data00 != 37 then
sql show tags from st_int_8
if $data05 != 37 then
return -1
endi
sql create table st_int_9 using mt_int tags (-100)
sql select tagname from st_int_9
if $data00 != -100 then
sql show tags from st_int_9
if $data05 != -100 then
return -1
endi
sql create table st_int_10 using mt_int tags (+113)
sql select tagname from st_int_10
if $data00 != 113 then
sql show tags from st_int_10
if $data05 != 113 then
return -1
endi
sql create table st_int_11 using mt_int tags ('-100')
sql select tagname from st_int_11
if $data00 != -100 then
sql show tags from st_int_11
if $data05 != -100 then
return -1
endi
sql create table st_int_12 using mt_int tags ("+78")
sql select tagname from st_int_12
if $data00 != 78 then
sql show tags from st_int_12
if $data05 != 78 then
return -1
endi
sql create table st_int_13 using mt_int tags (+0078)
sql select tagname from st_int_13
if $data00 != 78 then
sql show tags from st_int_13
if $data05 != 78 then
return -1
endi
sql create table st_int_14 using mt_int tags (-00078)
sql select tagname from st_int_14
if $data00 != -78 then
sql show tags from st_int_14
if $data05 != -78 then
return -1
endi
@ -102,38 +95,6 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_2 values (now, 'NULL')
sql select * from st_int_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_3 values (now, 'NULL')
sql select * from st_int_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_4 values (now, "NULL")
sql select * from st_int_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_5 values (now, "NULL")
sql select * from st_int_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_6 values (now, 2147483647)
sql select * from st_int_6
if $rows != 1 then
@ -211,8 +172,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_int_16 using mt_int tags (NULL) values (now, NULL)
sql select tagname from st_int_16
if $data00 != NULL then
sql show tags from st_int_16
if $data05 != NULL then
return -1
endi
sql select * from st_int_16
@ -221,8 +182,8 @@ if $data01 != NULL then
endi
sql insert into st_int_17 using mt_int tags (NULL) values (now, NULL)
sql select tagname from st_int_17
if $data00 != NULL then
sql show tags from st_int_17
if $data05 != NULL then
return -1
endi
sql select * from st_int_17
@ -230,8 +191,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_18 using mt_int tags ('NULL') values (now, 'NULL')
sql select tagname from st_int_18
if $data00 != NULL then
sql show tags from st_int_18
if $data05 != NULL then
return -1
endi
sql select * from st_int_18
@ -239,8 +200,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_19 using mt_int tags ('NULL') values (now, 'NULL')
sql select tagname from st_int_19
if $data00 != NULL then
sql show tags from st_int_19
if $data05 != NULL then
return -1
endi
sql select * from st_int_19
@ -248,8 +209,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_20 using mt_int tags ("NULL") values (now, "NULL")
sql select tagname from st_int_20
if $data00 != NULL then
sql show tags from st_int_20
if $data05 != NULL then
return -1
endi
sql select * from st_int_20
@ -257,8 +218,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_21 using mt_int tags ("NULL") values (now, "NULL")
sql select tagname from st_int_21
if $data00 != NULL then
sql show tags from st_int_21
if $data05 != NULL then
return -1
endi
sql select * from st_int_21
@ -266,8 +227,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_22 using mt_int tags (2147483647) values (now, 2147483647)
sql select tagname from st_int_22
if $data00 != 2147483647 then
sql show tags from st_int_22
if $data05 != 2147483647 then
return -1
endi
sql select * from st_int_22
@ -275,8 +236,8 @@ if $data01 != 2147483647 then
return -1
endi
sql insert into st_int_23 using mt_int tags (-2147483647) values (now, -2147483647)
sql select tagname from st_int_23
if $data00 != -2147483647 then
sql show tags from st_int_23
if $data05 != -2147483647 then
return -1
endi
sql select * from st_int_23
@ -284,8 +245,8 @@ if $data01 != -2147483647 then
return -1
endi
sql insert into st_int_24 using mt_int tags (10) values (now, 10)
sql select tagname from st_int_24
if $data00 != 10 then
sql show tags from st_int_24
if $data05 != 10 then
return -1
endi
sql select * from st_int_24
@ -293,8 +254,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_int_25 using mt_int tags ("-0") values (now, "-0")
sql select tagname from st_int_25
if $data00 != 0 then
sql show tags from st_int_25
if $data05 != 0 then
return -1
endi
sql select * from st_int_25
@ -302,8 +263,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_int_26 using mt_int tags ('123') values (now, '123')
sql select tagname from st_int_26
if $data00 != 123 then
sql show tags from st_int_26
if $data05 != 123 then
return -1
endi
sql select * from st_int_26
@ -311,8 +272,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_int_27 using mt_int tags (+056) values (now, +00056)
sql select tagname from st_int_27
if $data00 != 56 then
sql show tags from st_int_27
if $data05 != 56 then
return -1
endi
sql select * from st_int_27
@ -320,8 +281,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_int_28 using mt_int tags (-056) values (now, -0056)
sql select tagname from st_int_28
if $data00 != -56 then
sql show tags from st_int_28
if $data05 != -56 then
return -1
endi
sql select * from st_int_28
@ -331,49 +292,49 @@ endi
### case 03: alter tag values
#sql alter table st_int_0 set tag tagname=2147483647
#sql select tagname from st_int_0
#if $data00 != 2147483647 then
#sql show tags from st_int_0
#if $data05 != 2147483647 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=-2147483647
#sql select tagname from st_int_0
#if $data00 != -2147483647 then
#sql show tags from st_int_0
#if $data05 != -2147483647 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=+100
#sql select tagname from st_int_0
#if $data00 != 100 then
#sql show tags from st_int_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=-33
#sql select tagname from st_int_0
#if $data00 != -33 then
#sql show tags from st_int_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname='+98'
#sql select tagname from st_int_0
#if $data00 != 98 then
#sql show tags from st_int_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname='-076'
#sql select tagname from st_int_0
#if $data00 != -76 then
#sql show tags from st_int_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=+0012
#sql select tagname from st_int_0
#if $data00 != 12 then
#sql show tags from st_int_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=-00063
#sql select tagname from st_int_0
#if $data00 != -63 then
#sql show tags from st_int_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
sql_error create table st_int_e0 using mt_int tags (2147483648)
sql_error create table st_int_e0 using mt_int tags (-2147483648)
sql create table st_int_e0_err1 using mt_int tags (-2147483648)
sql_error create table st_int_e0 using mt_int tags (214748364800)
sql_error create table st_int_e0 using mt_int tags (-214748364800)
#sql_error create table st_int_e0 using mt_int tags (12.80) truncate integer part
@ -383,7 +344,7 @@ sql_error create table st_int_e0 using mt_int tags ("123abc")
sql_error create table st_int_e0 using mt_int tags (abc)
sql_error create table st_int_e0 using mt_int tags ("abc")
sql_error create table st_int_e0 using mt_int tags (" ")
sql_error create table st_int_e0 using mt_int tags ('')
sql create table st_int_e0_err2 using mt_int tags ('')
sql create table st_int_e0 using mt_int tags (123)
sql create table st_int_e1 using mt_int tags (123)
@ -400,7 +361,7 @@ sql create table st_int_e11 using mt_int tags (123)
sql create table st_int_e12 using mt_int tags (123)
sql_error insert into st_int_e0 values (now, 2147483648)
sql_error insert into st_int_e1 values (now, -2147483648)
sql insert into st_int_e1 values (now, -2147483648)
sql_error insert into st_int_e2 values (now, 3147483648)
sql_error insert into st_int_e3 values (now, -21474836481)
#sql_error insert into st_int_e4 values (now, 12.80)
@ -410,10 +371,10 @@ sql_error insert into st_int_e7 values (now, "123abc")
sql_error insert into st_int_e9 values (now, abc)
sql_error insert into st_int_e10 values (now, "abc")
sql_error insert into st_int_e11 values (now, " ")
sql_error insert into st_int_e12 values (now, '')
sql insert into st_int_e12 values (now, '')
sql_error insert into st_int_e13 using mt_int tags (033) values (now, 2147483648)
sql_error insert into st_int_e14 using mt_int tags (033) values (now, -2147483648)
sql insert into st_int_e14 using mt_int tags (033) values (now, -2147483648)
sql_error insert into st_int_e15 using mt_int tags (033) values (now, 5147483648)
sql_error insert into st_int_e16 using mt_int tags (033) values (now, -21474836481)
#sql_error insert into st_int_e17 using mt_int tags (033) values (now, 12.80)
@ -423,10 +384,10 @@ sql_error insert into st_int_e20 using mt_int tags (033) values (now, "123abc")
sql_error insert into st_int_e22 using mt_int tags (033) values (now, abc)
sql_error insert into st_int_e23 using mt_int tags (033) values (now, "abc")
sql_error insert into st_int_e24 using mt_int tags (033) values (now, " ")
sql_error insert into st_int_e25 using mt_int tags (033) values (now, '')
sql insert into st_int_e25 using mt_int tags (033) values (now, '')
sql_error insert into st_int_e13 using mt_int tags (2147483648) values (now, -033)
sql_error insert into st_int_e14 using mt_int tags (-2147483648) values (now, -033)
sql insert into st_int_e14_1 using mt_int tags (-2147483648) values (now, -033)
sql_error insert into st_int_e15 using mt_int tags (21474836480) values (now, -033)
sql_error insert into st_int_e16 using mt_int tags (-2147483649) values (now, -033)
#sql_error insert into st_int_e17 using mt_int tags (12.80) values (now, -033)
@ -436,7 +397,7 @@ sql_error insert into st_int_e20 using mt_int tags ("123abc") values (now, -033)
sql_error insert into st_int_e22 using mt_int tags (abc) values (now, -033)
sql_error insert into st_int_e23 using mt_int tags ("abc") values (now, -033)
sql_error insert into st_int_e24 using mt_int tags (" ") values (now, -033)
sql_error insert into st_int_e25 using mt_int tags ('') values (now, -033)
sql insert into st_int_e25_1 using mt_int tags ('') values (now, -033)
sql insert into st_int_e13 using mt_int tags (033) values (now, 00062)
sql insert into st_int_e14 using mt_int tags (033) values (now, 00062)
@ -453,7 +414,7 @@ sql insert into st_int_e24 using mt_int tags (033) values (now, 00062)
sql insert into st_int_e25 using mt_int tags (033) values (now, 00062)
sql_error alter table st_int_e13 set tag tagname=2147483648
sql_error alter table st_int_e14 set tag tagname=-2147483648
sql alter table st_int_e14 set tag tagname=-2147483648
sql_error alter table st_int_e15 set tag tagname=12147483648
sql_error alter table st_int_e16 set tag tagname=-3147483648
sql_error alter table st_int_e19 set tag tagname=123abc
@ -461,4 +422,4 @@ sql_error alter table st_int_e20 set tag tagname="123abc"
sql_error alter table st_int_e22 set tag tagname=abc
sql_error alter table st_int_e23 set tag tagname="abc"
sql_error alter table st_int_e24 set tag tagname=" "
sql_error alter table st_int_e25 set tag tagname=''
sql alter table st_int_e25 set tag tagname=''

View File

@ -1,6 +1,17 @@
sql create database if not exists db
sql use db
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
######## case 0: smallint
@ -9,78 +20,64 @@ sql create table mt_smallint (ts timestamp, c smallint) tags (tagname smallint)
## case 00: static create table for test tag values
sql create table st_smallint_0 using mt_smallint tags (NULL)
sql select tagname from st_smallint_0
if $data00 != NULL then
sql show tags from st_smallint_0
if $data05 != NULL then
return -1
endi
sql create table st_smallint_1 using mt_smallint tags (NULL)
sql select tagname from st_smallint_1
if $data00 != NULL then
return -1
endi
sql create table st_smallint_2 using mt_smallint tags ('NULL')
sql select tagname from st_smallint_2
if $data00 != NULL then
return -1
endi
sql create table st_smallint_3 using mt_smallint tags ('NULL')
sql select tagname from st_smallint_3
if $data00 != NULL then
return -1
endi
sql create table st_smallint_4 using mt_smallint tags ("NULL")
sql select tagname from st_smallint_4
if $data00 != NULL then
return -1
endi
sql create table st_smallint_5 using mt_smallint tags ("NULL")
sql select tagname from st_smallint_5
if $data00 != NULL then
sql show tags from st_smallint_1
if $data05 != NULL then
return -1
endi
sql_error create table st_smallint_2 using mt_smallint tags ('NULL')
sql_error create table st_smallint_3 using mt_smallint tags ('NULL')
sql_error create table st_smallint_4 using mt_smallint tags ("NULL")
sql_error create table st_smallint_5 using mt_smallint tags ("NULL")
sql create table st_smallint_6 using mt_smallint tags (-32767)
sql select tagname from st_smallint_6
if $data00 != -32767 then
sql show tags from st_smallint_6
if $data05 != -32767 then
return -1
endi
sql create table st_smallint_7 using mt_smallint tags (32767)
sql select tagname from st_smallint_7
if $data00 != 32767 then
sql show tags from st_smallint_7
if $data05 != 32767 then
return -1
endi
sql create table st_smallint_8 using mt_smallint tags (37)
sql select tagname from st_smallint_8
if $data00 != 37 then
sql show tags from st_smallint_8
if $data05 != 37 then
return -1
endi
sql create table st_smallint_9 using mt_smallint tags (-100)
sql select tagname from st_smallint_9
if $data00 != -100 then
sql show tags from st_smallint_9
if $data05 != -100 then
return -1
endi
sql create table st_smallint_10 using mt_smallint tags (+113)
sql select tagname from st_smallint_10
if $data00 != 113 then
sql show tags from st_smallint_10
if $data05 != 113 then
return -1
endi
sql create table st_smallint_11 using mt_smallint tags ('-100')
sql select tagname from st_smallint_11
if $data00 != -100 then
sql show tags from st_smallint_11
if $data05 != -100 then
return -1
endi
sql create table st_smallint_12 using mt_smallint tags ("+78")
sql select tagname from st_smallint_12
if $data00 != 78 then
sql show tags from st_smallint_12
if $data05 != 78 then
return -1
endi
sql create table st_smallint_13 using mt_smallint tags (+0078)
sql select tagname from st_smallint_13
if $data00 != 78 then
sql show tags from st_smallint_13
if $data05 != 78 then
return -1
endi
sql create table st_smallint_14 using mt_smallint tags (-00078)
sql select tagname from st_smallint_14
if $data00 != -78 then
sql show tags from st_smallint_14
if $data05 != -78 then
return -1
endi
@ -101,38 +98,6 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_2 values (now, 'NULL')
sql select * from st_smallint_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_3 values (now, 'NULL')
sql select * from st_smallint_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_4 values (now, "NULL")
sql select * from st_smallint_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_5 values (now, "NULL")
sql select * from st_smallint_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_6 values (now, 32767)
sql select * from st_smallint_6
if $rows != 1 then
@ -210,8 +175,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_smallint_16 using mt_smallint tags (NULL) values (now, NULL)
sql select tagname from st_smallint_16
if $data00 != NULL then
sql show tags from st_smallint_16
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_16
@ -220,8 +185,8 @@ if $data01 != NULL then
endi
sql insert into st_smallint_17 using mt_smallint tags (NULL) values (now, NULL)
sql select tagname from st_smallint_17
if $data00 != NULL then
sql show tags from st_smallint_17
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_17
@ -229,8 +194,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_18 using mt_smallint tags ('NULL') values (now, 'NULL')
sql select tagname from st_smallint_18
if $data00 != NULL then
sql show tags from st_smallint_18
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_18
@ -238,8 +203,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_19 using mt_smallint tags ('NULL') values (now, 'NULL')
sql select tagname from st_smallint_19
if $data00 != NULL then
sql show tags from st_smallint_19
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_19
@ -247,8 +212,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_20 using mt_smallint tags ("NULL") values (now, "NULL")
sql select tagname from st_smallint_20
if $data00 != NULL then
sql show tags from st_smallint_20
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_20
@ -256,8 +221,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_21 using mt_smallint tags ("NULL") values (now, "NULL")
sql select tagname from st_smallint_21
if $data00 != NULL then
sql show tags from st_smallint_21
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_21
@ -265,8 +230,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_22 using mt_smallint tags (32767) values (now, 32767)
sql select tagname from st_smallint_22
if $data00 != 32767 then
sql show tags from st_smallint_22
if $data05 != 32767 then
return -1
endi
sql select * from st_smallint_22
@ -274,8 +239,8 @@ if $data01 != 32767 then
return -1
endi
sql insert into st_smallint_23 using mt_smallint tags (-32767) values (now, -32767)
sql select tagname from st_smallint_23
if $data00 != -32767 then
sql show tags from st_smallint_23
if $data05 != -32767 then
return -1
endi
sql select * from st_smallint_23
@ -283,8 +248,8 @@ if $data01 != -32767 then
return -1
endi
sql insert into st_smallint_24 using mt_smallint tags (10) values (now, 10)
sql select tagname from st_smallint_24
if $data00 != 10 then
sql show tags from st_smallint_24
if $data05 != 10 then
return -1
endi
sql select * from st_smallint_24
@ -292,8 +257,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_smallint_25 using mt_smallint tags ("-0") values (now, "-0")
sql select tagname from st_smallint_25
if $data00 != 0 then
sql show tags from st_smallint_25
if $data05 != 0 then
return -1
endi
sql select * from st_smallint_25
@ -301,8 +266,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_smallint_26 using mt_smallint tags ('123') values (now, '123')
sql select tagname from st_smallint_26
if $data00 != 123 then
sql show tags from st_smallint_26
if $data05 != 123 then
return -1
endi
sql select * from st_smallint_26
@ -310,8 +275,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_smallint_27 using mt_smallint tags (+056) values (now, +00056)
sql select tagname from st_smallint_27
if $data00 != 56 then
sql show tags from st_smallint_27
if $data05 != 56 then
return -1
endi
sql select * from st_smallint_27
@ -319,8 +284,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_smallint_28 using mt_smallint tags (-056) values (now, -0056)
sql select tagname from st_smallint_28
if $data00 != -56 then
sql show tags from st_smallint_28
if $data05 != -56 then
return -1
endi
sql select * from st_smallint_28
@ -330,49 +295,49 @@ endi
## case 03: alter tag values
#sql alter table st_smallint_0 set tag tagname=32767
#sql select tagname from st_smallint_0
#if $data00 != 32767 then
#sql show tags from st_smallint_0
#if $data05 != 32767 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=-32767
#sql select tagname from st_smallint_0
#if $data00 != -32767 then
#sql show tags from st_smallint_0
#if $data05 != -32767 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=+100
#sql select tagname from st_smallint_0
#if $data00 != 100 then
#sql show tags from st_smallint_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=-33
#sql select tagname from st_smallint_0
#if $data00 != -33 then
#sql show tags from st_smallint_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname='+98'
#sql select tagname from st_smallint_0
#if $data00 != 98 then
#sql show tags from st_smallint_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname='-076'
#sql select tagname from st_smallint_0
#if $data00 != -76 then
#sql show tags from st_smallint_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=+0012
#sql select tagname from st_smallint_0
#if $data00 != 12 then
#sql show tags from st_smallint_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=-00063
#sql select tagname from st_smallint_0
#if $data00 != -63 then
#sql show tags from st_smallint_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
sql_error create table st_smallint_e0 using mt_smallint tags (32768)
sql_error create table st_smallint_e0 using mt_smallint tags (-32768)
sql create table st_smallint_e0_0 using mt_smallint tags (-32768)
sql_error create table st_smallint_e0 using mt_smallint tags (3276899)
sql_error create table st_smallint_e0 using mt_smallint tags (-3276833)
#sql_error create table st_smallint_e0 using mt_smallint tags (12.80) truncate integer part
@ -382,7 +347,7 @@ sql_error create table st_smallint_e0 using mt_smallint tags ("123abc")
sql_error create table st_smallint_e0 using mt_smallint tags (abc)
sql_error create table st_smallint_e0 using mt_smallint tags ("abc")
sql_error create table st_smallint_e0 using mt_smallint tags (" ")
sql_error create table st_smallint_e0 using mt_smallint tags ('')
sql create table st_smallint_e0_1 using mt_smallint tags ('')
sql create table st_smallint_e0 using mt_smallint tags (123)
sql create table st_smallint_e1 using mt_smallint tags (123)
@ -399,7 +364,7 @@ sql create table st_smallint_e11 using mt_smallint tags (123)
sql create table st_smallint_e12 using mt_smallint tags (123)
sql_error insert into st_smallint_e0 values (now, 32768)
sql_error insert into st_smallint_e1 values (now, -32768)
sql insert into st_smallint_e1 values (now, -32768)
sql_error insert into st_smallint_e2 values (now, 42768)
sql_error insert into st_smallint_e3 values (now, -32769)
#sql_error insert into st_smallint_e4 values (now, 12.80)
@ -409,10 +374,10 @@ sql_error insert into st_smallint_e7 values (now, "123abc")
sql_error insert into st_smallint_e9 values (now, abc)
sql_error insert into st_smallint_e10 values (now, "abc")
sql_error insert into st_smallint_e11 values (now, " ")
sql_error insert into st_smallint_e12 values (now, '')
sql insert into st_smallint_e12 values (now, '')
sql_error insert into st_smallint_e13 using mt_smallint tags (033) values (now, 32768)
sql_error insert into st_smallint_e14 using mt_smallint tags (033) values (now, -32768)
sql insert into st_smallint_e14_1 using mt_smallint tags (033) values (now, -32768)
sql_error insert into st_smallint_e15 using mt_smallint tags (033) values (now, 32968)
sql_error insert into st_smallint_e16 using mt_smallint tags (033) values (now, -33768)
#sql_error insert into st_smallint_e17 using mt_smallint tags (033) values (now, 12.80)
@ -422,10 +387,10 @@ sql_error insert into st_smallint_e20 using mt_smallint tags (033) values (now,
sql_error insert into st_smallint_e22 using mt_smallint tags (033) values (now, abc)
sql_error insert into st_smallint_e23 using mt_smallint tags (033) values (now, "abc")
sql_error insert into st_smallint_e24 using mt_smallint tags (033) values (now, " ")
sql_error insert into st_smallint_e25 using mt_smallint tags (033) values (now, '')
sql insert into st_smallint_e25_1 using mt_smallint tags (033) values (now, '')
sql_error insert into st_smallint_e13 using mt_smallint tags (32768) values (now, -033)
sql_error insert into st_smallint_e14 using mt_smallint tags (-32768) values (now, -033)
sql insert into st_smallint_e14 using mt_smallint tags (-32768) values (now, -033)
sql_error insert into st_smallint_e15 using mt_smallint tags (72768) values (now, -033)
sql_error insert into st_smallint_e16 using mt_smallint tags (-92768) values (now, -033)
#sql_error insert into st_smallint_e17 using mt_smallint tags (12.80) values (now, -033)
@ -435,7 +400,7 @@ sql_error insert into st_smallint_e20 using mt_smallint tags ("123abc") values (
sql_error insert into st_smallint_e22 using mt_smallint tags (abc) values (now, -033)
sql_error insert into st_smallint_e23 using mt_smallint tags ("abc") values (now, -033)
sql_error insert into st_smallint_e24 using mt_smallint tags (" ") values (now, -033)
sql_error insert into st_smallint_e25 using mt_smallint tags ('') values (now, -033)
sql insert into st_smallint_e25 using mt_smallint tags ('') values (now, -033)
sql insert into st_smallint_e13 using mt_smallint tags (033) values (now, 00062)
sql insert into st_smallint_e14 using mt_smallint tags (033) values (now, 00062)
@ -452,7 +417,7 @@ sql insert into st_smallint_e24 using mt_smallint tags (033) values (now, 00062)
sql insert into st_smallint_e25 using mt_smallint tags (033) values (now, 00062)
sql_error alter table st_smallint_e13 set tag tagname=32768
sql_error alter table st_smallint_e14 set tag tagname=-32768
sql alter table st_smallint_e14 set tag tagname=-32768
sql_error alter table st_smallint_e15 set tag tagname=52768
sql_error alter table st_smallint_e16 set tag tagname=-32778
sql_error alter table st_smallint_e19 set tag tagname=123abc
@ -460,4 +425,4 @@ sql_error alter table st_smallint_e20 set tag tagname="123abc"
sql_error alter table st_smallint_e22 set tag tagname=abc
sql_error alter table st_smallint_e23 set tag tagname="abc"
sql_error alter table st_smallint_e24 set tag tagname=" "
sql_error alter table st_smallint_e25 set tag tagname=''
sql alter table st_smallint_e25 set tag tagname=''

View File

@ -1,4 +1,12 @@
sql create database if not exists db
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
@ -9,79 +17,65 @@ sql create table mt_tinyint (ts timestamp, c tinyint) tags (tagname tinyint)
## case 00: static create table for test tag values
sql create table st_tinyint_0 using mt_tinyint tags (NULL)
sql select tagname from st_tinyint_0
if $data00 != NULL then
print expect NULL, actually: $data00
sql show tags from st_tinyint_0
if $data05 != NULL then
print expect NULL, actually: $data05
return -1
endi
sql create table st_tinyint_1 using mt_tinyint tags (NULL)
sql select tagname from st_tinyint_1
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_2 using mt_tinyint tags ('NULL')
sql select tagname from st_tinyint_2
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_3 using mt_tinyint tags ('NULL')
sql select tagname from st_tinyint_3
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_4 using mt_tinyint tags ("NULL")
sql select tagname from st_tinyint_4
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_5 using mt_tinyint tags ("NULL")
sql select tagname from st_tinyint_5
if $data00 != NULL then
sql show tags from st_tinyint_1
if $data05 != NULL then
return -1
endi
sql_error create table st_tinyint_2 using mt_tinyint tags ('NULL')
sql_error create table st_tinyint_3 using mt_tinyint tags ('NULL')
sql_error create table st_tinyint_4 using mt_tinyint tags ("NULL")
sql_error create table st_tinyint_5 using mt_tinyint tags ("NULL")
sql create table st_tinyint_6 using mt_tinyint tags (-127)
sql select tagname from st_tinyint_6
if $data00 != -127 then
sql show tags from st_tinyint_6
if $data05 != -127 then
return -1
endi
sql create table st_tinyint_7 using mt_tinyint tags (127)
sql select tagname from st_tinyint_7
if $data00 != 127 then
sql show tags from st_tinyint_7
if $data05 != 127 then
return -1
endi
sql create table st_tinyint_8 using mt_tinyint tags (37)
sql select tagname from st_tinyint_8
if $data00 != 37 then
sql show tags from st_tinyint_8
if $data05 != 37 then
return -1
endi
sql create table st_tinyint_9 using mt_tinyint tags (-100)
sql select tagname from st_tinyint_9
if $data00 != -100 then
sql show tags from st_tinyint_9
if $data05 != -100 then
return -1
endi
sql create table st_tinyint_10 using mt_tinyint tags (+113)
sql select tagname from st_tinyint_10
if $data00 != 113 then
sql show tags from st_tinyint_10
if $data05 != 113 then
return -1
endi
sql create table st_tinyint_11 using mt_tinyint tags ('-100')
sql select tagname from st_tinyint_11
if $data00 != -100 then
sql show tags from st_tinyint_11
if $data05 != -100 then
return -1
endi
sql create table st_tinyint_12 using mt_tinyint tags ("+78")
sql select tagname from st_tinyint_12
if $data00 != 78 then
sql show tags from st_tinyint_12
if $data05 != 78 then
return -1
endi
sql create table st_tinyint_13 using mt_tinyint tags (+0078)
sql select tagname from st_tinyint_13
if $data00 != 78 then
sql show tags from st_tinyint_13
if $data05 != 78 then
return -1
endi
sql create table st_tinyint_14 using mt_tinyint tags (-00078)
sql select tagname from st_tinyint_14
if $data00 != -78 then
sql show tags from st_tinyint_14
if $data05 != -78 then
return -1
endi
@ -102,38 +96,6 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_2 values (now, 'NULL')
sql select * from st_tinyint_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_3 values (now, 'NULL')
sql select * from st_tinyint_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_4 values (now, "NULL")
sql select * from st_tinyint_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_5 values (now, "NULL")
sql select * from st_tinyint_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_6 values (now, 127)
sql select * from st_tinyint_6
if $rows != 1 then
@ -211,8 +173,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_tinyint_16 using mt_tinyint tags (NULL) values (now, NULL)
sql select tagname from st_tinyint_16
if $data00 != NULL then
sql show tags from st_tinyint_16
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_16
@ -221,8 +183,8 @@ if $data01 != NULL then
endi
sql insert into st_tinyint_17 using mt_tinyint tags (NULL) values (now, NULL)
sql select tagname from st_tinyint_17
if $data00 != NULL then
sql show tags from st_tinyint_17
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_17
@ -230,8 +192,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_18 using mt_tinyint tags ('NULL') values (now, 'NULL')
sql select tagname from st_tinyint_18
if $data00 != NULL then
sql show tags from st_tinyint_18
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_18
@ -239,8 +201,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_19 using mt_tinyint tags ('NULL') values (now, 'NULL')
sql select tagname from st_tinyint_19
if $data00 != NULL then
sql show tags from st_tinyint_19
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_19
@ -248,8 +210,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_20 using mt_tinyint tags ("NULL") values (now, "NULL")
sql select tagname from st_tinyint_20
if $data00 != NULL then
sql show tags from st_tinyint_20
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_20
@ -257,8 +219,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_21 using mt_tinyint tags ("NULL") values (now, "NULL")
sql select tagname from st_tinyint_21
if $data00 != NULL then
sql show tags from st_tinyint_21
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_21
@ -266,8 +228,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_22 using mt_tinyint tags (127) values (now, 127)
sql select tagname from st_tinyint_22
if $data00 != 127 then
sql show tags from st_tinyint_22
if $data05 != 127 then
return -1
endi
sql select * from st_tinyint_22
@ -275,8 +237,8 @@ if $data01 != 127 then
return -1
endi
sql insert into st_tinyint_23 using mt_tinyint tags (-127) values (now, -127)
sql select tagname from st_tinyint_23
if $data00 != -127 then
sql show tags from st_tinyint_23
if $data05 != -127 then
return -1
endi
sql select * from st_tinyint_23
@ -284,8 +246,8 @@ if $data01 != -127 then
return -1
endi
sql insert into st_tinyint_24 using mt_tinyint tags (10) values (now, 10)
sql select tagname from st_tinyint_24
if $data00 != 10 then
sql show tags from st_tinyint_24
if $data05 != 10 then
return -1
endi
sql select * from st_tinyint_24
@ -293,8 +255,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_tinyint_25 using mt_tinyint tags ("-0") values (now, "-0")
sql select tagname from st_tinyint_25
if $data00 != 0 then
sql show tags from st_tinyint_25
if $data05 != 0 then
return -1
endi
sql select * from st_tinyint_25
@ -302,8 +264,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_tinyint_26 using mt_tinyint tags ('123') values (now, '123')
sql select tagname from st_tinyint_26
if $data00 != 123 then
sql show tags from st_tinyint_26
if $data05 != 123 then
return -1
endi
sql select * from st_tinyint_26
@ -311,8 +273,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_tinyint_27 using mt_tinyint tags (+056) values (now, +00056)
sql select tagname from st_tinyint_27
if $data00 != 56 then
sql show tags from st_tinyint_27
if $data05 != 56 then
return -1
endi
sql select * from st_tinyint_27
@ -320,8 +282,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_tinyint_28 using mt_tinyint tags (-056) values (now, -0056)
sql select tagname from st_tinyint_28
if $data00 != -56 then
sql show tags from st_tinyint_28
if $data05 != -56 then
return -1
endi
sql select * from st_tinyint_28
@ -331,49 +293,49 @@ endi
## case 03: alter tag values
#sql alter table st_tinyint_0 set tag tagname=127
#sql select tagname from st_tinyint_0
#if $data00 != 127 then
#sql show tags from st_tinyint_0
#if $data05 != 127 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=-127
#sql select tagname from st_tinyint_0
#if $data00 != -127 then
#sql show tags from st_tinyint_0
#if $data05 != -127 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=+100
#sql select tagname from st_tinyint_0
#if $data00 != 100 then
#sql show tags from st_tinyint_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=-33
#sql select tagname from st_tinyint_0
#if $data00 != -33 then
#sql show tags from st_tinyint_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname='+98'
#sql select tagname from st_tinyint_0
#if $data00 != 98 then
#sql show tags from st_tinyint_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname='-076'
#sql select tagname from st_tinyint_0
#if $data00 != -76 then
#sql show tags from st_tinyint_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=+0012
#sql select tagname from st_tinyint_0
#if $data00 != 12 then
#sql show tags from st_tinyint_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=-00063
#sql select tagname from st_tinyint_0
#if $data00 != -63 then
#sql show tags from st_tinyint_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
sql_error create table st_tinyint_e0 using mt_tinyint tags (128)
sql_error create table st_tinyint_e0 using mt_tinyint tags (-128)
sql create table st_tinyint_e0_1 using mt_tinyint tags (-128)
sql_error create table st_tinyint_e0 using mt_tinyint tags (1280)
sql_error create table st_tinyint_e0 using mt_tinyint tags (-1280)
#sql_error create table st_tinyint_e0 using mt_tinyint tags (12.80) truncate integer part
@ -383,7 +345,7 @@ sql_error create table st_tinyint_e0 using mt_tinyint tags ("123abc")
sql_error create table st_tinyint_e0 using mt_tinyint tags (abc)
sql_error create table st_tinyint_e0 using mt_tinyint tags ("abc")
sql_error create table st_tinyint_e0 using mt_tinyint tags (" ")
sql_error create table st_tinyint_e0 using mt_tinyint tags ('')
sql create table st_tinyint_e0_2 using mt_tinyint tags ('')
sql create table st_tinyint_e0 using mt_tinyint tags (123)
sql create table st_tinyint_e1 using mt_tinyint tags (123)
@ -400,7 +362,7 @@ sql create table st_tinyint_e11 using mt_tinyint tags (123)
sql create table st_tinyint_e12 using mt_tinyint tags (123)
sql_error insert into st_tinyint_e0 values (now, 128)
sql_error insert into st_tinyint_e1 values (now, -128)
sql insert into st_tinyint_e1 values (now, -128)
sql_error insert into st_tinyint_e2 values (now, 1280)
sql_error insert into st_tinyint_e3 values (now, -1280)
#sql_error insert into st_tinyint_e4 values (now, 12.80)
@ -410,10 +372,10 @@ sql_error insert into st_tinyint_e7 values (now, "123abc")
sql_error insert into st_tinyint_e9 values (now, abc)
sql_error insert into st_tinyint_e10 values (now, "abc")
sql_error insert into st_tinyint_e11 values (now, " ")
sql_error insert into st_tinyint_e12 values (now, '')
sql insert into st_tinyint_e12 values (now, '')
sql_error insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 128)
sql_error insert into st_tinyint_e14 using mt_tinyint tags (033) values (now, -128)
sql insert into st_tinyint_e14_1 using mt_tinyint tags (033) values (now, -128)
sql_error insert into st_tinyint_e15 using mt_tinyint tags (033) values (now, 1280)
sql_error insert into st_tinyint_e16 using mt_tinyint tags (033) values (now, -1280)
#sql_error insert into st_tinyint_e17 using mt_tinyint tags (033) values (now, 12.80)
@ -423,10 +385,10 @@ sql_error insert into st_tinyint_e20 using mt_tinyint tags (033) values (now, "1
sql_error insert into st_tinyint_e22 using mt_tinyint tags (033) values (now, abc)
sql_error insert into st_tinyint_e23 using mt_tinyint tags (033) values (now, "abc")
sql_error insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, " ")
sql_error insert into st_tinyint_e25 using mt_tinyint tags (033) values (now, '')
sql insert into st_tinyint_e25_2 using mt_tinyint tags (033) values (now, '')
sql_error insert into st_tinyint_e13 using mt_tinyint tags (128) values (now, -033)
sql_error insert into st_tinyint_e14 using mt_tinyint tags (-128) values (now, -033)
sql insert into st_tinyint_e14 using mt_tinyint tags (-128) values (now, -033)
sql_error insert into st_tinyint_e15 using mt_tinyint tags (1280) values (now, -033)
sql_error insert into st_tinyint_e16 using mt_tinyint tags (-1280) values (now, -033)
#sql_error insert into st_tinyint_e17 using mt_tinyint tags (12.80) values (now, -033)
@ -436,7 +398,7 @@ sql_error insert into st_tinyint_e20 using mt_tinyint tags ("123abc") values (no
sql_error insert into st_tinyint_e22 using mt_tinyint tags (abc) values (now, -033)
sql_error insert into st_tinyint_e23 using mt_tinyint tags ("abc") values (now, -033)
sql_error insert into st_tinyint_e24 using mt_tinyint tags (" ") values (now, -033)
sql_error insert into st_tinyint_e25 using mt_tinyint tags ('') values (now, -033)
sql insert into st_tinyint_e25 using mt_tinyint tags ('') values (now, -033)
sql insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 00062)
sql insert into st_tinyint_e14 using mt_tinyint tags (033) values (now, 00062)
@ -453,7 +415,7 @@ sql insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, 00062)
sql insert into st_tinyint_e25 using mt_tinyint tags (033) values (now, 00062)
sql_error alter table st_tinyint_e13 set tag tagname=128
sql_error alter table st_tinyint_e14 set tag tagname=-128
sql alter table st_tinyint_e14 set tag tagname=-128
sql_error alter table st_tinyint_e15 set tag tagname=1280
sql_error alter table st_tinyint_e16 set tag tagname=-1280
sql_error alter table st_tinyint_e19 set tag tagname=123abc
@ -461,4 +423,4 @@ sql_error alter table st_tinyint_e20 set tag tagname="123abc"
sql_error alter table st_tinyint_e22 set tag tagname=abc
sql_error alter table st_tinyint_e23 set tag tagname="abc"
sql_error alter table st_tinyint_e24 set tag tagname=" "
sql_error alter table st_tinyint_e25 set tag tagname=''
sql alter table st_tinyint_e25 set tag tagname=''

View File

@ -1,4 +1,12 @@
sql create database if not exists db
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
sql drop table if exists mt_unsigned;
@ -10,28 +18,21 @@ sql alter table mt_unsigned_1 set tag t1=138;
sql alter table mt_unsigned_1 set tag t2=32769;
sql alter table mt_unsigned_1 set tag t3=294967295;
sql alter table mt_unsigned_1 set tag t4=446744073709551615;
sql insert into mt_unsigned_1 values (now, 0, 0, 0, 0, 0, 0, 0, 0, 0)
sql select t1,t2,t3,t4 from mt_unsigned_1
if $rows != 1 then
return -1
endi
print $data00, $data01, $data02, $data03
if $data00 != 138 then
print expect 138, actual: $data00
return -1
endi
print $data01, $data02, $data03
if $data01 != 32769 then
return -1
return -1
endi
if $data02 != 294967295 then
return -1
return -1
endi
if $data03 != 446744073709551615 then
return -1
return -1
endi
sql_error sql alter table mt_unsigned_1 set tag t1 = 999;
@ -44,10 +45,10 @@ sql_error create table mt_unsigned_3 using mt_unsigned tags(0, -1, 0, 0, 0, 0, 0
sql_error create table mt_unsigned_4 using mt_unsigned tags(0, 0, -1, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_5 using mt_unsigned tags(0, 0, 0, -1, 0, 0, 0, 0);
sql_error create table mt_unsigned_2 using mt_unsigned tags(255, 0, 0, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_3 using mt_unsigned tags(0, 65535, 0, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_4 using mt_unsigned tags(0, 0, 4294967295, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_5 using mt_unsigned tags(0, 0, 0, 18446744073709551615, 0, 0, 0, 0);
sql create table mt_unsigned_21 using mt_unsigned tags(255, 0, 0, 0, 0, 0, 0, 0);
sql create table mt_unsigned_31 using mt_unsigned tags(0, 65535, 0, 0, 0, 0, 0, 0);
sql create table mt_unsigned_41 using mt_unsigned tags(0, 0, 4294967295, 0, 0, 0, 0, 0);
sql create table mt_unsigned_51 using mt_unsigned tags(0, 0, 0, 18446744073709551615, 0, 0, 0, 0);
sql_error create table mt_unsigned_2 using mt_unsigned tags(999, 0, 0, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_3 using mt_unsigned tags(0, 95535, 0, 0, 0, 0, 0, 0);
@ -63,11 +64,6 @@ if $rows != 1 then
return -1;
endi
if $data00 != NULL then
print expect NULL, actual: $data00
return -1
endi
if $data01 != NULL then
return -1
endi
@ -87,82 +83,44 @@ sql_error insert into mt_unsigned_1 values(now, -1, NULL, NULL, NULL, NULL, NULL
sql_error insert into mt_unsigned_1 values(now, NULL, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, -1, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, NULL, -1, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, 65535, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, 4294967295, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, NULL, 18446744073709551615, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, NULL, 65535, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, NULL, NULL, 4294967295, NULL, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, NULL, NULL, NULL, 18446744073709551615, NULL, NULL, NULL, NULL, NULL);
sql select count(a),count(b),count(c),count(d), count(e) from mt_unsigned_1
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select a+b+c from mt_unsigned_1 where a is null;
if $rows != 1 then
return -1
endi
if $data00 != NULL then
print expect NULL, actual:$data00
return -1
endi
sql select count(*), a from mt_unsigned_1 group by a;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
sql select count(*), b from mt_unsigned_1 group by b;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 2 then
return -1
endi
sql select count(*), c from mt_unsigned_1 group by c;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 3 then
return -1
endi
sql select a+b+c from mt_unsigned_1 where a is null;
if $rows != 4 then
return -1
endi
sql select count(*), a from mt_unsigned_1 group by a;
if $rows != 4 then
return -1
endi
sql select count(*), b from mt_unsigned_1 group by b;
if $rows != 4 then
return -1
endi
sql select count(*), c from mt_unsigned_1 group by c;
if $rows != 4 then
return -1
endi
sql select count(*), d from mt_unsigned_1 group by d;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 4 then
if $rows != 4 then
return -1
endi