diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index c7a89945f8..e084710e25 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -270,13 +270,12 @@ static int32_t mndStbActionInsert(SSdb *pSdb, SStbObj *pStb) { static int32_t mndStbActionDelete(SSdb *pSdb, SStbObj *pStb) { mTrace("stb:%s, perform delete action, row:%p", pStb->name, pStb); + taosArrayDestroy(pStb->pFuncs); taosMemoryFreeClear(pStb->pColumns); taosMemoryFreeClear(pStb->pTags); taosMemoryFreeClear(pStb->comment); - taosMemoryFreeClear(pStb->pFuncs); taosMemoryFreeClear(pStb->pAst1); taosMemoryFreeClear(pStb->pAst2); - taosArrayDestroy(pStb->pFuncs); return 0; } @@ -798,6 +797,7 @@ static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCrea _OVER: mndTransDrop(pTrans); + mndStbActionDelete(pMnode->pSdb, &stbObj); return code; } diff --git a/tests/script/tsim/valgrind/basic1.sim b/tests/script/tsim/valgrind/basic1.sim index c599263b5a..adcc92594b 100644 --- a/tests/script/tsim/valgrind/basic1.sim +++ b/tests/script/tsim/valgrind/basic1.sim @@ -32,12 +32,30 @@ sql create dnode $hostname port 7200 sql drop dnode 2 sql alter dnode 1 'debugflag 143' -print =============== step4: create alter drop show database -sql create database db vgroups 1 -sql show databases -sql show db.vgroups -sql drop database db +print =============== step4: create show database +sql create database d1 vgroups 1 sql show databases +sql show d1.vgroups + +print =============== step5: create show stable +sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) +sql show stables +if $rows != 1 then + return -1 +endi + + +goto _OVER +print =============== step6: create show table +sql create table ct1 using stb tags(1000) +sql show tables +if $rows != 1 then + return -1 +endi + +print =============== step7: insert data + +print =============== step7: select data _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/valgrind/basic2.sim b/tests/script/tsim/valgrind/basic2.sim index ab25b7e0b7..8781acd698 100644 --- a/tests/script/tsim/valgrind/basic2.sim +++ b/tests/script/tsim/valgrind/basic2.sim @@ -20,6 +20,8 @@ endi print =============== step2: create db sql create database db vgroups 1 +sql use db +sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/valgrind/checkError2.sim b/tests/script/tsim/valgrind/checkError2.sim index 355685febc..b3d57d7fdb 100644 --- a/tests/script/tsim/valgrind/checkError2.sim +++ b/tests/script/tsim/valgrind/checkError2.sim @@ -29,7 +29,7 @@ print ----> start to check if there are ERRORS in vagrind log file for each dnod system_content sh/checkValgrind.sh -n dnode1 print cmd return result ----> [ $system_content ] -if $system_content <= 10 then +if $system_content <= 8 then return 0 endi