Solve the bugs when creating the database
This commit is contained in:
parent
fb9be172df
commit
cffe218533
|
@ -201,6 +201,15 @@ char *tscBuildQueryStreamDesc(char *pMsg, STscObj *pObj) {
|
||||||
pMsg += sizeof(SQList);
|
pMsg += sizeof(SQList);
|
||||||
SSqlObj *pSql = pObj->sqlList;
|
SSqlObj *pSql = pObj->sqlList;
|
||||||
while (pSql) {
|
while (pSql) {
|
||||||
|
/*
|
||||||
|
* avoid sqlobj may not be correctly removed from sql list
|
||||||
|
* e.g., forgetting to free the sql result may cause the sql object still in sql list
|
||||||
|
*/
|
||||||
|
if (pSql->sqlstr == NULL) {
|
||||||
|
pSql = pSql->next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strncpy(pQdesc->sql, pSql->sqlstr, TSDB_SHOW_SQL_LEN - 1);
|
strncpy(pQdesc->sql, pSql->sqlstr, TSDB_SHOW_SQL_LEN - 1);
|
||||||
pQdesc->sql[TSDB_SHOW_SQL_LEN - 1] = 0;
|
pQdesc->sql[TSDB_SHOW_SQL_LEN - 1] = 0;
|
||||||
pQdesc->stime = pSql->stime;
|
pQdesc->stime = pSql->stime;
|
||||||
|
|
|
@ -3928,9 +3928,9 @@ static void setCreateDBOption(SCreateDbMsg* pMsg, SCreateDBInfo* pCreateDb) {
|
||||||
pMsg->daysToKeep2 = htonl(-1);
|
pMsg->daysToKeep2 = htonl(-1);
|
||||||
|
|
||||||
pMsg->blocksPerMeter = (pCreateDb->numOfBlocksPerTable == 0) ? htons(-1) : htons(pCreateDb->numOfBlocksPerTable);
|
pMsg->blocksPerMeter = (pCreateDb->numOfBlocksPerTable == 0) ? htons(-1) : htons(pCreateDb->numOfBlocksPerTable);
|
||||||
pMsg->compression = (pCreateDb->compressionLevel == 0) ? -1 : pCreateDb->numOfAvgCacheBlocks;
|
pMsg->compression = (pCreateDb->compressionLevel == 0) ? -1 : pCreateDb->compressionLevel;
|
||||||
|
|
||||||
pMsg->commitLog = (pCreateDb->commitLog == 0) ? -1 : pCreateDb->numOfAvgCacheBlocks;
|
pMsg->commitLog = (pCreateDb->commitLog == 0) ? -1 : pCreateDb->commitLog;
|
||||||
pMsg->commitTime = (pCreateDb->commitTime == 0) ? htonl(-1) : htonl(pCreateDb->commitTime);
|
pMsg->commitTime = (pCreateDb->commitTime == 0) ? htonl(-1) : htonl(pCreateDb->commitTime);
|
||||||
pMsg->maxSessions = (pCreateDb->tablesPerVnode == 0) ? htonl(-1) : htonl(pCreateDb->tablesPerVnode);
|
pMsg->maxSessions = (pCreateDb->tablesPerVnode == 0) ? htonl(-1) : htonl(pCreateDb->tablesPerVnode);
|
||||||
pMsg->cacheNumOfBlocks.fraction = (pCreateDb->numOfAvgCacheBlocks == 0) ? -1 : pCreateDb->numOfAvgCacheBlocks;
|
pMsg->cacheNumOfBlocks.fraction = (pCreateDb->numOfAvgCacheBlocks == 0) ? -1 : pCreateDb->numOfAvgCacheBlocks;
|
||||||
|
|
Loading…
Reference in New Issue