提交 6843fd6e 编写于 作者: H Hongze Cheng

Merge branch 'develop' into feature/TD-1925_new

...@@ -95,7 +95,7 @@ void taos_query_a(TAOS *taos, const char *sqlstr, __async_cb_func_t fp, void *pa ...@@ -95,7 +95,7 @@ void taos_query_a(TAOS *taos, const char *sqlstr, __async_cb_func_t fp, void *pa
return; return;
} }
nPrintTsc(sqlstr); nPrintTsc("%s", sqlstr);
SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj)); SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj));
if (pSql == NULL) { if (pSql == NULL) {
...@@ -365,7 +365,7 @@ static void tscProcessAsyncError(SSchedMsg *pMsg) { ...@@ -365,7 +365,7 @@ static void tscProcessAsyncError(SSchedMsg *pMsg) {
void (*fp)() = pMsg->ahandle; void (*fp)() = pMsg->ahandle;
terrno = *(int32_t*) pMsg->msg; terrno = *(int32_t*) pMsg->msg;
tfree(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) { void tscQueueAsyncError(void(*fp), void *param, int32_t code) {
......
...@@ -327,7 +327,7 @@ TAOS_RES* taos_query_c(TAOS *taos, const char *sqlstr, uint32_t sqlLen, int64_t* ...@@ -327,7 +327,7 @@ TAOS_RES* taos_query_c(TAOS *taos, const char *sqlstr, uint32_t sqlLen, int64_t*
return NULL; return NULL;
} }
nPrintTsc(sqlstr); nPrintTsc("%s", sqlstr);
SSqlObj* pSql = calloc(1, sizeof(SSqlObj)); SSqlObj* pSql = calloc(1, sizeof(SSqlObj));
if (pSql == NULL) { if (pSql == NULL) {
......
...@@ -181,7 +181,7 @@ void httpProcessMultiSql(HttpContext *pContext) { ...@@ -181,7 +181,7 @@ void httpProcessMultiSql(HttpContext *pContext) {
char *sql = httpGetCmdsString(pContext, cmd->sql); 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, httpTraceL("context:%p, fd:%d, user:%s, process pos:%d, start query, sql:%s", pContext, pContext->fd, pContext->user,
multiCmds->pos, sql); multiCmds->pos, sql);
nPrintHttp(sql); nPrintHttp("%s", sql);
taos_query_a(pContext->session->taos, sql, httpProcessMultiSqlCallBack, (void *)pContext); taos_query_a(pContext->session->taos, sql, httpProcessMultiSqlCallBack, (void *)pContext);
} }
...@@ -329,7 +329,7 @@ void httpProcessSingleSqlCmd(HttpContext *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); 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); taos_query_a(pSession->taos, sql, httpProcessSingleSqlCallBack, (void *)pContext);
} }
......
...@@ -409,9 +409,6 @@ void vnodeCleanUp(SVnodeObj *pVnode) { ...@@ -409,9 +409,6 @@ void vnodeCleanUp(SVnodeObj *pVnode) {
vnodeSetClosingStatus(pVnode); vnodeSetClosingStatus(pVnode);
// release local resources only after cutting off outside connections
qQueryMgmtNotifyClosed(pVnode->qMgmt);
// stop replication module // stop replication module
if (pVnode->sync > 0) { if (pVnode->sync > 0) {
int64_t sync = pVnode->sync; int64_t sync = pVnode->sync;
......
...@@ -75,6 +75,9 @@ bool vnodeSetClosingStatus(SVnodeObj* pVnode) { ...@@ -75,6 +75,9 @@ bool vnodeSetClosingStatus(SVnodeObj* pVnode) {
} }
} }
// release local resources only after cutting off outside connections
qQueryMgmtNotifyClosed(pVnode->qMgmt);
return true; return true;
} }
...@@ -116,6 +119,9 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode) { ...@@ -116,6 +119,9 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode) {
} }
} }
// release local resources only after cutting off outside connections
qQueryMgmtNotifyClosed(pVnode->qMgmt);
return true; return true;
} }
......
...@@ -144,8 +144,10 @@ class TDTestCase: ...@@ -144,8 +144,10 @@ class TDTestCase:
print("apercentile result: %s" % tdSql.getData(0, 0)) print("apercentile result: %s" % tdSql.getData(0, 0))
# Test case for: https://jira.taosdata.com:18080/browse/TD-2609 # 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("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.query("select apercentile(k, 20) from st")
tdSql.checkData(0, 0, -100.00) tdSql.checkData(0, 0, -100.00)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册