scalarNull.sim 2.2 KB
Newer Older
D
dapan1121 已提交
1 2 3 4 5 6
system sh/stop_dnodes.sh

system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1

7
print ========= start dnode1 as leader
D
dapan1121 已提交
8 9 10 11 12 13 14 15 16 17
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect

print ======== step1 
sql create database db1 vgroups 3;
sql use db1;
sql show databases;
sql create stable st1 (ts timestamp, f1 int, f2 binary(200)) tags(t1 int);
sql create table tb1 using st1 tags(1);
D
dapan1121 已提交
18 19 20 21 22 23 24 25 26
sql insert into tb1 values ('2022-04-26 15:15:00', 1, "a");
sql insert into tb1 values ('2022-04-26 15:15:01', 2, "b");
sql insert into tb1 values ('2022-04-26 15:15:02', 3, "c");
sql insert into tb1 values ('2022-04-26 15:15:03', 4, "d");
sql insert into tb1 values ('2022-04-26 15:15:04', 5, "e");
sql insert into tb1 values ('2022-04-26 15:15:05', 6, "f");
sql insert into tb1 values ('2022-04-26 15:15:06', null, null);
sql insert into tb1 values ('2022-04-26 15:15:07', null, "g");
sql insert into tb1 values ('2022-04-26 15:15:08', 7, null);
D
dapan1121 已提交
27

D
dapan1121 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
sql select * from tb1 where f1 in (1,2,3);
if $rows != 3 then
  return -1
endi
sql select * from tb1 where f1 <>3;
if $rows != 6 then
  return -1
endi
sql select * from tb1 where f1 in (1,2,3,null);
if $rows != 3 then
  return -1
endi
sql select * from tb1 where f1 not in (1,2,3,null);
if $rows != 0 then
  return -1
endi
sql select * from tb1 where f1 in (null);
if $rows != 0 then
  return -1
endi
sql select * from tb1 where f1 = null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where f1 <> null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where f1 + 3 <> null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where f1+1 <>3+null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where f1+1*null <>3+null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where null = null;
if $rows != 0 then
  return -1
endi
sql select * from tb1 where null <> null;
if $rows != 0 then
  return -1
endi
D
dapan1121 已提交
80

D
dapan1121 已提交
81 82 83 84 85
#TODO: ENABLE IT
#sql select * from tb1 where not (null <> null);
#if $rows != 9 then
#  return -1
#endi
D
dapan1121 已提交
86 87


D
dapan1121 已提交
88 89
#TODO: MOVE IT TO NORMAL CASE
sql_error select * from tb1 where not (null);
D
dapan1121 已提交
90 91 92


system sh/exec.sh -n dnode1 -s stop -x SIGINT