show_create_table.sim 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect

print ===============create three type table
sql create database db
sql use db
sql create table meters(ts timestamp, f binary(8)) tags(loc int, zone binary(8))
sql create table t0 using meters tags(1,'ch')
sql create table normalTbl(ts timestamp, zone binary(8))

sql use db
G
Ganlin Zhao 已提交
14 15
sql show create table meters
if $rows != 1 then
16 17 18 19 20
  return -1
endi

print ===============check sub table
sql show create table t0
G
Ganlin Zhao 已提交
21
if $rows != 1 then
22 23 24 25 26 27 28 29
  return -1
endi
if $data00 == 't0' then
  return -1
endi

print ===============check normal table

G
Ganlin Zhao 已提交
30 31
sql show create table normalTbl
if $rows != 1 then
32 33 34 35 36 37 38 39
  return -1
endi

if $data00 == 'normalTbl' then
  return -1
endi

print ===============check super table
G
Ganlin Zhao 已提交
40 41
sql show create table meters
if $rows != 1 then
42 43 44 45 46 47 48 49 50 51
  return -1
endi

if $data00 == 'meters' then
  return -1
endi

print ===============check sub table with prefix

sql show create table db.t0
G
Ganlin Zhao 已提交
52
if $rows != 1 then
53 54 55 56 57 58 59 60
  return -1
endi

if $data00 == 't0' then
  return -1
endi

print ===============check normal table with prefix
G
Ganlin Zhao 已提交
61 62
sql show create table db.normalTbl
if $rows != 1 then
63 64 65 66 67 68 69 70 71
  return -1
endi

if $data00 == 'normalTbl' then
  return -1
endi


print ===============check super table with prefix
G
Ganlin Zhao 已提交
72 73
sql show create table db.meters
if $rows != 1 then
74 75 76 77 78 79 80 81 82 83
  return -1
endi

if $data00 == 'meters' then
  return -1
endi

sql drop database db

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