未验证 提交 e240b2f8 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #14624 from taosdata/fix/valgrind

fix: invalid free while create stb
...@@ -270,13 +270,12 @@ static int32_t mndStbActionInsert(SSdb *pSdb, SStbObj *pStb) { ...@@ -270,13 +270,12 @@ static int32_t mndStbActionInsert(SSdb *pSdb, SStbObj *pStb) {
static int32_t mndStbActionDelete(SSdb *pSdb, SStbObj *pStb) { static int32_t mndStbActionDelete(SSdb *pSdb, SStbObj *pStb) {
mTrace("stb:%s, perform delete action, row:%p", pStb->name, pStb); mTrace("stb:%s, perform delete action, row:%p", pStb->name, pStb);
taosArrayDestroy(pStb->pFuncs);
taosMemoryFreeClear(pStb->pColumns); taosMemoryFreeClear(pStb->pColumns);
taosMemoryFreeClear(pStb->pTags); taosMemoryFreeClear(pStb->pTags);
taosMemoryFreeClear(pStb->comment); taosMemoryFreeClear(pStb->comment);
taosMemoryFreeClear(pStb->pFuncs);
taosMemoryFreeClear(pStb->pAst1); taosMemoryFreeClear(pStb->pAst1);
taosMemoryFreeClear(pStb->pAst2); taosMemoryFreeClear(pStb->pAst2);
taosArrayDestroy(pStb->pFuncs);
return 0; return 0;
} }
...@@ -798,6 +797,7 @@ static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCrea ...@@ -798,6 +797,7 @@ static int32_t mndCreateStb(SMnode *pMnode, SRpcMsg *pReq, SMCreateStbReq *pCrea
_OVER: _OVER:
mndTransDrop(pTrans); mndTransDrop(pTrans);
mndStbActionDelete(pMnode->pSdb, &stbObj);
return code; return code;
} }
......
...@@ -32,12 +32,30 @@ sql create dnode $hostname port 7200 ...@@ -32,12 +32,30 @@ sql create dnode $hostname port 7200
sql drop dnode 2 sql drop dnode 2
sql alter dnode 1 'debugflag 143' sql alter dnode 1 'debugflag 143'
print =============== step4: create alter drop show database print =============== step4: create show database
sql create database db vgroups 1 sql create database d1 vgroups 1
sql show databases
sql show db.vgroups
sql drop database db
sql show databases 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: _OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
...@@ -20,6 +20,8 @@ endi ...@@ -20,6 +20,8 @@ endi
print =============== step2: create db print =============== step2: create db
sql create database db vgroups 1 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: _OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
...@@ -29,7 +29,7 @@ print ----> start to check if there are ERRORS in vagrind log file for each dnod ...@@ -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 system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ] print cmd return result ----> [ $system_content ]
if $system_content <= 10 then if $system_content <= 8 then
return 0 return 0
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册