From ee427b165614fb9727ff7c9e3832b6eab10bb851 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 29 Dec 2020 09:01:46 +0000 Subject: [PATCH] pass sql string to server for debug --- src/client/src/tscServer.c | 2 ++ src/inc/taosmsg.h | 1 + src/query/inc/qExecutor.h | 1 + src/query/src/qExecutor.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index f7a2236262..fc1ed1a177 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -721,6 +721,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pQueryMsg->numOfTags = htonl(numOfTags); pQueryMsg->queryType = htonl(pQueryInfo->type); pQueryMsg->vgroupLimit = htobe64(pQueryInfo->vgroupLimit); + + strcpy(pQueryMsg->sqlstr, pSql->sqlstr); size_t numOfOutput = tscSqlExprNumOfExprs(pQueryInfo); pQueryMsg->numOfOutput = htons((int16_t)numOfOutput); // this is the stage one output column number diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 200fe2b0f9..c48ebfe852 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -494,6 +494,7 @@ typedef struct { int32_t tsNumOfBlocks; // ts comp block numbers int32_t tsOrder; // ts comp block order int32_t numOfTags; // number of tags columns involved + char sqlstr[256]; SColumnInfo colList[]; } SQueryTableMsg; diff --git a/src/query/inc/qExecutor.h b/src/query/inc/qExecutor.h index 201b3b2abc..59c800d553 100644 --- a/src/query/inc/qExecutor.h +++ b/src/query/inc/qExecutor.h @@ -172,6 +172,7 @@ typedef struct SQuery { SOrderedPrjQueryInfo prjInfo; // limit value for each vgroup, only available in global order projection query. SSingleColumnFilterInfo* pFilterInfo; + char sqlstr[256]; } SQuery; typedef struct SQueryRuntimeEnv { diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 7fb366160c..eca4d55e78 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6837,6 +6837,8 @@ static int32_t initQInfo(SQueryTableMsg *pQueryMsg, void *tsdb, int32_t vgId, SQ int32_t code = TSDB_CODE_SUCCESS; SQuery *pQuery = pQInfo->runtimeEnv.pQuery; + strcpy(pQuery->sqlstr, pQueryMsg->sqlstr); + STSBuf *pTSBuf = NULL; if (pQueryMsg->tsLen > 0) { // open new file to save the result char *tsBlock = (char *) pQueryMsg + pQueryMsg->tsOffset; -- GitLab