scalarNull.sim 2.1 KB
Newer Older
D
dapan1121 已提交
1 2 3 4 5
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect

6
print ======== step1
D
dapan1121 已提交
7 8
sql create database db1 vgroups 3;
sql use db1;
X
Xiaoyu Wang 已提交
9
sql select * from information_schema.ins_databases;
D
dapan1121 已提交
10 11
sql create stable st1 (ts timestamp, f1 int, f2 binary(200)) tags(t1 int);
sql create table tb1 using st1 tags(1);
D
dapan1121 已提交
12 13 14 15 16 17 18 19 20
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 已提交
21

D
dapan1121 已提交
22 23 24 25 26 27 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
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;
63
print $rows
D
dapan1121 已提交
64 65 66 67 68 69 70 71 72 73 74
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 已提交
75

D
dapan1121 已提交
76 77 78 79 80
#TODO: ENABLE IT
#sql select * from tb1 where not (null <> null);
#if $rows != 9 then
#  return -1
#endi
D
dapan1121 已提交
81 82


D
dapan1121 已提交
83 84
#TODO: MOVE IT TO NORMAL CASE
sql_error select * from tb1 where not (null);
D
dapan1121 已提交
85 86

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