提交 9f015223 编写于 作者: D dapan1121

fix: fix stop query

上级 7fcf80a8
......@@ -1293,6 +1293,7 @@ void catalogDestroy(void) {
if (!taosCheckCurrentInDll()) {
ctgClearCacheEnqueue(NULL, true, true, true);
taosThreadJoin(gCtgMgmt.updateThread, NULL);
}
taosHashCleanup(gCtgMgmt.pCluster);
......
......@@ -431,7 +431,7 @@ static int32_t taosDecRefCount(int32_t rsetId, int64_t rid, int32_t remove) {
}
released = 1;
} else {
uTrace("rsetId:%d p:%p rid:%" PRId64 " is released", rsetId, pNode->p, rid);
uTrace("rsetId:%d p:%p rid:%" PRId64 " is released, remain count %d", rsetId, pNode->p, rid, pNode->count);
}
} else {
uTrace("rsetId:%d rid:%" PRId64 " is not there, failed to release/remove", rsetId, rid);
......
......@@ -36,7 +36,7 @@ int64_t st, et;
char hostName[128];
char dbName[128];
char tbName[128];
int32_t runTimes = 10000;
int32_t runTimes = 1000;
typedef struct {
int id;
......@@ -88,6 +88,7 @@ static void sqExecSQLE(TAOS *taos, char *command) {
void sqExit(char* prefix, const char* errMsg) {
fprintf(stderr, "%s error: %s\n", prefix, errMsg);
sleep(10000);
exit(1);
}
......@@ -141,16 +142,20 @@ void sqCloseFetchCb(void *param, TAOS_RES *pRes, int numOfRows) {
taos_close(qParam->taos);
*qParam->end = 1;
taos_free_result(pRes);
}
void sqCloseQueryCb(void *param, TAOS_RES *pRes, int code) {
SSP_CB_PARAM *qParam = (SSP_CB_PARAM *)param;
if (code == 0 && pRes) {
if (qParam->fetch) {
taos_fetch_rows_a(pRes, sqFreeFetchCb, param);
taos_fetch_rows_a(pRes, sqCloseFetchCb, param);
} else {
taos_close(qParam->taos);
*qParam->end = 1;
taos_free_result(pRes);
}
} else {
sqExit("select", taos_errstr(pRes));
......@@ -358,6 +363,7 @@ int sqCloseSyncQuery(bool fetch) {
}
taos_close(taos);
taos_free_result(pRes);
}
CASE_LEAVE();
}
......@@ -382,7 +388,7 @@ int sqCloseAsyncQuery(bool fetch) {
SSP_CB_PARAM param = {0};
param.fetch = fetch;
param.end = &qEnd;
taos_query_a(taos, sql, sqFreeQueryCb, &param);
taos_query_a(taos, sql, sqCloseQueryCb, &param);
while (0 == qEnd) {
usleep(5000);
}
......@@ -640,7 +646,7 @@ void sqRunAllCase(void) {
int32_t l = 5;
while (l) {
printf("%d\n", l--);
sleep(1);
sleep(1000);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册