Merge pull request #16213 from taosdata/fix/TD-18487
fix(query): restrict interp input type to numerical type only
This commit is contained in:
commit
fdb94e3db3
|
@ -1503,11 +1503,17 @@ static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
|
||||||
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, 0));
|
||||||
|
uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type;
|
||||||
|
if (!IS_NUMERIC_TYPE(paraType) || QUERY_NODE_VALUE == nodeType) {
|
||||||
|
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
|
}
|
||||||
|
|
||||||
if (3 <= numOfParams) {
|
if (3 <= numOfParams) {
|
||||||
int64_t timeVal[2] = {0};
|
int64_t timeVal[2] = {0};
|
||||||
for (int32_t i = 1; i < 3; ++i) {
|
for (int32_t i = 1; i < 3; ++i) {
|
||||||
uint8_t nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, i));
|
nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, i));
|
||||||
uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, i))->resType.type;
|
paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, i))->resType.type;
|
||||||
if (!IS_VAR_DATA_TYPE(paraType) || QUERY_NODE_VALUE != nodeType) {
|
if (!IS_VAR_DATA_TYPE(paraType) || QUERY_NODE_VALUE != nodeType) {
|
||||||
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
}
|
}
|
||||||
|
@ -1525,8 +1531,8 @@ static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (4 == numOfParams) {
|
if (4 == numOfParams) {
|
||||||
uint8_t nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, 3));
|
nodeType = nodeType(nodesListGetNode(pFunc->pParameterList, 3));
|
||||||
uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 3))->resType.type;
|
paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 3))->resType.type;
|
||||||
if (!IS_INTEGER_TYPE(paraType) || QUERY_NODE_VALUE != nodeType) {
|
if (!IS_INTEGER_TYPE(paraType) || QUERY_NODE_VALUE != nodeType) {
|
||||||
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ print ========== cached_schema_after_alter.sim
|
||||||
|
|
||||||
sql drop database $db -x step1
|
sql drop database $db -x step1
|
||||||
step1:
|
step1:
|
||||||
sql create database $db
|
sql create database $db
|
||||||
print ====== create tables
|
print ====== create tables
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
|
@ -32,10 +32,10 @@ if $rows != 1 then
|
||||||
endi
|
endi
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != 1 then
|
if $data02 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from $tb2
|
sql select * from $tb2
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
|
@ -43,10 +43,10 @@ if $rows != 1 then
|
||||||
endi
|
endi
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != 1 then
|
if $data02 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================== restart server to commit data into disk
|
print ================== restart server to commit data into disk
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
@ -61,10 +61,10 @@ if $rows != 1 then
|
||||||
endi
|
endi
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != 1 then
|
if $data02 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from $tb2
|
sql select * from $tb2
|
||||||
print select * from $tb2 ==> $data00 $data01 $data02
|
print select * from $tb2 ==> $data00 $data01 $data02
|
||||||
|
@ -73,10 +73,10 @@ if $rows != 1 then
|
||||||
endi
|
endi
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != 1 then
|
if $data02 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$ts = $ts0 + $delta
|
$ts = $ts0 + $delta
|
||||||
sql insert into $tb2 values ( $ts , 2, 2)
|
sql insert into $tb2 values ( $ts , 2, 2)
|
||||||
|
@ -86,16 +86,16 @@ if $rows != 2 then
|
||||||
endi
|
endi
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != 1 then
|
if $data02 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data11 != 2 then
|
if $data11 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data12 != 2 then
|
if $data12 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from $tb2 order by ts asc
|
sql select * from $tb2 order by ts asc
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
|
@ -103,15 +103,15 @@ if $rows != 2 then
|
||||||
endi
|
endi
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != 1 then
|
if $data02 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data11 != 2 then
|
if $data11 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data12 != 2 then
|
if $data12 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
sql alter dnode 1 'resetlog'
|
sql alter dnode 1 'resetlog'
|
||||||
sql alter dnode 1 'monitor' '1'
|
sql alter dnode 1 'monitor' '1'
|
||||||
sql alter dnode 1 'monitor' '0'
|
sql alter dnode 1 'monitor' '0'
|
||||||
|
@ -65,4 +65,4 @@ sql alter dnode 1 balance "vnode:2-dnode:1" -x step4
|
||||||
step4:
|
step4:
|
||||||
|
|
||||||
print ======= over
|
print ======= over
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
sql create database d1
|
sql create database d1
|
||||||
sql use d1
|
sql use d1
|
||||||
sql create table tb (ts timestamp, a int)
|
sql create table tb (ts timestamp, a int)
|
||||||
|
|
|
@ -7,24 +7,24 @@ sql connect
|
||||||
|
|
||||||
print =============== select * from information_schema.ins_dnodes
|
print =============== select * from information_schema.ins_dnodes
|
||||||
sql select * from information_schema.ins_dnodes;
|
sql select * from information_schema.ins_dnodes;
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 1 then
|
if $data00 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from information_schema.ins_mnodes;
|
sql select * from information_schema.ins_mnodes;
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 1 then
|
if $data00 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data02 != leader then
|
if $data02 != leader then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -33,62 +33,62 @@ sql create dnode $hostname port 7200
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
|
||||||
sql select * from information_schema.ins_dnodes;
|
sql select * from information_schema.ins_dnodes;
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 1 then
|
if $data00 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data10 != 2 then
|
if $data10 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print $data02
|
print $data02
|
||||||
if $data02 != 0 then
|
if $data02 != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data12 != 0 then
|
if $data12 != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data04 != ready then
|
if $data04 != ready then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data14 != ready then
|
if $data14 != ready then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from information_schema.ins_mnodes;
|
sql select * from information_schema.ins_mnodes;
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 1 then
|
if $data00 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data02 != leader then
|
if $data02 != leader then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#print =============== create drop bnode 1
|
#print =============== create drop bnode 1
|
||||||
#sql create bnode on dnode 1
|
#sql create bnode on dnode 1
|
||||||
#sql show bnodes
|
#sql show bnodes
|
||||||
#if $rows != 1 then
|
#if $rows != 1 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#if $data00 != 1 then
|
#if $data00 != 1 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql_error create bnode on dnode 1
|
#sql_error create bnode on dnode 1
|
||||||
#
|
#
|
||||||
#sql drop bnode on dnode 1
|
#sql drop bnode on dnode 1
|
||||||
#sql show bnodes
|
#sql show bnodes
|
||||||
#if $rows != 0 then
|
#if $rows != 0 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql_error drop bnode on dnode 1
|
#sql_error drop bnode on dnode 1
|
||||||
|
@ -96,17 +96,17 @@ endi
|
||||||
#print =============== create drop bnode 2
|
#print =============== create drop bnode 2
|
||||||
#sql create bnode on dnode 2
|
#sql create bnode on dnode 2
|
||||||
#sql show bnodes
|
#sql show bnodes
|
||||||
#if $rows != 1 then
|
#if $rows != 1 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#if $data00 != 2 then
|
#if $data00 != 2 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql_error create bnode on dnode 2
|
#sql_error create bnode on dnode 2
|
||||||
#
|
#
|
||||||
#sql drop bnode on dnode 2
|
#sql drop bnode on dnode 2
|
||||||
#sql show bnodes
|
#sql show bnodes
|
||||||
#if $rows != 0 then
|
#if $rows != 0 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql_error drop bnode on dnode 2
|
#sql_error drop bnode on dnode 2
|
||||||
|
@ -115,7 +115,7 @@ endi
|
||||||
#sql create bnode on dnode 1
|
#sql create bnode on dnode 1
|
||||||
#sql create bnode on dnode 2
|
#sql create bnode on dnode 2
|
||||||
#sql show bnodes
|
#sql show bnodes
|
||||||
#if $rows != 2 then
|
#if $rows != 2 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ endi
|
||||||
#
|
#
|
||||||
#sleep 2000
|
#sleep 2000
|
||||||
#sql show bnodes
|
#sql show bnodes
|
||||||
#if $rows != 2 then
|
#if $rows != 2 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -93,18 +93,18 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$i = 2
|
$i = 2
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$tb = $tbPrefix . $i
|
$tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -25,7 +25,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -95,18 +95,18 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$i = 2
|
$i = 2
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$tb = $tbPrefix . $i
|
$tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -26,7 +26,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -96,18 +96,18 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$i = 2
|
$i = 2
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$tb = $tbPrefix . $i
|
$tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -26,7 +26,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ while $count < $N
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -95,18 +95,18 @@ $tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$i = 2
|
$i = 2
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$tb = $tbPrefix . $i
|
$tb = $tbPrefix . $i
|
||||||
sql use $db
|
sql use $db
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
print select * from $tb ==> $rows points
|
print select * from $tb ==> $rows points
|
||||||
if $rows != $N then
|
if $rows != $N then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -186,13 +186,13 @@ sql_error alter database db replica 0
|
||||||
#sql alter database db replica 1
|
#sql alter database db replica 1
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print replica: $data4_db
|
#print replica: $data4_db
|
||||||
#if $data4_db != 1 then
|
#if $data4_db != 1 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql alter database db replica 3
|
#sql alter database db replica 3
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print replica: $data4_db
|
#print replica: $data4_db
|
||||||
#if $data4_db != 3 then
|
#if $data4_db != 3 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
|
@ -200,13 +200,13 @@ sql_error alter database db replica 0
|
||||||
#sql alter database db quorum 2
|
#sql alter database db quorum 2
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print quorum $data5_db
|
#print quorum $data5_db
|
||||||
#if $data5_db != 2 then
|
#if $data5_db != 2 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql alter database db quorum 1
|
#sql alter database db quorum 1
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print quorum $data5_db
|
#print quorum $data5_db
|
||||||
#if $data5_db != 1 then
|
#if $data5_db != 1 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ endi
|
||||||
#sql alter database db keep 1000,2000
|
#sql alter database db keep 1000,2000
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print keep $data7_db
|
#print keep $data7_db
|
||||||
#if $data7_db != 500,500,500 then
|
#if $data7_db != 500,500,500 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
|
@ -263,13 +263,13 @@ sql_error alter database db keep -1
|
||||||
#sql alter database db blocks 3
|
#sql alter database db blocks 3
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print blocks $data9_db
|
#print blocks $data9_db
|
||||||
#if $data9_db != 3 then
|
#if $data9_db != 3 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
#sql alter database db blocks 11
|
#sql alter database db blocks 11
|
||||||
#sql select * from information_schema.ins_databases
|
#sql select * from information_schema.ins_databases
|
||||||
#print blocks $data9_db
|
#print blocks $data9_db
|
||||||
#if $data9_db != 11 then
|
#if $data9_db != 11 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
|
@ -300,13 +300,13 @@ print ============== step wal_level
|
||||||
sql alter database db wal_level 1
|
sql alter database db wal_level 1
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print wal_level $data20_db
|
print wal_level $data20_db
|
||||||
if $data20_db != 1 then
|
if $data20_db != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db wal_level 2
|
sql alter database db wal_level 2
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print wal_level $data20_db
|
print wal_level $data20_db
|
||||||
if $data20_db != 2 then
|
if $data20_db != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -319,19 +319,19 @@ print ============== modify wal_fsync_period
|
||||||
sql alter database db wal_fsync_period 2000
|
sql alter database db wal_fsync_period 2000
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print wal_fsync_period $data21_db
|
print wal_fsync_period $data21_db
|
||||||
if $data21_db != 2000 then
|
if $data21_db != 2000 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db wal_fsync_period 500
|
sql alter database db wal_fsync_period 500
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print wal_fsync_period $data21_db
|
print wal_fsync_period $data21_db
|
||||||
if $data21_db != 500 then
|
if $data21_db != 500 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db wal_fsync_period 0
|
sql alter database db wal_fsync_period 0
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print wal_fsync_period $data21_db
|
print wal_fsync_period $data21_db
|
||||||
if $data21_db != 0 then
|
if $data21_db != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql_error alter database db wal_fsync_period 180001
|
sql_error alter database db wal_fsync_period 180001
|
||||||
|
@ -351,31 +351,31 @@ print ============== modify cachelast [0, 1, 2, 3]
|
||||||
sql alter database db cachemodel 'last_value'
|
sql alter database db cachemodel 'last_value'
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print cachelast $data18_db
|
print cachelast $data18_db
|
||||||
if $data18_db != last_value then
|
if $data18_db != last_value then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db cachemodel 'last_row'
|
sql alter database db cachemodel 'last_row'
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print cachelast $data18_db
|
print cachelast $data18_db
|
||||||
if $data18_db != last_row then
|
if $data18_db != last_row then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db cachemodel 'none'
|
sql alter database db cachemodel 'none'
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print cachelast $data18_db
|
print cachelast $data18_db
|
||||||
if $data18_db != none then
|
if $data18_db != none then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db cachemodel 'last_value'
|
sql alter database db cachemodel 'last_value'
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print cachelast $data18_db
|
print cachelast $data18_db
|
||||||
if $data18_db != last_value then
|
if $data18_db != last_value then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql alter database db cachemodel 'both'
|
sql alter database db cachemodel 'both'
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print cachelast $data18_db
|
print cachelast $data18_db
|
||||||
if $data18_db != both then
|
if $data18_db != both then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,10 @@ endi
|
||||||
print =============== step2: create database
|
print =============== step2: create database
|
||||||
sql create database db vgroups 1
|
sql create database db vgroups 1
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data(db)[4] != 1 then
|
if $data(db)[4] != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ step3:
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql select * from information_schema.ins_dnodes
|
sql select * from information_schema.ins_dnodes
|
||||||
print ===> rows: $rows
|
print ===> rows: $rows
|
||||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||||
print ===> $data20 $data21 $data22 $data23 $data24 $data25
|
print ===> $data20 $data21 $data22 $data23 $data24 $data25
|
||||||
|
@ -115,7 +115,7 @@ step4:
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql show db.vgroups
|
sql show db.vgroups
|
||||||
print ===> rows: $rows
|
print ===> rows: $rows
|
||||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
if $data[0][4] != leader then
|
if $data[0][4] != leader then
|
||||||
goto step4
|
goto step4
|
||||||
|
@ -137,4 +137,4 @@ endi
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
|
|
|
@ -23,7 +23,7 @@ step1:
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql select * from information_schema.ins_dnodes
|
sql select * from information_schema.ins_dnodes
|
||||||
print ===> rows: $rows
|
print ===> rows: $rows
|
||||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||||
print ===> $data20 $data21 $data22 $data23 $data24 $data25
|
print ===> $data20 $data21 $data22 $data23 $data24 $data25
|
||||||
|
@ -47,10 +47,10 @@ endi
|
||||||
print =============== step2: create database
|
print =============== step2: create database
|
||||||
sql create database db vgroups 1 replica 3
|
sql create database db vgroups 1 replica 3
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data(db)[4] != 3 then
|
if $data(db)[4] != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ step3:
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql show db.vgroups
|
sql show db.vgroups
|
||||||
print ===> rows: $rows
|
print ===> rows: $rows
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
goto step3
|
goto step3
|
||||||
endi
|
endi
|
||||||
|
@ -165,4 +165,4 @@ endi
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
|
|
|
@ -2,8 +2,8 @@ sql connect
|
||||||
$x = 1
|
$x = 1
|
||||||
begin:
|
begin:
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 100
|
sleep 100
|
||||||
sql insert into db.tb values(now, $x ) -x begin
|
sql insert into db.tb values(now, $x ) -x begin
|
||||||
#print ===> insert successed $x
|
#print ===> insert successed $x
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
goto begin
|
goto begin
|
||||||
|
|
|
@ -25,15 +25,15 @@ endi
|
||||||
print =============== show vgroups1
|
print =============== show vgroups1
|
||||||
sql use d1
|
sql use d1
|
||||||
sql show vgroups
|
sql show vgroups
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 2 then
|
if $data00 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data10 != 3 then
|
if $data10 != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -59,11 +59,11 @@ if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 4 then
|
if $data00 != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data10 != 5 then
|
if $data10 != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -73,15 +73,15 @@ if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 6 then
|
if $data00 != 6 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data10 != 7 then
|
if $data10 != 7 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data20 != 8 then
|
if $data20 != 8 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -91,19 +91,19 @@ if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != 9 then
|
if $data00 != 9 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data10 != 10 then
|
if $data10 != 10 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data20 != 11 then
|
if $data20 != 11 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data30 != 12 then
|
if $data30 != 12 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ sql create table t3 (ts timestamp, i int);
|
||||||
sql create table t4 (ts timestamp, i int);
|
sql create table t4 (ts timestamp, i int);
|
||||||
|
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print rows: $rows
|
print rows: $rows
|
||||||
print $data00 $data01 $data02 $data03
|
print $data00 $data01 $data02 $data03
|
||||||
print $data10 $data11 $data12 $data13
|
print $data10 $data11 $data12 $data13
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
|
@ -47,7 +47,7 @@ endi
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 4 then
|
if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -64,8 +64,8 @@ if $rows != 4 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -23,12 +23,12 @@ if $data22 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#if $data03 != 4 then
|
#if $data03 != 4 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
sql show d1.tables
|
sql show d1.tables
|
||||||
if $rows != 4 then
|
if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ if $rows != 4 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d2.tables
|
sql show d2.tables
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -11,109 +11,109 @@ sql create table d1.t3 (ts timestamp, i int);
|
||||||
sql create table d1.t4 (ts timestamp, i int);
|
sql create table d1.t4 (ts timestamp, i int);
|
||||||
|
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data20 != d1 then
|
if $data20 != d1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data22 != 1 then
|
if $data22 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data24 != 1 then
|
if $data24 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d1.tables
|
sql show d1.tables
|
||||||
if $rows != 4 then
|
if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d1.vgroups
|
sql show d1.vgroups
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data00 != 2 then
|
if $data00 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data01 != d1 then
|
if $data01 != d1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== drop table
|
print =============== drop table
|
||||||
sql drop table d1.t1
|
sql drop table d1.t1
|
||||||
|
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data20 != d1 then
|
if $data20 != d1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data22 != 1 then
|
if $data22 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data24 != 1 then
|
if $data24 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d1.tables
|
sql show d1.tables
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d1.vgroups
|
sql show d1.vgroups
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data00 != 2 then
|
if $data00 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data01 != d1 then
|
if $data01 != d1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
print =============== drop all table
|
print =============== drop all table
|
||||||
sql drop table d1.t2
|
sql drop table d1.t2
|
||||||
sql drop table d1.t3
|
sql drop table d1.t3
|
||||||
sql drop table d1.t4
|
sql drop table d1.t4
|
||||||
|
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data20 != d1 then
|
if $data20 != d1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data22 != 1 then
|
if $data22 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data24 != 1 then
|
if $data24 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d1.tables
|
sql show d1.tables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show d1.vgroups
|
sql show d1.vgroups
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data00 != 2 then
|
if $data00 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data01 != d1 then
|
if $data01 != d1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -13,13 +13,13 @@ sql create table tb1 using st1 tags(1);
|
||||||
sql insert into tb1 values (now, 1);
|
sql insert into tb1 values (now, 1);
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
print $rows
|
print $rows
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -35,12 +35,12 @@ sql use db1;
|
||||||
sql create stable st1 (ts timestamp, f1 int) tags(t1 int)
|
sql create stable st1 (ts timestamp, f1 int) tags(t1 int)
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ $st = $stPrefix . $i
|
||||||
$tb = $tbPrefix . $i
|
$tb = $tbPrefix . $i
|
||||||
|
|
||||||
print =============== step1
|
print =============== step1
|
||||||
# quorum presicion
|
# quorum presicion
|
||||||
sql create database $db vgroups 8 replica 1 duration 2 keep 10 minrows 80 maxrows 10000 wal_level 2 wal_fsync_period 1000 comp 0 cachemodel 'last_value' precision 'us'
|
sql create database $db vgroups 8 replica 1 duration 2 keep 10 minrows 80 maxrows 10000 wal_level 2 wal_fsync_period 1000 comp 0 cachemodel 'last_value' precision 'us'
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
|
||||||
|
@ -46,7 +46,7 @@ endi
|
||||||
#if $data29 != 12 then
|
#if $data29 != 12 then
|
||||||
# return -1
|
# return -1
|
||||||
#endi
|
#endi
|
||||||
|
|
||||||
print =============== step2
|
print =============== step2
|
||||||
sql_error create database $db
|
sql_error create database $db
|
||||||
sql create database if not exists $db
|
sql create database if not exists $db
|
||||||
|
@ -60,7 +60,7 @@ sql drop database $db
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step4
|
print =============== step4
|
||||||
sql_error drop database $db
|
sql_error drop database $db
|
||||||
|
@ -102,22 +102,22 @@ while $i < 5
|
||||||
sql create table $tb using $st tags(1)
|
sql create table $tb using $st tags(1)
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print $data00 $data01 $data02 $data03
|
print $data00 $data01 $data02 $data03
|
||||||
if $data00 != $st then
|
if $data00 != $st then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print $data00 $data01 $data02 $data03
|
print $data00 $data01 $data02 $data03
|
||||||
if $data00 != $tb then
|
if $data00 != $tb then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -127,8 +127,8 @@ endw
|
||||||
print =============== step7
|
print =============== step7
|
||||||
$i = 0
|
$i = 0
|
||||||
while $i < 5
|
while $i < 5
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
|
@ -143,20 +143,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
|
||||||
sql create table $tb using $st tags(1)
|
sql create table $tb using $st tags(1)
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $st then
|
if $data00 != $st then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $tb then
|
if $data00 != $tb then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -168,12 +168,12 @@ sql create database $db
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -182,20 +182,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
|
||||||
sql create table $tb using $st tags(1)
|
sql create table $tb using $st tags(1)
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $st then
|
if $data00 != $st then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $tb then
|
if $data00 != $tb then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -207,12 +207,12 @@ sql create database $db
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -221,20 +221,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
|
||||||
sql create table $tb using $st tags(1)
|
sql create table $tb using $st tags(1)
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $st then
|
if $data00 != $st then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $tb then
|
if $data00 != $tb then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -245,12 +245,12 @@ sql insert into $tb values (now+4a, 3)
|
||||||
sql insert into $tb values (now+5a, 4)
|
sql insert into $tb values (now+5a, 4)
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from $st
|
sql select * from $st
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -262,12 +262,12 @@ sql create database $db
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -276,20 +276,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
|
||||||
sql create table $tb using $st tags(1)
|
sql create table $tb using $st tags(1)
|
||||||
|
|
||||||
sql show stables
|
sql show stables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $st then
|
if $data00 != $st then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show tables
|
sql show tables
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != $tb then
|
if $data00 != $tb then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -300,12 +300,12 @@ sql insert into $tb values (now+4a, 3)
|
||||||
sql insert into $tb values (now+5a, 4)
|
sql insert into $tb values (now+5a, 4)
|
||||||
|
|
||||||
sql select * from $tb
|
sql select * from $tb
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from $st
|
sql select * from $st
|
||||||
if $rows != 5 then
|
if $rows != 5 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,9 @@ sql create table tb (ts timestamp, i int)
|
||||||
$x = 1
|
$x = 1
|
||||||
while $x < 41
|
while $x < 41
|
||||||
$time = $x . m
|
$time = $x . m
|
||||||
sql insert into tb values (now + $time , $x )
|
sql insert into tb values (now + $time , $x )
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from tb order by ts desc
|
sql select * from tb order by ts desc
|
||||||
print ===> rows $rows
|
print ===> rows $rows
|
||||||
|
@ -71,7 +71,7 @@ if $data01 != 40 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$oldnum = $rows
|
$oldnum = $rows
|
||||||
$num = $rows + 2
|
$num = $rows + 2
|
||||||
|
|
||||||
print ======== step3 import old data
|
print ======== step3 import old data
|
||||||
|
@ -120,4 +120,4 @@ if $data01 != 40 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
sql create database d1 replica 1 vgroups 1
|
sql create database d1 replica 1 vgroups 1
|
||||||
sql create database d2 replica 1 vgroups 1
|
sql create database d2 replica 1 vgroups 1
|
||||||
sql create database d3 replica 1 vgroups 1
|
sql create database d3 replica 1 vgroups 1
|
||||||
|
@ -47,7 +47,7 @@ step2:
|
||||||
|
|
||||||
print ========= step3
|
print ========= step3
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 50
|
sleep 50
|
||||||
|
|
||||||
sql create database d1 replica 1
|
sql create database d1 replica 1
|
||||||
sql create table d1.t1 (ts timestamp, i int)
|
sql create table d1.t1 (ts timestamp, i int)
|
||||||
|
@ -65,20 +65,20 @@ while $x < 20
|
||||||
sql insert into d1.t1 values(now, -1) -x step4
|
sql insert into d1.t1 values(now, -1) -x step4
|
||||||
return -1
|
return -1
|
||||||
step4:
|
step4:
|
||||||
|
|
||||||
sql create database d1 replica 1
|
sql create database d1 replica 1
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 50
|
sleep 50
|
||||||
sql create table d1.t1 (ts timestamp, i int)
|
sql create table d1.t1 (ts timestamp, i int)
|
||||||
sql insert into d1.t1 values(now, $x )
|
sql insert into d1.t1 values(now, $x )
|
||||||
sql select * from d1.t1
|
sql select * from d1.t1
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
$x = $x + 1
|
|
||||||
|
|
||||||
print ===> loop times: $x
|
|
||||||
endw
|
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
$x = $x + 1
|
||||||
|
|
||||||
|
print ===> loop times: $x
|
||||||
|
endw
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
sql create database d1 replica 1
|
sql create database d1 replica 1
|
||||||
sql create database d2 replica 1
|
sql create database d2 replica 1
|
||||||
sql create database d3 replica 1
|
sql create database d3 replica 1
|
||||||
|
@ -48,7 +48,7 @@ step2:
|
||||||
print ========= step3
|
print ========= step3
|
||||||
sql create database db1 replica 1
|
sql create database db1 replica 1
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 50
|
sleep 50
|
||||||
|
|
||||||
sql create table db1.tb1 (ts timestamp, i int)
|
sql create table db1.tb1 (ts timestamp, i int)
|
||||||
sql insert into db1.tb1 values(now, 2)
|
sql insert into db1.tb1 values(now, 2)
|
||||||
|
@ -61,7 +61,7 @@ print ========= step4
|
||||||
$x = 1
|
$x = 1
|
||||||
while $x < 20
|
while $x < 20
|
||||||
|
|
||||||
$db = db . $x
|
$db = db . $x
|
||||||
$tb = tb . $x
|
$tb = tb . $x
|
||||||
sql use $db
|
sql use $db
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
|
@ -69,14 +69,14 @@ while $x < 20
|
||||||
sql insert into $tb values(now, -1) -x step4
|
sql insert into $tb values(now, -1) -x step4
|
||||||
return -1
|
return -1
|
||||||
step4:
|
step4:
|
||||||
|
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
$db = db . $x
|
$db = db . $x
|
||||||
$tb = tb . $x
|
$tb = tb . $x
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 50
|
sleep 50
|
||||||
|
|
||||||
sql create database $db replica 1
|
sql create database $db replica 1
|
||||||
sql use $db
|
sql use $db
|
||||||
sql create table $tb (ts timestamp, i int)
|
sql create table $tb (ts timestamp, i int)
|
||||||
|
@ -85,8 +85,8 @@ while $x < 20
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ===> loop times: $x
|
|
||||||
endw
|
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
print ===> loop times: $x
|
||||||
|
endw
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
|
||||||
$tbPrefix = t
|
$tbPrefix = t
|
||||||
$i = 0
|
$i = 0
|
||||||
|
@ -21,13 +21,13 @@ while $i < 30
|
||||||
print times $i
|
print times $i
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
|
|
||||||
endw
|
endw
|
||||||
|
|
||||||
print ======== step2
|
print ======== step2
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
|
|
||||||
|
@ -94,4 +94,4 @@ if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -62,4 +62,4 @@ if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create database db
|
sql create database db
|
||||||
sql create table db.tb (ts timestamp, i int)
|
sql create table db.tb (ts timestamp, i int)
|
||||||
sql insert into db.tb values(now, 1)
|
sql insert into db.tb values(now, 1)
|
||||||
|
|
||||||
|
@ -11,18 +11,18 @@ print ======== start back
|
||||||
run_back tsim/db/back_insert.sim
|
run_back tsim/db/back_insert.sim
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
$x = 1
|
$x = 1
|
||||||
while $x < 10
|
while $x < 10
|
||||||
|
|
||||||
print drop database times $x
|
print drop database times $x
|
||||||
sql drop database if exists db
|
sql drop database if exists db
|
||||||
sql create database db
|
sql create database db
|
||||||
sql create table db.tb (ts timestamp, i int)
|
sql create table db.tb (ts timestamp, i int)
|
||||||
|
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create database db
|
sql create database db
|
||||||
sql create table db.tb (ts timestamp, i int)
|
sql create table db.tb (ts timestamp, i int)
|
||||||
sql insert into db.tb values(now, 1)
|
sql insert into db.tb values(now, 1)
|
||||||
|
|
||||||
|
@ -11,11 +11,11 @@ sql create database db2
|
||||||
sql create table db2.tb2 (ts timestamp, i int)
|
sql create table db2.tb2 (ts timestamp, i int)
|
||||||
sql insert into db2.tb2 values(now, 1)
|
sql insert into db2.tb2 values(now, 1)
|
||||||
|
|
||||||
sql create database db3
|
sql create database db3
|
||||||
sql create table db3.tb3 (ts timestamp, i int)
|
sql create table db3.tb3 (ts timestamp, i int)
|
||||||
sql insert into db3.tb3 values(now, 1)
|
sql insert into db3.tb3 values(now, 1)
|
||||||
|
|
||||||
sql create database db4
|
sql create database db4
|
||||||
sql create table db4.tb4 (ts timestamp, i int)
|
sql create table db4.tb4 (ts timestamp, i int)
|
||||||
sql insert into db4.tb4 values(now, 1)
|
sql insert into db4.tb4 values(now, 1)
|
||||||
|
|
||||||
|
@ -23,19 +23,19 @@ print ======== start back
|
||||||
run_back tsim/db/back_insert.sim
|
run_back tsim/db/back_insert.sim
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
$x = 1
|
$x = 1
|
||||||
while $x < 10
|
while $x < 10
|
||||||
|
|
||||||
print drop database times $x
|
print drop database times $x
|
||||||
sql drop database if exists db
|
sql drop database if exists db
|
||||||
|
|
||||||
sql create database db
|
sql create database db
|
||||||
sql create table db.tb (ts timestamp, i int)
|
sql create table db.tb (ts timestamp, i int)
|
||||||
|
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -12,7 +12,7 @@ system sh/exec.sh -n dnode1 -s start
|
||||||
system sh/exec.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
@ -61,13 +61,13 @@ sql show tables
|
||||||
print $rows
|
print $rows
|
||||||
if $rows != 16 then
|
if $rows != 16 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from mt
|
sql select * from mt
|
||||||
print $rows
|
print $rows
|
||||||
if $rows != 16 then
|
if $rows != 16 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========== step3
|
print ========== step3
|
||||||
|
|
||||||
|
@ -82,26 +82,26 @@ sql show tables
|
||||||
print $rows
|
print $rows
|
||||||
if $rows != 8 then
|
if $rows != 8 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from mt
|
sql select * from mt
|
||||||
print $rows
|
print $rows
|
||||||
if $rows != 8 then
|
if $rows != 8 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from db.t5
|
sql select * from db.t5
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select * from db.t13
|
sql select * from db.t13
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql_error select * from db.t1
|
sql_error select * from db.t1
|
||||||
sql_error select * from db.t9
|
sql_error select * from db.t9
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
|
@ -14,7 +14,7 @@ while $x < 41
|
||||||
sql insert into tb values (now - $time , $x ) -x step2
|
sql insert into tb values (now - $time , $x ) -x step2
|
||||||
step2:
|
step2:
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from tb
|
sql select * from tb
|
||||||
print ===> rows $rows last $data01
|
print ===> rows $rows last $data01
|
||||||
|
@ -42,10 +42,10 @@ sql alter database keepdb keep 60
|
||||||
sql flush database keepdb
|
sql flush database keepdb
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
|
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
|
||||||
if $data22 != 2 then
|
if $data22 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data27 != 86400m,86400m,86400m then
|
if $data27 != 86400m,86400m,86400m then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ while $x < 81
|
||||||
sql insert into tb values (now - $time , $x ) -x step4
|
sql insert into tb values (now - $time , $x ) -x step4
|
||||||
step4:
|
step4:
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from tb
|
sql select * from tb
|
||||||
print ===> rows $rows last $data01
|
print ===> rows $rows last $data01
|
||||||
|
@ -83,10 +83,10 @@ endi
|
||||||
print ======== step6 alter db
|
print ======== step6 alter db
|
||||||
sql alter database keepdb keep 30
|
sql alter database keepdb keep 30
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $data22 != 2 then
|
if $data22 != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data27 != 43200m,43200m,43200m then
|
if $data27 != 43200m,43200m,43200m then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ while $x < 121
|
||||||
sql insert into tb values (now - $time , $x ) -x step8
|
sql insert into tb values (now - $time , $x ) -x step8
|
||||||
step8:
|
step8:
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sql select * from tb
|
sql select * from tb
|
||||||
print ===> rows $rows last $data01
|
print ===> rows $rows last $data01
|
||||||
|
@ -137,4 +137,4 @@ error3:
|
||||||
print ======= test success
|
print ======= test success
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
|
@ -11,33 +11,33 @@ sql create database -x step1
|
||||||
step1:
|
step1:
|
||||||
|
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step2
|
print =============== step2
|
||||||
sql create database a
|
sql create database a
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql drop database a
|
sql drop database a
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step3
|
print =============== step3
|
||||||
sql create database a12345678
|
sql create database a12345678
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql drop database a12345678
|
sql drop database a12345678
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -46,15 +46,15 @@ sql create database a012345678901201234567890120123456789012a0123456789012012345
|
||||||
return -1
|
return -1
|
||||||
step4:
|
step4:
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step5
|
print =============== step5
|
||||||
sql create database a;1
|
sql create database a;1
|
||||||
sql drop database a
|
sql drop database a
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ sql create database a'1 -x step6
|
||||||
step6:
|
step6:
|
||||||
|
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ sql create database (a) -x step7
|
||||||
return -1
|
return -1
|
||||||
step7:
|
step7:
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -82,8 +82,8 @@ sql create database a.1 -x step8
|
||||||
return -1
|
return -1
|
||||||
step8:
|
step8:
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -56,4 +56,4 @@ sql drop database d10
|
||||||
sql drop database d11
|
sql drop database d11
|
||||||
sql drop database d12
|
sql drop database d12
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -7,7 +7,7 @@ print =============== step2
|
||||||
sql create database db
|
sql create database db
|
||||||
sql show create database db
|
sql show create database db
|
||||||
|
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -15,13 +15,13 @@ print =============== step3
|
||||||
sql use db
|
sql use db
|
||||||
sql show create database db
|
sql show create database db
|
||||||
|
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
if $data00 != db then
|
if $data00 != db then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql drop database db
|
sql drop database db
|
||||||
|
|
||||||
|
|
|
@ -11,14 +11,14 @@ sql create table t0 using meters tags(1,'ch')
|
||||||
sql create table normalTbl(ts timestamp, zone binary(8))
|
sql create table normalTbl(ts timestamp, zone binary(8))
|
||||||
|
|
||||||
sql use db
|
sql use db
|
||||||
sql show create table meters
|
sql show create table meters
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ===============check sub table
|
print ===============check sub table
|
||||||
sql show create table t0
|
sql show create table t0
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data00 == 't0' then
|
if $data00 == 't0' then
|
||||||
|
@ -27,8 +27,8 @@ endi
|
||||||
|
|
||||||
print ===============check normal table
|
print ===============check normal table
|
||||||
|
|
||||||
sql show create table normalTbl
|
sql show create table normalTbl
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ if $data00 == 'normalTbl' then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ===============check super table
|
print ===============check super table
|
||||||
sql show create table meters
|
sql show create table meters
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ endi
|
||||||
print ===============check sub table with prefix
|
print ===============check sub table with prefix
|
||||||
|
|
||||||
sql show create table db.t0
|
sql show create table db.t0
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -58,8 +58,8 @@ if $data00 == 't0' then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ===============check normal table with prefix
|
print ===============check normal table with prefix
|
||||||
sql show create table db.normalTbl
|
sql show create table db.normalTbl
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ endi
|
||||||
|
|
||||||
|
|
||||||
print ===============check super table with prefix
|
print ===============check super table with prefix
|
||||||
sql show create table db.meters
|
sql show create table db.meters
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ sql create database db
|
||||||
sql select * from information_schema.ins_databases
|
sql select * from information_schema.ins_databases
|
||||||
print $rows $data07
|
print $rows $data07
|
||||||
|
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -125,4 +125,4 @@ if $data01 != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -551,6 +551,29 @@ class TDTestCase:
|
||||||
tdSql.checkData(0, 0, 15)
|
tdSql.checkData(0, 0, 15)
|
||||||
tdSql.checkData(1, 0, 15)
|
tdSql.checkData(1, 0, 15)
|
||||||
|
|
||||||
|
tdLog.printNoPrefix("==========step9:test error cases")
|
||||||
|
|
||||||
|
tdSql.error(f"select interp(c0) from {dbname}.{tbname}")
|
||||||
|
tdSql.error(f"select interp(c0) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05')")
|
||||||
|
tdSql.error(f"select interp(c0) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d)")
|
||||||
|
tdSql.error(f"select interp(c0) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') fill(null)")
|
||||||
|
tdSql.error(f"select interp(c0) from {dbname}.{tbname} every(1s) fill(null)")
|
||||||
|
tdSql.error(f"select interp(c0) from {dbname}.{tbname} where ts >= '2020-02-10 00:00:05' and ts <= '2020-02-15 00:00:05' every(1s) fill(null)")
|
||||||
|
|
||||||
|
# input can only be numerical types
|
||||||
|
tdSql.error(f"select interp(ts) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp(c6) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp(c7) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp(c8) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
|
||||||
|
# input can only be columns
|
||||||
|
tdSql.error(f"select interp(1) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp(1.5) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp(true) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp(false) from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp('abcd') from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
tdSql.error(f"select interp('中文字符') from {dbname}.{tbname} range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
Loading…
Reference in New Issue