diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index b7b3441bd18606d3b6444e508587f6552efc08ff..c693df1f3b31878f251a3a28a350f9d8a2ff9c5e 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -95,7 +95,7 @@ void taos_query_a(TAOS *taos, const char *sqlstr, __async_cb_func_t fp, void *pa return; } - nPrintTsc(sqlstr); + nPrintTsc("%s", sqlstr); SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj)); if (pSql == NULL) { @@ -365,7 +365,7 @@ static void tscProcessAsyncError(SSchedMsg *pMsg) { void (*fp)() = pMsg->ahandle; terrno = *(int32_t*) pMsg->msg; tfree(pMsg->msg); - (*fp)(pMsg->thandle, NULL, *(int32_t*)pMsg->msg); + (*fp)(pMsg->thandle, NULL, terrno); } void tscQueueAsyncError(void(*fp), void *param, int32_t code) { diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 377cb24b1d5b1c92c702cd113c4feea185617911..92a2198a8089d2ab3e288ca52657df89fbcd5e43 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -327,7 +327,7 @@ TAOS_RES* taos_query_c(TAOS *taos, const char *sqlstr, uint32_t sqlLen, int64_t* return NULL; } - nPrintTsc(sqlstr); + nPrintTsc("%s", sqlstr); SSqlObj* pSql = calloc(1, sizeof(SSqlObj)); if (pSql == NULL) { diff --git a/src/plugins/http/src/httpSql.c b/src/plugins/http/src/httpSql.c index 3e517c6fa682ce28ee2416aee3672a8628f953cf..cc8e9e86e37dea8de50d624435662c1e21ff4a94 100644 --- a/src/plugins/http/src/httpSql.c +++ b/src/plugins/http/src/httpSql.c @@ -181,7 +181,7 @@ void httpProcessMultiSql(HttpContext *pContext) { char *sql = httpGetCmdsString(pContext, cmd->sql); httpTraceL("context:%p, fd:%d, user:%s, process pos:%d, start query, sql:%s", pContext, pContext->fd, pContext->user, multiCmds->pos, sql); - nPrintHttp(sql); + nPrintHttp("%s", sql); taos_query_a(pContext->session->taos, sql, httpProcessMultiSqlCallBack, (void *)pContext); } @@ -329,7 +329,7 @@ void httpProcessSingleSqlCmd(HttpContext *pContext) { } httpTraceL("context:%p, fd:%d, user:%s, start query, sql:%s", pContext, pContext->fd, pContext->user, sql); - nPrintHttp(sql); + nPrintHttp("%s", sql); taos_query_a(pSession->taos, sql, httpProcessSingleSqlCallBack, (void *)pContext); } diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index fe0fa6326339167649d05e142d2cb685b025cdba..57482482be062ee8934d3e9808a096397f35934c 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -409,9 +409,6 @@ void vnodeCleanUp(SVnodeObj *pVnode) { vnodeSetClosingStatus(pVnode); - // release local resources only after cutting off outside connections - qQueryMgmtNotifyClosed(pVnode->qMgmt); - // stop replication module if (pVnode->sync > 0) { int64_t sync = pVnode->sync; diff --git a/src/vnode/src/vnodeStatus.c b/src/vnode/src/vnodeStatus.c index ce7ddd11b529c7da22519af3c657e4e898aea2ea..c016b78396772f917e5eded4e73d375c345a1d55 100644 --- a/src/vnode/src/vnodeStatus.c +++ b/src/vnode/src/vnodeStatus.c @@ -75,6 +75,9 @@ bool vnodeSetClosingStatus(SVnodeObj* pVnode) { } } + // release local resources only after cutting off outside connections + qQueryMgmtNotifyClosed(pVnode->qMgmt); + return true; } @@ -116,6 +119,9 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode) { } } + // release local resources only after cutting off outside connections + qQueryMgmtNotifyClosed(pVnode->qMgmt); + return true; } diff --git a/tests/pytest/functions/function_percentile.py b/tests/pytest/functions/function_percentile.py index e793008ce681a04111fdee29e91520fed944d05a..688e91eefa79348a88f37f3b7cb0cc1ac63152d8 100644 --- a/tests/pytest/functions/function_percentile.py +++ b/tests/pytest/functions/function_percentile.py @@ -144,8 +144,10 @@ class TDTestCase: print("apercentile result: %s" % tdSql.getData(0, 0)) # Test case for: https://jira.taosdata.com:18080/browse/TD-2609 + + # modified for : https://jira.taosdata.com:18080/browse/TD-2627 tdSql.execute("create table st(ts timestamp, k int)") - tdSql.execute("insert into st values(now, -100)") + tdSql.execute("insert into st values(now, -100)(now+1a,-99)") tdSql.query("select apercentile(k, 20) from st") tdSql.checkData(0, 0, -100.00)