sys_tbname.sim 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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

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 sys_tbname;
sql use sys_tbname;
sql create stable st(ts timestamp, f int) tags(t int);
sql create table ct1 using st tags(1);
sql create table ct2 using st tags(2);

sql create table t (ts timestamp, f int);
sql insert into t values(now, 1)(now+1s, 2);


sql create table t2 (ts timestamp, f1 int, f2 int);
sql insert into t2 values(now, 0, 0)(now+1s, 1, 1);

sql select tbname from information_schema.ins_databases;
print $rows $data00
if $rows != 3 then
	return -1
endi
if $data00 != @ins_databases@ then
	return -1
endi
sql select distinct tbname from information_schema.ins_databases;
print $rows $data00
if $rows != 1 then
	return -1
endi
if $data00 != @ins_databases@ then
	return -1
endi

sql select tbname from information_schema.ins_stables;
print $rows $data00
if $rows != 1 then
	return -1
endi
if $data00 != @ins_stables@ then
	return -1
endi
sql select distinct tbname from information_schema.ins_stables;
print $rows $data00
if $rows != 1 then
	return -1
endi
if $data00 != @ins_stables@ then
	return -1
endi

54 55 56 57 58
sql select * from information_schema.ins_tables where table_name='';
if $rows != 0 then 
        return -1
endi

59 60
sql select tbname from information_schema.ins_tables;
print $rows $data00
wmmhello's avatar
wmmhello 已提交
61
if $rows != 33 then
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
	return -1
endi
if $data00 != @ins_tables@ then
	return -1
endi

sql select distinct tbname from information_schema.ins_tables;
print $rows $data00
if $rows != 1 then
	return -1
endi
if $data00 != @ins_tables@ then
	return -1
endi

sql select tbname from information_schema.ins_tags;
print $rows $data00
if $rows != 2 then
	return -1
endi
if $data00 != @ins_tags@ then
	return -1
endi
sql select distinct tbname from information_schema.ins_tags;
print $rows $data00
if $rows != 1 then
	return -1
endi
if $data00 != @ins_tags@ then
	return -1
endi

94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
sql create stable stb(ts timestamp, f int) tags(t1 int, t2 int, t3 int, t4 int, t5 int);

$i = 0
$tbNum = 1000
$tbPrefix = stb_tb
while $i < $tbNum
  $tb = $tbPrefix . $i
  sql create table $tb using stb tags( $i , $i , $i , $i , $i )

  $i = $i + 1
endw

sql select tag_value from information_schema.ins_tags where stable_name='stb';
if $rows != 5000 then
   print $rows
        return -1
endi

S
slzhou 已提交
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
sql create database d1;
sql create stable d1.st1 (ts timestamp, f int) tags(t int);
sql create stable d1.st2 (ts timestamp, f int) tags(t int);
sql create table d1.ct1 using d1.st1 tags(1);
sql create table d1.ct2 using d1.st2 tags(2);

sql create database d2;
sql create stable d2.st1(ts timestamp, f int) tags(t int);
sql create stable d2.st2(ts timestamp, f int) tags(t int);
sql create table d2.ct1 using d2.st1 tags(1);
sql create table d2.ct2 using d2.st2 tags(2);

sql create database d3;
sql create stable d3.st1(ts timestamp, f int) tags(t int);
sql create stable d3.st2(ts timestamp, f int) tags(t int);
sql create table d3.ct1 using d3.st1 tags(1);
sql create table d3.ct2 using d3.st2 tags(2);
sql select count(*), stable_name, db_name from information_schema.ins_tables where db_name != 'd2' group by stable_name,db_name
print $rows
if $rows != 9 then
  return -1
endi
134
#system sh/exec.sh -n dnode1 -s stop -x SIGINT