user_create.sim 1.1 KB
Newer Older
S
slguan 已提交
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 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 80
sql connect
sleep 3000

print =============== step1
sql show users
if $rows != 3 then 
  return -1
endi

sql create user read PASS 'pass123'
sql create user read PASS 'pass123' -x step1
	return -1
step1:

sql show users
if $rows != 4 then 
  return -1
endi

sql alter user read PASS 'taosdata'

print =============== step2
sql close
sql connect read
sleep 2000

sql alter user read PASS 'taosdata'

print =============== step3
sql drop user read -x step31
  return -1
step31:
sql drop user sys -x step32
  return -1
step32:
sql drop user stream -x step33
  return -1
step33:

print =============== step4
sql close
sql connect
sleep 2000

sql alter user read privilege read
sql show users
if $data1_read != read then 
  return -1
endi

sql alter user read privilege super
sql show users
if $data1_read != super then 
  return -1
endi

sql alter user read privilege write
sql show users
if $data1_read != write then 
  return -1
endi

sql alter user read privilege 1 -x step43
  return -1
step43:

sql drop user sys -x step41
  return -1
step41:

sql drop user stream -x step42
  return -1
step42:

sql drop user read