commit
2b83bfae7c
|
@ -331,7 +331,7 @@ void tscProcessAsyncRes(SSchedMsg *pMsg) {
|
|||
|
||||
// pCmd may be released, so cache pCmd->command
|
||||
int cmd = pCmd->command;
|
||||
int code = pRes->code;// ? -pRes->code : pRes->numOfRows;
|
||||
int code = pRes->code;
|
||||
|
||||
// in case of async insert, restore the user specified callback function
|
||||
bool shouldFree = tscShouldFreeAsyncSqlObj(pSql);
|
||||
|
|
|
@ -1293,7 +1293,16 @@ int tsParseInsertSql(SSqlObj *pSql) {
|
|||
|
||||
int tsParseSql(SSqlObj *pSql, bool initialParse) {
|
||||
int32_t ret = TSDB_CODE_SUCCESS;
|
||||
|
||||
if (initialParse) {
|
||||
char* p = pSql->sqlstr;
|
||||
pSql->sqlstr = NULL;
|
||||
|
||||
tscFreeSqlObjPartial(pSql);
|
||||
pSql->sqlstr = p;
|
||||
} else {
|
||||
tscTrace("continue parse sql: %s", pSql->asyncTblPos);
|
||||
}
|
||||
|
||||
if (tscIsInsertOrImportData(pSql->sqlstr)) {
|
||||
/*
|
||||
|
@ -1302,8 +1311,6 @@ int tsParseSql(SSqlObj *pSql, bool initialParse) {
|
|||
* the error handle callback function can rightfully restore the user defined function (fp)
|
||||
*/
|
||||
if (initialParse) {
|
||||
tscFreeSqlCmdData(&pSql->cmd);
|
||||
|
||||
// replace user defined callback function with multi-insert proxy function
|
||||
pSql->fetchFp = pSql->fp;
|
||||
pSql->fp = (void(*)())tscHandleMultivnodeInsert;
|
||||
|
@ -1316,10 +1323,6 @@ int tsParseSql(SSqlObj *pSql, bool initialParse) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (initialParse) {
|
||||
tscFreeSqlCmdData(&pSql->cmd);
|
||||
}
|
||||
|
||||
SSqlInfo SQLInfo = {0};
|
||||
tSQLParse(&SQLInfo, pSql->sqlstr);
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ int taos_query(TAOS *taos, const char *sqlstr) {
|
|||
SSqlObj* pSql = pObj->pSql;
|
||||
|
||||
size_t sqlLen = strlen(sqlstr);
|
||||
doAsyncQuery(pObj, pObj->pSql, waitForQueryRsp, taos, sqlstr, sqlLen);
|
||||
doAsyncQuery(pObj, pSql, waitForQueryRsp, taos, sqlstr, sqlLen);
|
||||
|
||||
// wait for the callback function to post the semaphore
|
||||
sem_wait(&pSql->rspSem);
|
||||
|
|
|
@ -466,9 +466,14 @@ void tscFreeSqlObjPartial(SSqlObj* pSql) {
|
|||
|
||||
tscFreeSqlResult(pSql);
|
||||
tfree(pSql->pSubs);
|
||||
pSql->numOfSubs = 0;
|
||||
|
||||
taosHashCleanup(pSql->pTableHashList);
|
||||
|
||||
pSql->freed = 0;
|
||||
pSql->numOfSubs = 0;
|
||||
pSql->pTableHashList = NULL;
|
||||
pSql->asyncTblPos = NULL;
|
||||
|
||||
tscFreeSqlCmdData(pCmd);
|
||||
|
||||
tscTrace("%p partially free sqlObj completed", pSql);
|
||||
|
|
Loading…
Reference in New Issue