modify case
This commit is contained in:
parent
51fc9a7b24
commit
32c00b3801
|
@ -91,9 +91,6 @@ void closeTransporter(SAppInstInfo *pAppInfo) {
|
||||||
static bool clientRpcRfp(int32_t code, tmsg_t msgType) {
|
static bool clientRpcRfp(int32_t code, tmsg_t msgType) {
|
||||||
if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED ||
|
if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED ||
|
||||||
code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) {
|
code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) {
|
||||||
if (msgType == TDMT_VND_QUERY || msgType == TDMT_VND_FETCH) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -125,7 +125,7 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas
|
||||||
p->instKey = key;
|
p->instKey = key;
|
||||||
key = NULL;
|
key = NULL;
|
||||||
tscDebug("new app inst mgr %p, user:%s, ip:%s, port:%d", p, user, ip, port);
|
tscDebug("new app inst mgr %p, user:%s, ip:%s, port:%d", p, user, ip, port);
|
||||||
|
|
||||||
pInst = &p;
|
pInst = &p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,12 +620,12 @@ int32_t scheduleAsyncQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNod
|
||||||
.requestId = pRequest->requestId,
|
.requestId = pRequest->requestId,
|
||||||
.requestObjRefId = pRequest->self};
|
.requestObjRefId = pRequest->self};
|
||||||
SSchedulerReq req = {.pConn = &conn,
|
SSchedulerReq req = {.pConn = &conn,
|
||||||
.pNodeList = pNodeList,
|
.pNodeList = pNodeList,
|
||||||
.pDag = pDag,
|
.pDag = pDag,
|
||||||
.sql = pRequest->sqlstr,
|
.sql = pRequest->sqlstr,
|
||||||
.startTs = pRequest->metric.start,
|
.startTs = pRequest->metric.start,
|
||||||
.fp = schdExecCallback,
|
.fp = schdExecCallback,
|
||||||
.cbParam = &res};
|
.cbParam = &res};
|
||||||
|
|
||||||
int32_t code = schedulerAsyncExecJob(&req, &pRequest->body.queryJob);
|
int32_t code = schedulerAsyncExecJob(&req, &pRequest->body.queryJob);
|
||||||
|
|
||||||
|
@ -672,13 +672,13 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList
|
||||||
.requestId = pRequest->requestId,
|
.requestId = pRequest->requestId,
|
||||||
.requestObjRefId = pRequest->self};
|
.requestObjRefId = pRequest->self};
|
||||||
SSchedulerReq req = {.pConn = &conn,
|
SSchedulerReq req = {.pConn = &conn,
|
||||||
.pNodeList = pNodeList,
|
.pNodeList = pNodeList,
|
||||||
.pDag = pDag,
|
.pDag = pDag,
|
||||||
.sql = pRequest->sqlstr,
|
.sql = pRequest->sqlstr,
|
||||||
.startTs = pRequest->metric.start,
|
.startTs = pRequest->metric.start,
|
||||||
.fp = NULL,
|
.fp = NULL,
|
||||||
.cbParam = NULL,
|
.cbParam = NULL,
|
||||||
.reqKilled = &pRequest->killed};
|
.reqKilled = &pRequest->killed};
|
||||||
|
|
||||||
int32_t code = schedulerExecJob(&req, &pRequest->body.queryJob, &res);
|
int32_t code = schedulerExecJob(&req, &pRequest->body.queryJob, &res);
|
||||||
pRequest->body.resInfo.execRes = res.res;
|
pRequest->body.resInfo.execRes = res.res;
|
||||||
|
@ -877,15 +877,15 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QUERY_EXEC_MODE_SCHEDULE: {
|
case QUERY_EXEC_MODE_SCHEDULE: {
|
||||||
SArray* pMnodeList = taosArrayInit(4, sizeof(SQueryNodeLoad));
|
SArray* pMnodeList = taosArrayInit(4, sizeof(SQueryNodeLoad));
|
||||||
SQueryPlan* pDag = NULL;
|
SQueryPlan* pDag = NULL;
|
||||||
code = getPlan(pRequest, pQuery, &pDag, pMnodeList);
|
code = getPlan(pRequest, pQuery, &pDag, pMnodeList);
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
pRequest->body.subplanNum = pDag->numOfSubplans;
|
pRequest->body.subplanNum = pDag->numOfSubplans;
|
||||||
if (!pRequest->validateOnly) {
|
if (!pRequest->validateOnly) {
|
||||||
SArray* pNodeList = NULL;
|
SArray* pNodeList = NULL;
|
||||||
buildSyncExecNodeList(pRequest, &pNodeList, pMnodeList);
|
buildSyncExecNodeList(pRequest, &pNodeList, pMnodeList);
|
||||||
|
|
||||||
code = scheduleQuery(pRequest, pDag, pNodeList);
|
code = scheduleQuery(pRequest, pDag, pNodeList);
|
||||||
taosArrayDestroy(pNodeList);
|
taosArrayDestroy(pNodeList);
|
||||||
}
|
}
|
||||||
|
@ -966,7 +966,7 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM
|
||||||
.pUser = pRequest->pTscObj->user};
|
.pUser = pRequest->pTscObj->user};
|
||||||
|
|
||||||
SAppInstInfo* pAppInfo = getAppInfo(pRequest);
|
SAppInstInfo* pAppInfo = getAppInfo(pRequest);
|
||||||
SQueryPlan* pDag = NULL;
|
SQueryPlan* pDag = NULL;
|
||||||
code = qCreateQueryPlan(&cxt, &pDag, pMnodeList);
|
code = qCreateQueryPlan(&cxt, &pDag, pMnodeList);
|
||||||
if (code) {
|
if (code) {
|
||||||
tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
|
tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code),
|
||||||
|
@ -1336,7 +1336,7 @@ TAOS* taos_connect_auth(const char* ip, const char* user, const char* auth, cons
|
||||||
|
|
||||||
STscObj* pObj = taos_connect_internal(ip, user, NULL, auth, db, port, CONN_TYPE__QUERY);
|
STscObj* pObj = taos_connect_internal(ip, user, NULL, auth, db, port, CONN_TYPE__QUERY);
|
||||||
if (pObj) {
|
if (pObj) {
|
||||||
int64_t *rid = taosMemoryCalloc(1, sizeof(int64_t));
|
int64_t* rid = taosMemoryCalloc(1, sizeof(int64_t));
|
||||||
*rid = pObj->id;
|
*rid = pObj->id;
|
||||||
return (TAOS*)rid;
|
return (TAOS*)rid;
|
||||||
}
|
}
|
||||||
|
@ -2027,7 +2027,7 @@ void taosAsyncQueryImpl(TAOS* taos, const char* sql, __taos_async_fn_t fp, void*
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t rid = *(int64_t*)taos;
|
int64_t rid = *(int64_t*)taos;
|
||||||
STscObj* pTscObj = acquireTscObj(rid);
|
STscObj* pTscObj = acquireTscObj(rid);
|
||||||
if (pTscObj == NULL || sql == NULL || NULL == fp) {
|
if (pTscObj == NULL || sql == NULL || NULL == fp) {
|
||||||
terrno = TSDB_CODE_INVALID_PARA;
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
|
@ -2063,7 +2063,7 @@ void taosAsyncQueryImpl(TAOS* taos, const char* sql, __taos_async_fn_t fp, void*
|
||||||
pRequest->body.queryFp = fp;
|
pRequest->body.queryFp = fp;
|
||||||
pRequest->body.param = param;
|
pRequest->body.param = param;
|
||||||
doAsyncQuery(pRequest, false);
|
doAsyncQuery(pRequest, false);
|
||||||
releaseTscObj(rid);
|
releaseTscObj(rid);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) {
|
TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) {
|
||||||
|
@ -2072,7 +2072,7 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t rid = *(int64_t*)taos;
|
int64_t rid = *(int64_t*)taos;
|
||||||
STscObj* pTscObj = acquireTscObj(rid);
|
STscObj* pTscObj = acquireTscObj(rid);
|
||||||
if (pTscObj == NULL || sql == NULL) {
|
if (pTscObj == NULL || sql == NULL) {
|
||||||
terrno = TSDB_CODE_TSC_DISCONNECTED;
|
terrno = TSDB_CODE_TSC_DISCONNECTED;
|
||||||
|
|
|
@ -251,9 +251,6 @@ static inline void dmReleaseHandle(SRpcHandleInfo *pHandle, int8_t type) {
|
||||||
static bool rpcRfp(int32_t code, tmsg_t msgType) {
|
static bool rpcRfp(int32_t code, tmsg_t msgType) {
|
||||||
if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED ||
|
if (code == TSDB_CODE_RPC_REDIRECT || code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_NODE_NOT_DEPLOYED ||
|
||||||
code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) {
|
code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_APP_NOT_READY) {
|
||||||
if (msgType == TDMT_VND_QUERY || msgType == TDMT_VND_FETCH) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -124,7 +124,7 @@ if $data(5)[3] != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
#sql reset query cache
|
sql reset query cache
|
||||||
|
|
||||||
print =============== step4: select data
|
print =============== step4: select data
|
||||||
sql show d1.tables
|
sql show d1.tables
|
||||||
|
|
Loading…
Reference in New Issue