fix RC
This commit is contained in:
parent
018356b8dd
commit
dabcf00ade
|
@ -1233,12 +1233,11 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
|
|
||||||
entry.version = version;
|
entry.version = version;
|
||||||
|
|
||||||
metaDeleteNcolIdx(pMeta, &oldEntry);
|
|
||||||
metaUpdateNcolIdx(pMeta, &entry);
|
|
||||||
|
|
||||||
// do actual write
|
// do actual write
|
||||||
metaWLock(pMeta);
|
metaWLock(pMeta);
|
||||||
|
|
||||||
|
metaDeleteNcolIdx(pMeta, &oldEntry);
|
||||||
|
metaUpdateNcolIdx(pMeta, &entry);
|
||||||
// save to table db
|
// save to table db
|
||||||
metaSaveToTbDb(pMeta, &entry);
|
metaSaveToTbDb(pMeta, &entry);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ print ======== step0
|
||||||
$dbPrefix = ta_3_db
|
$dbPrefix = ta_3_db
|
||||||
$tbPrefix = ta_3_tb
|
$tbPrefix = ta_3_tb
|
||||||
$mtPrefix = ta_3_mt
|
$mtPrefix = ta_3_mt
|
||||||
$tbNum = 10000
|
$tbNum = 1000000
|
||||||
$rowNum = 20
|
$rowNum = 20
|
||||||
$totalNum = 200
|
$totalNum = 200
|
||||||
|
|
||||||
|
@ -48,21 +48,178 @@ while $i < $tbNum
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
print ========== filter data
|
|
||||||
|
|
||||||
$i = 0
|
|
||||||
while $i < $tbNum
|
|
||||||
sql select count(*) from $mtPrefix where t2 = $i
|
|
||||||
$i = $i + 1
|
|
||||||
endw
|
|
||||||
|
|
||||||
sql create index ti2 on $mtPrefix (t2)
|
sql create index ti2 on $mtPrefix (t2)
|
||||||
|
|
||||||
|
print ==== test name conflict
|
||||||
|
#
|
||||||
|
sql_error create index ti3 on $mtPrefix(t2)
|
||||||
|
|
||||||
|
sql_error create index ti2 on $mtPrefix(t2)
|
||||||
|
sql_error create index ti2 on $mtPrefix(t1)
|
||||||
|
sql_error create index ti2 on $mtPrefix(t3)
|
||||||
|
sql_error create index ti2 on $mtPrefix(txx)
|
||||||
|
|
||||||
|
|
||||||
|
print ===== test operator equal
|
||||||
|
|
||||||
$i = 0
|
$i = 0
|
||||||
while $i < $tbNum
|
while $i < $tbNum
|
||||||
sql select count(*) from $mtPrefix where t2 = $i
|
sql select * from $mtPrefix where t2= $i ;
|
||||||
$i = $i + 1
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
||||||
|
|
||||||
|
print ===== test operator great equal
|
||||||
|
# great equal than
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
sql select * from $mtPrefix where t2 >= $i ;
|
||||||
|
$tmp = $tbNum - $i
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ===== test operator great
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
sql select * from $mtPrefix where t2 > $i ;
|
||||||
|
$tmp = $tbNum - $i
|
||||||
|
$tmp = $tmp - 1
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ===== test operator lower
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
sql select * from $mtPrefix where t2 <= $i ;
|
||||||
|
$tmp = $i + 1
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ===== test operator lower than
|
||||||
|
# lower equal than
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
sql select * from $mtPrefix where t2 < $i ;
|
||||||
|
$tmp = $i
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ===== add table after index created
|
||||||
|
$interval = $tbNum + $tbNum
|
||||||
|
$i = $interval
|
||||||
|
$limit = $interval + $tbNum
|
||||||
|
while $i < $limit
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql insert into $tb using $mtPrefix tags( $i , $i , $i , $i , $i ) values( now, $i )
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print ===== add table after index created (opeator great equal than)
|
||||||
|
# great equal than
|
||||||
|
$i = $interval
|
||||||
|
while $i < $limit
|
||||||
|
sql select * from $mtPrefix where t2 >= $i ;
|
||||||
|
$tmp = $limit - $i
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
print ===== add table after index created (opeator great than)
|
||||||
|
# great than
|
||||||
|
$i = $interval
|
||||||
|
while $i < $limit
|
||||||
|
sql select * from $mtPrefix where t2 > $i ;
|
||||||
|
$tmp = $limit - $i
|
||||||
|
$tmp = $tmp - 1
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ===== drop table after index created
|
||||||
|
|
||||||
|
# drop table
|
||||||
|
$dropTbNum = $tbNum / 2
|
||||||
|
$i = 0
|
||||||
|
|
||||||
|
while $i < $tbNum
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql drop table $tb
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ===== drop table after index created(opeator lower than)
|
||||||
|
|
||||||
|
# lower equal than
|
||||||
|
$i = $interval
|
||||||
|
while $i < $limit
|
||||||
|
sql select * from $mtPrefix where t2 < $i ;
|
||||||
|
$tmp = $i - $interval
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
print ===== drop table after index created(opeator lower equal than)
|
||||||
|
|
||||||
|
# lower equal than
|
||||||
|
$i = $interval
|
||||||
|
while $i < $limit
|
||||||
|
sql select * from $mtPrefix where t2 <= $i ;
|
||||||
|
|
||||||
|
$tmp = $i - $interval
|
||||||
|
$tmp = $tmp + 1
|
||||||
|
if $rows != $tmp then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
print === show index
|
||||||
|
|
||||||
|
sql select * from information_schema.ins_indexes
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
print === drop index ti2
|
||||||
|
sql drop index ti2
|
||||||
|
|
||||||
|
print === drop not exist index
|
||||||
|
sql_error drop index t2
|
||||||
|
sql_error drop index t3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sql_error create index ti0 on $mtPrefix (t1)
|
||||||
|
sql_error create index t2i on ta_3_tb17 (t2)
|
||||||
|
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
Loading…
Reference in New Issue