system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 6 system sh/cfg.sh -n dnode1 -c cache -v 1 system sh/cfg.sh -n dnode1 -c minRows -v 10 system sh/exec.sh -n dnode1 -s start sleep 100 sql connect sql drop database if exists db sql create database if not exists db sql use db sql create table stb1 (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double) sql create table tb1 using stb1 tags(1,'1',1.0) sql create table tb2 using stb1 tags(2,'2',2.0) sql insert into tb1 values ('2021-11-11 09:00:00',true,1,1,1,1,1,1,"1","1",1,1,1,1); sql insert into tb1 values ('2021-11-11 09:00:01',true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); sql insert into tb1 values ('2021-11-11 09:00:02',true,2,NULL,2,NULL,2,NULL,"2",NULL,2,NULL,2,NULL); sql insert into tb1 values ('2021-11-11 09:00:03',false,NULL,3,NULL,3,NULL,3,NULL,"3",NULL,3,NULL,3); sql insert into tb1 values ('2021-11-11 09:00:04',true,4,4,4,4,4,4,"4","4",4,4,4,4); sql insert into tb1 values ('2021-11-11 09:00:05',true,127,32767,2147483647,9223372036854775807,3.402823466e+38,1.79769e+308,"5","5",254,65534,4294967294,9223372036854775807); sql insert into tb1 values ('2021-11-11 09:00:06',true,-127,-32767,-2147483647,-9223372036854775807,-3.402823466e+38,-1.79769e+308,"6","6",0,0,0,0); sql_error select cast(* as tinyint) from tb1; sql_error select cast(* as smallint) from tb1; sql_error select cast(* as int) from tb1; sql_error select cast(* as bool) from tb1; sql_error select cast(* as bigint) as a from tb1; sql_error select cast(* as bigint) + 1 as a from tb1; sql_error select cast(tb1.* as bigint) + 1 as a from tb1; sql_error select cast(* as bigint) from tb1; sql_error select cast(c1 + c2 as bigint) from tb1; sql_error select cast(c1 as binary(0)) from tb1; sql_error select cast(c1 as binary(-1)) from tb1; sql_error select cast(c1 as nchar(0)) from tb1; sql_error select cast(c1 as nchar(-1)) from tb1; sql_error select cast(c1 as tinyint) from tb1; sql_error select cast(c1 as bool) from tb1; sql_error select cast(c1 as smallint) from tb1; sql_error select cast(c1 as int) from tb1; sql_error select cast(c1 as float) from tb1; sql_error select cast(c1 as double) from tb1; sql_error select cast(c1 as tinyint unsigned) from tb1; sql_error select cast(c1 as smallint unsigned) from tb1; sql_error select cast(c1 as int unsigned) from tb1; sql_error select cast(c2 as binary(0)) from tb1; sql_error select cast(c2 as binary(-1)) from tb1; sql_error select cast(c2 as nchar(0)) from tb1; sql_error select cast(c2 as nchar(-1)) from tb1; sql_error select cast(c2 as tinyint) from tb1; sql_error select cast(c2 as bool) from tb1; sql_error select cast(c2 as smallint) from tb1; sql_error select cast(c2 as int) from tb1; sql_error select cast(c2 as float) from tb1; sql_error select cast(c2 as double) from tb1; sql_error select cast(c2 as tinyint unsigned) from tb1; sql_error select cast(c2 as smallint unsigned) from tb1; sql_error select cast(c2 as int unsigned) from tb1; sql select cast(c1 as bigint) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != 1 then return -1 endi if $data20 != 1 then return -1 endi if $data30 != 0 then return -1 endi if $data40 != 1 then return -1 endi if $data50 != 1 then return -1 endi if $data60 != 1 then return -1 endi sql select cast(c1 as binary(10)) from tb1; if $rows != 7 then return -1 endi if $data00 != true then return -1 endi if $data10 != true then return -1 endi if $data20 != true then return -1 endi if $data30 != false then return -1 endi if $data40 != true then return -1 endi if $data50 != true then return -1 endi if $data60 != true then return -1 endi sql select cast(c1 as binary(1)) from tb1; if $rows != 7 then return -1 endi if $data00 != t then return -1 endi if $data10 != t then return -1 endi if $data20 != t then return -1 endi if $data30 != f then return -1 endi if $data40 != t then return -1 endi if $data50 != t then return -1 endi if $data60 != t then return -1 endi sql select cast(c1 as timestamp) from tb1; if $rows != 7 then return -1 endi if $data00 != @70-01-01 08:00:00.001@ then return -1 endi if $data10 != @70-01-01 08:00:00.001@ then return -1 endi if $data20 != @70-01-01 08:00:00.001@ then return -1 endi if $data30 != @70-01-01 08:00:00.000@ then return -1 endi if $data40 != @70-01-01 08:00:00.001@ then return -1 endi if $data50 != @70-01-01 08:00:00.001@ then return -1 endi if $data60 != @70-01-01 08:00:00.001@ then return -1 endi sql select cast(c1 as nchar(10)) from tb1; if $rows != 7 then return -1 endi if $data00 != true then return -1 endi if $data10 != true then return -1 endi if $data20 != true then return -1 endi if $data30 != false then return -1 endi if $data40 != true then return -1 endi if $data50 != true then return -1 endi if $data60 != true then return -1 endi sql select cast(c1 as nchar(1)) from tb1; if $rows != 7 then return -1 endi if $data00 != t then return -1 endi if $data10 != t then return -1 endi if $data20 != t then return -1 endi if $data30 != f then return -1 endi if $data40 != t then return -1 endi if $data50 != t then return -1 endi if $data60 != t then return -1 endi sql select cast(c1 as bigint unsigned) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != 1 then return -1 endi if $data20 != 1 then return -1 endi if $data30 != 0 then return -1 endi if $data40 != 1 then return -1 endi if $data50 != 1 then return -1 endi if $data60 != 1 then return -1 endi sql select cast(c2 as bigint) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != 2 then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 4 then return -1 endi if $data50 != 127 then return -1 endi if $data60 != -127 then return -1 endi sql select cast(c2 as binary(10)) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != 2 then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 4 then return -1 endi if $data50 != 127 then return -1 endi if $data60 != -127 then return -1 endi sql select cast(c2 as binary(1)) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != 2 then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 4 then return -1 endi if $data50 != 1 then return -1 endi if $data60 != - then return -1 endi sql select cast(c2 as timestamp) from tb1; if $rows != 7 then return -1 endi if $data00 != @70-01-01 08:00:00.001@ then return -1 endi if $data10 != NULL then return -1 endi if $data20 != @70-01-01 08:00:00.002@ then return -1 endi if $data30 != NULL then return -1 endi if $data40 != @70-01-01 08:00:00.004@ then return -1 endi if $data50 != @70-01-01 08:00:00.127@ then return -1 endi if $data60 != @70-01-01 08:00:00.-127@ then print $data60 return -1 endi sql select cast(c2 as nchar(10)) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != 2 then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 4 then return -1 endi if $data50 != 127 then return -1 endi if $data60 != -127 then return -1 endi sql select cast(c2 as nchar(1)) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != 2 then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 4 then return -1 endi if $data50 != 1 then return -1 endi if $data60 != - then return -1 endi sql select cast(c2 as bigint unsigned) from tb1; if $rows != 7 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != 1 then return -1 endi if $data20 != 1 then return -1 endi if $data30 != 0 then return -1 endi if $data40 != 1 then return -1 endi if $data50 != 1 then return -1 endi if $data60 != 1 then return -1 endi sql select cast(c2 + c3 as bigint) from tb1; if $rows != 7 then return -1 endi if $data00 != 2 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != NULL then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 8 then return -1 endi if $data50 != 32894 then return -1 endi if $data60 != -32894 then return -1 endi sql select cast((c2 + c3) as bigint) from tb1; if $rows != 7 then return -1 endi if $data00 != 2 then return -1 endi if $data10 != NULL then return -1 endi if $data20 != NULL then return -1 endi if $data30 != NULL then return -1 endi if $data40 != 8 then return -1 endi if $data50 != 32894 then return -1 endi if $data60 != -32894 then return -1 endi sql select cast(c1 as bigint)+c2 from tb1; #system sh/exec.sh -n dnode1 -s stop -x SIGINT