提交 163224f4 编写于 作者: X Xiaoyu Wang

fix: taosd crash when modify the schema and query last_row

上级 ab86f6ab
...@@ -1305,6 +1305,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo ...@@ -1305,6 +1305,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
int16_t iCol = 0; int16_t iCol = 0;
int16_t noneCol = 0; int16_t noneCol = 0;
bool setNoneCol = false; bool setNoneCol = false;
bool hasRow = false;
SArray *pColArray = NULL; SArray *pColArray = NULL;
SColVal *pColVal = &(SColVal){0}; SColVal *pColVal = &(SColVal){0};
...@@ -1327,6 +1328,8 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo ...@@ -1327,6 +1328,8 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
break; break;
} }
hasRow = true;
code = updateTSchema(TSDBROW_SVERSION(pRow), pr, uid); code = updateTSchema(TSDBROW_SVERSION(pRow), pr, uid);
if (TSDB_CODE_SUCCESS != code) { if (TSDB_CODE_SUCCESS != code) {
goto _err; goto _err;
...@@ -1418,6 +1421,9 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo ...@@ -1418,6 +1421,9 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo
//*ppColArray = NULL; //*ppColArray = NULL;
// taosArrayDestroy(pColArray); // taosArrayDestroy(pColArray);
//} else { //} else {
if (!hasRow) {
taosArrayClear(pColArray);
}
*ppColArray = pColArray; *ppColArray = pColArray;
//} //}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册