diff --git a/Jenkinsfile2 b/Jenkinsfile2 index a2b55e3acca0c141a2d550ccabb5bb129adb3d7e..950b316bab8110ef5da8522023b3971e2f35d4da 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -4,8 +4,10 @@ import jenkins.model.CauseOfInterruption node { } -def skipbuild=0 -def win_stop=0 +win_test_stage = 0 +linux_ready = 0 +linux_node_ip = "" +linux_node_pass = "" def abortPreviousBuilds() { def currentJobName = env.JOB_NAME @@ -227,6 +229,16 @@ def pre_test_win(){ cd C:\\workspace\\%EXECUTOR_NUMBER%\\TDinternal\\community git submodule update --init --recursive ''' + bat ''' + cd C:\\workspace\\%EXECUTOR_NUMBER%\\taos-connector-python + git branch + git reset --hard + git pull + ''' + bat ''' + cd C:\\workspace\\%EXECUTOR_NUMBER%\\taos-connector-python + git log -5 + ''' } def pre_test_build_win() { bat ''' @@ -246,8 +258,38 @@ def pre_test_build_win() { jom -j 6 || exit 8 time /t ''' + bat ''' + cd C:\\workspace\\%EXECUTOR_NUMBER%\\taos-connector-python + python -m pip install . + xcopy /e/y/i/f C:\\workspace\\%EXECUTOR_NUMBER%\\TDinternal\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 + ''' return 1 } +def run_win_ctest() { + bat ''' + echo "windows ctest ..." + time /t + cd C:\\workspace\\%EXECUTOR_NUMBER%\\TDinternal\\debug + ctest -j 1 || exit 7 + time /t + ''' +} +def run_win_test() { + echo "LINUX NODE: ${linux_node_ip} - ${linux_node_pass}" + bat ''' + echo "windows test ..." + cd C:\\workspace\\%EXECUTOR_NUMBER%\\taos-connector-python + python -m pip install . + xcopy /e/y/i/f C:\\workspace\\%EXECUTOR_NUMBER%\\TDinternal\\debug\\build\\lib\\taos.dll C:\\Windows\\System32 + ls -l C:\\Windows\\System32\\taos.dll + time /t + cd C:\\workspace\\%EXECUTOR_NUMBER%\\TDinternal\\community\\tests\\system-test + echo "node: ''' + linux_node_ip + ''':''' + linux_node_pass + '''" + echo "testing ..." + test-all.bat "{\\\"host\\\":\\\"''' + linux_node_ip + '''\\\",\\\"port\\\":22,\\\"user\\\":\\\"root\\\",\\\"password\\\":\\\"''' + linux_node_pass + '''\\\",\\\"path\\\":\\\"/var/lib/jenkins/workspace/TDinternal\\\"}" + time /t + ''' +} pipeline { agent none @@ -264,8 +306,22 @@ pipeline { stage('windows test') { agent{label " windows10_01 || windows10_02 || windows10_03 || windows10_04 "} steps { - pre_test_win() - pre_test_build_win() + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + timeout(time: 55, unit: 'MINUTES'){ + pre_test_win() + pre_test_build_win() + run_win_ctest() + script { + while(linux_ready == 0) { + sleep(8) + } + } + run_win_test() + } + } + script { + win_test_stage = 1 + } } } stage('linux test') { @@ -275,22 +331,78 @@ pipeline { changeRequest() } steps { - timeout(time: 40, unit: 'MINUTES'){ - pre_test() - script { - sh ''' - cd ${WKC}/tests/parallel_test - date - time ./container_build.sh -w ${WKDIR} -t 8 -e - rm -f /tmp/cases.task - ./collect_cases.sh -e - ''' - sh ''' - cd ${WKC}/tests/parallel_test - export DEFAULT_RETRY_TIME=2 - date - timeout 2100 time ./run.sh -e -m /home/m.json -t /tmp/cases.task -b ${BRANCH_NAME}_${BUILD_ID} -l ${WKDIR}/log -o 480 - ''' + script { + linux_node_ip = sh ( + script: 'jq .ip /home/node_info.json | sed "s/\\\"//g"', + returnStdout: true + ).trim() + linux_node_pass = sh ( + script: 'jq .password /home/node_info.json | sed "s/\\\"//g" |sed "s/\\!/^^^^^^^^\\!/g"', + returnStdout: true + ).trim() + echo "${linux_node_ip}:${linux_node_pass}" + } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + timeout(time: 40, unit: 'MINUTES'){ + pre_test() + script { + sh ''' + date + rm -rf ${WKC}/debug + cd ${WKC}/tests/parallel_test + time ./container_build.sh -w ${WKDIR} -t 8 -e + rm -f /tmp/cases.task + ./collect_cases.sh -e + ''' + sh ''' + cd ${WKC}/tests/parallel_test + export DEFAULT_RETRY_TIME=2 + date + timeout 2100 time ./run.sh -e -m /home/m.json -t /tmp/cases.task -b ${BRANCH_NAME}_${BUILD_ID} -l ${WKDIR}/log -o 480 + ''' + } + } + } + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + timeout(time: 15, unit: 'MINUTES'){ + script { + sh ''' + echo "packaging ..." + date + rm -rf ${WKC}/release/* + cd ${WKC}/packaging + ./release.sh -v cluster -n 3.0.0.100 -s static + ''' + sh ''' + echo "install ..." + cd ${WKC}/release + tar xzf TDengine-enterprise-server-3.0.0.100-Linux-x64.tar.gz + cd TDengine-enterprise-server-3.0.0.100 + service taosd stop || : + rm -rf /var/lib/taos + ./install.sh -e no + ''' + sh ''' + echo "checking ..." + which taos + which taosd + rm -rf ${WK}/debug + mv ${WKC}/debug ${WK}/ + ''' + sh ''' + echo "install taospy ..." + cd ${WKPY} + pip3 install . + ''' + } + } + } + script { + linux_ready = 1 + } + script { + while(win_test_stage == 0){ + sleep(12) } } } diff --git a/include/common/tmsg.h b/include/common/tmsg.h index ee858ad506c91650ad3a7dc0bd3da8f6ad44b81a..507ce7ebaf23d4ea3e36350c119d440467d0d230 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2397,16 +2397,26 @@ static int32_t tDecodeTSmaWrapper(SDecoder* pDecoder, STSmaWrapper* pReq) { } typedef struct { - int64_t tsmaIndexUid; + int64_t indexUid; STimeWindow queryWindow; } SVGetTsmaExpWndsReq; +#define SMA_WNDS_EXPIRE_FLAG (0x1) +#define SMA_WNDS_IS_EXPIRE(flag) (((flag)&SMA_WNDS_EXPIRE_FLAG) != 0) +#define SMA_WNDS_SET_EXPIRE(flag) ((flag) |= SMA_WNDS_EXPIRE_FLAG) + typedef struct { - int64_t tsmaIndexUid; + int64_t indexUid; + int8_t flags; // 0x1 all window expired int32_t numExpWnds; - TSKEY* expWndsStartTs; + TSKEY wndSKeys[]; } SVGetTsmaExpWndsRsp; +int32_t tEncodeSVGetTSmaExpWndsReq(SEncoder* pCoder, const SVGetTsmaExpWndsReq* pReq); +int32_t tDecodeSVGetTsmaExpWndsReq(SDecoder* pCoder, SVGetTsmaExpWndsReq* pReq); +int32_t tEncodeSVGetTSmaExpWndsRsp(SEncoder* pCoder, const SVGetTsmaExpWndsRsp* pReq); +int32_t tDecodeSVGetTsmaExpWndsRsp(SDecoder* pCoder, SVGetTsmaExpWndsRsp* pReq); + typedef struct { int idx; } SMCreateFullTextReq; @@ -2670,23 +2680,27 @@ typedef struct { int32_t tEncodeSVSubmitReq(SEncoder* pCoder, const SVSubmitReq* pReq); int32_t tDecodeSVSubmitReq(SDecoder* pCoder, SVSubmitReq* pReq); -// TDMT_VND_DELETE typedef struct { - TSKEY sKey; - TSKEY eKey; - - // super table - char* stbName; - - // child/normal - char* tbName; + int64_t delUid; + int64_t tbUid; // super/child/normal table + int8_t type; // table type + int16_t nWnds; + char* tbFullName; + char* subPlan; + STimeWindow wnds[]; } SVDeleteReq; +int32_t tEncodeSVDeleteReq(SEncoder* pCoder, const SVDeleteReq* pReq); +int32_t tDecodeSVDeleteReq(SDecoder* pCoder, SVDeleteReq* pReq); + typedef struct { int32_t code; - // TODO + int64_t affectedRows; } SVDeleteRsp; +int32_t tEncodeSVDeleteRsp(SEncoder* pCoder, const SVDeleteRsp* pReq); +int32_t tDecodeSVDeleteRsp(SDecoder* pCoder, SVDeleteRsp* pReq); + #pragma pack(pop) #ifdef __cplusplus diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index c3b0e54f3da416ccc2e2b2dbd6c05ec356a50a30..d28f87cb6ad8925a26753bfc053e98b0ebe331ae 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -193,65 +193,66 @@ #define TK_REDISTRIBUTE 175 #define TK_SPLIT 176 #define TK_SYNCDB 177 -#define TK_NULL 178 -#define TK_NK_QUESTION 179 -#define TK_NK_ARROW 180 -#define TK_ROWTS 181 -#define TK_TBNAME 182 -#define TK_QSTARTTS 183 -#define TK_QENDTS 184 -#define TK_WSTARTTS 185 -#define TK_WENDTS 186 -#define TK_WDURATION 187 -#define TK_CAST 188 -#define TK_NOW 189 -#define TK_TODAY 190 -#define TK_TIMEZONE 191 -#define TK_COUNT 192 -#define TK_FIRST 193 -#define TK_LAST 194 -#define TK_LAST_ROW 195 -#define TK_BETWEEN 196 -#define TK_IS 197 -#define TK_NK_LT 198 -#define TK_NK_GT 199 -#define TK_NK_LE 200 -#define TK_NK_GE 201 -#define TK_NK_NE 202 -#define TK_MATCH 203 -#define TK_NMATCH 204 -#define TK_CONTAINS 205 -#define TK_JOIN 206 -#define TK_INNER 207 -#define TK_SELECT 208 -#define TK_DISTINCT 209 -#define TK_WHERE 210 -#define TK_PARTITION 211 -#define TK_BY 212 -#define TK_SESSION 213 -#define TK_STATE_WINDOW 214 -#define TK_SLIDING 215 -#define TK_FILL 216 -#define TK_VALUE 217 -#define TK_NONE 218 -#define TK_PREV 219 -#define TK_LINEAR 220 -#define TK_NEXT 221 -#define TK_HAVING 222 -#define TK_ORDER 223 -#define TK_SLIMIT 224 -#define TK_SOFFSET 225 -#define TK_LIMIT 226 -#define TK_OFFSET 227 -#define TK_ASC 228 -#define TK_NULLS 229 -#define TK_ID 230 -#define TK_NK_BITNOT 231 -#define TK_INSERT 232 -#define TK_VALUES 233 -#define TK_IMPORT 234 -#define TK_NK_SEMI 235 -#define TK_FILE 236 +#define TK_DELETE 178 +#define TK_NULL 179 +#define TK_NK_QUESTION 180 +#define TK_NK_ARROW 181 +#define TK_ROWTS 182 +#define TK_TBNAME 183 +#define TK_QSTARTTS 184 +#define TK_QENDTS 185 +#define TK_WSTARTTS 186 +#define TK_WENDTS 187 +#define TK_WDURATION 188 +#define TK_CAST 189 +#define TK_NOW 190 +#define TK_TODAY 191 +#define TK_TIMEZONE 192 +#define TK_COUNT 193 +#define TK_FIRST 194 +#define TK_LAST 195 +#define TK_LAST_ROW 196 +#define TK_BETWEEN 197 +#define TK_IS 198 +#define TK_NK_LT 199 +#define TK_NK_GT 200 +#define TK_NK_LE 201 +#define TK_NK_GE 202 +#define TK_NK_NE 203 +#define TK_MATCH 204 +#define TK_NMATCH 205 +#define TK_CONTAINS 206 +#define TK_JOIN 207 +#define TK_INNER 208 +#define TK_SELECT 209 +#define TK_DISTINCT 210 +#define TK_WHERE 211 +#define TK_PARTITION 212 +#define TK_BY 213 +#define TK_SESSION 214 +#define TK_STATE_WINDOW 215 +#define TK_SLIDING 216 +#define TK_FILL 217 +#define TK_VALUE 218 +#define TK_NONE 219 +#define TK_PREV 220 +#define TK_LINEAR 221 +#define TK_NEXT 222 +#define TK_HAVING 223 +#define TK_ORDER 224 +#define TK_SLIMIT 225 +#define TK_SOFFSET 226 +#define TK_LIMIT 227 +#define TK_OFFSET 228 +#define TK_ASC 229 +#define TK_NULLS 230 +#define TK_ID 231 +#define TK_NK_BITNOT 232 +#define TK_INSERT 233 +#define TK_VALUES 234 +#define TK_IMPORT 235 +#define TK_NK_SEMI 236 +#define TK_FILE 237 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 15e5e14e41e2eb3b7bc0036932102d42cefecf79..de5a40d969ea62128f2abaef6e9c075b4c8c7447 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -180,6 +180,7 @@ typedef enum ENodeType { QUERY_NODE_KILL_CONNECTION_STMT, QUERY_NODE_KILL_QUERY_STMT, QUERY_NODE_KILL_TRANSACTION_STMT, + QUERY_NODE_DELETE_STMT, QUERY_NODE_QUERY, // logic plan node diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index e4af78892baaf3757ab58be41fec776e2cb7186f..c2aa86e89f731cb6fdadb2911e805b55454fe2b4 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -60,6 +60,7 @@ typedef struct SColumnNode { int8_t tableType; col_id_t colId; EColumnType colType; // column or tag + bool hasIndex; char dbName[TSDB_DB_NAME_LEN]; char tableName[TSDB_TABLE_NAME_LEN]; char tableAlias[TSDB_TABLE_NAME_LEN]; @@ -258,6 +259,7 @@ typedef struct SSetOperator { SNodeList* pOrderByList; // SOrderByExprNode SNode* pLimit; char stmtName[TSDB_TABLE_NAME_LEN]; + uint8_t precision; } SSetOperator; typedef enum ESqlClause { @@ -272,6 +274,17 @@ typedef enum ESqlClause { SQL_CLAUSE_ORDER_BY } ESqlClause; +typedef struct SDeleteStmt { + ENodeType type; // QUERY_NODE_DELETE_STMT + SNode* pFromTable; // FROM clause + SNode* pWhere; // WHERE clause + SNode* pCountFunc; // count the number of rows affected + SNode* pTagIndexCond; // pWhere divided into pTagIndexCond and timeRange + STimeWindow timeRange; + uint8_t precision; + bool deleteZeroRows; +} SDeleteStmt; + typedef enum { PAYLOAD_TYPE_KV = 0, PAYLOAD_TYPE_RAW = 1, @@ -363,8 +376,11 @@ bool nodesIsRegularOp(const SOperatorNode* pOp); void* nodesGetValueFromNode(SValueNode* pNode); int32_t nodesSetValueNodeValue(SValueNode* pNode, void* value); char* nodesGetStrValueFromNode(SValueNode* pNode); -char* getFillModeString(EFillMode mode); -void valueNodeToVariant(const SValueNode* pNode, SVariant* pVal); +void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal); + +char* nodesGetFillModeString(EFillMode mode); +int32_t nodesMergeConds(SNode** pDst, SNodeList** pSrc); +int32_t nodesPartitionCond(SNode** pCondition, SNode** pPrimaryKeyCond, SNode** pTagCond, SNode** pOtherCond); #ifdef __cplusplus } diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 526c8609bf50b8c82539f27c8aca2a0636115361..2d016cab9eb52f4155da4ca21019e5a0023c7365 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -649,6 +649,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_PAR_INVALID_COL_JSON TAOS_DEF_ERROR_CODE(0, 0x2652) #define TSDB_CODE_PAR_VALUE_TOO_LONG TAOS_DEF_ERROR_CODE(0, 0x2653) #define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2654) +#define TSDB_CODE_PAR_INVALID_DELETE_WHERE TAOS_DEF_ERROR_CODE(0, 0x2655) //planner #define TSDB_CODE_PLAN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x2700) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index e7ee164be725465a0368e39d2f7dcfc9a24eb5d9..477eff00047f5c78b7f09514cd12c21dda35c67d 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3742,6 +3742,111 @@ int32_t tDecodeSVDropTSmaReq(SDecoder *pCoder, SVDropTSmaReq *pReq) { return 0; } +int32_t tEncodeSVGetTSmaExpWndsReq(SEncoder* pCoder, const SVGetTsmaExpWndsReq* pReq) { + if (tStartEncode(pCoder) < 0) return -1; + + if (tEncodeI64(pCoder, pReq->indexUid) < 0) return -1; + if (tEncodeI64(pCoder, pReq->queryWindow.skey) < 0) return -1; + if (tEncodeI64(pCoder, pReq->queryWindow.ekey) < 0) return -1; + + tEndEncode(pCoder); + return 0; +} + +int32_t tDecodeSVGetTsmaExpWndsReq(SDecoder* pCoder, SVGetTsmaExpWndsReq* pReq) { + if (tStartDecode(pCoder) < 0) return -1; + + if (tDecodeI64(pCoder, &pReq->indexUid) < 0) return -1; + if (tDecodeI64(pCoder, &pReq->queryWindow.skey) < 0) return -1; + if (tDecodeI64(pCoder, &pReq->queryWindow.ekey) < 0) return -1; + + tEndDecode(pCoder); + return 0; +} + +int32_t tEncodeSVGetTSmaExpWndsRsp(SEncoder* pCoder, const SVGetTsmaExpWndsRsp* pReq) { + if (tStartEncode(pCoder) < 0) return -1; + + if (tEncodeI64(pCoder, pReq->indexUid) < 0) return -1; + if (tEncodeI8(pCoder, pReq->flags) < 0) return -1; + if (tEncodeI32(pCoder, pReq->numExpWnds) < 0) return -1; + for (int32_t i = 0; i < pReq->numExpWnds; ++i) { + if (tEncodeI64(pCoder, pReq->wndSKeys[i]) < 0) return -1; + } + tEndEncode(pCoder); + return 0; +} + +int32_t tDecodeSVGetTsmaExpWndsRsp(SDecoder *pCoder, SVGetTsmaExpWndsRsp *pReq) { + if (tStartDecode(pCoder) < 0) return -1; + + if (tDecodeI64(pCoder, &pReq->indexUid) < 0) return -1; + if (tDecodeI8(pCoder, &pReq->flags) < 0) return -1; + if (tDecodeI32(pCoder, &pReq->numExpWnds) < 0) return -1; + for (int32_t i = 0; i < pReq->numExpWnds; ++i) { + if (tDecodeI64(pCoder, &pReq->wndSKeys[i]) < 0) return -1; + } + + tEndDecode(pCoder); + return 0; +} + +int32_t tEncodeSVDeleteReq(SEncoder* pCoder, const SVDeleteReq* pReq) { + if (tStartEncode(pCoder) < 0) return -1; + + if (tEncodeI64(pCoder, pReq->delUid) < 0) return -1; + if (tEncodeI64(pCoder, pReq->tbUid) < 0) return -1; + if (tEncodeI8(pCoder, pReq->type) < 0) return -1; + if (tEncodeI16v(pCoder, pReq->nWnds) < 0) return -1; + if (tEncodeCStr(pCoder, pReq->tbFullName) < 0) return -1; + if (tEncodeCStr(pCoder, pReq->subPlan) < 0) return -1; + for (int16_t i = 0; i < pReq->nWnds; ++i) { + if (tEncodeI64(pCoder, pReq->wnds[i].skey) < 0) return -1; + if (tEncodeI64(pCoder, pReq->wnds[i].ekey) < 0) return -1; + } + + tEndEncode(pCoder); + return 0; +} + +int32_t tDecodeSVDeleteReq(SDecoder* pCoder, SVDeleteReq* pReq) { + if (tStartDecode(pCoder) < 0) return -1; + + if (tDecodeI64(pCoder, &pReq->delUid) < 0) return -1; + if (tDecodeI64(pCoder, &pReq->tbUid) < 0) return -1; + if (tDecodeI8(pCoder, &pReq->type) < 0) return -1; + if (tDecodeI16v(pCoder, &pReq->nWnds) < 0) return -1; + if (tDecodeCStr(pCoder, &pReq->tbFullName) < 0) return -1; + if (tDecodeCStr(pCoder, &pReq->subPlan) < 0) return -1; + for (int16_t i = 0; i < pReq->nWnds; ++i) { + if (tDecodeI64(pCoder, &pReq->wnds[i].skey) < 0) return -1; + if (tDecodeI64(pCoder, &pReq->wnds[i].ekey) < 0) return -1; + } + + tEndDecode(pCoder); + return 0; +} + +int32_t tEncodeSVDeleteRsp(SEncoder* pCoder, const SVDeleteRsp* pReq) { + if (tStartEncode(pCoder) < 0) return -1; + + if (tEncodeI32(pCoder, pReq->code) < 0) return -1; + if (tEncodeI64(pCoder, pReq->affectedRows) < 0) return -1; + + tEndEncode(pCoder); + return 0; +} + +int32_t tDecodeSVDeleteRsp(SDecoder* pCoder, SVDeleteRsp* pReq) { + if (tStartDecode(pCoder) < 0) return -1; + + if (tDecodeI32(pCoder, &pReq->code) < 0) return -1; + if (tDecodeI64(pCoder, &pReq->affectedRows) < 0) return -1; + + tEndDecode(pCoder); + return 0; +} + int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateStreamReq *pReq) { int32_t sqlLen = 0; int32_t astLen = 0; diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 60be28167d53cd0b23e65787d37f91d38281e95a..bf0fd9859fa3b2406a126d3598f892e4203be98e 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -503,7 +503,7 @@ typedef struct SProjectOperatorInfo { // SOptrBasicInfo should be first, SAggSupporter should be second for stream encode SOptrBasicInfo binfo; SAggSupporter aggSup; - + SNode* pFilterNode; // filter info, which is push down by optimizer SSDataBlock* existDataBlock; SArray* pPseudoColInfo; SLimit limit; @@ -706,7 +706,7 @@ int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t *order, int32_t* scan int32_t getBufferPgSize(int32_t rowSize, uint32_t* defaultPgsz, uint32_t* defaultBufsz); void doSetOperatorCompleted(SOperatorInfo* pOperator); -void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock, SArray* pColMatchInfo); +void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock); SqlFunctionCtx* createSqlFunctionCtx(SExprInfo* pExprInfo, int32_t numOfOutput, int32_t** rowCellInfoOffset); void relocateColumnData(SSDataBlock* pBlock, const SArray* pColMatchInfo, SArray* pCols); void initExecTimeWindowInfo(SColumnInfoData* pColData, STimeWindow* pQueryWindow); @@ -738,7 +738,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExprInfo, int32_t numOfCols, SSDataBlock* pResultBlock, SExprInfo* pScalarExprInfo, int32_t numOfScalarExpr, SExecTaskInfo* pTaskInfo); -SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExprInfo, int32_t num, SSDataBlock* pResBlock, SLimit* pLimit, SLimit* pSlimit, SExecTaskInfo* pTaskInfo); +SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExprInfo, int32_t num, SSDataBlock* pResBlock, SLimit* pLimit, SLimit* pSlimit, SNode* pCondition, SExecTaskInfo* pTaskInfo); SOperatorInfo *createSortOperatorInfo(SOperatorInfo* downstream, SSDataBlock* pResBlock, SArray* pSortInfo, SExprInfo* pExprInfo, int32_t numOfCols, SArray* pIndexMap, SExecTaskInfo* pTaskInfo); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 8388253975fe69c7c328003adbcb61975bd66fbd..95c3d4404295ee5d5fd7d1c7aeb0233e43f3595f 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -345,7 +345,6 @@ SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pR // In case of group by column query, the required SResultRow object must be existInCurrentResusltRowInfo in the // pResultRowInfo object. if (p1 != NULL) { - // todo pResult = getResultRowByPos(pResultBuf, p1); ASSERT(pResult->pageId == p1->pageId && pResult->offset == p1->offset); @@ -356,7 +355,7 @@ SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pR if (pResultRowInfo->cur.pageId != -1 && ((pResult == NULL) || (pResult->pageId != pResultRowInfo->cur.pageId && pResult->offset != pResultRowInfo->cur.offset))) { SResultRowPosition pos = pResultRowInfo->cur; - SFilePage* pPage = getBufPage(pResultBuf, pos.pageId); + SFilePage* pPage = getBufPage(pResultBuf, pos.pageId); releaseBufPage(pResultBuf, pPage); } @@ -369,7 +368,8 @@ SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pR // add a new result set for a new group SResultRowPosition pos = {.pageId = pResult->pageId, .offset = pResult->offset}; - taosHashPut(pSup->pResultRowHashTable, pSup->keyBuf, GET_RES_WINDOW_KEY_LEN(bytes), &pos, sizeof(SResultRowPosition)); + taosHashPut(pSup->pResultRowHashTable, pSup->keyBuf, GET_RES_WINDOW_KEY_LEN(bytes), &pos, + sizeof(SResultRowPosition)); } // 2. set the new time window to be the new active time window @@ -551,7 +551,6 @@ void initExecTimeWindowInfo(SColumnInfoData* pColData, STimeWindow* pQueryWindow colDataAppendInt64(pColData, 4, &pQueryWindow->ekey); } - void doApplyFunctions(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, STimeWindow* pWin, SColumnInfoData* pTimeWindowData, int32_t offset, int32_t forwardStep, TSKEY* tsCol, int32_t numOfTotal, int32_t numOfOutput, int32_t order) { @@ -1219,9 +1218,9 @@ void setTaskKilled(SExecTaskInfo* pTaskInfo) { pTaskInfo->code = TSDB_CODE_TSC_Q static bool isCachedLastQuery(STaskAttr* pQueryAttr) { for (int32_t i = 0; i < pQueryAttr->numOfOutput; ++i) { int32_t functionId = getExprFunctionId(&pQueryAttr->pExpr1[i]); -// if (functionId == FUNCTION_LAST || functionId == FUNCTION_LAST_DST) { -// continue; -// } + // if (functionId == FUNCTION_LAST || functionId == FUNCTION_LAST_DST) { + // continue; + // } return false; } @@ -1283,7 +1282,6 @@ static int32_t updateBlockLoadStatus(STaskAttr* pQuery, int32_t status) { hasOtherFunc = true; } #endif - } if (hasFirstLastFunc && status == BLK_DATA_NOT_LOAD) { @@ -1765,7 +1763,6 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t* bufCapacity, int32_t numOf // if (i > 0) pBInfo->pCtx[i].pTsOutput = pBInfo->pCtx[i - 1].pOutput; } #endif - } } @@ -1824,7 +1821,8 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO } static void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowRes, bool keep); -void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock, SArray* pColMatchInfo) { + +void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock) { if (pFilterNode == NULL) { return; } @@ -3669,6 +3667,8 @@ static SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { longjmp(pTaskInfo->env, code); } + doFilter(pProjectInfo->pFilterNode, pBlock); + setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order, scanFlag, false); blockDataEnsureCapacity(pInfo->pRes, pInfo->pRes->info.rows + pBlock->info.rows); @@ -4044,7 +4044,7 @@ static SArray* setRowTsColumnOutputInfo(SqlFunctionCtx* pCtx, int32_t numOfCols) } SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExprInfo, int32_t num, - SSDataBlock* pResBlock, SLimit* pLimit, SLimit* pSlimit, + SSDataBlock* pResBlock, SLimit* pLimit, SLimit* pSlimit, SNode* pCondition, SExecTaskInfo* pTaskInfo) { SProjectOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SProjectOperatorInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); @@ -4052,12 +4052,12 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SExprInfo* p goto _error; } - pInfo->limit = *pLimit; - pInfo->slimit = *pSlimit; - pInfo->curOffset = pLimit->offset; + pInfo->limit = *pLimit; + pInfo->slimit = *pSlimit; + pInfo->curOffset = pLimit->offset; pInfo->curSOffset = pSlimit->offset; - pInfo->binfo.pRes = pResBlock; + pInfo->pFilterNode= pCondition; int32_t numOfCols = num; int32_t numOfRows = 4096; @@ -4259,7 +4259,7 @@ SExprInfo* createExprInfo(SNodeList* pNodeList, SNodeList* pGroupKeys, int32_t* pExp->base.resSchema = createResSchema(pType->type, pType->bytes, pTargetNode->slotId, pType->scale, pType->precision, pValNode->node.aliasName); pExp->base.pParam[0].type = FUNC_PARAM_TYPE_VALUE; - valueNodeToVariant(pValNode, &pExp->base.pParam[0].param); + nodesValueNodeToVariant(pValNode, &pExp->base.pParam[0].param); } else if (type == QUERY_NODE_FUNCTION) { pExp->pExpr->nodeType = QUERY_NODE_FUNCTION; SFunctionNode* pFuncNode = (SFunctionNode*)pTargetNode->pExpr; @@ -4302,7 +4302,7 @@ SExprInfo* createExprInfo(SNodeList* pNodeList, SNodeList* pGroupKeys, int32_t* } else if (p1->type == QUERY_NODE_VALUE) { SValueNode* pvn = (SValueNode*)p1; pExp->base.pParam[j].type = FUNC_PARAM_TYPE_VALUE; - valueNodeToVariant(pvn, &pExp->base.pParam[j].param); + nodesValueNodeToVariant(pvn, &pExp->base.pParam[j].param); } } } else if (type == QUERY_NODE_OPERATOR) { @@ -4389,7 +4389,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo } SArray* groupKyes = extractPartitionColInfo(pTableScanNode->pPartitionKeys); extractTableSchemaVersion(pHandle, pTableScanNode->scan.uid, pTaskInfo); - SOperatorInfo* pOperator = createTableScanOperatorInfo(pTableScanNode, pDataReader, pHandle, groupKyes, pTaskInfo); + SOperatorInfo* pOperator = + createTableScanOperatorInfo(pTableScanNode, pDataReader, pHandle, groupKyes, pTaskInfo); STableScanInfo* pScanInfo = pOperator->info; pTaskInfo->cost.pRecoder = &pScanInfo->readRecorder; @@ -4417,10 +4418,10 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo } else { qDebug("%s pDataReader is not NULL", GET_TASKID(pTaskInfo)); } - SArray* tableIdList = extractTableIdList(pTableListInfo); + SArray* tableIdList = extractTableIdList(pTableListInfo); - SOperatorInfo* pOperator = createStreamScanOperatorInfo(pDataReader, pHandle, - tableIdList, pTableScanNode, pTaskInfo, &twSup); + SOperatorInfo* pOperator = + createStreamScanOperatorInfo(pDataReader, pHandle, tableIdList, pTableScanNode, pTaskInfo, &twSup); taosArrayDestroy(tableIdList); return pOperator; @@ -4486,7 +4487,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); SLimit limit = {.limit = pProjPhyNode->limit, .offset = pProjPhyNode->offset}; SLimit slimit = {.limit = pProjPhyNode->slimit, .offset = pProjPhyNode->soffset}; - pOptr = createProjectOperatorInfo(ops[0], pExprInfo, num, pResBlock, &limit, &slimit, pTaskInfo); + pOptr = createProjectOperatorInfo(ops[0], pExprInfo, num, pResBlock, &limit, &slimit, pProjPhyNode->node.pConditions, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_AGG == type) { SAggPhysiNode* pAggNode = (SAggPhysiNode*)pPhyNode; SExprInfo* pExprInfo = createExprInfo(pAggNode->pAggFuncs, pAggNode->pGroupKeys, &num); @@ -4519,18 +4520,19 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo .offset = pIntervalPhyNode->offset, .precision = ((SColumnNode*)pIntervalPhyNode->window.pTspk)->node.resType.precision}; - STimeWindowAggSupp as = {.waterMark = pIntervalPhyNode->window.watermark, - .calTrigger = pIntervalPhyNode->window.triggerType, - .maxTs = INT64_MIN, - .winMap = NULL,}; + STimeWindowAggSupp as = { + .waterMark = pIntervalPhyNode->window.watermark, + .calTrigger = pIntervalPhyNode->window.triggerType, + .maxTs = INT64_MIN, + .winMap = NULL, + }; if (isSmaStream(pIntervalPhyNode->window.triggerType)) { if (FLT_LESS(pIntervalPhyNode->window.filesFactor, 1.000000)) { as.calTrigger = STREAM_TRIGGER_AT_ONCE_SMA; } else { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_TIMESTAMP); as.winMap = taosHashInit(64, hashFn, true, HASH_NO_LOCK); - as.waterMark = getSmaWaterMark(interval.interval, - pIntervalPhyNode->window.filesFactor); + as.waterMark = getSmaWaterMark(interval.interval, pIntervalPhyNode->window.filesFactor); as.calTrigger = STREAM_TRIGGER_WINDOW_CLOSE_SMA; } } @@ -5205,14 +5207,13 @@ int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, const char* pKey) { int64_t getSmaWaterMark(int64_t interval, double filesFactor) { int64_t waterMark = 0; - ASSERT(FLT_GREATEREQUAL(filesFactor,0.000000)); + ASSERT(FLT_GREATEREQUAL(filesFactor, 0.000000)); waterMark = -1 * filesFactor; return waterMark; } bool isSmaStream(int8_t triggerType) { - if (triggerType == STREAM_TRIGGER_AT_ONCE || - triggerType == STREAM_TRIGGER_WINDOW_CLOSE) { + if (triggerType == STREAM_TRIGGER_AT_ONCE || triggerType == STREAM_TRIGGER_WINDOW_CLOSE) { return false; } return true; diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 3691024096d869a5d8527c0a95cbf5837e558a9c..222867fc4bba6056afc8b7d96dca4b3c8c07e2dd 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -341,7 +341,7 @@ static SSDataBlock* hashGroupbyAggregate(SOperatorInfo* pOperator) { while(1) { doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); - doFilter(pInfo->pCondition, pRes, NULL); + doFilter(pInfo->pCondition, pRes); bool hasRemain = hashRemainDataInGroupInfo(&pInfo->groupResInfo); if (!hasRemain) { diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 0774ccec1cdbc71666df5a2940f1435276765132..0d84c7816fe0ee385acf355e7f58700f2e031d18 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -256,7 +256,7 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanInfo* pTableSca } int64_t st = taosGetTimestampMs(); - doFilter(pTableScanInfo->pFilterNode, pBlock, pTableScanInfo->pColMatchInfo); + doFilter(pTableScanInfo->pFilterNode, pBlock); int64_t et = taosGetTimestampMs(); pTableScanInfo->readRecorder.filterTime += (et - st); @@ -894,7 +894,7 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) { addTagPseudoColumnData(&pInfo->readHandle, pInfo->pPseudoExpr, pInfo->numOfPseudoExpr, pInfo->pRes); } - doFilter(pInfo->pCondition, pInfo->pRes, NULL); + doFilter(pInfo->pCondition, pInfo->pRes); blockDataUpdateTsWindow(pInfo->pRes, 0); break; } diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index 018f0016a22db237b70bdd43135492d835147ee1..110c2d6a8f896ee040d03402780564e44df3216b 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -22,24 +22,25 @@ #include "thash.h" #include "ttime.h" -#include "function.h" -#include "tdatablock.h" #include "executorInt.h" +#include "function.h" #include "querynodes.h" +#include "tdatablock.h" #include "tfill.h" #define FILL_IS_ASC_FILL(_f) ((_f)->order == TSDB_ORDER_ASC) -#define DO_INTERPOLATION(_v1, _v2, _k1, _k2, _k) ((_v1) + ((_v2) - (_v1)) * (((double)(_k)) - ((double)(_k1))) / (((double)(_k2)) - ((double)(_k1)))) +#define DO_INTERPOLATION(_v1, _v2, _k1, _k2, _k) \ + ((_v1) + ((_v2) - (_v1)) * (((double)(_k)) - ((double)(_k1))) / (((double)(_k2)) - ((double)(_k1)))) static void setTagsValue(SFillInfo* pFillInfo, void** data, int32_t genRows) { - for(int32_t j = 0; j < pFillInfo->numOfCols; ++j) { + for (int32_t j = 0; j < pFillInfo->numOfCols; ++j) { SFillColInfo* pCol = &pFillInfo->pFillCol[j]; if (TSDB_COL_IS_NORMAL_COL(pCol->flag) || TSDB_COL_IS_UD_COL(pCol->flag)) { continue; } SResSchema* pSchema = &pCol->pExpr->base.resSchema; - char* val1 = elePtrAt(data[j], pSchema->bytes, genRows); + char* val1 = elePtrAt(data[j], pSchema->bytes, genRows); assert(pCol->tagIndex >= 0 && pCol->tagIndex < pFillInfo->numOfTags); SFillTagColInfo* pTag = &pFillInfo->pTags[pCol->tagIndex]; @@ -55,21 +56,22 @@ static void setNullRow(SSDataBlock* pBlock, int32_t numOfCol, int32_t rowIndex) } } -#define GET_DEST_SLOT_ID(_p) ((_p)->pExpr->base.resSchema.slotId) +#define GET_DEST_SLOT_ID(_p) ((_p)->pExpr->base.resSchema.slotId) #define GET_SRC_SLOT_ID(_p) ((_p)->pExpr->base.pParam[0].pCol->slotId) static void doSetVal(SColumnInfoData* pDstColInfoData, int32_t rowIndex, const SGroupKeys* pKey); -static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSDataBlock* pSrcBlock, int64_t ts, bool outOfBound) { - SPoint point1, point2, point; +static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* pSrcBlock, int64_t ts, + bool outOfBound) { + SPoint point1, point2, point; int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order); // set the primary timestamp column value - int32_t index = pFillInfo->numOfCurrent; - SColumnInfoData *pCol0 = taosArrayGet(pBlock->pDataBlock, 0); - char* val = colDataGetData(pCol0, index); - - *(TSKEY*) val = pFillInfo->currentKey; + int32_t index = pFillInfo->numOfCurrent; + SColumnInfoData* pCol0 = taosArrayGet(pBlock->pDataBlock, 0); + char* val = colDataGetData(pCol0, index); + + *(TSKEY*)val = pFillInfo->currentKey; // set the other values if (pFillInfo->type == TSDB_FILL_PREV) { @@ -81,7 +83,7 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSData continue; } - SGroupKeys* pKey = taosArrayGet(p, i); + SGroupKeys* pKey = taosArrayGet(p, i); SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol)); doSetVal(pDstColInfoData, index, pKey); } @@ -94,7 +96,7 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSData continue; } - SGroupKeys* pKey = taosArrayGet(p, i); + SGroupKeys* pKey = taosArrayGet(p, i); SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol)); doSetVal(pDstColInfoData, index, pKey); } @@ -111,10 +113,10 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSData int32_t srcSlotId = GET_SRC_SLOT_ID(pCol); - int32_t dstSlotId = GET_DEST_SLOT_ID(pCol); + int32_t dstSlotId = GET_DEST_SLOT_ID(pCol); SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId); - int16_t type = pCol->pExpr->base.resSchema.type; + int16_t type = pCol->pExpr->base.resSchema.type; SGroupKeys* pKey = taosArrayGet(pFillInfo->prev, i); if (IS_VAR_DATA_TYPE(type) || type == TSDB_DATA_TYPE_BOOL || pKey->isNull) { colDataAppendNULL(pDstCol, index); @@ -122,10 +124,10 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSData } SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, 0); - int64_t prevTs = *(int64_t*)pKey1->pData; + int64_t prevTs = *(int64_t*)pKey1->pData; SColumnInfoData* pSrcCol = taosArrayGet(pSrcBlock->pDataBlock, srcSlotId); - char* data = colDataGetData(pSrcCol, pFillInfo->index); + char* data = colDataGetData(pSrcCol, pFillInfo->index); point1 = (SPoint){.key = prevTs, .val = pKey->pData}; point2 = (SPoint){.key = ts, .val = data}; @@ -139,10 +141,10 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSData } } else if (pFillInfo->type == TSDB_FILL_NULL) { // fill with NULL setNullRow(pBlock, pFillInfo->numOfCols, index); - } else { // fill with user specified value for each column + } else { // fill with user specified value for each column for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; - if (TSDB_COL_IS_TAG(pCol->flag)/* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) { + if (TSDB_COL_IS_TAG(pCol->flag) /* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) { continue; } @@ -165,9 +167,10 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, SSDataBlock *pBlock, SSData } } -// setTagsValue(pFillInfo, data, index); + // setTagsValue(pFillInfo, data, index); SInterval* pInterval = &pFillInfo->interval; - pFillInfo->currentKey = taosTimeAdd(pFillInfo->currentKey, pInterval->sliding * step, pInterval->slidingUnit, pInterval->precision); + pFillInfo->currentKey = + taosTimeAdd(pFillInfo->currentKey, pInterval->sliding * step, pInterval->slidingUnit, pInterval->precision); pFillInfo->numOfCurrent++; } @@ -187,12 +190,12 @@ static void initBeforeAfterDataBuf(SFillInfo* pFillInfo) { for (int i = 0; i < pFillInfo->numOfCols; i++) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; - SGroupKeys key = {0}; + SGroupKeys key = {0}; SResSchema* pSchema = &pCol->pExpr->base.resSchema; - key.pData = taosMemoryMalloc(pSchema->bytes); + key.pData = taosMemoryMalloc(pSchema->bytes); key.isNull = true; key.bytes = pSchema->bytes; - key.type = pSchema->type; + key.type = pSchema->type; taosArrayPush(pFillInfo->next, &key); @@ -209,7 +212,7 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SArray SColumnInfoData* pSrcCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, srcSlotId); - bool isNull = colDataIsNull_s(pSrcCol, rowIndex); + bool isNull = colDataIsNull_s(pSrcCol, rowIndex); char* p = colDataGetData(pSrcCol, rowIndex); saveColData(pRow, i, p, isNull); } @@ -222,7 +225,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, 0); int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order); - bool ascFill = FILL_IS_ASC_FILL(pFillInfo); + bool ascFill = FILL_IS_ASC_FILL(pFillInfo); #if 0 ASSERT(ascFill && (pFillInfo->currentKey >= pFillInfo->start) || (!ascFill && (pFillInfo->currentKey <= pFillInfo->start))); @@ -236,9 +239,11 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t copyCurrentRowIntoBuf(pFillInfo, pFillInfo->index, pFillInfo->next); } - if (((pFillInfo->currentKey < ts && ascFill) || (pFillInfo->currentKey > ts && !ascFill)) && pFillInfo->numOfCurrent < outputRows) { + if (((pFillInfo->currentKey < ts && ascFill) || (pFillInfo->currentKey > ts && !ascFill)) && + pFillInfo->numOfCurrent < outputRows) { // fill the gap between two input rows - while (((pFillInfo->currentKey < ts && ascFill) || (pFillInfo->currentKey > ts && !ascFill)) && pFillInfo->numOfCurrent < outputRows) { + while (((pFillInfo->currentKey < ts && ascFill) || (pFillInfo->currentKey > ts && !ascFill)) && + pFillInfo->numOfCurrent < outputRows) { doFillOneRowResult(pFillInfo, pBlock, pFillInfo->pSrcBlock, ts, false); } @@ -259,7 +264,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t // assign rows to dst buffer for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; - if (TSDB_COL_IS_TAG(pCol->flag)/* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) { + if (TSDB_COL_IS_TAG(pCol->flag) /* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) { continue; } @@ -277,7 +282,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t saveColData(pFillInfo->prev, i, src, isNull); } else { // i > 0 and data is null , do interpolation if (pFillInfo->type == TSDB_FILL_PREV) { - SGroupKeys *pKey = taosArrayGet(pFillInfo->prev, i); + SGroupKeys* pKey = taosArrayGet(pFillInfo->prev, i); doSetVal(pDst, pFillInfo->numOfCurrent, pKey); } else if (pFillInfo->type == TSDB_FILL_LINEAR) { bool isNull = colDataIsNull_s(pSrc, pFillInfo->index); @@ -286,7 +291,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t } else if (pFillInfo->type == TSDB_FILL_NULL) { colDataAppendNULL(pDst, pFillInfo->numOfCurrent); } else if (pFillInfo->type == TSDB_FILL_NEXT) { - SGroupKeys *pKey = taosArrayGet(pFillInfo->next, i); + SGroupKeys* pKey = taosArrayGet(pFillInfo->next, i); doSetVal(pDst, pFillInfo->numOfCurrent, pKey); } else { SVariant* pVar = &pFillInfo->pFillCol[i].fillVal; @@ -296,9 +301,10 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t } // set the tag value for final result -// setTagsValue(pFillInfo, data, pFillInfo->numOfCurrent); - SInterval *pInterval = &pFillInfo->interval; - pFillInfo->currentKey = taosTimeAdd(pFillInfo->currentKey, pInterval->sliding * step, pInterval->slidingUnit, pInterval->precision); + // setTagsValue(pFillInfo, data, pFillInfo->numOfCurrent); + SInterval* pInterval = &pFillInfo->interval; + pFillInfo->currentKey = + taosTimeAdd(pFillInfo->currentKey, pInterval->sliding * step, pInterval->slidingUnit, pInterval->precision); pFillInfo->index += 1; pFillInfo->numOfCurrent += 1; @@ -306,9 +312,9 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t if (pFillInfo->index >= pFillInfo->numOfRows || pFillInfo->numOfCurrent >= outputRows) { /* the raw data block is exhausted, next value does not exists */ -// if (pFillInfo->index >= pFillInfo->numOfRows) { -// taosMemoryFreeClear(*next); -// } + // if (pFillInfo->index >= pFillInfo->numOfRows) { + // taosMemoryFreeClear(*next); + // } pFillInfo->numOfTotal += pFillInfo->numOfCurrent; return pFillInfo->numOfCurrent; } @@ -318,7 +324,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t } static void saveColData(SArray* rowBuf, int32_t columnIndex, const char* src, bool isNull) { - SGroupKeys *pKey = taosArrayGet(rowBuf, columnIndex); + SGroupKeys* pKey = taosArrayGet(rowBuf, columnIndex); if (isNull) { pKey->isNull = true; } else { @@ -351,12 +357,12 @@ static int32_t setTagColumnInfo(SFillInfo* pFillInfo, int32_t numOfCols, int32_t int32_t k = 0; for (int32_t i = 0; i < numOfCols; ++i) { SFillColInfo* pColInfo = &pFillInfo->pFillCol[i]; - SResSchema* pSchema = &pColInfo->pExpr->base.resSchema; + SResSchema* pSchema = &pColInfo->pExpr->base.resSchema; if (TSDB_COL_IS_TAG(pColInfo->flag) || pSchema->type == TSDB_DATA_TYPE_BINARY) { numOfTags += 1; - bool exists = false; + bool exists = false; int32_t index = -1; for (int32_t j = 0; j < k; ++j) { if (pFillInfo->pTags[j].col.colId == pSchema->slotId) { @@ -369,7 +375,7 @@ static int32_t setTagColumnInfo(SFillInfo* pFillInfo, int32_t numOfCols, int32_t if (!exists) { SSchema* pSchema1 = &pFillInfo->pTags[k].col; pSchema1->colId = pSchema->slotId; - pSchema1->type = pSchema->type; + pSchema1->type = pSchema->type; pSchema1->bytes = pSchema->bytes; pFillInfo->pTags[k].tagVal = taosMemoryCalloc(1, pSchema->bytes); @@ -399,7 +405,8 @@ static int32_t taosNumOfRemainRows(SFillInfo* pFillInfo) { } struct SFillInfo* taosCreateFillInfo(int32_t order, TSKEY skey, int32_t numOfTags, int32_t capacity, int32_t numOfCols, - SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, const char* id) { + SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, + const char* id) { if (fillType == TSDB_FILL_NONE) { return NULL; } @@ -413,32 +420,44 @@ struct SFillInfo* taosCreateFillInfo(int32_t order, TSKEY skey, int32_t numOfTag taosResetFillInfo(pFillInfo, skey); pFillInfo->order = order; - switch(fillType) { - case FILL_MODE_NONE: pFillInfo->type = TSDB_FILL_NONE; break; - case FILL_MODE_PREV: pFillInfo->type = TSDB_FILL_PREV; break; - case FILL_MODE_NULL: pFillInfo->type = TSDB_FILL_NULL; break; - case FILL_MODE_LINEAR: pFillInfo->type = TSDB_FILL_LINEAR;break; - case FILL_MODE_NEXT: pFillInfo->type = TSDB_FILL_NEXT; break; - case FILL_MODE_VALUE: pFillInfo->type = TSDB_FILL_SET_VALUE; break; + switch (fillType) { + case FILL_MODE_NONE: + pFillInfo->type = TSDB_FILL_NONE; + break; + case FILL_MODE_PREV: + pFillInfo->type = TSDB_FILL_PREV; + break; + case FILL_MODE_NULL: + pFillInfo->type = TSDB_FILL_NULL; + break; + case FILL_MODE_LINEAR: + pFillInfo->type = TSDB_FILL_LINEAR; + break; + case FILL_MODE_NEXT: + pFillInfo->type = TSDB_FILL_NEXT; + break; + case FILL_MODE_VALUE: + pFillInfo->type = TSDB_FILL_SET_VALUE; + break; default: terrno = TSDB_CODE_INVALID_PARA; return NULL; } - pFillInfo->type = fillType; - pFillInfo->pFillCol = pCol; + pFillInfo->type = fillType; + pFillInfo->pFillCol = pCol; pFillInfo->numOfTags = numOfTags; pFillInfo->numOfCols = numOfCols; - pFillInfo->alloc = capacity; - pFillInfo->id = id; - pFillInfo->interval = *pInterval; - -// if (numOfTags > 0) { - pFillInfo->pTags = taosMemoryCalloc(numOfCols, sizeof(SFillTagColInfo)); - for (int32_t i = 0; i < numOfCols; ++i) { - pFillInfo->pTags[i].col.colId = -2; // TODO - } -// } + pFillInfo->alloc = capacity; + pFillInfo->id = id; + pFillInfo->interval = *pInterval; + + // if (numOfTags > 0) { + pFillInfo->pTags = taosMemoryCalloc(numOfCols, sizeof(SFillTagColInfo)); + for (int32_t i = 0; i < numOfCols; ++i) { + pFillInfo->pTags[i].col.colId = -2; // TODO + } + // } pFillInfo->next = taosArrayInit(numOfCols, sizeof(SGroupKeys)); pFillInfo->prev = taosArrayInit(numOfCols, sizeof(SGroupKeys)); @@ -451,13 +470,13 @@ struct SFillInfo* taosCreateFillInfo(int32_t order, TSKEY skey, int32_t numOfTag } void taosResetFillInfo(SFillInfo* pFillInfo, TSKEY startTimestamp) { - pFillInfo->start = startTimestamp; - pFillInfo->currentKey = startTimestamp; - pFillInfo->end = startTimestamp; - pFillInfo->index = -1; - pFillInfo->numOfRows = 0; + pFillInfo->start = startTimestamp; + pFillInfo->currentKey = startTimestamp; + pFillInfo->end = startTimestamp; + pFillInfo->index = -1; + pFillInfo->numOfRows = 0; pFillInfo->numOfCurrent = 0; - pFillInfo->numOfTotal = 0; + pFillInfo->numOfTotal = 0; } void* taosDestroyFillInfo(SFillInfo* pFillInfo) { @@ -468,7 +487,7 @@ void* taosDestroyFillInfo(SFillInfo* pFillInfo) { taosArrayDestroy(pFillInfo->prev); taosArrayDestroy(pFillInfo->next); - for(int32_t i = 0; i < pFillInfo->numOfTags; ++i) { + for (int32_t i = 0; i < pFillInfo->numOfTags; ++i) { taosMemoryFreeClear(pFillInfo->pTags[i].tagVal); } @@ -488,12 +507,12 @@ void taosFillSetStartInfo(SFillInfo* pFillInfo, int32_t numOfRows, TSKEY endKey) pFillInfo->end = taosTimeTruncate(endKey, &pFillInfo->interval, pFillInfo->interval.precision); } - pFillInfo->index = 0; + pFillInfo->index = 0; pFillInfo->numOfRows = numOfRows; } void taosFillSetInputDataBlock(SFillInfo* pFillInfo, const SSDataBlock* pInput) { - pFillInfo->pSrcBlock = (SSDataBlock*) pInput; + pFillInfo->pSrcBlock = (SSDataBlock*)pInput; } bool taosFillHasMoreResults(SFillInfo* pFillInfo) { @@ -513,8 +532,8 @@ bool taosFillHasMoreResults(SFillInfo* pFillInfo) { int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows) { SColumnInfoData* pCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, 0); - int64_t* tsList = (int64_t*) pCol->pData; - int32_t numOfRows = taosNumOfRemainRows(pFillInfo); + int64_t* tsList = (int64_t*)pCol->pData; + int32_t numOfRows = taosNumOfRemainRows(pFillInfo); TSKEY ekey1 = ekey; if (!FILL_IS_ASC_FILL(pFillInfo)) { @@ -524,32 +543,25 @@ int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t ma int64_t numOfRes = -1; if (numOfRows > 0) { // still fill gap within current data block, not generating data after the result set. TSKEY lastKey = tsList[pFillInfo->numOfRows - 1]; - numOfRes = taosTimeCountInterval( - lastKey, - pFillInfo->currentKey, - pFillInfo->interval.sliding, - pFillInfo->interval.slidingUnit, - pFillInfo->interval.precision); + numOfRes = taosTimeCountInterval(lastKey, pFillInfo->currentKey, pFillInfo->interval.sliding, + pFillInfo->interval.slidingUnit, pFillInfo->interval.precision); numOfRes += 1; assert(numOfRes >= numOfRows); - } else { // reach the end of data + } else { // reach the end of data if ((ekey1 < pFillInfo->currentKey && FILL_IS_ASC_FILL(pFillInfo)) || (ekey1 > pFillInfo->currentKey && !FILL_IS_ASC_FILL(pFillInfo))) { return 0; } - numOfRes = taosTimeCountInterval( - ekey1, - pFillInfo->currentKey, - pFillInfo->interval.sliding, - pFillInfo->interval.slidingUnit, - pFillInfo->interval.precision); + numOfRes = taosTimeCountInterval(ekey1, pFillInfo->currentKey, pFillInfo->interval.sliding, + pFillInfo->interval.slidingUnit, pFillInfo->interval.precision); numOfRes += 1; } return (numOfRes > maxNumOfRows) ? maxNumOfRows : numOfRes; } -int32_t taosGetLinearInterpolationVal(SPoint* point, int32_t outputType, SPoint* point1, SPoint* point2, int32_t inputType) { +int32_t taosGetLinearInterpolationVal(SPoint* point, int32_t outputType, SPoint* point1, SPoint* point2, + int32_t inputType) { double v1 = -1, v2 = -1; GET_TYPED_DATA(v1, double, inputType, point1->val); GET_TYPED_DATA(v2, double, inputType, point2->val); @@ -570,20 +582,20 @@ int64_t taosFillResultDataBlock(SFillInfo* pFillInfo, SSDataBlock* p, int32_t ca if (remain == 0) { appendFilledResult(pFillInfo, p, numOfRes); } else { - fillResultImpl(pFillInfo, p, (int32_t) numOfRes); + fillResultImpl(pFillInfo, p, (int32_t)numOfRes); assert(numOfRes == pFillInfo->numOfCurrent); } -// qDebug("fill:%p, generated fill result, src block:%d, index:%d, brange:%"PRId64"-%"PRId64", currentKey:%"PRId64", current:%d, total:%d, %p", -// pFillInfo, pFillInfo->numOfRows, pFillInfo->index, pFillInfo->start, pFillInfo->end, pFillInfo->currentKey, pFillInfo->numOfCurrent, -// pFillInfo->numOfTotal, pFillInfo->handle); + // qDebug("fill:%p, generated fill result, src block:%d, index:%d, brange:%"PRId64"-%"PRId64", currentKey:%"PRId64", + // current:%d, total:%d, %p", + // pFillInfo, pFillInfo->numOfRows, pFillInfo->index, pFillInfo->start, pFillInfo->end, pFillInfo->currentKey, + // pFillInfo->numOfCurrent, + // pFillInfo->numOfTotal, pFillInfo->handle); return numOfRes; } -int64_t getFillInfoStart(struct SFillInfo *pFillInfo) { - return pFillInfo->start; -} +int64_t getFillInfoStart(struct SFillInfo* pFillInfo) { return pFillInfo->start; } SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfOutput, const struct SNodeListNode* pValNode) { SFillColInfo* pFillCol = taosMemoryCalloc(numOfOutput, sizeof(SFillColInfo)); @@ -591,8 +603,8 @@ SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfOutput, const str return NULL; } - size_t len = (pValNode != NULL)? LIST_LENGTH(pValNode->pNodeList):0; - for(int32_t i = 0; i < numOfOutput; ++i) { + size_t len = (pValNode != NULL) ? LIST_LENGTH(pValNode->pNodeList) : 0; + for (int32_t i = 0; i < numOfOutput; ++i) { SExprInfo* pExprInfo = &pExpr[i]; pFillCol[i].pExpr = pExprInfo; pFillCol[i].tagIndex = -2; @@ -600,14 +612,14 @@ SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfOutput, const str // todo refactor if (len > 0) { // if the user specified value is less than the column, alway use the last one as the fill value - int32_t index = (i >= len)? (len - 1):i; + int32_t index = (i >= len) ? (len - 1) : i; SValueNode* pv = (SValueNode*)nodesListGetNode(pValNode->pNodeList, index); - valueNodeToVariant(pv, &pFillCol[i].fillVal); + nodesValueNodeToVariant(pv, &pFillCol[i].fillVal); } if (pExprInfo->base.numOfParams > 0) { - pFillCol[i].flag = pExprInfo->base.pParam[0].pCol->flag; // always be the normal column for table query + pFillCol[i].flag = pExprInfo->base.pParam[0].pCol->flag; // always be the normal column for table query } } diff --git a/source/libs/index/src/indexFilter.c b/source/libs/index/src/indexFilter.c index b41006b6dddf68e8d239e7c9c6bd348ee6177a9a..8db8576e82973231a43e5ed066056b5df7d71f53 100644 --- a/source/libs/index/src/indexFilter.c +++ b/source/libs/index/src/indexFilter.c @@ -31,7 +31,7 @@ typedef struct SIFParam { SHashObj *pFilter; SArray *result; - char * condValue; + char *condValue; SIdxFltStatus status; uint8_t colValType; @@ -45,7 +45,7 @@ typedef struct SIFParam { typedef struct SIFCtx { int32_t code; - SHashObj * pRes; /* element is SIFParam */ + SHashObj *pRes; /* element is SIFParam */ bool noExec; // true: just iterate condition tree, and add hint to executor plan SIndexMetaArg arg; // SIdxFltStatus st; @@ -128,7 +128,7 @@ static int32_t sifGetValueFromNode(SNode *node, char **value) { // covert data From snode; SValueNode *vn = (SValueNode *)node; - char * pData = nodesGetValueFromNode(vn); + char *pData = nodesGetValueFromNode(vn); SDataType *pType = &vn->node.resType; int32_t type = pType->type; int32_t valLen = 0; @@ -486,7 +486,7 @@ static int32_t sifExecLogic(SLogicConditionNode *node, SIFCtx *ctx, SIFParam *ou return TSDB_CODE_QRY_INVALID_INPUT; } - int32_t code; + int32_t code = TSDB_CODE_SUCCESS; SIFParam *params = NULL; SIF_ERR_RET(sifInitParamList(¶ms, node->pParameterList, ctx)); @@ -664,7 +664,7 @@ int32_t doFilterTag(const SNode *pFilterNode, SIndexMetaArg *metaArg, SArray *re // todo move to the initialization function // SIF_ERR_RET(filterInitFromNode((SNode *)pFilterNode, &filter, 0)); - SArray * output = taosArrayInit(8, sizeof(uint64_t)); + SArray *output = taosArrayInit(8, sizeof(uint64_t)); SIFParam param = {.arg = *metaArg, .result = output}; SIF_ERR_RET(sifCalculate((SNode *)pFilterNode, ¶m)); diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 35b4da7013f2c9cce51c1382368cc38cd9aafa93..1fce5ecaba57880271fd82aaf635706bc535a971 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -98,6 +98,7 @@ static SNode* columnNodeCopy(const SColumnNode* pSrc, SColumnNode* pDst) { COPY_SCALAR_FIELD(tableType); COPY_SCALAR_FIELD(colId); COPY_SCALAR_FIELD(colType); + COPY_SCALAR_FIELD(hasIndex); COPY_CHAR_ARRAY_FIELD(dbName); COPY_CHAR_ARRAY_FIELD(tableName); COPY_CHAR_ARRAY_FIELD(tableAlias); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 54754ace51558ed23baf56dd9155c5ca1a41dbe3..8bf5f45b95825dea065261d669675926ce3eeb89 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -178,6 +178,8 @@ const char* nodesNodeName(ENodeType type) { return "ShowQueriesStmt"; case QUERY_NODE_SHOW_VNODES_STMT: return "ShowVnodeStmt"; + case QUERY_NODE_DELETE_STMT: + return "DeleteStmt"; case QUERY_NODE_LOGIC_PLAN_SCAN: return "LogicScan"; case QUERY_NODE_LOGIC_PLAN_JOIN: diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 76f15afc8e050ee57b4bc5b774f0fd1e57338972..824c1bc2480d1b91cf2478510bb910eb7b737b05 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -208,6 +208,8 @@ SNodeptr nodesMakeNode(ENodeType type) { case QUERY_NODE_KILL_QUERY_STMT: case QUERY_NODE_KILL_TRANSACTION_STMT: return makeNode(type, sizeof(SKillStmt)); + case QUERY_NODE_DELETE_STMT: + return makeNode(type, sizeof(SDeleteStmt)); case QUERY_NODE_LOGIC_PLAN_SCAN: return makeNode(type, sizeof(SScanLogicNode)); case QUERY_NODE_LOGIC_PLAN_JOIN: @@ -1305,7 +1307,7 @@ int32_t nodesCollectSpecialNodes(SSelectStmt* pSelect, ESqlClause clause, ENodeT return TSDB_CODE_SUCCESS; } -char* getFillModeString(EFillMode mode) { +char* nodesGetFillModeString(EFillMode mode) { switch (mode) { case FILL_MODE_NONE: return "none"; @@ -1353,7 +1355,7 @@ int32_t nodesGetOutputNumFromSlotList(SNodeList* pSlots) { return num; } -void valueNodeToVariant(const SValueNode* pNode, SVariant* pVal) { +void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal) { pVal->nType = pNode->node.resType.type; pVal->nLen = pNode->node.resType.bytes; switch (pNode->node.resType.type) { @@ -1394,3 +1396,159 @@ void valueNodeToVariant(const SValueNode* pNode, SVariant* pVal) { break; } } + +int32_t nodesMergeConds(SNode** pDst, SNodeList** pSrc) { + if (NULL == *pSrc) { + return TSDB_CODE_SUCCESS; + } + + if (1 == LIST_LENGTH(*pSrc)) { + *pDst = nodesListGetNode(*pSrc, 0); + nodesClearList(*pSrc); + } else { + SLogicConditionNode* pLogicCond = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); + if (NULL == pLogicCond) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pLogicCond->node.resType.type = TSDB_DATA_TYPE_BOOL; + pLogicCond->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes; + pLogicCond->condType = LOGIC_COND_TYPE_AND; + pLogicCond->pParameterList = *pSrc; + *pDst = (SNode*)pLogicCond; + } + *pSrc = NULL; + + return TSDB_CODE_SUCCESS; +} + +typedef struct SClassifyConditionCxt { + bool hasPrimaryKey; + bool hasTagIndexCol; + bool hasOtherCol; +} SClassifyConditionCxt; + +static EDealRes classifyConditionImpl(SNode* pNode, void* pContext) { + SClassifyConditionCxt* pCxt = (SClassifyConditionCxt*)pContext; + if (QUERY_NODE_COLUMN == nodeType(pNode)) { + SColumnNode* pCol = (SColumnNode*)pNode; + if (PRIMARYKEY_TIMESTAMP_COL_ID == pCol->colId) { + pCxt->hasPrimaryKey = true; + } else if (pCol->hasIndex) { + pCxt->hasTagIndexCol = true; + } else { + pCxt->hasOtherCol = true; + } + return *((bool*)pContext) ? DEAL_RES_CONTINUE : DEAL_RES_END; + } + return DEAL_RES_CONTINUE; +} + +typedef enum EConditionType { COND_TYPE_PRIMARY_KEY = 1, COND_TYPE_TAG_INDEX, COND_TYPE_NORMAL } EConditionType; + +static EConditionType classifyCondition(SNode* pNode) { + SClassifyConditionCxt cxt = {.hasPrimaryKey = false, .hasTagIndexCol = false, .hasOtherCol = false}; + nodesWalkExpr(pNode, classifyConditionImpl, &cxt); + return cxt.hasOtherCol ? COND_TYPE_NORMAL + : (cxt.hasPrimaryKey && cxt.hasTagIndexCol + ? COND_TYPE_NORMAL + : (cxt.hasPrimaryKey ? COND_TYPE_PRIMARY_KEY : COND_TYPE_TAG_INDEX)); +} + +static int32_t partitionLogicCond(SNode** pCondition, SNode** pPrimaryKeyCond, SNode** pTagCond, SNode** pOtherCond) { + SLogicConditionNode* pLogicCond = (SLogicConditionNode*)(*pCondition); + + int32_t code = TSDB_CODE_SUCCESS; + + SNodeList* pPrimaryKeyConds = NULL; + SNodeList* pTagConds = NULL; + SNodeList* pOtherConds = NULL; + SNode* pCond = NULL; + FOREACH(pCond, pLogicCond->pParameterList) { + switch (classifyCondition(pCond)) { + case COND_TYPE_PRIMARY_KEY: + if (NULL != pPrimaryKeyCond) { + code = nodesListMakeAppend(&pPrimaryKeyConds, nodesCloneNode(pCond)); + } + break; + case COND_TYPE_TAG_INDEX: + if (NULL != pTagCond) { + code = nodesListMakeAppend(&pTagConds, nodesCloneNode(pCond)); + } + break; + case COND_TYPE_NORMAL: + default: + if (NULL != pOtherCond) { + code = nodesListMakeAppend(&pOtherConds, nodesCloneNode(pCond)); + } + break; + } + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + + SNode* pTempPrimaryKeyCond = NULL; + SNode* pTempTagCond = NULL; + SNode* pTempOtherCond = NULL; + if (TSDB_CODE_SUCCESS == code) { + code = nodesMergeConds(&pTempPrimaryKeyCond, &pPrimaryKeyConds); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodesMergeConds(&pTempTagCond, &pTagConds); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodesMergeConds(&pTempOtherCond, &pOtherConds); + } + + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pPrimaryKeyCond) { + *pPrimaryKeyCond = pTempPrimaryKeyCond; + } + if (NULL != pTagCond) { + *pTagCond = pTempTagCond; + } + if (NULL != pOtherCond) { + *pOtherCond = pTempOtherCond; + } + nodesDestroyNode(*pCondition); + *pCondition = NULL; + } else { + nodesDestroyList(pPrimaryKeyConds); + nodesDestroyList(pTagConds); + nodesDestroyList(pOtherConds); + nodesDestroyNode(pTempPrimaryKeyCond); + nodesDestroyNode(pTempTagCond); + nodesDestroyNode(pTempOtherCond); + } + + return code; +} + +int32_t nodesPartitionCond(SNode** pCondition, SNode** pPrimaryKeyCond, SNode** pTagCond, SNode** pOtherCond) { + if (QUERY_NODE_LOGIC_CONDITION == nodeType(*pCondition) && + LOGIC_COND_TYPE_AND == ((SLogicConditionNode*)*pCondition)->condType) { + return partitionLogicCond(pCondition, pPrimaryKeyCond, pTagCond, pOtherCond); + } + + switch (classifyCondition(*pCondition)) { + case COND_TYPE_PRIMARY_KEY: + if (NULL != pPrimaryKeyCond) { + *pPrimaryKeyCond = *pCondition; + } + break; + case COND_TYPE_TAG_INDEX: + if (NULL != pTagCond) { + *pTagCond = *pCondition; + } + break; + case COND_TYPE_NORMAL: + default: + if (NULL != pOtherCond) { + *pOtherCond = *pCondition; + } + break; + } + *pCondition = NULL; + + return TSDB_CODE_SUCCESS; +} diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 7dd0ef2616bf3fda27192fa7099906348753c163..ca7fa7a4c671e039f4858f422737d62b8cf49342 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -193,6 +193,7 @@ SNode* createSplitVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId); SNode* createSyncdbStmt(SAstCreateContext* pCxt, const SToken* pDbName); SNode* createGrantStmt(SAstCreateContext* pCxt, int64_t privileges, SToken* pDbName, SToken* pUserName); SNode* createRevokeStmt(SAstCreateContext* pCxt, int64_t privileges, SToken* pDbName, SToken* pUserName); +SNode* createDeleteStmt(SAstCreateContext* pCxt, SNode* pTable, SNode* pWhere); #ifdef __cplusplus } diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 6c090a07901c1d96a567961b8a2ec3daabaaedf8..7e5979ffc617297e20b81eb49aa7543f2b2072a9 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -481,6 +481,9 @@ dnode_list(A) ::= dnode_list(B) DNODE NK_INTEGER(C). /************************************************ syncdb **************************************************************/ cmd ::= SYNCDB db_name(A) REPLICA. { pCxt->pRootNode = createSyncdbStmt(pCxt, &A); } +/************************************************ syncdb **************************************************************/ +cmd ::= DELETE FROM full_table_name(A) where_clause_opt(B). { pCxt->pRootNode = createDeleteStmt(pCxt, A, B); } + /************************************************ select **************************************************************/ cmd ::= query_expression(A). { pCxt->pRootNode = A; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 72a88548d2270d6d4776e2614bf05fc8c2b7ebf6..90c2d7f87acf6bca20cce3f2976150c6962b2713 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1488,3 +1488,12 @@ SNode* createRevokeStmt(SAstCreateContext* pCxt, int64_t privileges, SToken* pDb strncpy(pStmt->userName, pUserName->z, pUserName->n); return (SNode*)pStmt; } + +SNode* createDeleteStmt(SAstCreateContext* pCxt, SNode* pTable, SNode* pWhere) { + CHECK_PARSER_STATUS(pCxt); + SDeleteStmt* pStmt = nodesMakeNode(QUERY_NODE_DELETE_STMT); + CHECK_OUT_OF_MEM(pStmt); + pStmt->pFromTable = pTable; + pStmt->pWhere = pWhere; + return (SNode*)pStmt; +} diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 7abe2442610bbe85e823fb3fb85843351f8e52e8..40f421e6545ca0e26e29efc0b5e64b3ce04ea6ab 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -113,21 +113,26 @@ static EDealRes collectMetaKeyFromFunction(SCollectMetaKeyFromExprCxt* pCxt, SFu return reserveUdfInCache(pFunc->functionName, pCxt->pComCxt->pMetaCache); } -static EDealRes collectMetaKeyFromRealTable(SCollectMetaKeyFromExprCxt* pCxt, SRealTableNode* pRealTable) { - pCxt->errCode = reserveTableMetaInCache(pCxt->pComCxt->pParseCxt->acctId, pRealTable->table.dbName, - pRealTable->table.tableName, pCxt->pComCxt->pMetaCache); - if (TSDB_CODE_SUCCESS == pCxt->errCode) { - pCxt->errCode = reserveTableVgroupInCache(pCxt->pComCxt->pParseCxt->acctId, pRealTable->table.dbName, - pRealTable->table.tableName, pCxt->pComCxt->pMetaCache); +static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, SRealTableNode* pRealTable, + AUTH_TYPE authType) { + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pRealTable->table.dbName, pRealTable->table.tableName, + pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pRealTable->table.dbName, pRealTable->table.tableName, + pCxt->pMetaCache); } - if (TSDB_CODE_SUCCESS == pCxt->errCode) { - pCxt->errCode = reserveUserAuthInCache(pCxt->pComCxt->pParseCxt->acctId, pCxt->pComCxt->pParseCxt->pUser, - pRealTable->table.dbName, AUTH_TYPE_READ, pCxt->pComCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pRealTable->table.dbName, authType, + pCxt->pMetaCache); } - if (TSDB_CODE_SUCCESS == pCxt->errCode) { - pCxt->errCode = - reserveDbVgInfoInCache(pCxt->pComCxt->pParseCxt->acctId, pRealTable->table.dbName, pCxt->pComCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, pRealTable->table.dbName, pCxt->pMetaCache); } + return code; +} + +static EDealRes collectMetaKeyFromRealTable(SCollectMetaKeyFromExprCxt* pCxt, SRealTableNode* pRealTable) { + pCxt->errCode = collectMetaKeyFromRealTableImpl(pCxt->pComCxt, pRealTable, AUTH_TYPE_READ); return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_CONTINUE : DEAL_RES_ERROR; } @@ -347,6 +352,10 @@ static int32_t collectMetaKeyFromShowTransactions(SCollectMetaKeyCxt* pCxt, SSho pCxt->pMetaCache); } +static int32_t collectMetaKeyFromDelete(SCollectMetaKeyCxt* pCxt, SDeleteStmt* pStmt) { + return collectMetaKeyFromRealTableImpl(pCxt, (SRealTableNode*)pStmt->pFromTable, AUTH_TYPE_WRITE); +} + static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { switch (nodeType(pStmt)) { case QUERY_NODE_SET_OPERATOR: @@ -405,6 +414,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowTopics(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_TRANSACTIONS_STMT: return collectMetaKeyFromShowTransactions(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_DELETE_STMT: + return collectMetaKeyFromDelete(pCxt, (SDeleteStmt*)pStmt); default: break; } diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index 2670e5710b9f5418c401e9799678c68d82c8f29d..2ee23dedf2d9ebf6041347b7b2631748cf737348 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -80,6 +80,10 @@ static int32_t authDropUser(SAuthCxt* pCxt, SDropUserStmt* pStmt) { return TSDB_CODE_SUCCESS; } +static int32_t authDelete(SAuthCxt* pCxt, SDeleteStmt* pDelete) { + return checkAuth(pCxt, ((SRealTableNode*)pDelete->pFromTable)->table.dbName, AUTH_TYPE_WRITE); +} + static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { switch (nodeType(pStmt)) { case QUERY_NODE_SET_OPERATOR: @@ -88,6 +92,8 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { return authSelect(pCxt, (SSelectStmt*)pStmt); case QUERY_NODE_DROP_USER_STMT: return authDropUser(pCxt, (SDropUserStmt*)pStmt); + case QUERY_NODE_DELETE_STMT: + return authDelete(pCxt, (SDeleteStmt*)pStmt); default: break; } diff --git a/source/libs/parser/src/parCalcConst.c b/source/libs/parser/src/parCalcConst.c index 42b001c1318058be96871918bea5aee0f084c82a..b2cb67b1c3fc13a66922f51f250c2e39621798b3 100644 --- a/source/libs/parser/src/parCalcConst.c +++ b/source/libs/parser/src/parCalcConst.c @@ -135,11 +135,11 @@ static int32_t rewriteConditionForFromTable(SCalcConstContext* pCxt, SNode* pTab return code; } -static int32_t calcConstFromTable(SCalcConstContext* pCxt, SSelectStmt* pSelect) { - return rewriteConditionForFromTable(pCxt, pSelect->pFromTable); +static int32_t calcConstFromTable(SCalcConstContext* pCxt, SNode* pTable) { + return rewriteConditionForFromTable(pCxt, pTable); } -static void rewriteConstCondition(SSelectStmt* pSelect, SNode** pCond) { +static void rewriteConstCondition(SNode** pCond, bool* pAlwaysFalse) { if (QUERY_NODE_VALUE != nodeType(*pCond)) { return; } @@ -147,11 +147,11 @@ static void rewriteConstCondition(SSelectStmt* pSelect, SNode** pCond) { nodesDestroyNode(*pCond); *pCond = NULL; } else { - pSelect->isEmptyResult = true; + *pAlwaysFalse = true; } } -static int32_t calcConstSelectCondition(SCalcConstContext* pCxt, SSelectStmt* pSelect, SNode** pCond) { +static int32_t calcConstStmtCondition(SCalcConstContext* pCxt, SNode** pCond, bool* pAlwaysFalse) { if (NULL == *pCond) { return TSDB_CODE_SUCCESS; } @@ -161,7 +161,7 @@ static int32_t calcConstSelectCondition(SCalcConstContext* pCxt, SSelectStmt* pS code = calcConstNode(pCond); } if (TSDB_CODE_SUCCESS == code) { - rewriteConstCondition(pSelect, pCond); + rewriteConstCondition(pCond, pAlwaysFalse); } return code; } @@ -233,12 +233,12 @@ static int32_t calcConstGroupBy(SCalcConstContext* pCxt, SSelectStmt* pSelect) { } static int32_t calcConstSelect(SCalcConstContext* pCxt, SSelectStmt* pSelect, bool subquery) { - int32_t code = calcConstFromTable(pCxt, pSelect); + int32_t code = calcConstFromTable(pCxt, pSelect->pFromTable); if (TSDB_CODE_SUCCESS == code) { code = calcConstProjections(pCxt, pSelect, subquery); } if (TSDB_CODE_SUCCESS == code) { - code = calcConstSelectCondition(pCxt, pSelect, &pSelect->pWhere); + code = calcConstStmtCondition(pCxt, &pSelect->pWhere, &pSelect->isEmptyResult); } if (TSDB_CODE_SUCCESS == code) { code = calcConstList(pSelect->pPartitionByList); @@ -250,7 +250,7 @@ static int32_t calcConstSelect(SCalcConstContext* pCxt, SSelectStmt* pSelect, bo code = calcConstGroupBy(pCxt, pSelect); } if (TSDB_CODE_SUCCESS == code) { - code = calcConstSelectCondition(pCxt, pSelect, &pSelect->pHaving); + code = calcConstStmtCondition(pCxt, &pSelect->pHaving, &pSelect->isEmptyResult); } if (TSDB_CODE_SUCCESS == code) { code = calcConstList(pSelect->pOrderByList); @@ -258,6 +258,14 @@ static int32_t calcConstSelect(SCalcConstContext* pCxt, SSelectStmt* pSelect, bo return code; } +static int32_t calcConstDelete(SCalcConstContext* pCxt, SDeleteStmt* pDelete) { + int32_t code = calcConstFromTable(pCxt, pDelete->pFromTable); + if (TSDB_CODE_SUCCESS == code) { + code = calcConstStmtCondition(pCxt, &pDelete->pWhere, &pDelete->deleteZeroRows); + } + return code; +} + static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt, bool subquery) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pStmt)) { @@ -275,6 +283,9 @@ static int32_t calcConstQuery(SCalcConstContext* pCxt, SNode* pStmt, bool subque } break; } + case QUERY_NODE_DELETE_STMT: + code = calcConstDelete(pCxt, (SDeleteStmt*)pStmt); + break; default: break; } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index e9539073583c6d21a100efa5b33516eb9db18393..685c299c01af44d479d4e03cf42711cab30bfc73 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -68,6 +68,7 @@ static SKeyword keywordTable[] = { {"DATABASES", TK_DATABASES}, {"DAYS", TK_DAYS}, {"DBS", TK_DBS}, + {"DELETE", TK_DELETE}, {"DESC", TK_DESC}, {"DESCRIBE", TK_DESCRIBE}, {"DISTINCT", TK_DISTINCT}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 2d37e9087dfce24a9305858ceaaacb1d802146e4..27b57bd9853279ad8f71839f725d65431be077bd 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -35,7 +35,7 @@ typedef struct STranslateContext { SArray* pNsLevel; // element is SArray*, the element of this subarray is STableNode* int32_t currLevel; ESqlClause currClause; - SSelectStmt* pCurrStmt; + SSelectStmt* pCurrSelectStmt; SCmdMsgInfo* pCmdMsg; SHashObj* pDbs; SHashObj* pTables; @@ -335,7 +335,7 @@ static bool isIndefiniteRowsFunc(const SNode* pNode) { } static bool isDistinctOrderBy(STranslateContext* pCxt) { - return (SQL_CLAUSE_ORDER_BY == pCxt->currClause && pCxt->pCurrStmt->isDistinct); + return (SQL_CLAUSE_ORDER_BY == pCxt->currClause && pCxt->pCurrSelectStmt->isDistinct); } static bool belongTable(const char* currentDb, const SColumnNode* pCol, const STableNode* pTable) { @@ -360,7 +360,7 @@ static SNodeList* getProjectList(const SNode* pNode) { return NULL; } -static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* pColSchema, bool isTag, +static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* pColSchema, int32_t tagFlag, SColumnNode* pCol) { strcpy(pCol->dbName, pTable->table.dbName); strcpy(pCol->tableAlias, pTable->table.tableAlias); @@ -372,7 +372,8 @@ static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* p pCol->tableId = pTable->pMeta->uid; pCol->tableType = pTable->pMeta->tableType; pCol->colId = pColSchema->colId; - pCol->colType = isTag ? COLUMN_TYPE_TAG : COLUMN_TYPE_COLUMN; + pCol->colType = (tagFlag >= 0 ? COLUMN_TYPE_TAG : COLUMN_TYPE_COLUMN); + pCol->hasIndex = (0 == tagFlag); pCol->node.resType.type = pColSchema->type; pCol->node.resType.bytes = pColSchema->bytes; if (TSDB_DATA_TYPE_TIMESTAMP == pCol->node.resType.type) { @@ -414,7 +415,7 @@ static int32_t createColumnsByTable(STranslateContext* pCxt, const STableNode* p if (NULL == pCol) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY); } - setColumnInfoBySchema((SRealTableNode*)pTable, pMeta->schema + i, (i >= pMeta->tableInfo.numOfColumns), pCol); + setColumnInfoBySchema((SRealTableNode*)pTable, pMeta->schema + i, (i - pMeta->tableInfo.numOfColumns), pCol); nodesListAppend(pList, (SNode*)pCol); } } else { @@ -472,14 +473,14 @@ static int32_t findAndSetColumn(STranslateContext* pCxt, SColumnNode** pColRef, if (QUERY_NODE_REAL_TABLE == nodeType(pTable)) { const STableMeta* pMeta = ((SRealTableNode*)pTable)->pMeta; if (isInternalPrimaryKey(pCol)) { - setColumnInfoBySchema((SRealTableNode*)pTable, pMeta->schema, false, pCol); + setColumnInfoBySchema((SRealTableNode*)pTable, pMeta->schema, -1, pCol); *pFound = true; return TSDB_CODE_SUCCESS; } int32_t nums = pMeta->tableInfo.numOfTags + pMeta->tableInfo.numOfColumns; for (int32_t i = 0; i < nums; ++i) { if (0 == strcmp(pCol->colName, pMeta->schema[i].name)) { - setColumnInfoBySchema((SRealTableNode*)pTable, pMeta->schema + i, (i >= pMeta->tableInfo.numOfColumns), pCol); + setColumnInfoBySchema((SRealTableNode*)pTable, pMeta->schema + i, (i - pMeta->tableInfo.numOfColumns), pCol); *pFound = true; break; } @@ -551,7 +552,7 @@ static EDealRes translateColumnWithoutPrefix(STranslateContext* pCxt, SColumnNod } if (!found) { if (isInternalPk) { - if (NULL != pCxt->pCurrStmt->pWindow) { + if (NULL != pCxt->pCurrSelectStmt && NULL != pCxt->pCurrSelectStmt->pWindow) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_NOT_ALLOWED_WIN_QUERY); } return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_INVALID_INTERNAL_PK); @@ -563,7 +564,7 @@ static EDealRes translateColumnWithoutPrefix(STranslateContext* pCxt, SColumnNod } static bool translateColumnUseAlias(STranslateContext* pCxt, SColumnNode** pCol) { - SNodeList* pProjectionList = pCxt->pCurrStmt->pProjectionList; + SNodeList* pProjectionList = pCxt->pCurrSelectStmt->pProjectionList; SNode* pNode; FOREACH(pNode, pProjectionList) { SExprNode* pExpr = (SExprNode*)pNode; @@ -621,7 +622,7 @@ static int32_t parseTimeFromValueNode(STranslateContext* pCxt, SValueNode* pVal) } static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SDataType targetDt) { - uint8_t precision = (NULL != pCxt->pCurrStmt ? pCxt->pCurrStmt->precision : targetDt.precision); + uint8_t precision = (NULL != pCxt->pCurrSelectStmt ? pCxt->pCurrSelectStmt->precision : targetDt.precision); pVal->node.resType.precision = precision; if (pVal->placeholderNo > 0) { return DEAL_RES_CONTINUE; @@ -829,8 +830,9 @@ static EDealRes translateComparisonOperator(STranslateContext* pCxt, SOperatorNo if (!IS_VAR_DATA_TYPE(((SExprNode*)(pOp->pLeft))->resType.type)) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)(pOp->pLeft))->aliasName); } - if (QUERY_NODE_VALUE != nodeType(pOp->pRight) || - ((!IS_STR_DATA_TYPE(((SExprNode*)(pOp->pRight))->resType.type)) && (((SExprNode*)(pOp->pRight))->resType.type != TSDB_DATA_TYPE_NULL))) { + if (QUERY_NODE_VALUE != nodeType(pOp->pRight) || + ((!IS_STR_DATA_TYPE(((SExprNode*)(pOp->pRight))->resType.type)) && + (((SExprNode*)(pOp->pRight))->resType.type != TSDB_DATA_TYPE_NULL))) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)(pOp->pRight))->aliasName); } } @@ -910,7 +912,7 @@ static int32_t rewriteCountStar(STranslateContext* pCxt, SFunctionNode* pCount) STableNode* pTable = NULL; int32_t code = findTable(pCxt, ('\0' == pCol->tableAlias[0] ? NULL : pCol->tableAlias), &pTable); if (TSDB_CODE_SUCCESS == code && QUERY_NODE_REAL_TABLE == nodeType(pTable)) { - setColumnInfoBySchema((SRealTableNode*)pTable, ((SRealTableNode*)pTable)->pMeta->schema, false, pCol); + setColumnInfoBySchema((SRealTableNode*)pTable, ((SRealTableNode*)pTable)->pMeta->schema, -1, pCol); } return code; } @@ -936,7 +938,7 @@ static int32_t translateAggFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { if (hasInvalidFuncNesting(pFunc->pParameterList)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_AGG_FUNC_NESTING); } - if (pCxt->pCurrStmt->hasIndefiniteRowsFunc) { + if (pCxt->pCurrSelectStmt->hasIndefiniteRowsFunc) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); } @@ -948,7 +950,7 @@ static int32_t translateAggFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { static int32_t translateScanPseudoColumnFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { if (0 == LIST_LENGTH(pFunc->pParameterList)) { - if (QUERY_NODE_REAL_TABLE != nodeType(pCxt->pCurrStmt->pFromTable)) { + if (QUERY_NODE_REAL_TABLE != nodeType(pCxt->pCurrSelectStmt->pFromTable)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TBNAME); } } else { @@ -963,7 +965,8 @@ static int32_t translateScanPseudoColumnFunc(STranslateContext* pCxt, SFunctionN } static int32_t translateIndefiniteRowsFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { - if (SQL_CLAUSE_SELECT != pCxt->currClause || pCxt->pCurrStmt->hasIndefiniteRowsFunc || pCxt->pCurrStmt->hasAggFuncs) { + if (SQL_CLAUSE_SELECT != pCxt->currClause || pCxt->pCurrSelectStmt->hasIndefiniteRowsFunc || + pCxt->pCurrSelectStmt->hasAggFuncs) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); } if (hasInvalidFuncNesting(pFunc->pParameterList)) { @@ -973,9 +976,11 @@ static int32_t translateIndefiniteRowsFunc(STranslateContext* pCxt, SFunctionNod } static void setFuncClassification(SSelectStmt* pSelect, SFunctionNode* pFunc) { - pSelect->hasAggFuncs = pSelect->hasAggFuncs ? true : fmIsAggFunc(pFunc->funcId); - pSelect->hasRepeatScanFuncs = pSelect->hasRepeatScanFuncs ? true : fmIsRepeatScanFunc(pFunc->funcId); - pSelect->hasIndefiniteRowsFunc = pSelect->hasIndefiniteRowsFunc ? true : fmIsIndefiniteRowsFunc(pFunc->funcId); + if (NULL != pSelect) { + pSelect->hasAggFuncs = pSelect->hasAggFuncs ? true : fmIsAggFunc(pFunc->funcId); + pSelect->hasRepeatScanFuncs = pSelect->hasRepeatScanFuncs ? true : fmIsRepeatScanFunc(pFunc->funcId); + pSelect->hasIndefiniteRowsFunc = pSelect->hasIndefiniteRowsFunc ? true : fmIsIndefiniteRowsFunc(pFunc->funcId); + } } static EDealRes translateFunction(STranslateContext* pCxt, SFunctionNode* pFunc) { @@ -997,7 +1002,7 @@ static EDealRes translateFunction(STranslateContext* pCxt, SFunctionNode* pFunc) pCxt->errCode = translateIndefiniteRowsFunc(pCxt, pFunc); } if (TSDB_CODE_SUCCESS == pCxt->errCode) { - setFuncClassification(pCxt->pCurrStmt, pFunc); + setFuncClassification(pCxt->pCurrSelectStmt, pFunc); } return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_CONTINUE : DEAL_RES_ERROR; } @@ -1045,9 +1050,9 @@ static int32_t translateExprList(STranslateContext* pCxt, SNodeList* pList) { static SNodeList* getGroupByList(STranslateContext* pCxt) { if (isDistinctOrderBy(pCxt)) { - return pCxt->pCurrStmt->pProjectionList; + return pCxt->pCurrSelectStmt->pProjectionList; } - return pCxt->pCurrStmt->pGroupByList; + return pCxt->pCurrSelectStmt->pGroupByList; } static SNode* getGroupByNode(SNode* pNode) { @@ -1085,7 +1090,7 @@ static EDealRes rewriteColToSelectValFunc(STranslateContext* pCxt, SNode** pNode } if (TSDB_CODE_SUCCESS == pCxt->errCode) { *pNode = (SNode*)pFunc; - pCxt->pCurrStmt->hasSelectValFunc = true; + pCxt->pCurrSelectStmt->hasSelectValFunc = true; } else { nodesDestroyNode(pFunc); } @@ -1308,6 +1313,8 @@ static int32_t setTableVgroupList(STranslateContext* pCxt, SName* pName, SRealTa static uint8_t getStmtPrecision(SNode* pStmt) { if (QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { return ((SSelectStmt*)pStmt)->precision; + } else if (QUERY_NODE_SET_OPERATOR == nodeType(pStmt)) { + return ((SSetOperator*)pStmt)->precision; } return 0; } @@ -1319,10 +1326,10 @@ static bool stmtIsSingleTable(SNode* pStmt) { return false; } -static uint8_t getJoinTablePrecision(SJoinTableNode* pJoinTable) { - uint8_t lp = ((STableNode*)pJoinTable->pLeft)->precision; - uint8_t rp = ((STableNode*)pJoinTable->pRight)->precision; - return (lp > rp ? rp : lp); +static uint8_t calcPrecision(uint8_t lp, uint8_t rp) { return (lp > rp ? rp : lp); } + +static uint8_t calcJoinTablePrecision(SJoinTableNode* pJoinTable) { + return calcPrecision(((STableNode*)pJoinTable->pLeft)->precision, ((STableNode*)pJoinTable->pRight)->precision); } static bool joinTableIsSingleTable(SJoinTableNode* pJoinTable) { @@ -1378,7 +1385,7 @@ static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) { code = translateTable(pCxt, pJoinTable->pRight); } if (TSDB_CODE_SUCCESS == code) { - pJoinTable->table.precision = getJoinTablePrecision(pJoinTable); + pJoinTable->table.precision = calcJoinTablePrecision(pJoinTable); pJoinTable->table.singleTable = joinTableIsSingleTable(pJoinTable); code = translateExpr(pCxt, &pJoinTable->pOnCond); } @@ -1678,71 +1685,40 @@ static int32_t translateGroupBy(STranslateContext* pCxt, SSelectStmt* pSelect) { return TSDB_CODE_SUCCESS; } -static EDealRes isPrimaryKeyCondImpl(SNode* pNode, void* pContext) { - if (QUERY_NODE_COLUMN == nodeType(pNode)) { - *((bool*)pContext) = ((PRIMARYKEY_TIMESTAMP_COL_ID == ((SColumnNode*)pNode)->colId) ? true : false); - return *((bool*)pContext) ? DEAL_RES_CONTINUE : DEAL_RES_END; - } - return DEAL_RES_CONTINUE; -} - -static bool isPrimaryKeyCond(SNode* pNode) { - bool isPrimaryKeyCond = false; - nodesWalkExpr(pNode, isPrimaryKeyCondImpl, &isPrimaryKeyCond); - return isPrimaryKeyCond; -} - -static int32_t getTimeRangeFromLogicCond(STranslateContext* pCxt, SLogicConditionNode* pLogicCond, - STimeWindow* pTimeRange) { - SNodeList* pPrimaryKeyConds = NULL; - SNode* pCond = NULL; - FOREACH(pCond, pLogicCond->pParameterList) { - if (isPrimaryKeyCond(pCond)) { - if (TSDB_CODE_SUCCESS != nodesListMakeAppend(&pPrimaryKeyConds, pCond)) { - nodesClearList(pPrimaryKeyConds); - return TSDB_CODE_OUT_OF_MEMORY; - } - } - } - - if (NULL == pPrimaryKeyConds) { - *pTimeRange = TSWINDOW_INITIALIZER; - return TSDB_CODE_SUCCESS; - } - - SLogicConditionNode* pPrimaryKeyLogicCond = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); - if (NULL == pPrimaryKeyLogicCond) { - nodesClearList(pPrimaryKeyConds); - return TSDB_CODE_OUT_OF_MEMORY; +static int32_t getTimeRange(SNode** pPrimaryKeyCond, STimeWindow* pTimeRange, bool* pIsStrict) { + SNode* pNew = NULL; + int32_t code = scalarCalculateConstants(*pPrimaryKeyCond, &pNew); + if (TSDB_CODE_SUCCESS == code) { + *pPrimaryKeyCond = pNew; + code = filterGetTimeRange(*pPrimaryKeyCond, pTimeRange, pIsStrict); } - pPrimaryKeyLogicCond->condType = LOGIC_COND_TYPE_AND; - pPrimaryKeyLogicCond->pParameterList = pPrimaryKeyConds; - bool isStrict = false; - int32_t code = filterGetTimeRange((SNode*)pPrimaryKeyLogicCond, pTimeRange, &isStrict); - nodesClearList(pPrimaryKeyConds); - pPrimaryKeyLogicCond->pParameterList = NULL; - nodesDestroyNode(pPrimaryKeyLogicCond); return code; } -static int32_t getTimeRange(STranslateContext* pCxt, SNode* pWhere, STimeWindow* pTimeRange) { +static int32_t getFillTimeRange(STranslateContext* pCxt, SNode* pWhere, STimeWindow* pTimeRange) { if (NULL == pWhere) { *pTimeRange = TSWINDOW_INITIALIZER; return TSDB_CODE_SUCCESS; } - if (QUERY_NODE_LOGIC_CONDITION == nodeType(pWhere) && - LOGIC_COND_TYPE_AND == ((SLogicConditionNode*)pWhere)->condType) { - return getTimeRangeFromLogicCond(pCxt, (SLogicConditionNode*)pWhere, pTimeRange); + SNode* pCond = nodesCloneNode(pWhere); + if (NULL == pCond) { + return TSDB_CODE_OUT_OF_MEMORY; } - if (isPrimaryKeyCond(pWhere)) { + SNode* pPrimaryKeyCond = NULL; + nodesPartitionCond(&pCond, &pPrimaryKeyCond, NULL, NULL); + + int32_t code = TSDB_CODE_SUCCESS; + if (NULL != pPrimaryKeyCond) { bool isStrict = false; - return filterGetTimeRange(pWhere, pTimeRange, &isStrict); + code = getTimeRange(&pPrimaryKeyCond, pTimeRange, &isStrict); } else { *pTimeRange = TSWINDOW_INITIALIZER; } - return TSDB_CODE_SUCCESS; + nodesDestroyNode(pCond); + nodesDestroyNode(pPrimaryKeyCond); + return code; } static int32_t checkFill(STranslateContext* pCxt, SIntervalWindowNode* pInterval) { @@ -1778,7 +1754,7 @@ static int32_t translateFill(STranslateContext* pCxt, SNode* pWhere, SIntervalWi return TSDB_CODE_SUCCESS; } - int32_t code = getTimeRange(pCxt, pWhere, &(((SFillNode*)pInterval->pFill)->timeRange)); + int32_t code = getFillTimeRange(pCxt, pWhere, &(((SFillNode*)pInterval->pFill)->timeRange)); if (TSDB_CODE_SUCCESS == code) { code = checkFill(pCxt, pInterval); } @@ -1924,13 +1900,9 @@ static int32_t translateWhere(STranslateContext* pCxt, SNode** pWhere) { return translateExpr(pCxt, pWhere); } -static int32_t translateFrom(STranslateContext* pCxt, SSelectStmt* pSelect) { +static int32_t translateFrom(STranslateContext* pCxt, SNode* pTable) { pCxt->currClause = SQL_CLAUSE_FROM; - int32_t code = translateTable(pCxt, pSelect->pFromTable); - if (TSDB_CODE_SUCCESS == code) { - pSelect->precision = ((STableNode*)pSelect->pFromTable)->precision; - } - return code; + return translateTable(pCxt, pTable); } static int32_t checkLimit(STranslateContext* pCxt, SSelectStmt* pSelect) { @@ -1991,9 +1963,10 @@ static int32_t rewriteTimelineFunc(STranslateContext* pCxt, SSelectStmt* pSelect } static int32_t translateSelect(STranslateContext* pCxt, SSelectStmt* pSelect) { - pCxt->pCurrStmt = pSelect; - int32_t code = translateFrom(pCxt, pSelect); + pCxt->pCurrSelectStmt = pSelect; + int32_t code = translateFrom(pCxt, pSelect->pFromTable); if (TSDB_CODE_SUCCESS == code) { + pSelect->precision = ((STableNode*)pSelect->pFromTable)->precision; code = translateWhere(pCxt, &pSelect->pWhere); } if (TSDB_CODE_SUCCESS == code) { @@ -2094,6 +2067,10 @@ static int32_t translateSetOperatorImpl(STranslateContext* pCxt, SSetOperator* p return TSDB_CODE_SUCCESS; } +static uint8_t calcSetOperatorPrecision(SSetOperator* pSetOperator) { + return calcPrecision(getStmtPrecision(pSetOperator->pLeft), getStmtPrecision(pSetOperator->pRight)); +} + static int32_t translateSetOperator(STranslateContext* pCxt, SSetOperator* pSetOperator) { int32_t code = translateQuery(pCxt, pSetOperator->pLeft); if (TSDB_CODE_SUCCESS == code) { @@ -2103,11 +2080,55 @@ static int32_t translateSetOperator(STranslateContext* pCxt, SSetOperator* pSetO code = translateQuery(pCxt, pSetOperator->pRight); } if (TSDB_CODE_SUCCESS == code) { + pSetOperator->precision = calcSetOperatorPrecision(pSetOperator); code = translateSetOperatorImpl(pCxt, pSetOperator); } return code; } +static int32_t partitionDeleteWhere(STranslateContext* pCxt, SDeleteStmt* pDelete) { + if (NULL == pDelete->pWhere) { + pDelete->timeRange = TSWINDOW_INITIALIZER; + return TSDB_CODE_SUCCESS; + } + + SNode* pPrimaryKeyCond = NULL; + SNode* pOtherCond = NULL; + int32_t code = nodesPartitionCond(&pDelete->pWhere, &pPrimaryKeyCond, &pDelete->pTagIndexCond, &pOtherCond); + if (TSDB_CODE_SUCCESS == code && NULL != pOtherCond) { + code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DELETE_WHERE); + } + if (TSDB_CODE_SUCCESS == code) { + bool isStrict = false; + code = getTimeRange(&pPrimaryKeyCond, &pDelete->timeRange, &isStrict); + if (TSDB_CODE_SUCCESS == code && !isStrict) { + code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DELETE_WHERE); + } + } + nodesDestroyNode(pPrimaryKeyCond); + nodesDestroyNode(pOtherCond); + return code; +} + +static int32_t translateDeleteWhere(STranslateContext* pCxt, SDeleteStmt* pDelete) { + int32_t code = translateWhere(pCxt, &pDelete->pWhere); + if (TSDB_CODE_SUCCESS == code) { + code = partitionDeleteWhere(pCxt, pDelete); + } + return code; +} + +static int32_t translateDelete(STranslateContext* pCxt, SDeleteStmt* pDelete) { + int32_t code = translateFrom(pCxt, pDelete->pFromTable); + if (TSDB_CODE_SUCCESS == code) { + code = translateDeleteWhere(pCxt, pDelete); + } + if (TSDB_CODE_SUCCESS == code) { + code = translateExpr(pCxt, &pDelete->pCountFunc); + } + return code; +} + static int64_t getUnitPerMinute(uint8_t precision) { switch (precision) { case TSDB_TIME_PRECISION_MILLI: @@ -2647,7 +2668,7 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt code = checkTableSchema(pCxt, pStmt); } if (TSDB_CODE_SUCCESS == code) { - if(pCxt->pParseCxt->schemalessType == 0){ + if (pCxt->pParseCxt->schemalessType == 0) { code = isNotSchemalessDb(pCxt->pParseCxt, pStmt->dbName); } } @@ -2923,25 +2944,9 @@ static int32_t doTranslateDropSuperTable(STranslateContext* pCxt, const SName* p static int32_t translateDropTable(STranslateContext* pCxt, SDropTableStmt* pStmt) { SDropTableClause* pClause = nodesListGetNode(pStmt->pTables, 0); - - STableMeta* pTableMeta = NULL; - SName tableName; - int32_t code = getTableMetaImpl( - pCxt, toName(pCxt->pParseCxt->acctId, pClause->dbName, pClause->tableName, &tableName), &pTableMeta); - if ((TSDB_CODE_PAR_TABLE_NOT_EXIST == code || TSDB_CODE_VND_TB_NOT_EXIST == code) && pClause->ignoreNotExists) { - return TSDB_CODE_SUCCESS; - } - if (TSDB_CODE_SUCCESS == code) { - if (TSDB_SUPER_TABLE == pTableMeta->tableType) { - code = doTranslateDropSuperTable(pCxt, &tableName, pClause->ignoreNotExists); - } else { - // todo : drop normal table or child table - code = TSDB_CODE_FAILED; - } - taosMemoryFreeClear(pTableMeta); - } - - return code; + SName tableName; + return doTranslateDropSuperTable( + pCxt, toName(pCxt->pParseCxt->acctId, pClause->dbName, pClause->tableName, &tableName), pClause->ignoreNotExists); } static int32_t translateDropSuperTable(STranslateContext* pCxt, SDropSuperTableStmt* pStmt) { @@ -3449,7 +3454,6 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt* SName name; tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->streamName, strlen(pStmt->streamName)); tNameGetFullDbName(&name, pReq->name); - // tNameExtractFullName(toName(pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, pStmt->streamName, &name), pReq->name); if ('\0' != pStmt->targetTabName[0]) { strcpy(name.dbname, pStmt->targetDbName); @@ -3602,6 +3606,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_SET_OPERATOR: code = translateSetOperator(pCxt, (SSetOperator*)pNode); break; + case QUERY_NODE_DELETE_STMT: + code = translateDelete(pCxt, (SDeleteStmt*)pNode); + break; case QUERY_NODE_CREATE_DATABASE_STMT: code = translateCreateDatabase(pCxt, (SCreateDatabaseStmt*)pNode); break; @@ -3721,11 +3728,11 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { static int32_t translateSubquery(STranslateContext* pCxt, SNode* pNode) { ++(pCxt->currLevel); ESqlClause currClause = pCxt->currClause; - SSelectStmt* pCurrStmt = pCxt->pCurrStmt; + SSelectStmt* pCurrStmt = pCxt->pCurrSelectStmt; int32_t code = translateQuery(pCxt, pNode); --(pCxt->currLevel); pCxt->currClause = currClause; - pCxt->pCurrStmt = pCurrStmt; + pCxt->pCurrSelectStmt = pCurrStmt; return code; } @@ -4238,7 +4245,7 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla int16_t nTags = 0, nBufPos = 0; SSchema* pTagSchema = getTableTagSchema(pSuperTableMeta); SNode * pTag = NULL, *pNode = NULL; - bool isJson = false; + bool isJson = false; FORBOTH(pTag, pStmt->pSpecificTags, pNode, pStmt->pValsOfTags) { SColumnNode* pCol = (SColumnNode*)pTag; SSchema* pSchema = NULL; @@ -4271,11 +4278,11 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla isJson = true; code = parseJsontoTagData(pVal->literal, pTagArray, ppTag, &pCxt->msgBuf); - if(code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { goto end; } - }else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { - void* nodeVal = nodesGetValueFromNode(pVal); + } else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { + void* nodeVal = nodesGetValueFromNode(pVal); STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; if (IS_VAR_DATA_TYPE(pTagSchema->type)) { val.pData = varDataVal(nodeVal); @@ -4287,13 +4294,13 @@ static int32_t buildKVRowForBindTags(STranslateContext* pCxt, SCreateSubTableCla } } - if(!isJson) code = tTagNew(pTagArray, 1, false, ppTag); + if (!isJson) code = tTagNew(pTagArray, 1, false, ppTag); end: - if(isJson){ + if (isJson) { for (int i = 0; i < taosArrayGetSize(pTagArray); ++i) { - STagVal *p = (STagVal *)taosArrayGet(pTagArray, i); - if(IS_VAR_DATA_TYPE(p->type)){ + STagVal* p = (STagVal*)taosArrayGet(pTagArray, i); + if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFree(p->pData); } } @@ -4338,11 +4345,11 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau isJson = true; code = parseJsontoTagData(pVal->literal, pTagArray, ppTag, &pCxt->msgBuf); - if(code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { goto end; } - }else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { - char* tmpVal = nodesGetValueFromNode(pVal); + } else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { + char* tmpVal = nodesGetValueFromNode(pVal); STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; if (IS_VAR_DATA_TYPE(pTagSchema->type)) { val.pData = varDataVal(tmpVal); @@ -4354,13 +4361,13 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau } ++index; } - if(!isJson) code = tTagNew(pTagArray, 1, false, ppTag); + if (!isJson) code = tTagNew(pTagArray, 1, false, ppTag); end: - if(isJson){ + if (isJson) { for (int i = 0; i < taosArrayGetSize(pTagArray); ++i) { - STagVal *p = (STagVal *)taosArrayGet(pTagArray, i); - if(IS_VAR_DATA_TYPE(p->type)){ + STagVal* p = (STagVal*)taosArrayGet(pTagArray, i); + if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFree(p->pData); } } @@ -4428,7 +4435,6 @@ static SArray* serializeVgroupsCreateTableBatch(int32_t acctId, SHashObj* pVgrou } static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery) { - SCreateMultiTableStmt* pStmt = (SCreateMultiTableStmt*)pQuery->pRoot; SHashObj* pVgroupHashmap = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); @@ -4439,8 +4445,8 @@ static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery) int32_t code = TSDB_CODE_SUCCESS; SNode* pNode; FOREACH(pNode, pStmt->pSubTables) { - if(pCxt->pParseCxt->schemalessType == 0 && - (code = isNotSchemalessDb(pCxt->pParseCxt, ((SCreateSubTableClause*)pNode)->dbName)) != TSDB_CODE_SUCCESS){ + if (pCxt->pParseCxt->schemalessType == 0 && + (code = isNotSchemalessDb(pCxt->pParseCxt, ((SCreateSubTableClause*)pNode)->dbName)) != TSDB_CODE_SUCCESS) { return code; } code = rewriteCreateSubTable(pCxt, (SCreateSubTableClause*)pNode, pVgroupHashmap); @@ -4633,27 +4639,27 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS strlen(pStmt->pVal->literal) > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { return buildSyntaxErrMsg(&pCxt->msgBuf, "json string too long than 4095", pStmt->pVal->literal); } - SArray *pTagVals = taosArrayInit(1, sizeof(STagVal)); + SArray* pTagVals = taosArrayInit(1, sizeof(STagVal)); int32_t code = TSDB_CODE_SUCCESS; - STag* pTag = NULL; - do{ + STag* pTag = NULL; + do { code = parseJsontoTagData(pStmt->pVal->literal, pTagVals, &pTag, &pCxt->msgBuf); if (TSDB_CODE_SUCCESS != code) { break; } - }while(0); + } while (0); for (int i = 0; i < taosArrayGetSize(pTagVals); ++i) { - STagVal *p = (STagVal *)taosArrayGet(pTagVals, i); - if(IS_VAR_DATA_TYPE(p->type)){ + STagVal* p = (STagVal*)taosArrayGet(pTagVals, i); + if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFree(p->pData); } } taosArrayDestroy(pTagVals); - if (code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { return code; } pReq->nTagVal = pTag->len; - pReq->pTagVal = (uint8_t *)pTag; + pReq->pTagVal = (uint8_t*)pTag; pStmt->pVal->datum.p = (char*)pTag; // for free } else { pReq->nTagVal = pStmt->pVal->node.resType.bytes; @@ -4854,9 +4860,9 @@ static int32_t buildModifyVnodeArray(STranslateContext* pCxt, SAlterTableStmt* p static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) { SAlterTableStmt* pStmt = (SAlterTableStmt*)pQuery->pRoot; - int32_t code = TSDB_CODE_SUCCESS; - if(pCxt->pParseCxt->schemalessType == 0 && - (code = isNotSchemalessDb(pCxt->pParseCxt, pStmt->dbName)) != TSDB_CODE_SUCCESS){ + int32_t code = TSDB_CODE_SUCCESS; + if (pCxt->pParseCxt->schemalessType == 0 && + (code = isNotSchemalessDb(pCxt->pParseCxt, pStmt->dbName)) != TSDB_CODE_SUCCESS) { return code; } diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 0a1915d6c2fc5c1c776f6e991a2e39ee6d8a9aa3..474cbef0bc633bd08de7e7a6c70e51b14909ad9a 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -178,6 +178,8 @@ static char* getSyntaxErrFormat(int32_t errCode) { return "Only tag can be json type"; case TSDB_CODE_PAR_VALUE_TOO_LONG: return "Value too long for column/tag: %s"; + case TSDB_CODE_PAR_INVALID_DELETE_WHERE: + return "The DELETE statement must have a definite time window range"; case TSDB_CODE_OUT_OF_MEMORY: return "Out of memory"; default: @@ -322,11 +324,11 @@ static bool isValidateTag(char* input) { return true; } -int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag **ppTag, SMsgBuf* pMsgBuf) { +int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, SMsgBuf* pMsgBuf) { int32_t retCode = TSDB_CODE_SUCCESS; - cJSON* root = NULL; + cJSON* root = NULL; SHashObj* keyHash = NULL; - int32_t size = 0; + int32_t size = 0; // set json NULL data if (!json || strtrim((char*)json) == 0 || strcasecmp(json, TSDB_DATA_NULL_STR_L) == 0) { retCode = TSDB_CODE_SUCCESS; @@ -371,7 +373,8 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag **ppTag, SMs } STagVal val = {0}; val.pKey = jsonKey; - taosHashPut(keyHash, jsonKey, keyLen, &keyLen, CHAR_BYTES); // add key to hash to remove dumplicate, value is useless + taosHashPut(keyHash, jsonKey, keyLen, &keyLen, + CHAR_BYTES); // add key to hash to remove dumplicate, value is useless if (item->type == cJSON_String) { // add json value format: type|data char* jsonValue = item->valuestring; @@ -382,8 +385,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag **ppTag, SMs goto end; } val.type = TSDB_DATA_TYPE_NCHAR; - if (valLen > 0 && !taosMbsToUcs4(jsonValue, valLen, (TdUcs4*)tmp, - (int32_t)(valLen * TSDB_NCHAR_SIZE), &valLen)) { + if (valLen > 0 && !taosMbsToUcs4(jsonValue, valLen, (TdUcs4*)tmp, (int32_t)(valLen * TSDB_NCHAR_SIZE), &valLen)) { uError("charset:%s to %s. val:%s, errno:%s, convert failed.", DEFAULT_UNICODE_ENCODEC, tsCharset, jsonValue, strerror(errno)); retCode = buildSyntaxErrMsg(pMsgBuf, "charset convert json error", jsonValue); @@ -413,7 +415,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag **ppTag, SMs end: taosHashCleanup(keyHash); - if(retCode == TSDB_CODE_SUCCESS){ + if (retCode == TSDB_CODE_SUCCESS) { tTagNew(pTagVals, 1, true, ppTag); } cJSON_Delete(root); diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index ff4fe4032e9be6ab95696bf41d6e1f398983e7b1..e5844550e07561080e91f322f12474dc86b7766d 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,25 +104,25 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 357 +#define YYNOCODE 358 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SAlterOption yy53; - ENullOrder yy109; - SToken yy113; - EJoinType yy120; - int64_t yy123; - bool yy131; - EOrder yy428; - SDataType yy490; - EFillMode yy522; - int32_t yy550; - EOperatorType yy632; - SNodeList* yy670; - SNode* yy686; + EOrder yy14; + ENullOrder yy17; + SNodeList* yy60; + SToken yy105; + int32_t yy140; + SNode* yy172; + EFillMode yy202; + SDataType yy248; + EOperatorType yy572; + int64_t yy593; + SAlterOption yy609; + bool yy617; + EJoinType yy636; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -138,18 +138,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 612 -#define YYNRULE 451 -#define YYNRULE_WITH_ACTION 451 -#define YYNTOKEN 237 -#define YY_MAX_SHIFT 611 -#define YY_MIN_SHIFTREDUCE 898 -#define YY_MAX_SHIFTREDUCE 1348 -#define YY_ERROR_ACTION 1349 -#define YY_ACCEPT_ACTION 1350 -#define YY_NO_ACTION 1351 -#define YY_MIN_REDUCE 1352 -#define YY_MAX_REDUCE 1802 +#define YYNSTATE 616 +#define YYNRULE 452 +#define YYNTOKEN 238 +#define YY_MAX_SHIFT 615 +#define YY_MIN_SHIFTREDUCE 902 +#define YY_MAX_SHIFTREDUCE 1353 +#define YY_ERROR_ACTION 1354 +#define YY_ACCEPT_ACTION 1355 +#define YY_NO_ACTION 1356 +#define YY_MIN_REDUCE 1357 +#define YY_MAX_REDUCE 1808 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,622 +215,606 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2125) +#define YY_ACTTAB_COUNT (2165) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 132, 1780, 345, 1636, 1440, 1636, 294, 385, 311, 386, - /* 10 */ 1384, 78, 35, 33, 1779, 1472, 24, 1649, 1777, 131, - /* 20 */ 303, 1364, 1162, 1633, 114, 1633, 36, 34, 32, 31, - /* 30 */ 30, 1780, 1475, 36, 34, 32, 31, 30, 1629, 1635, - /* 40 */ 1629, 1635, 1780, 525, 147, 1665, 928, 1160, 1777, 529, - /* 50 */ 525, 529, 1350, 489, 393, 146, 386, 1384, 14, 1777, - /* 60 */ 35, 33, 1289, 509, 1168, 56, 384, 1619, 303, 388, - /* 70 */ 1162, 36, 34, 32, 31, 30, 36, 34, 32, 31, - /* 80 */ 30, 1, 77, 1678, 932, 933, 82, 1650, 512, 1652, - /* 90 */ 1653, 508, 73, 529, 1375, 1160, 1718, 1414, 1780, 1296, - /* 100 */ 296, 1714, 142, 608, 39, 1186, 14, 1353, 35, 33, - /* 110 */ 319, 1778, 1168, 1161, 220, 1777, 303, 277, 1162, 462, - /* 120 */ 468, 1745, 36, 34, 32, 31, 30, 71, 95, 2, - /* 130 */ 1374, 94, 93, 92, 91, 90, 89, 88, 87, 86, - /* 140 */ 525, 1200, 55, 1160, 1619, 315, 1303, 307, 1476, 1251, - /* 150 */ 1780, 608, 1563, 1565, 14, 129, 1163, 438, 437, 1780, - /* 160 */ 1168, 1161, 436, 146, 1485, 110, 433, 1777, 277, 432, - /* 170 */ 431, 430, 146, 945, 497, 944, 1777, 2, 1166, 1167, - /* 180 */ 1619, 1213, 1214, 1216, 1217, 1218, 1219, 1220, 505, 527, - /* 190 */ 1228, 1229, 1230, 1231, 1232, 1233, 286, 1239, 1252, 608, - /* 200 */ 1251, 38, 946, 1186, 1163, 55, 62, 95, 149, 1161, - /* 210 */ 94, 93, 92, 91, 90, 89, 88, 87, 86, 1257, - /* 220 */ 1732, 36, 34, 32, 31, 30, 1166, 1167, 1479, 1213, - /* 230 */ 1214, 1216, 1217, 1218, 1219, 1220, 505, 527, 1228, 1229, - /* 240 */ 1230, 1231, 1232, 1233, 1729, 287, 1373, 285, 284, 1252, - /* 250 */ 426, 403, 1163, 1372, 428, 27, 301, 1246, 1247, 1248, - /* 260 */ 1249, 1250, 1254, 1255, 1256, 513, 1188, 1215, 306, 149, - /* 270 */ 1257, 1572, 28, 228, 1166, 1167, 427, 1213, 1214, 1216, - /* 280 */ 1217, 1218, 1219, 1220, 505, 527, 1228, 1229, 1230, 1231, - /* 290 */ 1232, 1233, 35, 33, 1352, 1313, 1619, 64, 292, 1461, - /* 300 */ 303, 192, 1162, 1619, 526, 351, 27, 301, 1246, 1247, - /* 310 */ 1248, 1249, 1250, 1254, 1255, 1256, 349, 1189, 104, 103, - /* 320 */ 102, 101, 100, 99, 98, 97, 96, 1160, 149, 452, - /* 330 */ 560, 1649, 149, 1483, 472, 1311, 1312, 1314, 1315, 275, - /* 340 */ 35, 33, 1234, 1162, 1168, 486, 313, 1665, 303, 559, - /* 350 */ 1162, 558, 557, 556, 129, 479, 403, 1345, 526, 1665, - /* 360 */ 498, 8, 1371, 1485, 1560, 1215, 526, 489, 1160, 1780, - /* 370 */ 350, 157, 1527, 392, 113, 1160, 388, 509, 360, 293, - /* 380 */ 1186, 1619, 146, 608, 1525, 1168, 1777, 1483, 35, 33, - /* 390 */ 478, 219, 1168, 1161, 1370, 1483, 303, 1678, 1162, 1459, - /* 400 */ 82, 1650, 512, 1652, 1653, 508, 55, 529, 26, 9, - /* 410 */ 1718, 111, 1619, 1288, 296, 1714, 142, 141, 36, 34, - /* 420 */ 32, 31, 30, 1160, 608, 488, 143, 1725, 1726, 1521, - /* 430 */ 1730, 608, 62, 1369, 1161, 1746, 1163, 1344, 438, 437, - /* 440 */ 1168, 1161, 204, 436, 1619, 109, 110, 433, 11, 10, - /* 450 */ 432, 431, 430, 480, 1478, 1368, 562, 9, 1166, 1167, - /* 460 */ 475, 1213, 1214, 1216, 1217, 1218, 1219, 1220, 505, 527, - /* 470 */ 1228, 1229, 1230, 1231, 1232, 1233, 1187, 1163, 316, 608, - /* 480 */ 344, 336, 343, 1619, 1163, 1460, 129, 997, 149, 1161, - /* 490 */ 36, 34, 32, 31, 30, 1485, 1527, 604, 603, 1166, - /* 500 */ 1167, 338, 334, 308, 999, 1619, 1166, 1167, 1525, 1213, - /* 510 */ 1214, 1216, 1217, 1218, 1219, 1220, 505, 527, 1228, 1229, - /* 520 */ 1230, 1231, 1232, 1233, 36, 34, 32, 31, 30, 1265, - /* 530 */ 481, 476, 1163, 149, 7, 1035, 552, 551, 550, 1039, - /* 540 */ 549, 1041, 1042, 548, 1044, 545, 1367, 1050, 542, 1052, - /* 550 */ 1053, 539, 536, 1366, 1166, 1167, 1649, 1213, 1214, 1216, - /* 560 */ 1217, 1218, 1219, 1220, 505, 527, 1228, 1229, 1230, 1231, - /* 570 */ 1232, 1233, 35, 33, 274, 375, 1184, 1411, 560, 526, - /* 580 */ 303, 526, 1162, 368, 1665, 1732, 380, 250, 155, 390, - /* 590 */ 1513, 105, 507, 361, 1200, 1184, 1619, 559, 424, 558, - /* 600 */ 557, 556, 509, 1619, 381, 1527, 1619, 1160, 1483, 1728, - /* 610 */ 1483, 1363, 314, 60, 1253, 513, 59, 1525, 1287, 159, - /* 620 */ 158, 1573, 1678, 128, 1168, 270, 1650, 512, 1652, 1653, - /* 630 */ 508, 506, 529, 503, 1690, 1258, 486, 584, 583, 582, - /* 640 */ 318, 2, 581, 580, 579, 115, 574, 573, 572, 571, - /* 650 */ 570, 569, 568, 567, 122, 563, 1362, 32, 31, 30, - /* 660 */ 1186, 1619, 1361, 608, 1360, 113, 435, 434, 562, 578, - /* 670 */ 576, 25, 1359, 1161, 379, 1458, 1358, 374, 373, 372, - /* 680 */ 371, 370, 367, 366, 365, 364, 363, 359, 358, 357, - /* 690 */ 356, 355, 354, 353, 352, 486, 1564, 1565, 526, 932, - /* 700 */ 933, 1732, 111, 1527, 1284, 198, 1619, 54, 1357, 1356, - /* 710 */ 402, 526, 1619, 1355, 1619, 1526, 1163, 144, 1725, 1726, - /* 720 */ 1185, 1730, 1619, 105, 113, 1727, 1619, 1483, 129, 1649, - /* 730 */ 429, 55, 566, 65, 1455, 1365, 1474, 1486, 1166, 1167, - /* 740 */ 1483, 1213, 1214, 1216, 1217, 1218, 1219, 1220, 505, 527, - /* 750 */ 1228, 1229, 1230, 1231, 1232, 1233, 1633, 1665, 1619, 1619, - /* 760 */ 1649, 111, 1608, 1619, 428, 510, 969, 944, 560, 1737, - /* 770 */ 1284, 1629, 1635, 1147, 1148, 509, 145, 1725, 1726, 1619, - /* 780 */ 1730, 555, 529, 970, 490, 526, 427, 559, 1665, 558, - /* 790 */ 557, 556, 422, 502, 577, 1678, 510, 1480, 81, 1650, - /* 800 */ 512, 1652, 1653, 508, 494, 529, 509, 326, 1718, 1468, - /* 810 */ 1619, 526, 276, 1714, 1483, 490, 183, 185, 1637, 181, - /* 820 */ 184, 1649, 1215, 1599, 1780, 187, 1678, 1470, 186, 81, - /* 830 */ 1650, 512, 1652, 1653, 508, 339, 529, 148, 1633, 1718, - /* 840 */ 1483, 1777, 1639, 276, 1714, 130, 310, 309, 526, 1665, - /* 850 */ 256, 565, 450, 1629, 1635, 1780, 1176, 510, 149, 1466, - /* 860 */ 460, 195, 254, 53, 529, 448, 52, 509, 146, 504, - /* 870 */ 526, 1619, 1777, 443, 526, 189, 119, 1483, 188, 1641, - /* 880 */ 46, 1169, 523, 160, 1649, 207, 524, 1678, 451, 526, - /* 890 */ 82, 1650, 512, 1652, 1653, 508, 1171, 529, 1168, 1483, - /* 900 */ 1718, 241, 191, 1483, 296, 1714, 1793, 1401, 55, 1396, - /* 910 */ 1394, 526, 1665, 1243, 446, 1752, 554, 464, 1483, 440, - /* 920 */ 510, 1310, 1441, 317, 190, 37, 209, 492, 1170, 439, - /* 930 */ 509, 441, 444, 37, 1619, 1347, 1348, 530, 46, 223, - /* 940 */ 1483, 37, 11, 10, 80, 230, 117, 1172, 459, 51, - /* 950 */ 1678, 473, 50, 82, 1650, 512, 1652, 1653, 508, 453, - /* 960 */ 529, 214, 1174, 1718, 1666, 421, 1259, 296, 1714, 1793, - /* 970 */ 1649, 1385, 118, 119, 1221, 58, 57, 348, 1775, 249, - /* 980 */ 154, 1522, 1120, 222, 1748, 342, 232, 518, 495, 534, - /* 990 */ 1177, 118, 119, 487, 1173, 225, 1184, 273, 1665, 3, - /* 1000 */ 332, 1649, 328, 324, 151, 321, 510, 227, 325, 120, - /* 1010 */ 282, 997, 1180, 238, 1028, 1131, 509, 246, 118, 283, - /* 1020 */ 1619, 362, 1562, 527, 1228, 1229, 156, 369, 377, 1665, - /* 1030 */ 1056, 376, 1060, 1066, 378, 149, 1678, 510, 382, 82, - /* 1040 */ 1650, 512, 1652, 1653, 508, 1190, 529, 509, 383, 1718, - /* 1050 */ 1064, 1619, 391, 296, 1714, 1793, 490, 1193, 486, 121, - /* 1060 */ 394, 163, 1649, 395, 1736, 165, 1192, 1678, 1194, 397, - /* 1070 */ 261, 1650, 512, 1652, 1653, 508, 396, 529, 168, 399, - /* 1080 */ 170, 400, 1191, 401, 173, 61, 425, 113, 404, 176, - /* 1090 */ 1665, 1473, 423, 180, 1168, 291, 1780, 1469, 510, 85, - /* 1100 */ 247, 454, 1603, 455, 182, 193, 490, 458, 509, 148, - /* 1110 */ 123, 124, 1619, 1777, 1471, 1467, 125, 490, 196, 126, - /* 1120 */ 461, 199, 202, 1189, 111, 1649, 1759, 466, 1678, 474, - /* 1130 */ 516, 261, 1650, 512, 1652, 1653, 508, 1758, 529, 217, - /* 1140 */ 1725, 485, 465, 484, 6, 483, 1780, 471, 463, 205, - /* 1150 */ 208, 470, 295, 1665, 477, 213, 1649, 1780, 1739, 148, - /* 1160 */ 1284, 510, 5, 1777, 1749, 1188, 112, 1733, 40, 136, - /* 1170 */ 146, 509, 499, 496, 1777, 1619, 215, 18, 1571, 1570, - /* 1180 */ 1796, 514, 519, 297, 1665, 515, 305, 520, 234, 216, - /* 1190 */ 521, 1678, 510, 236, 83, 1650, 512, 1652, 1653, 508, - /* 1200 */ 1699, 529, 509, 248, 1718, 70, 1619, 72, 1717, 1714, - /* 1210 */ 1649, 1484, 251, 607, 532, 1456, 1776, 221, 47, 1649, - /* 1220 */ 135, 493, 1678, 243, 224, 83, 1650, 512, 1652, 1653, - /* 1230 */ 508, 500, 529, 226, 262, 1718, 272, 263, 1665, 501, - /* 1240 */ 1714, 253, 255, 1613, 1612, 320, 510, 1665, 1609, 322, - /* 1250 */ 323, 1156, 1157, 152, 327, 510, 509, 1607, 329, 330, - /* 1260 */ 1619, 331, 1606, 333, 1605, 509, 335, 1604, 337, 1619, - /* 1270 */ 1589, 153, 340, 341, 1134, 1133, 1678, 346, 347, 133, - /* 1280 */ 1650, 512, 1652, 1653, 508, 1678, 529, 1583, 83, 1650, - /* 1290 */ 512, 1652, 1653, 508, 1582, 529, 611, 1649, 1718, 1103, - /* 1300 */ 1555, 1554, 1553, 1715, 1581, 1580, 1552, 1551, 1649, 1550, - /* 1310 */ 245, 1549, 1548, 1547, 1546, 1545, 1544, 1543, 1542, 1541, - /* 1320 */ 1540, 1539, 106, 491, 1794, 1665, 1538, 1537, 600, 596, - /* 1330 */ 592, 588, 244, 510, 1536, 116, 1665, 1535, 1534, 1533, - /* 1340 */ 1532, 1531, 1530, 509, 510, 1105, 1529, 1619, 161, 935, - /* 1350 */ 469, 1528, 1413, 1381, 509, 1380, 1597, 79, 1619, 107, - /* 1360 */ 239, 934, 108, 1678, 1591, 139, 271, 1650, 512, 1652, - /* 1370 */ 1653, 508, 387, 529, 1678, 389, 1649, 266, 1650, 512, - /* 1380 */ 1652, 1653, 508, 162, 529, 1579, 167, 169, 1578, 1568, - /* 1390 */ 1462, 172, 963, 522, 1412, 1410, 407, 405, 1408, 411, - /* 1400 */ 1406, 1404, 406, 415, 1665, 409, 410, 413, 414, 419, - /* 1410 */ 418, 1393, 510, 1392, 417, 482, 1070, 179, 467, 1379, - /* 1420 */ 1464, 200, 509, 1463, 1069, 1649, 1619, 996, 995, 994, - /* 1430 */ 993, 990, 575, 45, 577, 1402, 1649, 288, 1397, 1139, - /* 1440 */ 289, 194, 1678, 989, 988, 133, 1650, 512, 1652, 1653, - /* 1450 */ 508, 442, 529, 1665, 1395, 290, 445, 1378, 447, 1377, - /* 1460 */ 1596, 510, 449, 84, 1665, 201, 456, 1577, 1141, 1590, - /* 1470 */ 1576, 509, 507, 1575, 1567, 1619, 212, 49, 300, 41, - /* 1480 */ 66, 457, 509, 4, 15, 134, 1619, 1649, 37, 48, - /* 1490 */ 1795, 1678, 206, 43, 271, 1650, 512, 1652, 1653, 508, - /* 1500 */ 1639, 529, 1678, 211, 1309, 270, 1650, 512, 1652, 1653, - /* 1510 */ 508, 210, 529, 197, 1691, 1665, 203, 10, 22, 23, - /* 1520 */ 42, 1302, 67, 510, 178, 218, 1649, 1281, 1280, 127, - /* 1530 */ 137, 1338, 1327, 509, 17, 1333, 140, 1619, 19, 1649, - /* 1540 */ 302, 1332, 420, 416, 412, 408, 177, 298, 1337, 1336, - /* 1550 */ 299, 1244, 29, 1678, 1665, 138, 271, 1650, 512, 1652, - /* 1560 */ 1653, 508, 510, 529, 1223, 1222, 12, 1665, 20, 1208, - /* 1570 */ 150, 63, 509, 21, 175, 510, 1619, 229, 1307, 304, - /* 1580 */ 231, 1566, 16, 235, 1178, 509, 13, 511, 1649, 1619, - /* 1590 */ 233, 517, 1678, 68, 69, 271, 1650, 512, 1652, 1653, - /* 1600 */ 508, 237, 529, 1638, 240, 1678, 1225, 73, 257, 1650, - /* 1610 */ 512, 1652, 1653, 508, 1681, 529, 1665, 1649, 528, 44, - /* 1620 */ 531, 1057, 533, 312, 510, 535, 537, 1054, 1049, 538, - /* 1630 */ 540, 174, 1051, 166, 509, 171, 541, 398, 1619, 543, - /* 1640 */ 1045, 546, 544, 1034, 547, 1665, 1043, 1048, 1047, 553, - /* 1650 */ 74, 75, 1065, 510, 1678, 164, 1649, 265, 1650, 512, - /* 1660 */ 1652, 1653, 508, 509, 529, 76, 1063, 1619, 1062, 961, - /* 1670 */ 1046, 561, 985, 1003, 564, 242, 983, 982, 981, 980, - /* 1680 */ 979, 978, 977, 1678, 1665, 976, 267, 1650, 512, 1652, - /* 1690 */ 1653, 508, 510, 529, 998, 973, 972, 971, 968, 967, - /* 1700 */ 966, 1000, 509, 1409, 585, 1649, 1619, 586, 587, 1407, - /* 1710 */ 589, 590, 591, 1405, 593, 594, 1649, 595, 1403, 597, - /* 1720 */ 599, 598, 1678, 1391, 601, 258, 1650, 512, 1652, 1653, - /* 1730 */ 508, 1390, 529, 1665, 602, 1376, 605, 606, 1351, 1351, - /* 1740 */ 609, 510, 1164, 252, 1665, 610, 1351, 1351, 1351, 1351, - /* 1750 */ 1351, 509, 510, 1351, 1351, 1619, 1351, 1351, 1351, 1351, - /* 1760 */ 1351, 1351, 509, 1351, 1351, 1649, 1619, 1351, 1351, 1351, - /* 1770 */ 1351, 1678, 1351, 1351, 268, 1650, 512, 1652, 1653, 508, - /* 1780 */ 1649, 529, 1678, 1351, 1351, 259, 1650, 512, 1652, 1653, - /* 1790 */ 508, 1351, 529, 1665, 1351, 1351, 1351, 1649, 1351, 1351, - /* 1800 */ 1351, 510, 1351, 1351, 1351, 1351, 1351, 1351, 1665, 1351, - /* 1810 */ 1351, 509, 1649, 1351, 1351, 1619, 510, 1351, 1351, 1351, - /* 1820 */ 1351, 1351, 1351, 1351, 1351, 1665, 509, 1351, 1351, 1649, - /* 1830 */ 1619, 1678, 1351, 510, 269, 1650, 512, 1652, 1653, 508, - /* 1840 */ 1665, 529, 1351, 509, 1351, 1351, 1678, 1619, 510, 260, - /* 1850 */ 1650, 512, 1652, 1653, 508, 1351, 529, 1665, 509, 1351, - /* 1860 */ 1351, 1351, 1619, 1678, 1351, 510, 1661, 1650, 512, 1652, - /* 1870 */ 1653, 508, 1351, 529, 1351, 509, 1649, 1351, 1678, 1619, - /* 1880 */ 1351, 1660, 1650, 512, 1652, 1653, 508, 1351, 529, 1351, - /* 1890 */ 1351, 1351, 1351, 1351, 1351, 1678, 1351, 1351, 1659, 1650, - /* 1900 */ 512, 1652, 1653, 508, 1665, 529, 1351, 1351, 1649, 1351, - /* 1910 */ 1351, 1351, 510, 1351, 1351, 1351, 1351, 1351, 1351, 1351, - /* 1920 */ 1351, 1351, 509, 1351, 1351, 1649, 1619, 1351, 1351, 1351, - /* 1930 */ 1351, 1351, 1351, 1351, 1351, 1351, 1665, 1351, 1351, 1351, - /* 1940 */ 1351, 1351, 1678, 1351, 510, 280, 1650, 512, 1652, 1653, - /* 1950 */ 508, 1351, 529, 1665, 509, 1351, 1351, 1649, 1619, 1351, - /* 1960 */ 1351, 510, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, - /* 1970 */ 1351, 509, 1351, 1351, 1678, 1619, 1351, 279, 1650, 512, - /* 1980 */ 1652, 1653, 508, 1351, 529, 1665, 1351, 1351, 1351, 1351, - /* 1990 */ 1351, 1678, 1351, 510, 281, 1650, 512, 1652, 1653, 508, - /* 2000 */ 1351, 529, 1351, 509, 1351, 1351, 1649, 1619, 1351, 1351, - /* 2010 */ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 486, - /* 2020 */ 1351, 1351, 1351, 1678, 1351, 1351, 278, 1650, 512, 1652, - /* 2030 */ 1653, 508, 1351, 529, 1665, 1351, 1351, 1351, 1351, 1351, - /* 2040 */ 1351, 1351, 510, 1351, 1351, 1351, 1351, 1351, 113, 1351, - /* 2050 */ 1351, 1351, 509, 1351, 1351, 1351, 1619, 1351, 1351, 1351, - /* 2060 */ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 490, 1351, 1351, - /* 2070 */ 1351, 1351, 1678, 1351, 1351, 264, 1650, 512, 1652, 1653, - /* 2080 */ 508, 1351, 529, 1351, 1351, 111, 1351, 1351, 1351, 1351, - /* 2090 */ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, - /* 2100 */ 217, 1725, 485, 1351, 484, 1351, 1351, 1780, 1351, 1351, - /* 2110 */ 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, 1351, - /* 2120 */ 146, 1351, 1351, 1351, 1777, + /* 0 */ 72, 355, 1655, 1642, 28, 230, 296, 1465, 1642, 608, + /* 10 */ 607, 313, 35, 33, 530, 36, 34, 32, 31, 30, + /* 20 */ 305, 1481, 1167, 1639, 530, 490, 106, 1477, 1639, 389, + /* 30 */ 1671, 390, 1389, 428, 490, 277, 152, 349, 514, 1635, + /* 40 */ 1641, 529, 133, 1488, 1635, 1641, 1445, 1165, 513, 132, + /* 50 */ 533, 1369, 1625, 1488, 114, 533, 529, 494, 14, 530, + /* 60 */ 35, 33, 1294, 114, 1173, 1416, 932, 63, 305, 1684, + /* 70 */ 1167, 353, 82, 1656, 516, 1658, 1659, 512, 1786, 533, + /* 80 */ 110, 1, 1724, 56, 1532, 1308, 278, 1720, 1488, 1483, + /* 90 */ 147, 295, 112, 517, 1783, 1165, 1530, 529, 1786, 1578, + /* 100 */ 564, 112, 39, 612, 936, 937, 14, 145, 1731, 1732, + /* 110 */ 149, 1736, 1173, 1166, 1783, 492, 144, 1731, 1732, 563, + /* 120 */ 1736, 562, 561, 560, 407, 588, 587, 586, 320, 2, + /* 130 */ 585, 584, 583, 116, 578, 577, 576, 575, 574, 573, + /* 140 */ 572, 571, 123, 567, 1358, 36, 34, 32, 31, 30, + /* 150 */ 397, 612, 390, 1389, 142, 317, 1168, 1191, 38, 1671, + /* 160 */ 55, 1166, 1568, 1570, 1466, 96, 1526, 483, 95, 94, + /* 170 */ 93, 92, 91, 90, 89, 88, 87, 479, 388, 1171, + /* 180 */ 1172, 392, 1218, 1219, 1221, 1222, 1223, 1224, 1225, 509, + /* 190 */ 531, 1233, 1234, 1235, 1236, 1237, 1238, 36, 34, 32, + /* 200 */ 31, 30, 517, 482, 1168, 308, 581, 96, 1577, 150, + /* 210 */ 95, 94, 93, 92, 91, 90, 89, 88, 87, 288, + /* 220 */ 130, 407, 36, 34, 32, 31, 30, 1171, 1172, 1491, + /* 230 */ 1218, 1219, 1221, 1222, 1223, 1224, 1225, 509, 531, 1233, + /* 240 */ 1234, 1235, 1236, 1237, 1238, 35, 33, 343, 485, 480, + /* 250 */ 1355, 442, 441, 305, 1655, 1167, 440, 200, 252, 111, + /* 260 */ 437, 1518, 379, 436, 435, 434, 35, 33, 289, 447, + /* 270 */ 287, 286, 1001, 430, 305, 1479, 1167, 432, 129, 309, + /* 280 */ 1165, 79, 1671, 55, 455, 66, 150, 130, 150, 1003, + /* 290 */ 514, 14, 1205, 484, 115, 1639, 1490, 1173, 193, 431, + /* 300 */ 513, 1165, 1480, 949, 1625, 948, 161, 160, 321, 494, + /* 310 */ 450, 1635, 1641, 394, 2, 444, 1192, 1643, 1173, 1189, + /* 320 */ 192, 1684, 533, 490, 82, 1656, 516, 1658, 1659, 512, + /* 330 */ 24, 533, 950, 1350, 1724, 8, 612, 1639, 278, 1720, + /* 340 */ 36, 34, 32, 31, 30, 51, 1166, 1464, 50, 1786, + /* 350 */ 1786, 566, 114, 1635, 1641, 65, 294, 612, 1380, 194, + /* 360 */ 559, 147, 147, 1463, 533, 1783, 1783, 1166, 1357, 1039, + /* 370 */ 556, 555, 554, 1043, 553, 1045, 1046, 552, 1048, 549, + /* 380 */ 1379, 1054, 546, 1056, 1057, 543, 540, 7, 55, 1168, + /* 390 */ 112, 1190, 105, 104, 103, 102, 101, 100, 99, 98, + /* 400 */ 97, 32, 31, 30, 566, 146, 1731, 1732, 1625, 1736, + /* 410 */ 1168, 150, 1171, 1172, 1349, 1218, 1219, 1221, 1222, 1223, + /* 420 */ 1224, 1225, 509, 531, 1233, 1234, 1235, 1236, 1237, 1238, + /* 430 */ 1625, 569, 157, 1171, 1172, 463, 1218, 1219, 1221, 1222, + /* 440 */ 1223, 1224, 1225, 509, 531, 1233, 1234, 1235, 1236, 1237, + /* 450 */ 1238, 35, 33, 1239, 26, 1378, 564, 61, 466, 305, + /* 460 */ 60, 1167, 564, 150, 36, 34, 32, 31, 30, 63, + /* 470 */ 1406, 396, 35, 33, 392, 563, 1655, 562, 561, 560, + /* 480 */ 305, 563, 1167, 562, 561, 560, 1165, 1193, 530, 1318, + /* 490 */ 530, 1484, 443, 36, 34, 32, 31, 30, 1786, 1786, + /* 500 */ 354, 1645, 106, 1173, 1671, 1625, 1473, 1165, 55, 433, + /* 510 */ 1785, 147, 493, 456, 1783, 1783, 150, 1488, 1377, 1488, + /* 520 */ 9, 570, 513, 1460, 1173, 1419, 1625, 454, 476, 1316, + /* 530 */ 1317, 1319, 1320, 36, 34, 32, 31, 30, 1647, 279, + /* 540 */ 452, 9, 612, 1684, 439, 438, 83, 1656, 516, 1658, + /* 550 */ 1659, 512, 1166, 533, 1786, 1475, 1724, 1532, 1289, 315, + /* 560 */ 298, 1720, 143, 612, 310, 1786, 147, 130, 1625, 1530, + /* 570 */ 1783, 1256, 1301, 1166, 222, 1786, 1490, 148, 1191, 472, + /* 580 */ 1751, 1783, 348, 1738, 347, 442, 441, 1784, 530, 340, + /* 590 */ 440, 1783, 1532, 111, 437, 1168, 1532, 436, 435, 434, + /* 600 */ 364, 582, 580, 316, 1531, 1569, 1570, 1735, 1530, 342, + /* 610 */ 338, 1293, 221, 1376, 936, 937, 1168, 1488, 1171, 1172, + /* 620 */ 1257, 1218, 1219, 1221, 1222, 1223, 1224, 1225, 509, 531, + /* 630 */ 1233, 1234, 1235, 1236, 1237, 1238, 150, 11, 10, 1171, + /* 640 */ 1172, 1262, 1218, 1219, 1221, 1222, 1223, 1224, 1225, 509, + /* 650 */ 531, 1233, 1234, 1235, 1236, 1237, 1238, 35, 33, 276, + /* 660 */ 1655, 1189, 530, 1625, 530, 305, 1375, 1167, 372, 54, + /* 670 */ 1374, 384, 1373, 1471, 365, 197, 406, 508, 27, 303, + /* 680 */ 1251, 1252, 1253, 1254, 1255, 1259, 1260, 1261, 1671, 385, + /* 690 */ 530, 1488, 1165, 1488, 1244, 530, 514, 1372, 1565, 530, + /* 700 */ 1191, 432, 1485, 1371, 318, 159, 513, 1604, 1191, 1173, + /* 710 */ 1625, 464, 130, 530, 1151, 1152, 1625, 1194, 1270, 1488, + /* 720 */ 1625, 1490, 1625, 431, 1488, 527, 2, 1684, 1488, 1258, + /* 730 */ 83, 1656, 516, 1658, 1659, 512, 948, 533, 1368, 1367, + /* 740 */ 1724, 1220, 1488, 498, 298, 1720, 1799, 1625, 612, 120, + /* 750 */ 1263, 1743, 1289, 1625, 1366, 1758, 1365, 1364, 1166, 383, + /* 760 */ 1363, 426, 378, 377, 376, 375, 374, 371, 370, 369, + /* 770 */ 368, 367, 363, 362, 361, 360, 359, 358, 357, 356, + /* 780 */ 530, 131, 530, 530, 1738, 1370, 258, 25, 1625, 1625, + /* 790 */ 468, 1738, 528, 1362, 243, 319, 1361, 501, 256, 53, + /* 800 */ 1613, 1168, 52, 1360, 1625, 506, 1625, 1625, 1734, 1488, + /* 810 */ 1625, 1488, 1488, 185, 1446, 1733, 183, 1292, 187, 162, + /* 820 */ 189, 186, 1176, 188, 1171, 1172, 46, 1218, 1219, 1221, + /* 830 */ 1222, 1223, 1224, 1225, 509, 531, 1233, 1234, 1235, 1236, + /* 840 */ 1237, 1238, 206, 1625, 55, 330, 1625, 36, 34, 32, + /* 850 */ 31, 30, 191, 1625, 1401, 190, 1167, 1399, 209, 11, + /* 860 */ 10, 1352, 1353, 1220, 46, 37, 37, 1315, 37, 232, + /* 870 */ 558, 1220, 457, 118, 119, 78, 445, 120, 1175, 448, + /* 880 */ 81, 1165, 538, 225, 973, 74, 119, 477, 1179, 120, + /* 890 */ 496, 216, 1672, 279, 121, 1390, 1655, 1527, 1173, 211, + /* 900 */ 425, 974, 119, 1754, 491, 251, 1264, 1226, 322, 1124, + /* 910 */ 234, 59, 58, 352, 522, 240, 156, 1205, 1032, 1189, + /* 920 */ 224, 346, 3, 1060, 1671, 1256, 1248, 1064, 499, 227, + /* 930 */ 1070, 229, 493, 275, 5, 1068, 336, 612, 332, 328, + /* 940 */ 153, 323, 513, 122, 1178, 329, 1625, 1166, 325, 284, + /* 950 */ 1001, 285, 312, 311, 248, 1135, 158, 366, 1567, 373, + /* 960 */ 381, 380, 1181, 1684, 382, 386, 83, 1656, 516, 1658, + /* 970 */ 1659, 512, 150, 533, 1257, 1655, 1724, 1195, 1198, 387, + /* 980 */ 298, 1720, 143, 395, 502, 398, 399, 1174, 1197, 400, + /* 990 */ 1168, 165, 167, 1199, 170, 1262, 172, 404, 401, 403, + /* 1000 */ 1752, 1196, 175, 1671, 1173, 62, 405, 408, 178, 427, + /* 1010 */ 1173, 514, 86, 1171, 1172, 429, 293, 1478, 1608, 182, + /* 1020 */ 1474, 513, 184, 124, 249, 1625, 125, 1476, 1655, 1472, + /* 1030 */ 126, 127, 27, 303, 1251, 1252, 1253, 1254, 1255, 1259, + /* 1040 */ 1260, 1261, 1684, 534, 195, 83, 1656, 516, 1658, 1659, + /* 1050 */ 512, 458, 533, 1177, 198, 1724, 1671, 462, 465, 298, + /* 1060 */ 1720, 1799, 201, 467, 514, 469, 459, 470, 478, 204, + /* 1070 */ 1781, 1194, 1765, 207, 513, 520, 1764, 475, 1625, 1655, + /* 1080 */ 297, 1755, 210, 481, 215, 6, 487, 1745, 474, 217, + /* 1090 */ 1655, 1289, 113, 1193, 40, 1684, 1182, 503, 83, 1656, + /* 1100 */ 516, 1658, 1659, 512, 1739, 533, 218, 1671, 1724, 137, + /* 1110 */ 500, 299, 298, 1720, 1799, 514, 18, 518, 1671, 1185, + /* 1120 */ 519, 1705, 1576, 1742, 1782, 513, 514, 223, 226, 1625, + /* 1130 */ 531, 1233, 1234, 228, 494, 1575, 513, 1802, 1655, 523, + /* 1140 */ 1625, 307, 236, 497, 524, 494, 1684, 238, 504, 263, + /* 1150 */ 1656, 516, 1658, 1659, 512, 525, 533, 1684, 250, 71, + /* 1160 */ 263, 1656, 516, 1658, 1659, 512, 1671, 533, 1489, 73, + /* 1170 */ 1461, 536, 253, 245, 514, 1786, 611, 47, 1655, 255, + /* 1180 */ 136, 264, 274, 265, 513, 1619, 1786, 149, 1625, 257, + /* 1190 */ 1618, 1783, 57, 1617, 324, 1614, 326, 327, 147, 331, + /* 1200 */ 1160, 1161, 1783, 154, 1612, 1684, 1671, 333, 84, 1656, + /* 1210 */ 516, 1658, 1659, 512, 514, 533, 334, 335, 1724, 1611, + /* 1220 */ 180, 337, 1723, 1720, 513, 1610, 339, 1609, 1625, 341, + /* 1230 */ 1594, 155, 141, 1138, 344, 345, 1137, 1655, 424, 420, + /* 1240 */ 416, 412, 179, 1588, 1587, 1684, 350, 351, 84, 1656, + /* 1250 */ 516, 1658, 1659, 512, 1586, 533, 1585, 1107, 1724, 1109, + /* 1260 */ 117, 1542, 505, 1720, 1560, 1671, 1559, 64, 1558, 1557, + /* 1270 */ 177, 1556, 1555, 511, 1554, 1553, 1552, 1551, 1550, 1549, + /* 1280 */ 1548, 1547, 1546, 513, 1545, 1544, 1543, 1625, 1541, 1655, + /* 1290 */ 1540, 1539, 1538, 1537, 1536, 1535, 1534, 1533, 1655, 1418, + /* 1300 */ 1386, 140, 163, 939, 1684, 1385, 1602, 272, 1656, 516, + /* 1310 */ 1658, 1659, 512, 510, 533, 507, 1696, 1671, 938, 1596, + /* 1320 */ 108, 1584, 171, 1583, 109, 514, 1671, 176, 1573, 168, + /* 1330 */ 1467, 173, 967, 402, 514, 513, 1417, 1415, 1413, 1625, + /* 1340 */ 164, 1411, 391, 1409, 513, 393, 169, 174, 1625, 411, + /* 1350 */ 409, 166, 410, 415, 1655, 413, 1684, 1398, 414, 134, + /* 1360 */ 1656, 516, 1658, 1659, 512, 1684, 533, 417, 84, 1656, + /* 1370 */ 516, 1658, 1659, 512, 418, 533, 419, 422, 1724, 615, + /* 1380 */ 421, 423, 1671, 1721, 1397, 1384, 1469, 1074, 1073, 1468, + /* 1390 */ 514, 579, 1000, 247, 999, 998, 997, 581, 994, 993, + /* 1400 */ 513, 992, 495, 1800, 1625, 107, 181, 473, 1655, 1407, + /* 1410 */ 290, 604, 600, 596, 592, 246, 45, 1655, 1402, 291, + /* 1420 */ 446, 1684, 1400, 292, 273, 1656, 516, 1658, 1659, 512, + /* 1430 */ 449, 533, 1383, 451, 1382, 453, 1671, 85, 1601, 1145, + /* 1440 */ 80, 1595, 460, 241, 514, 1671, 1582, 1581, 1580, 1572, + /* 1450 */ 67, 203, 15, 514, 513, 208, 4, 37, 1625, 49, + /* 1460 */ 461, 135, 48, 513, 199, 43, 213, 1625, 16, 1314, + /* 1470 */ 1655, 205, 212, 214, 22, 1684, 526, 1307, 268, 1656, + /* 1480 */ 516, 1658, 1659, 512, 1684, 533, 128, 134, 1656, 516, + /* 1490 */ 1658, 1659, 512, 68, 533, 1645, 23, 220, 1671, 42, + /* 1500 */ 1655, 471, 17, 1286, 202, 1285, 514, 138, 1343, 1338, + /* 1510 */ 1332, 1337, 300, 1342, 1341, 486, 513, 301, 10, 19, + /* 1520 */ 1625, 1228, 1143, 302, 196, 1249, 29, 139, 1671, 151, + /* 1530 */ 1213, 1801, 1227, 12, 515, 20, 511, 1684, 21, 521, + /* 1540 */ 273, 1656, 516, 1658, 1659, 512, 513, 533, 13, 41, + /* 1550 */ 1625, 231, 1655, 1312, 233, 235, 69, 1571, 70, 237, + /* 1560 */ 1687, 1644, 242, 74, 1230, 532, 1183, 1684, 1655, 44, + /* 1570 */ 272, 1656, 516, 1658, 1659, 512, 239, 533, 535, 1697, + /* 1580 */ 1671, 1061, 537, 314, 539, 541, 1058, 542, 514, 1055, + /* 1590 */ 544, 545, 547, 1049, 548, 550, 1671, 1047, 513, 1053, + /* 1600 */ 551, 1052, 1625, 1051, 514, 304, 1050, 1038, 1655, 75, + /* 1610 */ 76, 1069, 77, 557, 513, 1067, 1066, 965, 1625, 1684, + /* 1620 */ 1655, 306, 273, 1656, 516, 1658, 1659, 512, 565, 533, + /* 1630 */ 989, 1007, 244, 568, 987, 1684, 1671, 986, 273, 1656, + /* 1640 */ 516, 1658, 1659, 512, 514, 533, 985, 984, 1671, 983, + /* 1650 */ 982, 981, 980, 1004, 513, 1002, 514, 977, 1625, 976, + /* 1660 */ 975, 972, 971, 970, 1414, 589, 513, 590, 1655, 591, + /* 1670 */ 1625, 1412, 593, 595, 594, 1684, 1410, 597, 259, 1656, + /* 1680 */ 516, 1658, 1659, 512, 598, 533, 599, 1684, 1408, 601, + /* 1690 */ 267, 1656, 516, 1658, 1659, 512, 1671, 533, 602, 603, + /* 1700 */ 1655, 605, 606, 1395, 514, 1396, 1381, 609, 610, 1356, + /* 1710 */ 1356, 1169, 254, 613, 513, 614, 1356, 1356, 1625, 1356, + /* 1720 */ 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1671, 1356, + /* 1730 */ 1655, 1356, 1356, 1356, 1356, 1684, 514, 1356, 269, 1656, + /* 1740 */ 516, 1658, 1659, 512, 1356, 533, 513, 1356, 1356, 1356, + /* 1750 */ 1625, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1671, 1356, + /* 1760 */ 1356, 1356, 1655, 1356, 1356, 1356, 514, 1684, 1356, 1356, + /* 1770 */ 260, 1656, 516, 1658, 1659, 512, 513, 533, 1655, 1356, + /* 1780 */ 1625, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, + /* 1790 */ 1671, 1356, 1356, 1356, 1655, 1356, 1356, 1684, 514, 1356, + /* 1800 */ 270, 1656, 516, 1658, 1659, 512, 1671, 533, 513, 1356, + /* 1810 */ 1655, 1356, 1625, 1356, 514, 1356, 1356, 1356, 1356, 1356, + /* 1820 */ 1356, 1356, 1671, 1356, 513, 1356, 1356, 1356, 1625, 1684, + /* 1830 */ 514, 1356, 261, 1656, 516, 1658, 1659, 512, 1671, 533, + /* 1840 */ 513, 1356, 1356, 1356, 1625, 1684, 514, 1356, 271, 1656, + /* 1850 */ 516, 1658, 1659, 512, 1356, 533, 513, 1356, 1356, 1356, + /* 1860 */ 1625, 1684, 1655, 1356, 262, 1656, 516, 1658, 1659, 512, + /* 1870 */ 1356, 533, 1356, 1356, 1356, 1356, 1356, 1684, 1655, 1356, + /* 1880 */ 1667, 1656, 516, 1658, 1659, 512, 1356, 533, 1356, 1356, + /* 1890 */ 1671, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 514, 1356, + /* 1900 */ 1356, 1356, 1356, 1356, 1356, 1356, 1671, 1356, 513, 1356, + /* 1910 */ 1655, 1356, 1625, 1356, 514, 1356, 1356, 1356, 1356, 1356, + /* 1920 */ 1356, 1356, 1356, 1356, 513, 1356, 1356, 1356, 1625, 1684, + /* 1930 */ 1356, 1356, 1666, 1656, 516, 1658, 1659, 512, 1671, 533, + /* 1940 */ 1356, 1356, 1655, 1356, 1356, 1684, 514, 1356, 1665, 1656, + /* 1950 */ 516, 1658, 1659, 512, 1356, 533, 513, 1356, 1356, 1356, + /* 1960 */ 1625, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, + /* 1970 */ 1671, 1356, 1655, 1356, 1356, 1356, 1356, 1684, 514, 1356, + /* 1980 */ 282, 1656, 516, 1658, 1659, 512, 1356, 533, 513, 1356, + /* 1990 */ 1356, 1356, 1625, 1356, 1356, 1356, 1356, 1356, 1356, 1356, + /* 2000 */ 1671, 1356, 1356, 1356, 1655, 1356, 1356, 1356, 514, 1684, + /* 2010 */ 1356, 1356, 281, 1656, 516, 1658, 1659, 512, 513, 533, + /* 2020 */ 1655, 1356, 1625, 1356, 1356, 1356, 1356, 1356, 1356, 1356, + /* 2030 */ 1356, 1356, 1671, 1356, 1356, 1356, 1356, 1356, 1356, 1684, + /* 2040 */ 514, 1356, 283, 1656, 516, 1658, 1659, 512, 1671, 533, + /* 2050 */ 513, 490, 1356, 1356, 1625, 1356, 514, 1356, 1356, 490, + /* 2060 */ 1356, 1356, 1356, 1356, 1356, 1356, 513, 1356, 1356, 1356, + /* 2070 */ 1625, 1684, 1356, 1356, 280, 1656, 516, 1658, 1659, 512, + /* 2080 */ 114, 533, 1356, 1356, 1356, 1356, 1356, 1684, 114, 1356, + /* 2090 */ 266, 1656, 516, 1658, 1659, 512, 1356, 533, 1356, 494, + /* 2100 */ 1356, 1356, 1356, 1356, 1356, 1356, 1356, 494, 1356, 1356, + /* 2110 */ 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 112, 1356, + /* 2120 */ 1356, 1356, 1356, 1356, 1356, 1356, 112, 1356, 1356, 1356, + /* 2130 */ 1356, 1356, 1356, 219, 1731, 489, 1356, 488, 1356, 1356, + /* 2140 */ 1786, 219, 1731, 489, 1356, 488, 1356, 1356, 1786, 1356, + /* 2150 */ 1356, 1356, 149, 1356, 1356, 1356, 1783, 1356, 1356, 1356, + /* 2160 */ 147, 1356, 1356, 1356, 1783, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 253, 335, 295, 270, 257, 270, 273, 243, 273, 245, - /* 10 */ 246, 250, 12, 13, 348, 269, 2, 240, 352, 239, - /* 20 */ 20, 241, 22, 290, 263, 290, 12, 13, 14, 15, - /* 30 */ 16, 335, 271, 12, 13, 14, 15, 16, 305, 306, - /* 40 */ 305, 306, 335, 20, 348, 268, 4, 47, 352, 316, - /* 50 */ 20, 316, 237, 276, 243, 348, 245, 246, 58, 352, - /* 60 */ 12, 13, 14, 286, 64, 4, 244, 290, 20, 247, - /* 70 */ 22, 12, 13, 14, 15, 16, 12, 13, 14, 15, - /* 80 */ 16, 81, 81, 306, 42, 43, 309, 310, 311, 312, - /* 90 */ 313, 314, 91, 316, 240, 47, 319, 0, 335, 14, - /* 100 */ 323, 324, 325, 103, 81, 20, 58, 0, 12, 13, - /* 110 */ 295, 348, 64, 113, 337, 352, 20, 58, 22, 295, - /* 120 */ 343, 344, 12, 13, 14, 15, 16, 250, 21, 81, - /* 130 */ 240, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 140 */ 20, 82, 81, 47, 290, 278, 82, 260, 271, 90, - /* 150 */ 335, 103, 285, 286, 58, 268, 156, 60, 61, 335, - /* 160 */ 64, 113, 65, 348, 277, 68, 69, 352, 58, 72, - /* 170 */ 73, 74, 348, 20, 41, 22, 352, 81, 178, 179, - /* 180 */ 290, 181, 182, 183, 184, 185, 186, 187, 188, 189, - /* 190 */ 190, 191, 192, 193, 194, 195, 35, 14, 139, 103, - /* 200 */ 90, 81, 49, 20, 156, 81, 252, 21, 208, 113, - /* 210 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 160, - /* 220 */ 307, 12, 13, 14, 15, 16, 178, 179, 274, 181, + /* 0 */ 251, 248, 241, 271, 322, 323, 274, 0, 271, 249, + /* 10 */ 250, 274, 12, 13, 248, 12, 13, 14, 15, 16, + /* 20 */ 20, 272, 22, 291, 248, 248, 260, 270, 291, 244, + /* 30 */ 269, 246, 247, 267, 248, 282, 260, 296, 277, 307, + /* 40 */ 308, 20, 254, 277, 307, 308, 258, 47, 287, 240, + /* 50 */ 318, 242, 291, 277, 277, 318, 20, 296, 58, 248, + /* 60 */ 12, 13, 14, 277, 64, 0, 4, 253, 20, 308, + /* 70 */ 22, 260, 311, 312, 313, 314, 315, 316, 337, 318, + /* 80 */ 266, 81, 321, 4, 269, 82, 325, 326, 277, 275, + /* 90 */ 349, 276, 315, 287, 353, 47, 281, 20, 337, 293, + /* 100 */ 93, 315, 81, 103, 42, 43, 58, 330, 331, 332, + /* 110 */ 349, 334, 64, 113, 353, 329, 330, 331, 332, 112, + /* 120 */ 334, 114, 115, 116, 57, 60, 61, 62, 63, 81, + /* 130 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + /* 140 */ 75, 76, 77, 78, 0, 12, 13, 14, 15, 16, + /* 150 */ 244, 103, 246, 247, 268, 279, 156, 20, 81, 269, + /* 160 */ 81, 113, 286, 287, 0, 21, 280, 277, 24, 25, + /* 170 */ 26, 27, 28, 29, 30, 31, 32, 143, 245, 179, + /* 180 */ 180, 248, 182, 183, 184, 185, 186, 187, 188, 189, + /* 190 */ 190, 191, 192, 193, 194, 195, 196, 12, 13, 14, + /* 200 */ 15, 16, 287, 313, 156, 290, 41, 21, 293, 209, + /* 210 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 35, + /* 220 */ 269, 57, 12, 13, 14, 15, 16, 179, 180, 278, /* 230 */ 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - /* 240 */ 192, 193, 194, 195, 331, 84, 240, 86, 87, 139, - /* 250 */ 89, 57, 156, 240, 93, 196, 197, 198, 199, 200, - /* 260 */ 201, 202, 203, 204, 205, 286, 20, 182, 289, 208, - /* 270 */ 160, 292, 320, 321, 178, 179, 115, 181, 182, 183, - /* 280 */ 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - /* 290 */ 194, 195, 12, 13, 0, 178, 290, 165, 166, 0, - /* 300 */ 20, 169, 22, 290, 247, 247, 196, 197, 198, 199, - /* 310 */ 200, 201, 202, 203, 204, 205, 259, 20, 24, 25, - /* 320 */ 26, 27, 28, 29, 30, 31, 32, 47, 208, 295, - /* 330 */ 93, 240, 208, 276, 217, 218, 219, 220, 221, 281, - /* 340 */ 12, 13, 14, 22, 64, 247, 260, 268, 20, 112, - /* 350 */ 22, 114, 115, 116, 268, 276, 57, 148, 247, 268, - /* 360 */ 227, 81, 240, 277, 276, 182, 247, 276, 47, 335, - /* 370 */ 259, 283, 268, 244, 276, 47, 247, 286, 259, 275, - /* 380 */ 20, 290, 348, 103, 280, 64, 352, 276, 12, 13, - /* 390 */ 311, 145, 64, 113, 240, 276, 20, 306, 22, 0, - /* 400 */ 309, 310, 311, 312, 313, 314, 81, 316, 2, 81, - /* 410 */ 319, 313, 290, 4, 323, 324, 325, 267, 12, 13, - /* 420 */ 14, 15, 16, 47, 103, 327, 328, 329, 330, 279, - /* 430 */ 332, 103, 252, 240, 113, 344, 156, 228, 60, 61, - /* 440 */ 64, 113, 145, 65, 290, 265, 68, 69, 1, 2, - /* 450 */ 72, 73, 74, 20, 274, 240, 57, 81, 178, 179, - /* 460 */ 143, 181, 182, 183, 184, 185, 186, 187, 188, 189, - /* 470 */ 190, 191, 192, 193, 194, 195, 20, 156, 260, 103, - /* 480 */ 155, 151, 157, 290, 156, 0, 268, 47, 208, 113, - /* 490 */ 12, 13, 14, 15, 16, 277, 268, 248, 249, 178, - /* 500 */ 179, 171, 172, 275, 64, 290, 178, 179, 280, 181, - /* 510 */ 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - /* 520 */ 192, 193, 194, 195, 12, 13, 14, 15, 16, 82, - /* 530 */ 213, 214, 156, 208, 37, 94, 95, 96, 97, 98, - /* 540 */ 99, 100, 101, 102, 103, 104, 240, 106, 107, 108, - /* 550 */ 109, 110, 111, 240, 178, 179, 240, 181, 182, 183, - /* 560 */ 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - /* 570 */ 194, 195, 12, 13, 18, 75, 20, 0, 93, 247, - /* 580 */ 20, 247, 22, 27, 268, 307, 30, 261, 55, 14, - /* 590 */ 264, 259, 276, 259, 82, 20, 290, 112, 266, 114, - /* 600 */ 115, 116, 286, 290, 48, 268, 290, 47, 276, 331, - /* 610 */ 276, 240, 275, 80, 139, 286, 83, 280, 209, 119, - /* 620 */ 120, 292, 306, 145, 64, 309, 310, 311, 312, 313, - /* 630 */ 314, 315, 316, 317, 318, 160, 247, 60, 61, 62, - /* 640 */ 63, 81, 65, 66, 67, 68, 69, 70, 71, 72, - /* 650 */ 73, 74, 75, 76, 77, 78, 240, 14, 15, 16, - /* 660 */ 20, 290, 240, 103, 240, 276, 254, 255, 57, 254, - /* 670 */ 255, 196, 240, 113, 118, 0, 240, 121, 122, 123, - /* 680 */ 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - /* 690 */ 134, 135, 136, 137, 138, 247, 285, 286, 247, 42, - /* 700 */ 43, 307, 313, 268, 207, 55, 290, 3, 240, 240, - /* 710 */ 259, 247, 290, 240, 290, 280, 156, 328, 329, 330, - /* 720 */ 20, 332, 290, 259, 276, 331, 290, 276, 268, 240, - /* 730 */ 266, 81, 256, 83, 258, 241, 270, 277, 178, 179, - /* 740 */ 276, 181, 182, 183, 184, 185, 186, 187, 188, 189, - /* 750 */ 190, 191, 192, 193, 194, 195, 290, 268, 290, 290, - /* 760 */ 240, 313, 0, 290, 93, 276, 47, 22, 93, 206, - /* 770 */ 207, 305, 306, 167, 168, 286, 328, 329, 330, 290, - /* 780 */ 332, 92, 316, 64, 295, 247, 115, 112, 268, 114, - /* 790 */ 115, 116, 47, 58, 41, 306, 276, 259, 309, 310, - /* 800 */ 311, 312, 313, 314, 41, 316, 286, 45, 319, 269, - /* 810 */ 290, 247, 323, 324, 276, 295, 85, 85, 270, 88, - /* 820 */ 88, 240, 182, 259, 335, 85, 306, 269, 88, 309, - /* 830 */ 310, 311, 312, 313, 314, 82, 316, 348, 290, 319, - /* 840 */ 276, 352, 44, 323, 324, 18, 12, 13, 247, 268, - /* 850 */ 23, 64, 21, 305, 306, 335, 22, 276, 208, 269, - /* 860 */ 259, 269, 35, 36, 316, 34, 39, 286, 348, 269, - /* 870 */ 247, 290, 352, 4, 247, 85, 41, 276, 88, 81, - /* 880 */ 41, 47, 259, 56, 240, 41, 259, 306, 19, 247, - /* 890 */ 309, 310, 311, 312, 313, 314, 47, 316, 64, 276, - /* 900 */ 319, 259, 33, 276, 323, 324, 325, 0, 81, 0, - /* 910 */ 0, 247, 268, 178, 45, 334, 269, 82, 276, 50, - /* 920 */ 276, 82, 257, 259, 55, 41, 82, 223, 47, 22, - /* 930 */ 286, 22, 22, 41, 290, 193, 194, 103, 41, 355, - /* 940 */ 276, 41, 1, 2, 117, 41, 41, 113, 299, 80, - /* 950 */ 306, 346, 83, 309, 310, 311, 312, 313, 314, 303, - /* 960 */ 316, 340, 113, 319, 268, 248, 82, 323, 324, 325, - /* 970 */ 240, 246, 41, 41, 82, 148, 149, 150, 334, 82, - /* 980 */ 153, 279, 82, 349, 308, 158, 82, 82, 225, 41, - /* 990 */ 156, 41, 41, 333, 113, 349, 20, 170, 268, 336, - /* 1000 */ 173, 240, 175, 176, 177, 247, 276, 349, 45, 41, - /* 1010 */ 304, 47, 178, 82, 82, 154, 286, 297, 41, 254, - /* 1020 */ 290, 247, 247, 189, 190, 191, 40, 284, 139, 268, - /* 1030 */ 82, 282, 82, 82, 282, 208, 306, 276, 247, 309, - /* 1040 */ 310, 311, 312, 313, 314, 20, 316, 286, 242, 319, - /* 1050 */ 82, 290, 242, 323, 324, 325, 295, 20, 247, 82, - /* 1060 */ 301, 252, 240, 286, 334, 252, 20, 306, 20, 296, - /* 1070 */ 309, 310, 311, 312, 313, 314, 294, 316, 252, 294, - /* 1080 */ 252, 276, 20, 287, 252, 252, 268, 276, 247, 252, - /* 1090 */ 268, 268, 242, 268, 64, 242, 335, 268, 276, 247, - /* 1100 */ 301, 163, 290, 300, 268, 250, 295, 286, 286, 348, - /* 1110 */ 268, 268, 290, 352, 268, 268, 268, 295, 250, 268, - /* 1120 */ 247, 250, 250, 20, 313, 240, 345, 287, 306, 216, - /* 1130 */ 215, 309, 310, 311, 312, 313, 314, 345, 316, 328, - /* 1140 */ 329, 330, 276, 332, 222, 147, 335, 290, 294, 291, - /* 1150 */ 291, 211, 290, 268, 290, 341, 240, 335, 342, 348, - /* 1160 */ 207, 276, 210, 352, 308, 20, 276, 307, 40, 339, - /* 1170 */ 348, 286, 226, 224, 352, 290, 338, 81, 291, 291, - /* 1180 */ 356, 290, 142, 229, 268, 290, 290, 288, 276, 326, - /* 1190 */ 287, 306, 276, 250, 309, 310, 311, 312, 313, 314, - /* 1200 */ 322, 316, 286, 264, 319, 250, 290, 81, 323, 324, - /* 1210 */ 240, 276, 247, 242, 272, 258, 351, 350, 298, 240, - /* 1220 */ 302, 351, 306, 250, 350, 309, 310, 311, 312, 313, - /* 1230 */ 314, 351, 316, 350, 262, 319, 262, 262, 268, 323, - /* 1240 */ 324, 251, 238, 0, 0, 72, 276, 268, 0, 47, - /* 1250 */ 174, 47, 47, 47, 174, 276, 286, 0, 47, 47, - /* 1260 */ 290, 174, 0, 47, 0, 286, 47, 0, 47, 290, - /* 1270 */ 0, 81, 160, 159, 113, 156, 306, 152, 151, 309, - /* 1280 */ 310, 311, 312, 313, 314, 306, 316, 0, 309, 310, - /* 1290 */ 311, 312, 313, 314, 0, 316, 19, 240, 319, 44, - /* 1300 */ 0, 0, 0, 324, 0, 0, 0, 0, 240, 0, - /* 1310 */ 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* 1320 */ 0, 0, 45, 353, 354, 268, 0, 0, 51, 52, - /* 1330 */ 53, 54, 55, 276, 0, 40, 268, 0, 0, 0, - /* 1340 */ 0, 0, 0, 286, 276, 22, 0, 290, 40, 14, - /* 1350 */ 293, 0, 0, 0, 286, 0, 0, 80, 290, 37, - /* 1360 */ 83, 14, 37, 306, 0, 41, 309, 310, 311, 312, - /* 1370 */ 313, 314, 44, 316, 306, 44, 240, 309, 310, 311, - /* 1380 */ 312, 313, 314, 38, 316, 0, 37, 147, 0, 0, - /* 1390 */ 0, 37, 59, 116, 0, 0, 37, 47, 0, 37, - /* 1400 */ 0, 0, 45, 37, 268, 47, 45, 47, 45, 37, - /* 1410 */ 45, 0, 276, 0, 47, 347, 47, 88, 141, 0, - /* 1420 */ 0, 144, 286, 0, 22, 240, 290, 47, 47, 47, - /* 1430 */ 47, 47, 41, 90, 41, 0, 240, 22, 0, 162, - /* 1440 */ 22, 164, 306, 47, 47, 309, 310, 311, 312, 313, - /* 1450 */ 314, 48, 316, 268, 0, 22, 47, 0, 22, 0, - /* 1460 */ 0, 276, 22, 20, 268, 37, 22, 0, 47, 0, - /* 1470 */ 0, 286, 276, 0, 0, 290, 44, 145, 293, 206, - /* 1480 */ 81, 145, 286, 41, 212, 81, 290, 240, 41, 145, - /* 1490 */ 354, 306, 82, 41, 309, 310, 311, 312, 313, 314, - /* 1500 */ 44, 316, 306, 41, 82, 309, 310, 311, 312, 313, - /* 1510 */ 314, 81, 316, 142, 318, 268, 140, 2, 81, 41, - /* 1520 */ 41, 82, 81, 276, 33, 44, 240, 82, 82, 161, - /* 1530 */ 44, 82, 82, 286, 41, 47, 45, 290, 41, 240, - /* 1540 */ 293, 47, 51, 52, 53, 54, 55, 47, 47, 47, - /* 1550 */ 47, 178, 81, 306, 268, 44, 309, 310, 311, 312, - /* 1560 */ 313, 314, 276, 316, 82, 82, 81, 268, 81, 22, - /* 1570 */ 44, 80, 286, 81, 83, 276, 290, 82, 82, 293, - /* 1580 */ 81, 0, 212, 37, 22, 286, 212, 180, 240, 290, - /* 1590 */ 81, 143, 306, 81, 81, 309, 310, 311, 312, 313, - /* 1600 */ 314, 140, 316, 44, 44, 306, 82, 91, 309, 310, - /* 1610 */ 311, 312, 313, 314, 81, 316, 268, 240, 81, 81, - /* 1620 */ 92, 82, 47, 47, 276, 81, 47, 82, 105, 81, - /* 1630 */ 47, 140, 82, 142, 286, 144, 81, 146, 290, 47, - /* 1640 */ 82, 47, 81, 22, 81, 268, 82, 105, 105, 93, - /* 1650 */ 81, 81, 47, 276, 306, 164, 240, 309, 310, 311, - /* 1660 */ 312, 313, 314, 286, 316, 81, 113, 290, 22, 59, - /* 1670 */ 105, 58, 47, 64, 79, 41, 47, 47, 47, 47, - /* 1680 */ 47, 22, 47, 306, 268, 47, 309, 310, 311, 312, - /* 1690 */ 313, 314, 276, 316, 47, 47, 47, 47, 47, 47, - /* 1700 */ 47, 64, 286, 0, 47, 240, 290, 45, 37, 0, - /* 1710 */ 47, 45, 37, 0, 47, 45, 240, 37, 0, 47, - /* 1720 */ 37, 45, 306, 0, 47, 309, 310, 311, 312, 313, - /* 1730 */ 314, 0, 316, 268, 46, 0, 22, 21, 357, 357, - /* 1740 */ 21, 276, 22, 22, 268, 20, 357, 357, 357, 357, - /* 1750 */ 357, 286, 276, 357, 357, 290, 357, 357, 357, 357, - /* 1760 */ 357, 357, 286, 357, 357, 240, 290, 357, 357, 357, - /* 1770 */ 357, 306, 357, 357, 309, 310, 311, 312, 313, 314, - /* 1780 */ 240, 316, 306, 357, 357, 309, 310, 311, 312, 313, - /* 1790 */ 314, 357, 316, 268, 357, 357, 357, 240, 357, 357, - /* 1800 */ 357, 276, 357, 357, 357, 357, 357, 357, 268, 357, - /* 1810 */ 357, 286, 240, 357, 357, 290, 276, 357, 357, 357, - /* 1820 */ 357, 357, 357, 357, 357, 268, 286, 357, 357, 240, - /* 1830 */ 290, 306, 357, 276, 309, 310, 311, 312, 313, 314, - /* 1840 */ 268, 316, 357, 286, 357, 357, 306, 290, 276, 309, - /* 1850 */ 310, 311, 312, 313, 314, 357, 316, 268, 286, 357, - /* 1860 */ 357, 357, 290, 306, 357, 276, 309, 310, 311, 312, - /* 1870 */ 313, 314, 357, 316, 357, 286, 240, 357, 306, 290, - /* 1880 */ 357, 309, 310, 311, 312, 313, 314, 357, 316, 357, - /* 1890 */ 357, 357, 357, 357, 357, 306, 357, 357, 309, 310, - /* 1900 */ 311, 312, 313, 314, 268, 316, 357, 357, 240, 357, - /* 1910 */ 357, 357, 276, 357, 357, 357, 357, 357, 357, 357, - /* 1920 */ 357, 357, 286, 357, 357, 240, 290, 357, 357, 357, - /* 1930 */ 357, 357, 357, 357, 357, 357, 268, 357, 357, 357, - /* 1940 */ 357, 357, 306, 357, 276, 309, 310, 311, 312, 313, - /* 1950 */ 314, 357, 316, 268, 286, 357, 357, 240, 290, 357, - /* 1960 */ 357, 276, 357, 357, 357, 357, 357, 357, 357, 357, - /* 1970 */ 357, 286, 357, 357, 306, 290, 357, 309, 310, 311, - /* 1980 */ 312, 313, 314, 357, 316, 268, 357, 357, 357, 357, - /* 1990 */ 357, 306, 357, 276, 309, 310, 311, 312, 313, 314, - /* 2000 */ 357, 316, 357, 286, 357, 357, 240, 290, 357, 357, - /* 2010 */ 357, 357, 357, 357, 357, 357, 357, 357, 357, 247, - /* 2020 */ 357, 357, 357, 306, 357, 357, 309, 310, 311, 312, - /* 2030 */ 313, 314, 357, 316, 268, 357, 357, 357, 357, 357, - /* 2040 */ 357, 357, 276, 357, 357, 357, 357, 357, 276, 357, - /* 2050 */ 357, 357, 286, 357, 357, 357, 290, 357, 357, 357, - /* 2060 */ 357, 357, 357, 357, 357, 357, 357, 295, 357, 357, - /* 2070 */ 357, 357, 306, 357, 357, 309, 310, 311, 312, 313, - /* 2080 */ 314, 357, 316, 357, 357, 313, 357, 357, 357, 357, - /* 2090 */ 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, - /* 2100 */ 328, 329, 330, 357, 332, 357, 357, 335, 357, 357, - /* 2110 */ 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, - /* 2120 */ 348, 357, 357, 357, 352, 237, 237, 237, 237, 237, - /* 2130 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2140 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2150 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2160 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2170 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2180 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2190 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2200 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2210 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2220 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2230 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2240 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2250 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2260 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2270 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2280 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2290 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2300 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2310 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2320 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2330 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2340 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2350 */ 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - /* 2360 */ 237, 237, + /* 240 */ 192, 193, 194, 195, 196, 12, 13, 82, 214, 215, + /* 250 */ 238, 60, 61, 20, 241, 22, 65, 55, 262, 68, + /* 260 */ 69, 265, 75, 72, 73, 74, 12, 13, 84, 4, + /* 270 */ 86, 87, 47, 89, 20, 271, 22, 93, 145, 261, + /* 280 */ 47, 251, 269, 81, 19, 83, 209, 269, 209, 64, + /* 290 */ 277, 58, 82, 20, 264, 291, 278, 64, 33, 115, + /* 300 */ 287, 47, 272, 20, 291, 22, 119, 120, 296, 296, + /* 310 */ 45, 307, 308, 14, 81, 50, 20, 271, 64, 20, + /* 320 */ 55, 308, 318, 248, 311, 312, 313, 314, 315, 316, + /* 330 */ 2, 318, 49, 148, 321, 81, 103, 291, 325, 326, + /* 340 */ 12, 13, 14, 15, 16, 80, 113, 0, 83, 337, + /* 350 */ 337, 57, 277, 307, 308, 165, 166, 103, 241, 169, + /* 360 */ 92, 349, 349, 0, 318, 353, 353, 113, 0, 94, + /* 370 */ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + /* 380 */ 241, 106, 107, 108, 109, 110, 111, 37, 81, 156, + /* 390 */ 315, 20, 24, 25, 26, 27, 28, 29, 30, 31, + /* 400 */ 32, 14, 15, 16, 57, 330, 331, 332, 291, 334, + /* 410 */ 156, 209, 179, 180, 229, 182, 183, 184, 185, 186, + /* 420 */ 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + /* 430 */ 291, 64, 55, 179, 180, 300, 182, 183, 184, 185, + /* 440 */ 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + /* 450 */ 196, 12, 13, 14, 2, 241, 93, 80, 296, 20, + /* 460 */ 83, 22, 93, 209, 12, 13, 14, 15, 16, 253, + /* 470 */ 0, 245, 12, 13, 248, 112, 241, 114, 115, 116, + /* 480 */ 20, 112, 22, 114, 115, 116, 47, 20, 248, 179, + /* 490 */ 248, 275, 22, 12, 13, 14, 15, 16, 337, 337, + /* 500 */ 260, 44, 260, 64, 269, 291, 270, 47, 81, 267, + /* 510 */ 349, 349, 277, 296, 353, 353, 209, 277, 241, 277, + /* 520 */ 81, 257, 287, 259, 64, 0, 291, 21, 218, 219, + /* 530 */ 220, 221, 222, 12, 13, 14, 15, 16, 81, 58, + /* 540 */ 34, 81, 103, 308, 255, 256, 311, 312, 313, 314, + /* 550 */ 315, 316, 113, 318, 337, 270, 321, 269, 208, 261, + /* 560 */ 325, 326, 327, 103, 276, 337, 349, 269, 291, 281, + /* 570 */ 353, 90, 14, 113, 339, 337, 278, 349, 20, 344, + /* 580 */ 345, 353, 155, 309, 157, 60, 61, 349, 248, 151, + /* 590 */ 65, 353, 269, 68, 69, 156, 269, 72, 73, 74, + /* 600 */ 260, 255, 256, 276, 281, 286, 287, 333, 281, 171, + /* 610 */ 172, 4, 145, 241, 42, 43, 156, 277, 179, 180, + /* 620 */ 139, 182, 183, 184, 185, 186, 187, 188, 189, 190, + /* 630 */ 191, 192, 193, 194, 195, 196, 209, 1, 2, 179, + /* 640 */ 180, 160, 182, 183, 184, 185, 186, 187, 188, 189, + /* 650 */ 190, 191, 192, 193, 194, 195, 196, 12, 13, 18, + /* 660 */ 241, 20, 248, 291, 248, 20, 241, 22, 27, 3, + /* 670 */ 241, 30, 241, 270, 260, 270, 260, 270, 197, 198, + /* 680 */ 199, 200, 201, 202, 203, 204, 205, 206, 269, 48, + /* 690 */ 248, 277, 47, 277, 14, 248, 277, 241, 277, 248, + /* 700 */ 20, 93, 260, 241, 261, 284, 287, 260, 20, 64, + /* 710 */ 291, 260, 269, 248, 167, 168, 291, 20, 82, 277, + /* 720 */ 291, 278, 291, 115, 277, 260, 81, 308, 277, 139, + /* 730 */ 311, 312, 313, 314, 315, 316, 22, 318, 241, 241, + /* 740 */ 321, 183, 277, 41, 325, 326, 327, 291, 103, 41, + /* 750 */ 160, 207, 208, 291, 241, 336, 241, 241, 113, 118, + /* 760 */ 241, 47, 121, 122, 123, 124, 125, 126, 127, 128, + /* 770 */ 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + /* 780 */ 248, 18, 248, 248, 309, 242, 23, 197, 291, 291, + /* 790 */ 82, 309, 260, 241, 260, 260, 241, 41, 35, 36, + /* 800 */ 0, 156, 39, 241, 291, 58, 291, 291, 333, 277, + /* 810 */ 291, 277, 277, 85, 258, 333, 88, 210, 85, 56, + /* 820 */ 85, 88, 47, 88, 179, 180, 41, 182, 183, 184, + /* 830 */ 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + /* 840 */ 195, 196, 145, 291, 81, 45, 291, 12, 13, 14, + /* 850 */ 15, 16, 85, 291, 0, 88, 22, 0, 41, 1, + /* 860 */ 2, 194, 195, 183, 41, 41, 41, 82, 41, 41, + /* 870 */ 270, 183, 304, 41, 41, 81, 22, 41, 47, 22, + /* 880 */ 117, 47, 41, 356, 47, 91, 41, 347, 113, 41, + /* 890 */ 224, 341, 269, 58, 41, 247, 241, 280, 64, 82, + /* 900 */ 249, 64, 41, 310, 335, 82, 82, 82, 306, 82, + /* 910 */ 82, 148, 149, 150, 82, 82, 153, 82, 82, 20, + /* 920 */ 350, 158, 338, 82, 269, 90, 179, 82, 226, 350, + /* 930 */ 82, 350, 277, 170, 211, 82, 173, 103, 175, 176, + /* 940 */ 177, 178, 287, 82, 113, 45, 291, 113, 248, 305, + /* 950 */ 47, 255, 12, 13, 298, 154, 40, 248, 248, 285, + /* 960 */ 139, 283, 22, 308, 283, 248, 311, 312, 313, 314, + /* 970 */ 315, 316, 209, 318, 139, 241, 321, 20, 20, 243, + /* 980 */ 325, 326, 327, 243, 228, 302, 287, 47, 20, 295, + /* 990 */ 156, 253, 253, 20, 253, 160, 253, 277, 297, 295, + /* 1000 */ 345, 20, 253, 269, 64, 253, 288, 248, 253, 243, + /* 1010 */ 64, 277, 248, 179, 180, 269, 243, 269, 291, 269, + /* 1020 */ 269, 287, 269, 269, 302, 291, 269, 269, 241, 269, + /* 1030 */ 269, 269, 197, 198, 199, 200, 201, 202, 203, 204, + /* 1040 */ 205, 206, 308, 103, 251, 311, 312, 313, 314, 315, + /* 1050 */ 316, 163, 318, 113, 251, 321, 269, 287, 248, 325, + /* 1060 */ 326, 327, 251, 295, 277, 277, 301, 288, 217, 251, + /* 1070 */ 336, 20, 346, 292, 287, 216, 346, 291, 291, 241, + /* 1080 */ 291, 310, 292, 291, 342, 223, 147, 343, 212, 306, + /* 1090 */ 241, 208, 277, 20, 40, 308, 156, 227, 311, 312, + /* 1100 */ 313, 314, 315, 316, 309, 318, 328, 269, 321, 340, + /* 1110 */ 225, 230, 325, 326, 327, 277, 81, 291, 269, 179, + /* 1120 */ 291, 324, 292, 336, 352, 287, 277, 351, 351, 291, + /* 1130 */ 190, 191, 192, 351, 296, 292, 287, 357, 241, 142, + /* 1140 */ 291, 291, 277, 352, 289, 296, 308, 251, 352, 311, + /* 1150 */ 312, 313, 314, 315, 316, 288, 318, 308, 265, 251, + /* 1160 */ 311, 312, 313, 314, 315, 316, 269, 318, 277, 81, + /* 1170 */ 259, 273, 248, 251, 277, 337, 243, 299, 241, 252, + /* 1180 */ 303, 263, 263, 263, 287, 0, 337, 349, 291, 239, + /* 1190 */ 0, 353, 40, 0, 72, 0, 47, 174, 349, 174, + /* 1200 */ 47, 47, 353, 47, 0, 308, 269, 47, 311, 312, + /* 1210 */ 313, 314, 315, 316, 277, 318, 47, 174, 321, 0, + /* 1220 */ 33, 47, 325, 326, 287, 0, 47, 0, 291, 47, + /* 1230 */ 0, 81, 45, 113, 160, 159, 156, 241, 51, 52, + /* 1240 */ 53, 54, 55, 0, 0, 308, 152, 151, 311, 312, + /* 1250 */ 313, 314, 315, 316, 0, 318, 0, 44, 321, 22, + /* 1260 */ 40, 0, 325, 326, 0, 269, 0, 80, 0, 0, + /* 1270 */ 83, 0, 0, 277, 0, 0, 0, 0, 0, 0, + /* 1280 */ 0, 0, 0, 287, 0, 0, 0, 291, 0, 241, + /* 1290 */ 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, + /* 1300 */ 0, 41, 40, 14, 308, 0, 0, 311, 312, 313, + /* 1310 */ 314, 315, 316, 317, 318, 319, 320, 269, 14, 0, + /* 1320 */ 37, 0, 147, 0, 37, 277, 269, 140, 0, 142, + /* 1330 */ 0, 144, 59, 146, 277, 287, 0, 0, 0, 291, + /* 1340 */ 38, 0, 44, 0, 287, 44, 37, 37, 291, 37, + /* 1350 */ 47, 164, 45, 37, 241, 47, 308, 0, 45, 311, + /* 1360 */ 312, 313, 314, 315, 316, 308, 318, 47, 311, 312, + /* 1370 */ 313, 314, 315, 316, 45, 318, 37, 45, 321, 19, + /* 1380 */ 47, 37, 269, 326, 0, 0, 0, 47, 22, 0, + /* 1390 */ 277, 41, 47, 33, 47, 47, 47, 41, 47, 47, + /* 1400 */ 287, 47, 354, 355, 291, 45, 88, 294, 241, 0, + /* 1410 */ 22, 51, 52, 53, 54, 55, 90, 241, 0, 22, + /* 1420 */ 48, 308, 0, 22, 311, 312, 313, 314, 315, 316, + /* 1430 */ 47, 318, 0, 22, 0, 22, 269, 20, 0, 47, + /* 1440 */ 80, 0, 22, 83, 277, 269, 0, 0, 0, 0, + /* 1450 */ 81, 37, 213, 277, 287, 82, 41, 41, 291, 145, + /* 1460 */ 145, 81, 145, 287, 142, 41, 41, 291, 213, 82, + /* 1470 */ 241, 140, 81, 44, 81, 308, 116, 82, 311, 312, + /* 1480 */ 313, 314, 315, 316, 308, 318, 161, 311, 312, 313, + /* 1490 */ 314, 315, 316, 81, 318, 44, 41, 44, 269, 41, + /* 1500 */ 241, 141, 41, 82, 144, 82, 277, 44, 82, 47, + /* 1510 */ 82, 47, 47, 47, 47, 348, 287, 47, 2, 41, + /* 1520 */ 291, 82, 162, 294, 164, 179, 81, 44, 269, 44, + /* 1530 */ 22, 355, 82, 81, 181, 81, 277, 308, 81, 143, + /* 1540 */ 311, 312, 313, 314, 315, 316, 287, 318, 213, 207, + /* 1550 */ 291, 82, 241, 82, 81, 81, 81, 0, 81, 37, + /* 1560 */ 81, 44, 44, 91, 82, 81, 22, 308, 241, 81, + /* 1570 */ 311, 312, 313, 314, 315, 316, 140, 318, 92, 320, + /* 1580 */ 269, 82, 47, 47, 81, 47, 82, 81, 277, 82, + /* 1590 */ 47, 81, 47, 82, 81, 47, 269, 82, 287, 105, + /* 1600 */ 81, 105, 291, 105, 277, 294, 105, 22, 241, 81, + /* 1610 */ 81, 47, 81, 93, 287, 113, 22, 59, 291, 308, + /* 1620 */ 241, 294, 311, 312, 313, 314, 315, 316, 58, 318, + /* 1630 */ 47, 64, 41, 79, 47, 308, 269, 47, 311, 312, + /* 1640 */ 313, 314, 315, 316, 277, 318, 47, 47, 269, 47, + /* 1650 */ 22, 47, 47, 64, 287, 47, 277, 47, 291, 47, + /* 1660 */ 47, 47, 47, 47, 0, 47, 287, 45, 241, 37, + /* 1670 */ 291, 0, 47, 37, 45, 308, 0, 47, 311, 312, + /* 1680 */ 313, 314, 315, 316, 45, 318, 37, 308, 0, 47, + /* 1690 */ 311, 312, 313, 314, 315, 316, 269, 318, 45, 37, + /* 1700 */ 241, 47, 46, 0, 277, 0, 0, 22, 21, 358, + /* 1710 */ 358, 22, 22, 21, 287, 20, 358, 358, 291, 358, + /* 1720 */ 358, 358, 358, 358, 358, 358, 358, 358, 269, 358, + /* 1730 */ 241, 358, 358, 358, 358, 308, 277, 358, 311, 312, + /* 1740 */ 313, 314, 315, 316, 358, 318, 287, 358, 358, 358, + /* 1750 */ 291, 358, 358, 358, 358, 358, 358, 358, 269, 358, + /* 1760 */ 358, 358, 241, 358, 358, 358, 277, 308, 358, 358, + /* 1770 */ 311, 312, 313, 314, 315, 316, 287, 318, 241, 358, + /* 1780 */ 291, 358, 358, 358, 358, 358, 358, 358, 358, 358, + /* 1790 */ 269, 358, 358, 358, 241, 358, 358, 308, 277, 358, + /* 1800 */ 311, 312, 313, 314, 315, 316, 269, 318, 287, 358, + /* 1810 */ 241, 358, 291, 358, 277, 358, 358, 358, 358, 358, + /* 1820 */ 358, 358, 269, 358, 287, 358, 358, 358, 291, 308, + /* 1830 */ 277, 358, 311, 312, 313, 314, 315, 316, 269, 318, + /* 1840 */ 287, 358, 358, 358, 291, 308, 277, 358, 311, 312, + /* 1850 */ 313, 314, 315, 316, 358, 318, 287, 358, 358, 358, + /* 1860 */ 291, 308, 241, 358, 311, 312, 313, 314, 315, 316, + /* 1870 */ 358, 318, 358, 358, 358, 358, 358, 308, 241, 358, + /* 1880 */ 311, 312, 313, 314, 315, 316, 358, 318, 358, 358, + /* 1890 */ 269, 358, 358, 358, 358, 358, 358, 358, 277, 358, + /* 1900 */ 358, 358, 358, 358, 358, 358, 269, 358, 287, 358, + /* 1910 */ 241, 358, 291, 358, 277, 358, 358, 358, 358, 358, + /* 1920 */ 358, 358, 358, 358, 287, 358, 358, 358, 291, 308, + /* 1930 */ 358, 358, 311, 312, 313, 314, 315, 316, 269, 318, + /* 1940 */ 358, 358, 241, 358, 358, 308, 277, 358, 311, 312, + /* 1950 */ 313, 314, 315, 316, 358, 318, 287, 358, 358, 358, + /* 1960 */ 291, 358, 358, 358, 358, 358, 358, 358, 358, 358, + /* 1970 */ 269, 358, 241, 358, 358, 358, 358, 308, 277, 358, + /* 1980 */ 311, 312, 313, 314, 315, 316, 358, 318, 287, 358, + /* 1990 */ 358, 358, 291, 358, 358, 358, 358, 358, 358, 358, + /* 2000 */ 269, 358, 358, 358, 241, 358, 358, 358, 277, 308, + /* 2010 */ 358, 358, 311, 312, 313, 314, 315, 316, 287, 318, + /* 2020 */ 241, 358, 291, 358, 358, 358, 358, 358, 358, 358, + /* 2030 */ 358, 358, 269, 358, 358, 358, 358, 358, 358, 308, + /* 2040 */ 277, 358, 311, 312, 313, 314, 315, 316, 269, 318, + /* 2050 */ 287, 248, 358, 358, 291, 358, 277, 358, 358, 248, + /* 2060 */ 358, 358, 358, 358, 358, 358, 287, 358, 358, 358, + /* 2070 */ 291, 308, 358, 358, 311, 312, 313, 314, 315, 316, + /* 2080 */ 277, 318, 358, 358, 358, 358, 358, 308, 277, 358, + /* 2090 */ 311, 312, 313, 314, 315, 316, 358, 318, 358, 296, + /* 2100 */ 358, 358, 358, 358, 358, 358, 358, 296, 358, 358, + /* 2110 */ 358, 358, 358, 358, 358, 358, 358, 358, 315, 358, + /* 2120 */ 358, 358, 358, 358, 358, 358, 315, 358, 358, 358, + /* 2130 */ 358, 358, 358, 330, 331, 332, 358, 334, 358, 358, + /* 2140 */ 337, 330, 331, 332, 358, 334, 358, 358, 337, 358, + /* 2150 */ 358, 358, 349, 358, 358, 358, 353, 358, 358, 358, + /* 2160 */ 349, 358, 358, 358, 353, }; -#define YY_SHIFT_COUNT (611) +#define YY_SHIFT_COUNT (615) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1735) +#define YY_SHIFT_MAX (1706) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 827, 0, 0, 48, 96, 96, 96, 96, 280, 280, - /* 10 */ 96, 96, 328, 376, 560, 376, 376, 376, 376, 376, - /* 20 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - /* 30 */ 376, 376, 376, 376, 376, 376, 376, 376, 120, 120, - /* 40 */ 23, 23, 23, 834, 834, 834, 834, 325, 650, 124, - /* 50 */ 30, 30, 42, 42, 61, 124, 124, 30, 30, 30, - /* 60 */ 30, 30, 30, 194, 30, 30, 360, 433, 456, 360, - /* 70 */ 30, 30, 360, 30, 360, 360, 456, 360, 30, 611, - /* 80 */ 556, 59, 110, 110, 186, 378, 321, 321, 321, 321, - /* 90 */ 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, - /* 100 */ 321, 321, 321, 321, 321, 161, 153, 575, 575, 299, - /* 110 */ 440, 246, 246, 246, 399, 440, 700, 456, 360, 360, - /* 120 */ 456, 689, 787, 441, 441, 441, 441, 441, 441, 441, - /* 130 */ 1277, 107, 97, 209, 117, 132, 317, 85, 183, 657, - /* 140 */ 745, 671, 297, 563, 497, 563, 704, 704, 704, 409, - /* 150 */ 640, 976, 963, 964, 861, 976, 976, 986, 889, 889, - /* 160 */ 976, 1025, 1025, 1037, 194, 456, 194, 1046, 1048, 194, - /* 170 */ 1046, 194, 700, 1062, 194, 194, 976, 194, 1025, 360, - /* 180 */ 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, - /* 190 */ 976, 1025, 1030, 1037, 611, 938, 456, 611, 976, 1046, - /* 200 */ 611, 700, 1062, 611, 1103, 913, 915, 1030, 913, 915, - /* 210 */ 1030, 1030, 360, 922, 998, 940, 952, 953, 700, 1145, - /* 220 */ 1128, 946, 949, 954, 946, 949, 946, 949, 1096, 915, - /* 230 */ 1030, 1030, 915, 1030, 1040, 700, 1062, 611, 689, 611, - /* 240 */ 700, 1126, 787, 976, 611, 1025, 2125, 2125, 2125, 2125, - /* 250 */ 2125, 2125, 2125, 577, 1491, 294, 869, 64, 14, 406, - /* 260 */ 478, 512, 485, 675, 21, 21, 21, 21, 21, 21, - /* 270 */ 21, 21, 237, 330, 533, 500, 447, 475, 643, 643, - /* 280 */ 643, 643, 762, 753, 731, 732, 740, 790, 907, 909, - /* 290 */ 910, 831, 606, 835, 839, 844, 941, 742, 763, 133, - /* 300 */ 884, 735, 892, 798, 900, 904, 905, 931, 932, 849, - /* 310 */ 881, 897, 948, 950, 951, 968, 977, 1, 719, 1243, - /* 320 */ 1244, 1173, 1248, 1202, 1076, 1204, 1205, 1206, 1080, 1257, - /* 330 */ 1211, 1212, 1087, 1262, 1216, 1264, 1219, 1267, 1221, 1270, - /* 340 */ 1190, 1112, 1114, 1161, 1119, 1287, 1294, 1125, 1127, 1304, - /* 350 */ 1305, 1255, 1300, 1301, 1302, 1306, 1307, 1309, 1311, 1312, - /* 360 */ 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1326, - /* 370 */ 1295, 1327, 1334, 1337, 1338, 1339, 1340, 1323, 1341, 1342, - /* 380 */ 1346, 1351, 1352, 1353, 1308, 1322, 1324, 1335, 1328, 1347, - /* 390 */ 1331, 1355, 1345, 1325, 1356, 1364, 1385, 1349, 1240, 1388, - /* 400 */ 1389, 1354, 1390, 1333, 1394, 1395, 1350, 1357, 1359, 1398, - /* 410 */ 1358, 1361, 1362, 1400, 1360, 1363, 1366, 1401, 1367, 1365, - /* 420 */ 1372, 1411, 1413, 1419, 1420, 1343, 1329, 1369, 1402, 1423, - /* 430 */ 1380, 1381, 1382, 1383, 1391, 1393, 1384, 1396, 1397, 1435, - /* 440 */ 1415, 1438, 1418, 1403, 1454, 1433, 1409, 1457, 1436, 1459, - /* 450 */ 1440, 1443, 1460, 1332, 1421, 1469, 1368, 1444, 1336, 1371, - /* 460 */ 1467, 1470, 1473, 1344, 1474, 1399, 1428, 1376, 1442, 1447, - /* 470 */ 1272, 1410, 1452, 1422, 1404, 1430, 1437, 1439, 1462, 1432, - /* 480 */ 1456, 1441, 1478, 1370, 1445, 1446, 1481, 1273, 1479, 1486, - /* 490 */ 1449, 1493, 1374, 1450, 1488, 1494, 1500, 1501, 1502, 1503, - /* 500 */ 1450, 1515, 1373, 1497, 1482, 1471, 1483, 1511, 1485, 1487, - /* 510 */ 1526, 1547, 1407, 1492, 1495, 1496, 1499, 1509, 1448, 1512, - /* 520 */ 1581, 1546, 1461, 1513, 1516, 1559, 1560, 1533, 1524, 1537, - /* 530 */ 1562, 1538, 1528, 1539, 1575, 1576, 1544, 1545, 1579, 1548, - /* 540 */ 1550, 1583, 1555, 1558, 1592, 1561, 1564, 1594, 1563, 1523, - /* 550 */ 1542, 1543, 1565, 1621, 1556, 1569, 1570, 1605, 1584, 1553, - /* 560 */ 1646, 1610, 1613, 1625, 1609, 1595, 1634, 1629, 1630, 1631, - /* 570 */ 1632, 1633, 1659, 1635, 1638, 1637, 1391, 1647, 1393, 1648, - /* 580 */ 1649, 1650, 1651, 1652, 1653, 1703, 1657, 1662, 1671, 1709, - /* 590 */ 1663, 1666, 1675, 1713, 1667, 1670, 1680, 1718, 1672, 1676, - /* 600 */ 1683, 1723, 1677, 1688, 1731, 1735, 1714, 1716, 1720, 1721, - /* 610 */ 1719, 1725, + /* 0 */ 763, 0, 0, 48, 233, 233, 233, 233, 254, 254, + /* 10 */ 233, 233, 439, 460, 645, 460, 460, 460, 460, 460, + /* 20 */ 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, + /* 30 */ 460, 460, 460, 460, 460, 460, 460, 460, 77, 77, + /* 40 */ 21, 21, 21, 940, 940, 940, 940, 427, 202, 307, + /* 50 */ 36, 36, 62, 62, 79, 307, 307, 36, 36, 36, + /* 60 */ 36, 36, 36, 36, 67, 36, 36, 137, 273, 296, + /* 70 */ 137, 36, 36, 137, 36, 137, 137, 296, 137, 36, + /* 80 */ 294, 641, 835, 481, 481, 186, 191, 834, 834, 834, + /* 90 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 100 */ 834, 834, 834, 834, 834, 834, 184, 283, 299, 299, + /* 110 */ 164, 225, 467, 467, 467, 347, 225, 371, 296, 137, + /* 120 */ 137, 296, 268, 367, 275, 275, 275, 275, 275, 275, + /* 130 */ 275, 1360, 144, 525, 185, 310, 190, 34, 558, 680, + /* 140 */ 572, 714, 608, 697, 544, 350, 544, 666, 666, 666, + /* 150 */ 607, 688, 723, 899, 900, 903, 801, 899, 899, 916, + /* 160 */ 821, 821, 899, 957, 957, 958, 67, 296, 67, 968, + /* 170 */ 973, 67, 968, 67, 371, 981, 67, 67, 899, 67, + /* 180 */ 957, 137, 137, 137, 137, 137, 137, 137, 137, 137, + /* 190 */ 137, 137, 899, 957, 946, 958, 294, 888, 296, 294, + /* 200 */ 899, 968, 294, 371, 981, 294, 1051, 851, 859, 946, + /* 210 */ 851, 859, 946, 946, 137, 862, 939, 876, 723, 883, + /* 220 */ 371, 1073, 1054, 870, 885, 881, 870, 885, 870, 885, + /* 230 */ 1035, 859, 946, 946, 859, 946, 997, 371, 981, 294, + /* 240 */ 268, 294, 371, 1088, 367, 899, 294, 957, 2165, 2165, + /* 250 */ 2165, 2165, 2165, 2165, 2165, 65, 1187, 368, 265, 3, + /* 260 */ 328, 452, 133, 210, 7, 363, 521, 521, 521, 521, + /* 270 */ 521, 521, 521, 521, 369, 438, 377, 187, 636, 590, + /* 280 */ 387, 387, 387, 387, 800, 165, 728, 733, 735, 767, + /* 290 */ 470, 854, 857, 506, 547, 708, 785, 817, 858, 667, + /* 300 */ 702, 756, 824, 747, 825, 457, 827, 828, 832, 833, + /* 310 */ 836, 775, 831, 823, 841, 845, 848, 853, 861, 794, + /* 320 */ 837, 1185, 1190, 1152, 1193, 1122, 1195, 1149, 1023, 1153, + /* 330 */ 1154, 1156, 1025, 1204, 1160, 1169, 1043, 1219, 1174, 1225, + /* 340 */ 1179, 1227, 1182, 1230, 1150, 1074, 1076, 1120, 1080, 1243, + /* 350 */ 1244, 1094, 1096, 1254, 1256, 1213, 1264, 1266, 1268, 1269, + /* 360 */ 1271, 1272, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, + /* 370 */ 1282, 1284, 1285, 1286, 1220, 1261, 1288, 1290, 1291, 1292, + /* 380 */ 1293, 1237, 1294, 1295, 1296, 1297, 1299, 1300, 1262, 1283, + /* 390 */ 1260, 1289, 1298, 1304, 1301, 1305, 1302, 1287, 1306, 1319, + /* 400 */ 1321, 1309, 1175, 1323, 1328, 1310, 1330, 1273, 1336, 1337, + /* 410 */ 1303, 1307, 1312, 1338, 1308, 1313, 1316, 1341, 1320, 1329, + /* 420 */ 1339, 1343, 1333, 1332, 1344, 1357, 1384, 1385, 1386, 1326, + /* 430 */ 1318, 1340, 1366, 1389, 1345, 1347, 1348, 1349, 1350, 1356, + /* 440 */ 1351, 1352, 1354, 1409, 1388, 1418, 1397, 1372, 1422, 1401, + /* 450 */ 1383, 1432, 1411, 1434, 1413, 1417, 1438, 1314, 1392, 1441, + /* 460 */ 1325, 1420, 1315, 1322, 1446, 1447, 1448, 1317, 1449, 1369, + /* 470 */ 1414, 1331, 1415, 1416, 1239, 1373, 1424, 1387, 1380, 1391, + /* 480 */ 1393, 1395, 1425, 1429, 1451, 1412, 1455, 1255, 1421, 1423, + /* 490 */ 1453, 1342, 1458, 1463, 1426, 1461, 1335, 1428, 1462, 1464, + /* 500 */ 1465, 1466, 1467, 1470, 1428, 1516, 1346, 1478, 1439, 1445, + /* 510 */ 1450, 1483, 1452, 1454, 1485, 1508, 1353, 1457, 1469, 1471, + /* 520 */ 1473, 1474, 1396, 1475, 1557, 1522, 1436, 1477, 1472, 1517, + /* 530 */ 1518, 1479, 1482, 1484, 1544, 1488, 1486, 1499, 1535, 1536, + /* 540 */ 1503, 1504, 1538, 1506, 1507, 1543, 1510, 1511, 1545, 1513, + /* 550 */ 1515, 1548, 1519, 1494, 1496, 1498, 1501, 1585, 1520, 1528, + /* 560 */ 1529, 1564, 1531, 1502, 1594, 1558, 1570, 1583, 1567, 1554, + /* 570 */ 1591, 1587, 1590, 1599, 1600, 1602, 1628, 1604, 1605, 1589, + /* 580 */ 1350, 1608, 1356, 1610, 1612, 1613, 1614, 1615, 1616, 1664, + /* 590 */ 1618, 1622, 1632, 1671, 1625, 1629, 1636, 1676, 1630, 1639, + /* 600 */ 1649, 1688, 1642, 1653, 1662, 1705, 1654, 1656, 1703, 1706, + /* 610 */ 1685, 1687, 1689, 1690, 1692, 1695, }; -#define YY_REDUCE_COUNT (252) -#define YY_REDUCE_MIN (-334) -#define YY_REDUCE_MAX (1772) +#define YY_REDUCE_COUNT (254) +#define YY_REDUCE_MIN (-318) +#define YY_REDUCE_MAX (1811) static const short yy_reduce_ofst[] = { - /* 0 */ -185, 489, 520, -223, 91, 581, 644, 730, 761, 822, - /* 10 */ 885, 916, 316, 970, 979, 1057, 1068, 1136, 1185, 1196, - /* 20 */ 1247, 1286, 1299, 1348, 1377, 1416, 1465, 1476, 1525, 1540, - /* 30 */ 1557, 1572, 1589, 1636, 1668, 1685, 1717, 1766, 811, 1772, - /* 40 */ 98, 389, 448, -267, -265, 466, 548, -293, -176, 34, - /* 50 */ 332, 464, -236, -189, -334, -304, -237, 57, 111, 119, - /* 60 */ 334, 451, 538, 180, 564, 601, 104, 79, -21, -113, - /* 70 */ 623, 627, 228, 642, 86, 337, -133, 218, 664, -239, - /* 80 */ 58, -48, -48, -48, -220, -253, -146, -110, 6, 13, - /* 90 */ 122, 154, 193, 215, 306, 313, 371, 416, 422, 424, - /* 100 */ 432, 436, 468, 469, 473, 150, 249, -178, 129, -46, - /* 110 */ 412, -87, 278, 394, -123, 415, 88, 329, 460, 435, - /* 120 */ 411, 326, 476, -254, 540, 558, 590, 592, 600, 647, - /* 130 */ 649, 494, 665, 584, 605, 656, 621, 696, 696, 725, - /* 140 */ 717, 702, 676, 660, 660, 660, 634, 646, 658, 663, - /* 150 */ 696, 758, 706, 765, 720, 774, 775, 743, 749, 752, - /* 160 */ 791, 806, 810, 759, 809, 777, 813, 782, 773, 826, - /* 170 */ 785, 828, 805, 796, 832, 833, 841, 837, 850, 818, - /* 180 */ 823, 825, 829, 836, 842, 843, 846, 847, 848, 851, - /* 190 */ 852, 853, 812, 799, 855, 803, 821, 868, 873, 854, - /* 200 */ 871, 866, 840, 872, 856, 781, 858, 857, 792, 859, - /* 210 */ 862, 864, 696, 816, 814, 830, 838, 660, 890, 860, - /* 220 */ 863, 865, 867, 824, 870, 874, 880, 883, 878, 887, - /* 230 */ 891, 895, 888, 896, 899, 912, 903, 943, 939, 955, - /* 240 */ 935, 942, 957, 965, 973, 971, 920, 918, 972, 974, - /* 250 */ 975, 990, 1004, + /* 0 */ 12, -239, 13, 235, 655, 419, 734, 787, 838, 849, + /* 10 */ 897, 937, 996, 1048, 1057, 1113, 1167, 1176, 1229, 1259, + /* 20 */ 1311, 1327, 1367, 1379, 1427, 1459, 1489, 1521, 1537, 1553, + /* 30 */ 1569, 1621, 1637, 1669, 1701, 1731, 1763, 1779, 1803, 1811, + /* 40 */ -214, -223, 75, -268, -263, 4, 46, -259, 162, 217, + /* 50 */ -234, 242, -215, -94, 161, 228, 238, -224, -189, 240, + /* 60 */ 340, 414, 416, 442, -186, 447, 451, -185, -110, -85, + /* 70 */ 18, 465, 532, 288, 534, 298, 327, -124, 443, 535, + /* 80 */ 30, -247, -318, -318, -318, -191, -212, 117, 139, 214, + /* 90 */ 277, 372, 425, 429, 431, 456, 462, 497, 498, 513, + /* 100 */ 515, 516, 519, 552, 555, 562, -114, -240, -67, 226, + /* 110 */ 216, 289, 274, 475, 482, -251, 346, 421, -194, -49, + /* 120 */ 323, 319, -4, 264, -243, 236, 285, 403, 405, 407, + /* 130 */ 600, 135, 543, 556, 527, 540, 568, 550, 623, 623, + /* 140 */ 648, 651, 617, 593, 569, 569, 569, 570, 579, 581, + /* 150 */ 584, 623, 602, 700, 644, 696, 656, 709, 710, 674, + /* 160 */ 678, 681, 717, 736, 740, 683, 738, 699, 739, 694, + /* 170 */ 701, 741, 704, 743, 720, 718, 749, 752, 759, 755, + /* 180 */ 766, 746, 748, 750, 751, 753, 754, 757, 758, 760, + /* 190 */ 761, 762, 764, 773, 727, 722, 793, 765, 770, 803, + /* 200 */ 810, 768, 811, 788, 779, 818, 771, 726, 781, 786, + /* 210 */ 730, 790, 789, 792, 623, 744, 742, 769, 783, 569, + /* 220 */ 815, 795, 778, 772, 776, 780, 791, 777, 796, 782, + /* 230 */ 797, 830, 826, 829, 843, 850, 855, 865, 867, 896, + /* 240 */ 893, 908, 891, 898, 911, 924, 922, 933, 878, 877, + /* 250 */ 918, 919, 920, 927, 950, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 10 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 20 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 30 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 40 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 50 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 60 */ 1349, 1349, 1349, 1418, 1349, 1349, 1349, 1349, 1349, 1349, - /* 70 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1416, - /* 80 */ 1556, 1349, 1720, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 90 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 100 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1418, - /* 110 */ 1349, 1731, 1731, 1731, 1416, 1349, 1349, 1349, 1349, 1349, - /* 120 */ 1349, 1512, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 130 */ 1592, 1349, 1349, 1797, 1349, 1598, 1755, 1349, 1349, 1349, - /* 140 */ 1349, 1465, 1747, 1723, 1737, 1724, 1782, 1782, 1782, 1740, - /* 150 */ 1349, 1349, 1349, 1349, 1584, 1349, 1349, 1561, 1558, 1558, - /* 160 */ 1349, 1349, 1349, 1349, 1418, 1349, 1418, 1349, 1349, 1418, - /* 170 */ 1349, 1418, 1349, 1349, 1418, 1418, 1349, 1418, 1349, 1349, - /* 180 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 190 */ 1349, 1349, 1349, 1349, 1416, 1594, 1349, 1416, 1349, 1349, - /* 200 */ 1416, 1349, 1349, 1416, 1349, 1762, 1760, 1349, 1762, 1760, - /* 210 */ 1349, 1349, 1349, 1774, 1770, 1753, 1751, 1737, 1349, 1349, - /* 220 */ 1349, 1788, 1784, 1800, 1788, 1784, 1788, 1784, 1349, 1760, - /* 230 */ 1349, 1349, 1760, 1349, 1569, 1349, 1349, 1416, 1349, 1416, - /* 240 */ 1349, 1481, 1349, 1349, 1416, 1349, 1586, 1600, 1515, 1515, - /* 250 */ 1515, 1419, 1354, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 260 */ 1349, 1349, 1349, 1349, 1664, 1773, 1772, 1696, 1695, 1694, - /* 270 */ 1692, 1663, 1477, 1349, 1349, 1349, 1349, 1349, 1657, 1658, - /* 280 */ 1656, 1655, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 290 */ 1349, 1349, 1349, 1349, 1349, 1349, 1721, 1349, 1785, 1789, - /* 300 */ 1349, 1349, 1349, 1640, 1349, 1349, 1349, 1349, 1349, 1349, - /* 310 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 320 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 330 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 340 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 350 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 360 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 370 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 380 */ 1349, 1349, 1349, 1349, 1349, 1349, 1383, 1349, 1349, 1349, - /* 390 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 400 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 410 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 420 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 430 */ 1349, 1349, 1349, 1349, 1446, 1445, 1349, 1349, 1349, 1349, - /* 440 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 450 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 460 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1744, 1754, - /* 470 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 480 */ 1640, 1349, 1771, 1349, 1730, 1726, 1349, 1349, 1722, 1349, - /* 490 */ 1349, 1783, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 500 */ 1349, 1716, 1349, 1689, 1349, 1349, 1349, 1349, 1349, 1349, - /* 510 */ 1349, 1349, 1651, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 520 */ 1349, 1349, 1349, 1349, 1349, 1639, 1349, 1680, 1349, 1349, - /* 530 */ 1349, 1349, 1349, 1349, 1349, 1349, 1509, 1349, 1349, 1349, - /* 540 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1494, - /* 550 */ 1492, 1491, 1490, 1349, 1487, 1349, 1349, 1349, 1349, 1349, - /* 560 */ 1349, 1349, 1349, 1349, 1349, 1349, 1438, 1349, 1349, 1349, - /* 570 */ 1349, 1349, 1349, 1349, 1349, 1349, 1429, 1349, 1428, 1349, - /* 580 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 590 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 600 */ 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, - /* 610 */ 1349, 1349, + /* 0 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 10 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 20 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 30 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 40 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 50 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 60 */ 1354, 1354, 1354, 1354, 1423, 1354, 1354, 1354, 1354, 1354, + /* 70 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 80 */ 1421, 1561, 1354, 1726, 1354, 1354, 1354, 1354, 1354, 1354, + /* 90 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 100 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 110 */ 1423, 1354, 1737, 1737, 1737, 1421, 1354, 1354, 1354, 1354, + /* 120 */ 1354, 1354, 1517, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 130 */ 1354, 1597, 1354, 1354, 1803, 1354, 1603, 1761, 1354, 1354, + /* 140 */ 1354, 1354, 1470, 1753, 1729, 1743, 1730, 1788, 1788, 1788, + /* 150 */ 1746, 1354, 1757, 1354, 1354, 1354, 1589, 1354, 1354, 1566, + /* 160 */ 1563, 1563, 1354, 1354, 1354, 1354, 1423, 1354, 1423, 1354, + /* 170 */ 1354, 1423, 1354, 1423, 1354, 1354, 1423, 1423, 1354, 1423, + /* 180 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 190 */ 1354, 1354, 1354, 1354, 1354, 1354, 1421, 1599, 1354, 1421, + /* 200 */ 1354, 1354, 1421, 1354, 1354, 1421, 1354, 1768, 1766, 1354, + /* 210 */ 1768, 1766, 1354, 1354, 1354, 1780, 1776, 1759, 1757, 1743, + /* 220 */ 1354, 1354, 1354, 1794, 1790, 1806, 1794, 1790, 1794, 1790, + /* 230 */ 1354, 1766, 1354, 1354, 1766, 1354, 1574, 1354, 1354, 1421, + /* 240 */ 1354, 1421, 1354, 1486, 1354, 1354, 1421, 1354, 1591, 1605, + /* 250 */ 1520, 1520, 1520, 1424, 1359, 1354, 1354, 1354, 1354, 1354, + /* 260 */ 1354, 1354, 1354, 1354, 1354, 1354, 1670, 1779, 1778, 1702, + /* 270 */ 1701, 1700, 1698, 1669, 1482, 1354, 1354, 1354, 1354, 1354, + /* 280 */ 1663, 1664, 1662, 1661, 1354, 1354, 1354, 1354, 1354, 1354, + /* 290 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1727, 1354, + /* 300 */ 1791, 1795, 1354, 1354, 1354, 1646, 1354, 1354, 1354, 1354, + /* 310 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 320 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 330 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 340 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 350 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 360 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 370 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 380 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 390 */ 1388, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 400 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 410 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 420 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 430 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1451, 1450, + /* 440 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 450 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 460 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 470 */ 1354, 1354, 1750, 1760, 1354, 1354, 1354, 1354, 1354, 1354, + /* 480 */ 1354, 1354, 1354, 1354, 1646, 1354, 1777, 1354, 1736, 1732, + /* 490 */ 1354, 1354, 1728, 1354, 1354, 1789, 1354, 1354, 1354, 1354, + /* 500 */ 1354, 1354, 1354, 1354, 1354, 1722, 1354, 1695, 1354, 1354, + /* 510 */ 1354, 1354, 1354, 1354, 1354, 1354, 1657, 1354, 1354, 1354, + /* 520 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1645, + /* 530 */ 1354, 1686, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 540 */ 1514, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 550 */ 1354, 1354, 1354, 1499, 1497, 1496, 1495, 1354, 1492, 1354, + /* 560 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 570 */ 1443, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 580 */ 1434, 1354, 1433, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 590 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 600 */ 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, 1354, + /* 610 */ 1354, 1354, 1354, 1354, 1354, 1354, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1029,6 +1012,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* REDISTRIBUTE => nothing */ 0, /* SPLIT => nothing */ 0, /* SYNCDB => nothing */ + 0, /* DELETE => nothing */ 0, /* NULL => nothing */ 0, /* NK_QUESTION => nothing */ 0, /* NK_ARROW => nothing */ @@ -1082,12 +1066,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ID => nothing */ - 230, /* NK_BITNOT => ID */ - 230, /* INSERT => ID */ - 230, /* VALUES => ID */ - 230, /* IMPORT => ID */ - 230, /* NK_SEMI => ID */ - 230, /* FILE => ID */ + 231, /* NK_BITNOT => ID */ + 231, /* INSERT => ID */ + 231, /* VALUES => ID */ + 231, /* IMPORT => ID */ + 231, /* NK_SEMI => ID */ + 231, /* FILE => ID */ }; #endif /* YYFALLBACK */ @@ -1353,185 +1337,186 @@ static const char *const yyTokenName[] = { /* 175 */ "REDISTRIBUTE", /* 176 */ "SPLIT", /* 177 */ "SYNCDB", - /* 178 */ "NULL", - /* 179 */ "NK_QUESTION", - /* 180 */ "NK_ARROW", - /* 181 */ "ROWTS", - /* 182 */ "TBNAME", - /* 183 */ "QSTARTTS", - /* 184 */ "QENDTS", - /* 185 */ "WSTARTTS", - /* 186 */ "WENDTS", - /* 187 */ "WDURATION", - /* 188 */ "CAST", - /* 189 */ "NOW", - /* 190 */ "TODAY", - /* 191 */ "TIMEZONE", - /* 192 */ "COUNT", - /* 193 */ "FIRST", - /* 194 */ "LAST", - /* 195 */ "LAST_ROW", - /* 196 */ "BETWEEN", - /* 197 */ "IS", - /* 198 */ "NK_LT", - /* 199 */ "NK_GT", - /* 200 */ "NK_LE", - /* 201 */ "NK_GE", - /* 202 */ "NK_NE", - /* 203 */ "MATCH", - /* 204 */ "NMATCH", - /* 205 */ "CONTAINS", - /* 206 */ "JOIN", - /* 207 */ "INNER", - /* 208 */ "SELECT", - /* 209 */ "DISTINCT", - /* 210 */ "WHERE", - /* 211 */ "PARTITION", - /* 212 */ "BY", - /* 213 */ "SESSION", - /* 214 */ "STATE_WINDOW", - /* 215 */ "SLIDING", - /* 216 */ "FILL", - /* 217 */ "VALUE", - /* 218 */ "NONE", - /* 219 */ "PREV", - /* 220 */ "LINEAR", - /* 221 */ "NEXT", - /* 222 */ "HAVING", - /* 223 */ "ORDER", - /* 224 */ "SLIMIT", - /* 225 */ "SOFFSET", - /* 226 */ "LIMIT", - /* 227 */ "OFFSET", - /* 228 */ "ASC", - /* 229 */ "NULLS", - /* 230 */ "ID", - /* 231 */ "NK_BITNOT", - /* 232 */ "INSERT", - /* 233 */ "VALUES", - /* 234 */ "IMPORT", - /* 235 */ "NK_SEMI", - /* 236 */ "FILE", - /* 237 */ "cmd", - /* 238 */ "account_options", - /* 239 */ "alter_account_options", - /* 240 */ "literal", - /* 241 */ "alter_account_option", - /* 242 */ "user_name", - /* 243 */ "privileges", - /* 244 */ "priv_level", - /* 245 */ "priv_type_list", - /* 246 */ "priv_type", - /* 247 */ "db_name", - /* 248 */ "dnode_endpoint", - /* 249 */ "dnode_host_name", - /* 250 */ "not_exists_opt", - /* 251 */ "db_options", - /* 252 */ "exists_opt", - /* 253 */ "alter_db_options", - /* 254 */ "integer_list", - /* 255 */ "variable_list", - /* 256 */ "retention_list", - /* 257 */ "alter_db_option", - /* 258 */ "retention", - /* 259 */ "full_table_name", - /* 260 */ "column_def_list", - /* 261 */ "tags_def_opt", - /* 262 */ "table_options", - /* 263 */ "multi_create_clause", - /* 264 */ "tags_def", - /* 265 */ "multi_drop_clause", - /* 266 */ "alter_table_clause", - /* 267 */ "alter_table_options", - /* 268 */ "column_name", - /* 269 */ "type_name", - /* 270 */ "signed_literal", - /* 271 */ "create_subtable_clause", - /* 272 */ "specific_tags_opt", - /* 273 */ "literal_list", - /* 274 */ "drop_table_clause", - /* 275 */ "col_name_list", - /* 276 */ "table_name", - /* 277 */ "column_def", - /* 278 */ "func_name_list", - /* 279 */ "alter_table_option", - /* 280 */ "col_name", - /* 281 */ "db_name_cond_opt", - /* 282 */ "like_pattern_opt", - /* 283 */ "table_name_cond", - /* 284 */ "from_db_opt", - /* 285 */ "func_name", - /* 286 */ "function_name", - /* 287 */ "index_name", - /* 288 */ "index_options", - /* 289 */ "func_list", - /* 290 */ "duration_literal", - /* 291 */ "sliding_opt", - /* 292 */ "func", - /* 293 */ "expression_list", - /* 294 */ "topic_name", - /* 295 */ "query_expression", - /* 296 */ "cgroup_name", - /* 297 */ "analyze_opt", - /* 298 */ "explain_options", - /* 299 */ "agg_func_opt", - /* 300 */ "bufsize_opt", - /* 301 */ "stream_name", - /* 302 */ "stream_options", - /* 303 */ "into_opt", - /* 304 */ "dnode_list", - /* 305 */ "signed", - /* 306 */ "literal_func", - /* 307 */ "table_alias", - /* 308 */ "column_alias", - /* 309 */ "expression", - /* 310 */ "pseudo_column", - /* 311 */ "column_reference", - /* 312 */ "function_expression", - /* 313 */ "subquery", - /* 314 */ "star_func", - /* 315 */ "star_func_para_list", - /* 316 */ "noarg_func", - /* 317 */ "other_para_list", - /* 318 */ "star_func_para", - /* 319 */ "predicate", - /* 320 */ "compare_op", - /* 321 */ "in_op", - /* 322 */ "in_predicate_value", - /* 323 */ "boolean_value_expression", - /* 324 */ "boolean_primary", - /* 325 */ "common_expression", - /* 326 */ "from_clause", - /* 327 */ "table_reference_list", - /* 328 */ "table_reference", - /* 329 */ "table_primary", - /* 330 */ "joined_table", - /* 331 */ "alias_opt", - /* 332 */ "parenthesized_joined_table", - /* 333 */ "join_type", - /* 334 */ "search_condition", - /* 335 */ "query_specification", - /* 336 */ "set_quantifier_opt", - /* 337 */ "select_list", - /* 338 */ "where_clause_opt", - /* 339 */ "partition_by_clause_opt", - /* 340 */ "twindow_clause_opt", - /* 341 */ "group_by_clause_opt", - /* 342 */ "having_clause_opt", - /* 343 */ "select_sublist", - /* 344 */ "select_item", - /* 345 */ "fill_opt", - /* 346 */ "fill_mode", - /* 347 */ "group_by_list", - /* 348 */ "query_expression_body", - /* 349 */ "order_by_clause_opt", - /* 350 */ "slimit_clause_opt", - /* 351 */ "limit_clause_opt", - /* 352 */ "query_primary", - /* 353 */ "sort_specification_list", - /* 354 */ "sort_specification", - /* 355 */ "ordering_specification_opt", - /* 356 */ "null_ordering_opt", + /* 178 */ "DELETE", + /* 179 */ "NULL", + /* 180 */ "NK_QUESTION", + /* 181 */ "NK_ARROW", + /* 182 */ "ROWTS", + /* 183 */ "TBNAME", + /* 184 */ "QSTARTTS", + /* 185 */ "QENDTS", + /* 186 */ "WSTARTTS", + /* 187 */ "WENDTS", + /* 188 */ "WDURATION", + /* 189 */ "CAST", + /* 190 */ "NOW", + /* 191 */ "TODAY", + /* 192 */ "TIMEZONE", + /* 193 */ "COUNT", + /* 194 */ "FIRST", + /* 195 */ "LAST", + /* 196 */ "LAST_ROW", + /* 197 */ "BETWEEN", + /* 198 */ "IS", + /* 199 */ "NK_LT", + /* 200 */ "NK_GT", + /* 201 */ "NK_LE", + /* 202 */ "NK_GE", + /* 203 */ "NK_NE", + /* 204 */ "MATCH", + /* 205 */ "NMATCH", + /* 206 */ "CONTAINS", + /* 207 */ "JOIN", + /* 208 */ "INNER", + /* 209 */ "SELECT", + /* 210 */ "DISTINCT", + /* 211 */ "WHERE", + /* 212 */ "PARTITION", + /* 213 */ "BY", + /* 214 */ "SESSION", + /* 215 */ "STATE_WINDOW", + /* 216 */ "SLIDING", + /* 217 */ "FILL", + /* 218 */ "VALUE", + /* 219 */ "NONE", + /* 220 */ "PREV", + /* 221 */ "LINEAR", + /* 222 */ "NEXT", + /* 223 */ "HAVING", + /* 224 */ "ORDER", + /* 225 */ "SLIMIT", + /* 226 */ "SOFFSET", + /* 227 */ "LIMIT", + /* 228 */ "OFFSET", + /* 229 */ "ASC", + /* 230 */ "NULLS", + /* 231 */ "ID", + /* 232 */ "NK_BITNOT", + /* 233 */ "INSERT", + /* 234 */ "VALUES", + /* 235 */ "IMPORT", + /* 236 */ "NK_SEMI", + /* 237 */ "FILE", + /* 238 */ "cmd", + /* 239 */ "account_options", + /* 240 */ "alter_account_options", + /* 241 */ "literal", + /* 242 */ "alter_account_option", + /* 243 */ "user_name", + /* 244 */ "privileges", + /* 245 */ "priv_level", + /* 246 */ "priv_type_list", + /* 247 */ "priv_type", + /* 248 */ "db_name", + /* 249 */ "dnode_endpoint", + /* 250 */ "dnode_host_name", + /* 251 */ "not_exists_opt", + /* 252 */ "db_options", + /* 253 */ "exists_opt", + /* 254 */ "alter_db_options", + /* 255 */ "integer_list", + /* 256 */ "variable_list", + /* 257 */ "retention_list", + /* 258 */ "alter_db_option", + /* 259 */ "retention", + /* 260 */ "full_table_name", + /* 261 */ "column_def_list", + /* 262 */ "tags_def_opt", + /* 263 */ "table_options", + /* 264 */ "multi_create_clause", + /* 265 */ "tags_def", + /* 266 */ "multi_drop_clause", + /* 267 */ "alter_table_clause", + /* 268 */ "alter_table_options", + /* 269 */ "column_name", + /* 270 */ "type_name", + /* 271 */ "signed_literal", + /* 272 */ "create_subtable_clause", + /* 273 */ "specific_tags_opt", + /* 274 */ "literal_list", + /* 275 */ "drop_table_clause", + /* 276 */ "col_name_list", + /* 277 */ "table_name", + /* 278 */ "column_def", + /* 279 */ "func_name_list", + /* 280 */ "alter_table_option", + /* 281 */ "col_name", + /* 282 */ "db_name_cond_opt", + /* 283 */ "like_pattern_opt", + /* 284 */ "table_name_cond", + /* 285 */ "from_db_opt", + /* 286 */ "func_name", + /* 287 */ "function_name", + /* 288 */ "index_name", + /* 289 */ "index_options", + /* 290 */ "func_list", + /* 291 */ "duration_literal", + /* 292 */ "sliding_opt", + /* 293 */ "func", + /* 294 */ "expression_list", + /* 295 */ "topic_name", + /* 296 */ "query_expression", + /* 297 */ "cgroup_name", + /* 298 */ "analyze_opt", + /* 299 */ "explain_options", + /* 300 */ "agg_func_opt", + /* 301 */ "bufsize_opt", + /* 302 */ "stream_name", + /* 303 */ "stream_options", + /* 304 */ "into_opt", + /* 305 */ "dnode_list", + /* 306 */ "where_clause_opt", + /* 307 */ "signed", + /* 308 */ "literal_func", + /* 309 */ "table_alias", + /* 310 */ "column_alias", + /* 311 */ "expression", + /* 312 */ "pseudo_column", + /* 313 */ "column_reference", + /* 314 */ "function_expression", + /* 315 */ "subquery", + /* 316 */ "star_func", + /* 317 */ "star_func_para_list", + /* 318 */ "noarg_func", + /* 319 */ "other_para_list", + /* 320 */ "star_func_para", + /* 321 */ "predicate", + /* 322 */ "compare_op", + /* 323 */ "in_op", + /* 324 */ "in_predicate_value", + /* 325 */ "boolean_value_expression", + /* 326 */ "boolean_primary", + /* 327 */ "common_expression", + /* 328 */ "from_clause", + /* 329 */ "table_reference_list", + /* 330 */ "table_reference", + /* 331 */ "table_primary", + /* 332 */ "joined_table", + /* 333 */ "alias_opt", + /* 334 */ "parenthesized_joined_table", + /* 335 */ "join_type", + /* 336 */ "search_condition", + /* 337 */ "query_specification", + /* 338 */ "set_quantifier_opt", + /* 339 */ "select_list", + /* 340 */ "partition_by_clause_opt", + /* 341 */ "twindow_clause_opt", + /* 342 */ "group_by_clause_opt", + /* 343 */ "having_clause_opt", + /* 344 */ "select_sublist", + /* 345 */ "select_item", + /* 346 */ "fill_opt", + /* 347 */ "fill_mode", + /* 348 */ "group_by_list", + /* 349 */ "query_expression_body", + /* 350 */ "order_by_clause_opt", + /* 351 */ "slimit_clause_opt", + /* 352 */ "limit_clause_opt", + /* 353 */ "query_primary", + /* 354 */ "sort_specification_list", + /* 355 */ "sort_specification", + /* 356 */ "ordering_specification_opt", + /* 357 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1800,196 +1785,197 @@ static const char *const yyRuleName[] = { /* 258 */ "dnode_list ::= DNODE NK_INTEGER", /* 259 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", /* 260 */ "cmd ::= SYNCDB db_name REPLICA", - /* 261 */ "cmd ::= query_expression", - /* 262 */ "literal ::= NK_INTEGER", - /* 263 */ "literal ::= NK_FLOAT", - /* 264 */ "literal ::= NK_STRING", - /* 265 */ "literal ::= NK_BOOL", - /* 266 */ "literal ::= TIMESTAMP NK_STRING", - /* 267 */ "literal ::= duration_literal", - /* 268 */ "literal ::= NULL", - /* 269 */ "literal ::= NK_QUESTION", - /* 270 */ "duration_literal ::= NK_VARIABLE", - /* 271 */ "signed ::= NK_INTEGER", - /* 272 */ "signed ::= NK_PLUS NK_INTEGER", - /* 273 */ "signed ::= NK_MINUS NK_INTEGER", - /* 274 */ "signed ::= NK_FLOAT", - /* 275 */ "signed ::= NK_PLUS NK_FLOAT", - /* 276 */ "signed ::= NK_MINUS NK_FLOAT", - /* 277 */ "signed_literal ::= signed", - /* 278 */ "signed_literal ::= NK_STRING", - /* 279 */ "signed_literal ::= NK_BOOL", - /* 280 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 281 */ "signed_literal ::= duration_literal", - /* 282 */ "signed_literal ::= NULL", - /* 283 */ "signed_literal ::= literal_func", - /* 284 */ "literal_list ::= signed_literal", - /* 285 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 286 */ "db_name ::= NK_ID", - /* 287 */ "table_name ::= NK_ID", - /* 288 */ "column_name ::= NK_ID", - /* 289 */ "function_name ::= NK_ID", - /* 290 */ "table_alias ::= NK_ID", - /* 291 */ "column_alias ::= NK_ID", - /* 292 */ "user_name ::= NK_ID", - /* 293 */ "index_name ::= NK_ID", - /* 294 */ "topic_name ::= NK_ID", - /* 295 */ "stream_name ::= NK_ID", - /* 296 */ "cgroup_name ::= NK_ID", - /* 297 */ "expression ::= literal", - /* 298 */ "expression ::= pseudo_column", - /* 299 */ "expression ::= column_reference", - /* 300 */ "expression ::= function_expression", - /* 301 */ "expression ::= subquery", - /* 302 */ "expression ::= NK_LP expression NK_RP", - /* 303 */ "expression ::= NK_PLUS expression", - /* 304 */ "expression ::= NK_MINUS expression", - /* 305 */ "expression ::= expression NK_PLUS expression", - /* 306 */ "expression ::= expression NK_MINUS expression", - /* 307 */ "expression ::= expression NK_STAR expression", - /* 308 */ "expression ::= expression NK_SLASH expression", - /* 309 */ "expression ::= expression NK_REM expression", - /* 310 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 311 */ "expression_list ::= expression", - /* 312 */ "expression_list ::= expression_list NK_COMMA expression", - /* 313 */ "column_reference ::= column_name", - /* 314 */ "column_reference ::= table_name NK_DOT column_name", - /* 315 */ "pseudo_column ::= ROWTS", - /* 316 */ "pseudo_column ::= TBNAME", - /* 317 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 318 */ "pseudo_column ::= QSTARTTS", - /* 319 */ "pseudo_column ::= QENDTS", - /* 320 */ "pseudo_column ::= WSTARTTS", - /* 321 */ "pseudo_column ::= WENDTS", - /* 322 */ "pseudo_column ::= WDURATION", - /* 323 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 324 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 325 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", - /* 326 */ "function_expression ::= literal_func", - /* 327 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 328 */ "literal_func ::= NOW", - /* 329 */ "noarg_func ::= NOW", - /* 330 */ "noarg_func ::= TODAY", - /* 331 */ "noarg_func ::= TIMEZONE", - /* 332 */ "star_func ::= COUNT", - /* 333 */ "star_func ::= FIRST", - /* 334 */ "star_func ::= LAST", - /* 335 */ "star_func ::= LAST_ROW", - /* 336 */ "star_func_para_list ::= NK_STAR", - /* 337 */ "star_func_para_list ::= other_para_list", - /* 338 */ "other_para_list ::= star_func_para", - /* 339 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 340 */ "star_func_para ::= expression", - /* 341 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 342 */ "predicate ::= expression compare_op expression", - /* 343 */ "predicate ::= expression BETWEEN expression AND expression", - /* 344 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 345 */ "predicate ::= expression IS NULL", - /* 346 */ "predicate ::= expression IS NOT NULL", - /* 347 */ "predicate ::= expression in_op in_predicate_value", - /* 348 */ "compare_op ::= NK_LT", - /* 349 */ "compare_op ::= NK_GT", - /* 350 */ "compare_op ::= NK_LE", - /* 351 */ "compare_op ::= NK_GE", - /* 352 */ "compare_op ::= NK_NE", - /* 353 */ "compare_op ::= NK_EQ", - /* 354 */ "compare_op ::= LIKE", - /* 355 */ "compare_op ::= NOT LIKE", - /* 356 */ "compare_op ::= MATCH", - /* 357 */ "compare_op ::= NMATCH", - /* 358 */ "compare_op ::= CONTAINS", - /* 359 */ "in_op ::= IN", - /* 360 */ "in_op ::= NOT IN", - /* 361 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 362 */ "boolean_value_expression ::= boolean_primary", - /* 363 */ "boolean_value_expression ::= NOT boolean_primary", - /* 364 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 365 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 366 */ "boolean_primary ::= predicate", - /* 367 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 368 */ "common_expression ::= expression", - /* 369 */ "common_expression ::= boolean_value_expression", - /* 370 */ "from_clause ::= FROM table_reference_list", - /* 371 */ "table_reference_list ::= table_reference", - /* 372 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 373 */ "table_reference ::= table_primary", - /* 374 */ "table_reference ::= joined_table", - /* 375 */ "table_primary ::= table_name alias_opt", - /* 376 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 377 */ "table_primary ::= subquery alias_opt", - /* 378 */ "table_primary ::= parenthesized_joined_table", - /* 379 */ "alias_opt ::=", - /* 380 */ "alias_opt ::= table_alias", - /* 381 */ "alias_opt ::= AS table_alias", - /* 382 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 383 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 384 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 385 */ "join_type ::=", - /* 386 */ "join_type ::= INNER", - /* 387 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 388 */ "set_quantifier_opt ::=", - /* 389 */ "set_quantifier_opt ::= DISTINCT", - /* 390 */ "set_quantifier_opt ::= ALL", - /* 391 */ "select_list ::= NK_STAR", - /* 392 */ "select_list ::= select_sublist", - /* 393 */ "select_sublist ::= select_item", - /* 394 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 395 */ "select_item ::= common_expression", - /* 396 */ "select_item ::= common_expression column_alias", - /* 397 */ "select_item ::= common_expression AS column_alias", - /* 398 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 399 */ "where_clause_opt ::=", - /* 400 */ "where_clause_opt ::= WHERE search_condition", - /* 401 */ "partition_by_clause_opt ::=", - /* 402 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 403 */ "twindow_clause_opt ::=", - /* 404 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 405 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 406 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 407 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 408 */ "sliding_opt ::=", - /* 409 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 410 */ "fill_opt ::=", - /* 411 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 412 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 413 */ "fill_mode ::= NONE", - /* 414 */ "fill_mode ::= PREV", - /* 415 */ "fill_mode ::= NULL", - /* 416 */ "fill_mode ::= LINEAR", - /* 417 */ "fill_mode ::= NEXT", - /* 418 */ "group_by_clause_opt ::=", - /* 419 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 420 */ "group_by_list ::= expression", - /* 421 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 422 */ "having_clause_opt ::=", - /* 423 */ "having_clause_opt ::= HAVING search_condition", - /* 424 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 425 */ "query_expression_body ::= query_primary", - /* 426 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 427 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 428 */ "query_primary ::= query_specification", - /* 429 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 430 */ "order_by_clause_opt ::=", - /* 431 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 432 */ "slimit_clause_opt ::=", - /* 433 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 434 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 435 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 436 */ "limit_clause_opt ::=", - /* 437 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 438 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 439 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 440 */ "subquery ::= NK_LP query_expression NK_RP", - /* 441 */ "search_condition ::= common_expression", - /* 442 */ "sort_specification_list ::= sort_specification", - /* 443 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 444 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 445 */ "ordering_specification_opt ::=", - /* 446 */ "ordering_specification_opt ::= ASC", - /* 447 */ "ordering_specification_opt ::= DESC", - /* 448 */ "null_ordering_opt ::=", - /* 449 */ "null_ordering_opt ::= NULLS FIRST", - /* 450 */ "null_ordering_opt ::= NULLS LAST", + /* 261 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 262 */ "cmd ::= query_expression", + /* 263 */ "literal ::= NK_INTEGER", + /* 264 */ "literal ::= NK_FLOAT", + /* 265 */ "literal ::= NK_STRING", + /* 266 */ "literal ::= NK_BOOL", + /* 267 */ "literal ::= TIMESTAMP NK_STRING", + /* 268 */ "literal ::= duration_literal", + /* 269 */ "literal ::= NULL", + /* 270 */ "literal ::= NK_QUESTION", + /* 271 */ "duration_literal ::= NK_VARIABLE", + /* 272 */ "signed ::= NK_INTEGER", + /* 273 */ "signed ::= NK_PLUS NK_INTEGER", + /* 274 */ "signed ::= NK_MINUS NK_INTEGER", + /* 275 */ "signed ::= NK_FLOAT", + /* 276 */ "signed ::= NK_PLUS NK_FLOAT", + /* 277 */ "signed ::= NK_MINUS NK_FLOAT", + /* 278 */ "signed_literal ::= signed", + /* 279 */ "signed_literal ::= NK_STRING", + /* 280 */ "signed_literal ::= NK_BOOL", + /* 281 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 282 */ "signed_literal ::= duration_literal", + /* 283 */ "signed_literal ::= NULL", + /* 284 */ "signed_literal ::= literal_func", + /* 285 */ "literal_list ::= signed_literal", + /* 286 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 287 */ "db_name ::= NK_ID", + /* 288 */ "table_name ::= NK_ID", + /* 289 */ "column_name ::= NK_ID", + /* 290 */ "function_name ::= NK_ID", + /* 291 */ "table_alias ::= NK_ID", + /* 292 */ "column_alias ::= NK_ID", + /* 293 */ "user_name ::= NK_ID", + /* 294 */ "index_name ::= NK_ID", + /* 295 */ "topic_name ::= NK_ID", + /* 296 */ "stream_name ::= NK_ID", + /* 297 */ "cgroup_name ::= NK_ID", + /* 298 */ "expression ::= literal", + /* 299 */ "expression ::= pseudo_column", + /* 300 */ "expression ::= column_reference", + /* 301 */ "expression ::= function_expression", + /* 302 */ "expression ::= subquery", + /* 303 */ "expression ::= NK_LP expression NK_RP", + /* 304 */ "expression ::= NK_PLUS expression", + /* 305 */ "expression ::= NK_MINUS expression", + /* 306 */ "expression ::= expression NK_PLUS expression", + /* 307 */ "expression ::= expression NK_MINUS expression", + /* 308 */ "expression ::= expression NK_STAR expression", + /* 309 */ "expression ::= expression NK_SLASH expression", + /* 310 */ "expression ::= expression NK_REM expression", + /* 311 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 312 */ "expression_list ::= expression", + /* 313 */ "expression_list ::= expression_list NK_COMMA expression", + /* 314 */ "column_reference ::= column_name", + /* 315 */ "column_reference ::= table_name NK_DOT column_name", + /* 316 */ "pseudo_column ::= ROWTS", + /* 317 */ "pseudo_column ::= TBNAME", + /* 318 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 319 */ "pseudo_column ::= QSTARTTS", + /* 320 */ "pseudo_column ::= QENDTS", + /* 321 */ "pseudo_column ::= WSTARTTS", + /* 322 */ "pseudo_column ::= WENDTS", + /* 323 */ "pseudo_column ::= WDURATION", + /* 324 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 325 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 326 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", + /* 327 */ "function_expression ::= literal_func", + /* 328 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 329 */ "literal_func ::= NOW", + /* 330 */ "noarg_func ::= NOW", + /* 331 */ "noarg_func ::= TODAY", + /* 332 */ "noarg_func ::= TIMEZONE", + /* 333 */ "star_func ::= COUNT", + /* 334 */ "star_func ::= FIRST", + /* 335 */ "star_func ::= LAST", + /* 336 */ "star_func ::= LAST_ROW", + /* 337 */ "star_func_para_list ::= NK_STAR", + /* 338 */ "star_func_para_list ::= other_para_list", + /* 339 */ "other_para_list ::= star_func_para", + /* 340 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 341 */ "star_func_para ::= expression", + /* 342 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 343 */ "predicate ::= expression compare_op expression", + /* 344 */ "predicate ::= expression BETWEEN expression AND expression", + /* 345 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 346 */ "predicate ::= expression IS NULL", + /* 347 */ "predicate ::= expression IS NOT NULL", + /* 348 */ "predicate ::= expression in_op in_predicate_value", + /* 349 */ "compare_op ::= NK_LT", + /* 350 */ "compare_op ::= NK_GT", + /* 351 */ "compare_op ::= NK_LE", + /* 352 */ "compare_op ::= NK_GE", + /* 353 */ "compare_op ::= NK_NE", + /* 354 */ "compare_op ::= NK_EQ", + /* 355 */ "compare_op ::= LIKE", + /* 356 */ "compare_op ::= NOT LIKE", + /* 357 */ "compare_op ::= MATCH", + /* 358 */ "compare_op ::= NMATCH", + /* 359 */ "compare_op ::= CONTAINS", + /* 360 */ "in_op ::= IN", + /* 361 */ "in_op ::= NOT IN", + /* 362 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 363 */ "boolean_value_expression ::= boolean_primary", + /* 364 */ "boolean_value_expression ::= NOT boolean_primary", + /* 365 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 366 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 367 */ "boolean_primary ::= predicate", + /* 368 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 369 */ "common_expression ::= expression", + /* 370 */ "common_expression ::= boolean_value_expression", + /* 371 */ "from_clause ::= FROM table_reference_list", + /* 372 */ "table_reference_list ::= table_reference", + /* 373 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 374 */ "table_reference ::= table_primary", + /* 375 */ "table_reference ::= joined_table", + /* 376 */ "table_primary ::= table_name alias_opt", + /* 377 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 378 */ "table_primary ::= subquery alias_opt", + /* 379 */ "table_primary ::= parenthesized_joined_table", + /* 380 */ "alias_opt ::=", + /* 381 */ "alias_opt ::= table_alias", + /* 382 */ "alias_opt ::= AS table_alias", + /* 383 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 384 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 385 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 386 */ "join_type ::=", + /* 387 */ "join_type ::= INNER", + /* 388 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 389 */ "set_quantifier_opt ::=", + /* 390 */ "set_quantifier_opt ::= DISTINCT", + /* 391 */ "set_quantifier_opt ::= ALL", + /* 392 */ "select_list ::= NK_STAR", + /* 393 */ "select_list ::= select_sublist", + /* 394 */ "select_sublist ::= select_item", + /* 395 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 396 */ "select_item ::= common_expression", + /* 397 */ "select_item ::= common_expression column_alias", + /* 398 */ "select_item ::= common_expression AS column_alias", + /* 399 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 400 */ "where_clause_opt ::=", + /* 401 */ "where_clause_opt ::= WHERE search_condition", + /* 402 */ "partition_by_clause_opt ::=", + /* 403 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 404 */ "twindow_clause_opt ::=", + /* 405 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 406 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 407 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 408 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 409 */ "sliding_opt ::=", + /* 410 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 411 */ "fill_opt ::=", + /* 412 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 413 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 414 */ "fill_mode ::= NONE", + /* 415 */ "fill_mode ::= PREV", + /* 416 */ "fill_mode ::= NULL", + /* 417 */ "fill_mode ::= LINEAR", + /* 418 */ "fill_mode ::= NEXT", + /* 419 */ "group_by_clause_opt ::=", + /* 420 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 421 */ "group_by_list ::= expression", + /* 422 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 423 */ "having_clause_opt ::=", + /* 424 */ "having_clause_opt ::= HAVING search_condition", + /* 425 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 426 */ "query_expression_body ::= query_primary", + /* 427 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 428 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 429 */ "query_primary ::= query_specification", + /* 430 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 431 */ "order_by_clause_opt ::=", + /* 432 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 433 */ "slimit_clause_opt ::=", + /* 434 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 435 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 436 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 437 */ "limit_clause_opt ::=", + /* 438 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 439 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 440 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 441 */ "subquery ::= NK_LP query_expression NK_RP", + /* 442 */ "search_condition ::= common_expression", + /* 443 */ "sort_specification_list ::= sort_specification", + /* 444 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 445 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 446 */ "ordering_specification_opt ::=", + /* 447 */ "ordering_specification_opt ::= ASC", + /* 448 */ "ordering_specification_opt ::= DESC", + /* 449 */ "null_ordering_opt ::=", + /* 450 */ "null_ordering_opt ::= NULLS FIRST", + /* 451 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2116,174 +2102,174 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 237: /* cmd */ - case 240: /* literal */ - case 251: /* db_options */ - case 253: /* alter_db_options */ - case 258: /* retention */ - case 259: /* full_table_name */ - case 262: /* table_options */ - case 266: /* alter_table_clause */ - case 267: /* alter_table_options */ - case 270: /* signed_literal */ - case 271: /* create_subtable_clause */ - case 274: /* drop_table_clause */ - case 277: /* column_def */ - case 280: /* col_name */ - case 281: /* db_name_cond_opt */ - case 282: /* like_pattern_opt */ - case 283: /* table_name_cond */ - case 284: /* from_db_opt */ - case 285: /* func_name */ - case 288: /* index_options */ - case 290: /* duration_literal */ - case 291: /* sliding_opt */ - case 292: /* func */ - case 295: /* query_expression */ - case 298: /* explain_options */ - case 302: /* stream_options */ - case 303: /* into_opt */ - case 305: /* signed */ - case 306: /* literal_func */ - case 309: /* expression */ - case 310: /* pseudo_column */ - case 311: /* column_reference */ - case 312: /* function_expression */ - case 313: /* subquery */ - case 318: /* star_func_para */ - case 319: /* predicate */ - case 322: /* in_predicate_value */ - case 323: /* boolean_value_expression */ - case 324: /* boolean_primary */ - case 325: /* common_expression */ - case 326: /* from_clause */ - case 327: /* table_reference_list */ - case 328: /* table_reference */ - case 329: /* table_primary */ - case 330: /* joined_table */ - case 332: /* parenthesized_joined_table */ - case 334: /* search_condition */ - case 335: /* query_specification */ - case 338: /* where_clause_opt */ - case 340: /* twindow_clause_opt */ - case 342: /* having_clause_opt */ - case 344: /* select_item */ - case 345: /* fill_opt */ - case 348: /* query_expression_body */ - case 350: /* slimit_clause_opt */ - case 351: /* limit_clause_opt */ - case 352: /* query_primary */ - case 354: /* sort_specification */ + case 238: /* cmd */ + case 241: /* literal */ + case 252: /* db_options */ + case 254: /* alter_db_options */ + case 259: /* retention */ + case 260: /* full_table_name */ + case 263: /* table_options */ + case 267: /* alter_table_clause */ + case 268: /* alter_table_options */ + case 271: /* signed_literal */ + case 272: /* create_subtable_clause */ + case 275: /* drop_table_clause */ + case 278: /* column_def */ + case 281: /* col_name */ + case 282: /* db_name_cond_opt */ + case 283: /* like_pattern_opt */ + case 284: /* table_name_cond */ + case 285: /* from_db_opt */ + case 286: /* func_name */ + case 289: /* index_options */ + case 291: /* duration_literal */ + case 292: /* sliding_opt */ + case 293: /* func */ + case 296: /* query_expression */ + case 299: /* explain_options */ + case 303: /* stream_options */ + case 304: /* into_opt */ + case 306: /* where_clause_opt */ + case 307: /* signed */ + case 308: /* literal_func */ + case 311: /* expression */ + case 312: /* pseudo_column */ + case 313: /* column_reference */ + case 314: /* function_expression */ + case 315: /* subquery */ + case 320: /* star_func_para */ + case 321: /* predicate */ + case 324: /* in_predicate_value */ + case 325: /* boolean_value_expression */ + case 326: /* boolean_primary */ + case 327: /* common_expression */ + case 328: /* from_clause */ + case 329: /* table_reference_list */ + case 330: /* table_reference */ + case 331: /* table_primary */ + case 332: /* joined_table */ + case 334: /* parenthesized_joined_table */ + case 336: /* search_condition */ + case 337: /* query_specification */ + case 341: /* twindow_clause_opt */ + case 343: /* having_clause_opt */ + case 345: /* select_item */ + case 346: /* fill_opt */ + case 349: /* query_expression_body */ + case 351: /* slimit_clause_opt */ + case 352: /* limit_clause_opt */ + case 353: /* query_primary */ + case 355: /* sort_specification */ { - nodesDestroyNode((yypminor->yy686)); + nodesDestroyNode((yypminor->yy172)); } break; - case 238: /* account_options */ - case 239: /* alter_account_options */ - case 241: /* alter_account_option */ - case 300: /* bufsize_opt */ + case 239: /* account_options */ + case 240: /* alter_account_options */ + case 242: /* alter_account_option */ + case 301: /* bufsize_opt */ { } break; - case 242: /* user_name */ - case 244: /* priv_level */ - case 247: /* db_name */ - case 248: /* dnode_endpoint */ - case 249: /* dnode_host_name */ - case 268: /* column_name */ - case 276: /* table_name */ - case 286: /* function_name */ - case 287: /* index_name */ - case 294: /* topic_name */ - case 296: /* cgroup_name */ - case 301: /* stream_name */ - case 307: /* table_alias */ - case 308: /* column_alias */ - case 314: /* star_func */ - case 316: /* noarg_func */ - case 331: /* alias_opt */ + case 243: /* user_name */ + case 245: /* priv_level */ + case 248: /* db_name */ + case 249: /* dnode_endpoint */ + case 250: /* dnode_host_name */ + case 269: /* column_name */ + case 277: /* table_name */ + case 287: /* function_name */ + case 288: /* index_name */ + case 295: /* topic_name */ + case 297: /* cgroup_name */ + case 302: /* stream_name */ + case 309: /* table_alias */ + case 310: /* column_alias */ + case 316: /* star_func */ + case 318: /* noarg_func */ + case 333: /* alias_opt */ { } break; - case 243: /* privileges */ - case 245: /* priv_type_list */ - case 246: /* priv_type */ + case 244: /* privileges */ + case 246: /* priv_type_list */ + case 247: /* priv_type */ { } break; - case 250: /* not_exists_opt */ - case 252: /* exists_opt */ - case 297: /* analyze_opt */ - case 299: /* agg_func_opt */ - case 336: /* set_quantifier_opt */ + case 251: /* not_exists_opt */ + case 253: /* exists_opt */ + case 298: /* analyze_opt */ + case 300: /* agg_func_opt */ + case 338: /* set_quantifier_opt */ { } break; - case 254: /* integer_list */ - case 255: /* variable_list */ - case 256: /* retention_list */ - case 260: /* column_def_list */ - case 261: /* tags_def_opt */ - case 263: /* multi_create_clause */ - case 264: /* tags_def */ - case 265: /* multi_drop_clause */ - case 272: /* specific_tags_opt */ - case 273: /* literal_list */ - case 275: /* col_name_list */ - case 278: /* func_name_list */ - case 289: /* func_list */ - case 293: /* expression_list */ - case 304: /* dnode_list */ - case 315: /* star_func_para_list */ - case 317: /* other_para_list */ - case 337: /* select_list */ - case 339: /* partition_by_clause_opt */ - case 341: /* group_by_clause_opt */ - case 343: /* select_sublist */ - case 347: /* group_by_list */ - case 349: /* order_by_clause_opt */ - case 353: /* sort_specification_list */ + case 255: /* integer_list */ + case 256: /* variable_list */ + case 257: /* retention_list */ + case 261: /* column_def_list */ + case 262: /* tags_def_opt */ + case 264: /* multi_create_clause */ + case 265: /* tags_def */ + case 266: /* multi_drop_clause */ + case 273: /* specific_tags_opt */ + case 274: /* literal_list */ + case 276: /* col_name_list */ + case 279: /* func_name_list */ + case 290: /* func_list */ + case 294: /* expression_list */ + case 305: /* dnode_list */ + case 317: /* star_func_para_list */ + case 319: /* other_para_list */ + case 339: /* select_list */ + case 340: /* partition_by_clause_opt */ + case 342: /* group_by_clause_opt */ + case 344: /* select_sublist */ + case 348: /* group_by_list */ + case 350: /* order_by_clause_opt */ + case 354: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy670)); + nodesDestroyList((yypminor->yy60)); } break; - case 257: /* alter_db_option */ - case 279: /* alter_table_option */ + case 258: /* alter_db_option */ + case 280: /* alter_table_option */ { } break; - case 269: /* type_name */ + case 270: /* type_name */ { } break; - case 320: /* compare_op */ - case 321: /* in_op */ + case 322: /* compare_op */ + case 323: /* in_op */ { } break; - case 333: /* join_type */ + case 335: /* join_type */ { } break; - case 346: /* fill_mode */ + case 347: /* fill_mode */ { } break; - case 355: /* ordering_specification_opt */ + case 356: /* ordering_specification_opt */ { } break; - case 356: /* null_ordering_opt */ + case 357: /* null_ordering_opt */ { } @@ -2411,18 +2397,15 @@ static YYACTIONTYPE yy_find_shift_action( do{ i = yy_shift_ofst[stateno]; assert( i>=0 ); - assert( i<=YY_ACTTAB_COUNT ); - assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); + /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */ assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; - assert( i<(int)YY_NLOOKAHEAD ); - if( yy_lookahead[i]!=iLookAhead ){ + if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ - assert( iLookAhead %s\n", @@ -2437,8 +2420,16 @@ static YYACTIONTYPE yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); - if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ + if( +#if YY_SHIFT_MIN+YYWILDCARD<0 + j>=0 && +#endif +#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT + j0 + ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -2452,7 +2443,6 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ - assert( i>=0 && iyytos; #ifndef NDEBUG if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfoNRhs[yyruleno]; + yysize = yyRuleInfo[yyruleno].nrhs; if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", + fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; @@ -3572,11 +3108,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,238,&yymsp[0].minor); + yy_destructor(yypParser,239,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,239,&yymsp[0].minor); + yy_destructor(yypParser,240,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3590,20 +3126,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,238,&yymsp[-2].minor); +{ yy_destructor(yypParser,239,&yymsp[-2].minor); { } - yy_destructor(yypParser,240,&yymsp[0].minor); + yy_destructor(yypParser,241,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,241,&yymsp[0].minor); +{ yy_destructor(yypParser,242,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,239,&yymsp[-1].minor); +{ yy_destructor(yypParser,240,&yymsp[-1].minor); { } - yy_destructor(yypParser,241,&yymsp[0].minor); + yy_destructor(yypParser,242,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3617,63 +3153,63 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,240,&yymsp[0].minor); + yy_destructor(yypParser,241,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy113, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy105, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy113, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy105, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy105); } break; case 28: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy123, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy593, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); } break; case 29: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy123, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy593, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); } break; case 30: /* privileges ::= ALL */ -{ yymsp[0].minor.yy123 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy593 = PRIVILEGE_TYPE_ALL; } break; case 31: /* privileges ::= priv_type_list */ case 32: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==32); -{ yylhsminor.yy123 = yymsp[0].minor.yy123; } - yymsp[0].minor.yy123 = yylhsminor.yy123; +{ yylhsminor.yy593 = yymsp[0].minor.yy593; } + yymsp[0].minor.yy593 = yylhsminor.yy593; break; case 33: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy123 = yymsp[-2].minor.yy123 | yymsp[0].minor.yy123; } - yymsp[-2].minor.yy123 = yylhsminor.yy123; +{ yylhsminor.yy593 = yymsp[-2].minor.yy593 | yymsp[0].minor.yy593; } + yymsp[-2].minor.yy593 = yylhsminor.yy593; break; case 34: /* priv_type ::= READ */ -{ yymsp[0].minor.yy123 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy593 = PRIVILEGE_TYPE_READ; } break; case 35: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy123 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy593 = PRIVILEGE_TYPE_WRITE; } break; case 36: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy113 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy113 = yylhsminor.yy113; +{ yylhsminor.yy105 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy105 = yylhsminor.yy105; break; case 37: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy113 = yymsp[-2].minor.yy113; } - yymsp[-2].minor.yy113 = yylhsminor.yy113; +{ yylhsminor.yy105 = yymsp[-2].minor.yy105; } + yymsp[-2].minor.yy105 = yylhsminor.yy105; break; case 38: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy113, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy105, NULL); } break; case 39: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); } break; case 40: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 41: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy105); } break; case 42: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3690,26 +3226,26 @@ static YYACTIONTYPE yy_reduce( case 46: /* dnode_endpoint ::= NK_STRING */ case 47: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==47); case 48: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==48); - case 286: /* db_name ::= NK_ID */ yytestcase(yyruleno==286); - case 287: /* table_name ::= NK_ID */ yytestcase(yyruleno==287); - case 288: /* column_name ::= NK_ID */ yytestcase(yyruleno==288); - case 289: /* function_name ::= NK_ID */ yytestcase(yyruleno==289); - case 290: /* table_alias ::= NK_ID */ yytestcase(yyruleno==290); - case 291: /* column_alias ::= NK_ID */ yytestcase(yyruleno==291); - case 292: /* user_name ::= NK_ID */ yytestcase(yyruleno==292); - case 293: /* index_name ::= NK_ID */ yytestcase(yyruleno==293); - case 294: /* topic_name ::= NK_ID */ yytestcase(yyruleno==294); - case 295: /* stream_name ::= NK_ID */ yytestcase(yyruleno==295); - case 296: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==296); - case 329: /* noarg_func ::= NOW */ yytestcase(yyruleno==329); - case 330: /* noarg_func ::= TODAY */ yytestcase(yyruleno==330); - case 331: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==331); - case 332: /* star_func ::= COUNT */ yytestcase(yyruleno==332); - case 333: /* star_func ::= FIRST */ yytestcase(yyruleno==333); - case 334: /* star_func ::= LAST */ yytestcase(yyruleno==334); - case 335: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==335); -{ yylhsminor.yy113 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy113 = yylhsminor.yy113; + case 287: /* db_name ::= NK_ID */ yytestcase(yyruleno==287); + case 288: /* table_name ::= NK_ID */ yytestcase(yyruleno==288); + case 289: /* column_name ::= NK_ID */ yytestcase(yyruleno==289); + case 290: /* function_name ::= NK_ID */ yytestcase(yyruleno==290); + case 291: /* table_alias ::= NK_ID */ yytestcase(yyruleno==291); + case 292: /* column_alias ::= NK_ID */ yytestcase(yyruleno==292); + case 293: /* user_name ::= NK_ID */ yytestcase(yyruleno==293); + case 294: /* index_name ::= NK_ID */ yytestcase(yyruleno==294); + case 295: /* topic_name ::= NK_ID */ yytestcase(yyruleno==295); + case 296: /* stream_name ::= NK_ID */ yytestcase(yyruleno==296); + case 297: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==297); + case 330: /* noarg_func ::= NOW */ yytestcase(yyruleno==330); + case 331: /* noarg_func ::= TODAY */ yytestcase(yyruleno==331); + case 332: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==332); + case 333: /* star_func ::= COUNT */ yytestcase(yyruleno==333); + case 334: /* star_func ::= FIRST */ yytestcase(yyruleno==334); + case 335: /* star_func ::= LAST */ yytestcase(yyruleno==335); + case 336: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==336); +{ yylhsminor.yy105 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy105 = yylhsminor.yy105; break; case 49: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3742,156 +3278,156 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 59: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy131, &yymsp[-1].minor.yy113, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy617, &yymsp[-1].minor.yy105, yymsp[0].minor.yy172); } break; case 60: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy131, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); } break; case 61: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy105); } break; case 62: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy113, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy105, yymsp[0].minor.yy172); } break; case 63: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy131 = true; } +{ yymsp[-2].minor.yy617 = true; } break; case 64: /* not_exists_opt ::= */ case 66: /* exists_opt ::= */ yytestcase(yyruleno==66); case 232: /* analyze_opt ::= */ yytestcase(yyruleno==232); case 240: /* agg_func_opt ::= */ yytestcase(yyruleno==240); - case 388: /* set_quantifier_opt ::= */ yytestcase(yyruleno==388); -{ yymsp[1].minor.yy131 = false; } + case 389: /* set_quantifier_opt ::= */ yytestcase(yyruleno==389); +{ yymsp[1].minor.yy617 = false; } break; case 65: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy131 = true; } +{ yymsp[-1].minor.yy617 = true; } break; case 67: /* db_options ::= */ -{ yymsp[1].minor.yy686 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy172 = createDefaultDatabaseOptions(pCxt); } break; case 68: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 69: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 70: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 71: /* db_options ::= db_options DAYS NK_INTEGER */ case 72: /* db_options ::= db_options DAYS NK_VARIABLE */ yytestcase(yyruleno==72); -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 73: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 74: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 75: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 76: /* db_options ::= db_options KEEP integer_list */ case 77: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==77); -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_KEEP, yymsp[0].minor.yy670); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_KEEP, yymsp[0].minor.yy60); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 78: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 79: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 80: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 81: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 82: /* db_options ::= db_options STRICT NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 83: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 84: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 85: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 86: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_RETENTIONS, yymsp[0].minor.yy670); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_RETENTIONS, yymsp[0].minor.yy60); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 87: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy686 = setDatabaseOption(pCxt, yymsp[-2].minor.yy686, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setDatabaseOption(pCxt, yymsp[-2].minor.yy172, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 88: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy686 = createAlterDatabaseOptions(pCxt); yylhsminor.yy686 = setAlterDatabaseOption(pCxt, yylhsminor.yy686, &yymsp[0].minor.yy53); } - yymsp[0].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterDatabaseOptions(pCxt); yylhsminor.yy172 = setAlterDatabaseOption(pCxt, yylhsminor.yy172, &yymsp[0].minor.yy609); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; case 89: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy686 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy686, &yymsp[0].minor.yy53); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy172, &yymsp[0].minor.yy609); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; case 90: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 91: /* alter_db_option ::= CACHELAST NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 92: /* alter_db_option ::= FSYNC NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 93: /* alter_db_option ::= KEEP integer_list */ case 94: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==94); -{ yymsp[-1].minor.yy53.type = DB_OPTION_KEEP; yymsp[-1].minor.yy53.pList = yymsp[0].minor.yy670; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_KEEP; yymsp[-1].minor.yy609.pList = yymsp[0].minor.yy60; } break; case 95: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_PAGES; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_PAGES; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 96: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 97: /* alter_db_option ::= STRICT NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_STRICT; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_STRICT; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 98: /* alter_db_option ::= WAL NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = DB_OPTION_WAL; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = DB_OPTION_WAL; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 99: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy670 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy670 = yylhsminor.yy670; +{ yylhsminor.yy60 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy60 = yylhsminor.yy60; break; case 100: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ case 259: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==259); -{ yylhsminor.yy670 = addNodeToList(pCxt, yymsp[-2].minor.yy670, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy670 = yylhsminor.yy670; +{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy60 = yylhsminor.yy60; break; case 101: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy670 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy670 = yylhsminor.yy670; +{ yylhsminor.yy60 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy60 = yylhsminor.yy60; break; case 102: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy670 = addNodeToList(pCxt, yymsp[-2].minor.yy670, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy670 = yylhsminor.yy670; +{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy60 = yylhsminor.yy60; break; case 103: /* retention_list ::= retention */ case 123: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==123); @@ -3900,242 +3436,242 @@ static YYACTIONTYPE yy_reduce( case 173: /* col_name_list ::= col_name */ yytestcase(yyruleno==173); case 211: /* func_name_list ::= func_name */ yytestcase(yyruleno==211); case 220: /* func_list ::= func */ yytestcase(yyruleno==220); - case 284: /* literal_list ::= signed_literal */ yytestcase(yyruleno==284); - case 338: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==338); - case 393: /* select_sublist ::= select_item */ yytestcase(yyruleno==393); - case 442: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==442); -{ yylhsminor.yy670 = createNodeList(pCxt, yymsp[0].minor.yy686); } - yymsp[0].minor.yy670 = yylhsminor.yy670; + case 285: /* literal_list ::= signed_literal */ yytestcase(yyruleno==285); + case 339: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==339); + case 394: /* select_sublist ::= select_item */ yytestcase(yyruleno==394); + case 443: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==443); +{ yylhsminor.yy60 = createNodeList(pCxt, yymsp[0].minor.yy172); } + yymsp[0].minor.yy60 = yylhsminor.yy60; break; case 104: /* retention_list ::= retention_list NK_COMMA retention */ case 134: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==134); case 174: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==174); case 212: /* func_name_list ::= func_name_list NK_COMMA func_name */ yytestcase(yyruleno==212); case 221: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==221); - case 285: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==285); - case 339: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==339); - case 394: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==394); - case 443: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==443); -{ yylhsminor.yy670 = addNodeToList(pCxt, yymsp[-2].minor.yy670, yymsp[0].minor.yy686); } - yymsp[-2].minor.yy670 = yylhsminor.yy670; + case 286: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==286); + case 340: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==340); + case 395: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==395); + case 444: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==444); +{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, yymsp[0].minor.yy172); } + yymsp[-2].minor.yy60 = yylhsminor.yy60; break; case 105: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy686 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 106: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 108: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==108); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy131, yymsp[-5].minor.yy686, yymsp[-3].minor.yy670, yymsp[-1].minor.yy670, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy617, yymsp[-5].minor.yy172, yymsp[-3].minor.yy60, yymsp[-1].minor.yy60, yymsp[0].minor.yy172); } break; case 107: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy670); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy60); } break; case 109: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy670); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy60); } break; case 110: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy131, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy617, yymsp[0].minor.yy172); } break; case 111: /* cmd ::= ALTER TABLE alter_table_clause */ case 112: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==112); - case 261: /* cmd ::= query_expression */ yytestcase(yyruleno==261); -{ pCxt->pRootNode = yymsp[0].minor.yy686; } + case 262: /* cmd ::= query_expression */ yytestcase(yyruleno==262); +{ pCxt->pRootNode = yymsp[0].minor.yy172; } break; case 113: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy686 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy686, yymsp[0].minor.yy686); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; case 114: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy686 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy686, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy113, yymsp[0].minor.yy490); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 115: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy686 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy686, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy113); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy172, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy105); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; case 116: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy686 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy686, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy113, yymsp[0].minor.yy490); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 117: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy686 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy686, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 118: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy686 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy686, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy113, yymsp[0].minor.yy490); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 119: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy686 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy686, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy113); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy172, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy105); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; case 120: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy686 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy686, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy113, yymsp[0].minor.yy490); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 121: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy686 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy686, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy172, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 122: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy686 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy686, &yymsp[-2].minor.yy113, yymsp[0].minor.yy686); } - yymsp[-5].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy172, &yymsp[-2].minor.yy105, yymsp[0].minor.yy172); } + yymsp[-5].minor.yy172 = yylhsminor.yy172; break; case 124: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 127: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==127); -{ yylhsminor.yy670 = addNodeToList(pCxt, yymsp[-1].minor.yy670, yymsp[0].minor.yy686); } - yymsp[-1].minor.yy670 = yylhsminor.yy670; +{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-1].minor.yy60, yymsp[0].minor.yy172); } + yymsp[-1].minor.yy60 = yylhsminor.yy60; break; case 125: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ -{ yylhsminor.yy686 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy131, yymsp[-8].minor.yy686, yymsp[-6].minor.yy686, yymsp[-5].minor.yy670, yymsp[-2].minor.yy670, yymsp[0].minor.yy686); } - yymsp[-9].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy617, yymsp[-8].minor.yy172, yymsp[-6].minor.yy172, yymsp[-5].minor.yy60, yymsp[-2].minor.yy60, yymsp[0].minor.yy172); } + yymsp[-9].minor.yy172 = yylhsminor.yy172; break; case 128: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy686 = createDropTableClause(pCxt, yymsp[-1].minor.yy131, yymsp[0].minor.yy686); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createDropTableClause(pCxt, yymsp[-1].minor.yy617, yymsp[0].minor.yy172); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; case 129: /* specific_tags_opt ::= */ case 160: /* tags_def_opt ::= */ yytestcase(yyruleno==160); - case 401: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==401); - case 418: /* group_by_clause_opt ::= */ yytestcase(yyruleno==418); - case 430: /* order_by_clause_opt ::= */ yytestcase(yyruleno==430); -{ yymsp[1].minor.yy670 = NULL; } + case 402: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==402); + case 419: /* group_by_clause_opt ::= */ yytestcase(yyruleno==419); + case 431: /* order_by_clause_opt ::= */ yytestcase(yyruleno==431); +{ yymsp[1].minor.yy60 = NULL; } break; case 130: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy670 = yymsp[-1].minor.yy670; } +{ yymsp[-2].minor.yy60 = yymsp[-1].minor.yy60; } break; case 131: /* full_table_name ::= table_name */ -{ yylhsminor.yy686 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy113, NULL); } - yymsp[0].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy105, NULL); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; case 132: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy686 = createRealTableNode(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113, NULL); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createRealTableNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105, NULL); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 135: /* column_def ::= column_name type_name */ -{ yylhsminor.yy686 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy113, yymsp[0].minor.yy490, NULL); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248, NULL); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; case 136: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy686 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy113, yymsp[-2].minor.yy490, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-2].minor.yy248, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; case 137: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 138: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 139: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 140: /* type_name ::= INT */ case 141: /* type_name ::= INTEGER */ yytestcase(yyruleno==141); -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_INT); } break; case 142: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 143: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 144: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 145: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy490 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 146: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 147: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy490 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 148: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy490 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 149: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy490 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 150: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy490 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 151: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy490 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 152: /* type_name ::= JSON */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 153: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy490 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 154: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 155: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 156: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy490 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 157: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy490 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 158: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy490 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 159: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy490 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 161: /* tags_def_opt ::= tags_def */ - case 337: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==337); - case 392: /* select_list ::= select_sublist */ yytestcase(yyruleno==392); -{ yylhsminor.yy670 = yymsp[0].minor.yy670; } - yymsp[0].minor.yy670 = yylhsminor.yy670; + case 338: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==338); + case 393: /* select_list ::= select_sublist */ yytestcase(yyruleno==393); +{ yylhsminor.yy60 = yymsp[0].minor.yy60; } + yymsp[0].minor.yy60 = yylhsminor.yy60; break; case 162: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy670 = yymsp[-1].minor.yy670; } +{ yymsp[-3].minor.yy60 = yymsp[-1].minor.yy60; } break; case 163: /* table_options ::= */ -{ yymsp[1].minor.yy686 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy172 = createDefaultTableOptions(pCxt); } break; case 164: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy686 = setTableOption(pCxt, yymsp[-2].minor.yy686, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 165: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */ -{ yylhsminor.yy686 = setTableOption(pCxt, yymsp[-2].minor.yy686, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 166: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ -{ yylhsminor.yy686 = setTableOption(pCxt, yymsp[-4].minor.yy686, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy670); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-4].minor.yy172, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy60); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 167: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy686 = setTableOption(pCxt, yymsp[-2].minor.yy686, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-2].minor.yy172, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 168: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy686 = setTableOption(pCxt, yymsp[-4].minor.yy686, TABLE_OPTION_SMA, yymsp[-1].minor.yy670); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-4].minor.yy172, TABLE_OPTION_SMA, yymsp[-1].minor.yy60); } + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; case 169: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy686 = createAlterTableOptions(pCxt); yylhsminor.yy686 = setTableOption(pCxt, yylhsminor.yy686, yymsp[0].minor.yy53.type, &yymsp[0].minor.yy53.val); } - yymsp[0].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createAlterTableOptions(pCxt); yylhsminor.yy172 = setTableOption(pCxt, yylhsminor.yy172, yymsp[0].minor.yy609.type, &yymsp[0].minor.yy609.val); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; case 170: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy686 = setTableOption(pCxt, yymsp[-1].minor.yy686, yymsp[0].minor.yy53.type, &yymsp[0].minor.yy53.val); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setTableOption(pCxt, yymsp[-1].minor.yy172, yymsp[0].minor.yy609.type, &yymsp[0].minor.yy609.val); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; case 171: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy53.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 172: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy53.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy53.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy609.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy609.val = yymsp[0].minor.yy0; } break; case 175: /* col_name ::= column_name */ -{ yylhsminor.yy686 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy113); } - yymsp[0].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy105); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; case 176: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); } @@ -4147,13 +3683,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); } break; case 179: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy686, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); } break; case 180: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy686, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); } break; case 181: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy686, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy172, NULL); } break; case 182: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); } @@ -4168,7 +3704,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); } break; case 186: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy686, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); } break; case 187: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); } @@ -4187,13 +3723,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); } break; case 193: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy105); } break; case 194: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy172); } break; case 195: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy172); } break; case 196: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); } @@ -4221,139 +3757,139 @@ static YYACTIONTYPE yy_reduce( break; case 204: /* db_name_cond_opt ::= */ case 209: /* from_db_opt ::= */ yytestcase(yyruleno==209); -{ yymsp[1].minor.yy686 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy172 = createDefaultDatabaseCondValue(pCxt); } break; case 205: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy113); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy105); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; case 206: /* like_pattern_opt ::= */ case 217: /* index_options ::= */ yytestcase(yyruleno==217); case 246: /* into_opt ::= */ yytestcase(yyruleno==246); - case 399: /* where_clause_opt ::= */ yytestcase(yyruleno==399); - case 403: /* twindow_clause_opt ::= */ yytestcase(yyruleno==403); - case 408: /* sliding_opt ::= */ yytestcase(yyruleno==408); - case 410: /* fill_opt ::= */ yytestcase(yyruleno==410); - case 422: /* having_clause_opt ::= */ yytestcase(yyruleno==422); - case 432: /* slimit_clause_opt ::= */ yytestcase(yyruleno==432); - case 436: /* limit_clause_opt ::= */ yytestcase(yyruleno==436); -{ yymsp[1].minor.yy686 = NULL; } + case 400: /* where_clause_opt ::= */ yytestcase(yyruleno==400); + case 404: /* twindow_clause_opt ::= */ yytestcase(yyruleno==404); + case 409: /* sliding_opt ::= */ yytestcase(yyruleno==409); + case 411: /* fill_opt ::= */ yytestcase(yyruleno==411); + case 423: /* having_clause_opt ::= */ yytestcase(yyruleno==423); + case 433: /* slimit_clause_opt ::= */ yytestcase(yyruleno==433); + case 437: /* limit_clause_opt ::= */ yytestcase(yyruleno==437); +{ yymsp[1].minor.yy172 = NULL; } break; case 207: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 208: /* table_name_cond ::= table_name */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy113); } - yymsp[0].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy105); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; case 210: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy113); } +{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy105); } break; case 213: /* func_name ::= function_name */ -{ yylhsminor.yy686 = createFunctionNode(pCxt, &yymsp[0].minor.yy113, NULL); } - yymsp[0].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createFunctionNode(pCxt, &yymsp[0].minor.yy105, NULL); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; case 214: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy131, &yymsp[-3].minor.yy113, &yymsp[-1].minor.yy113, NULL, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy105, &yymsp[-1].minor.yy105, NULL, yymsp[0].minor.yy172); } break; case 215: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy131, &yymsp[-5].minor.yy113, &yymsp[-3].minor.yy113, yymsp[-1].minor.yy670, NULL); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy617, &yymsp[-5].minor.yy105, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60, NULL); } break; case 216: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy131, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy617, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); } break; case 218: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ -{ yymsp[-8].minor.yy686 = createIndexOption(pCxt, yymsp[-6].minor.yy670, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), NULL, yymsp[0].minor.yy686); } +{ yymsp[-8].minor.yy172 = createIndexOption(pCxt, yymsp[-6].minor.yy60, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), NULL, yymsp[0].minor.yy172); } break; case 219: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ -{ yymsp[-10].minor.yy686 = createIndexOption(pCxt, yymsp[-8].minor.yy670, releaseRawExprNode(pCxt, yymsp[-4].minor.yy686), releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), yymsp[0].minor.yy686); } +{ yymsp[-10].minor.yy172 = createIndexOption(pCxt, yymsp[-8].minor.yy60, releaseRawExprNode(pCxt, yymsp[-4].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), yymsp[0].minor.yy172); } break; case 222: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy686 = createFunctionNode(pCxt, &yymsp[-3].minor.yy113, yymsp[-1].minor.yy670); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = createFunctionNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; case 223: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy131, &yymsp[-2].minor.yy113, yymsp[0].minor.yy686, NULL, NULL); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy617, &yymsp[-2].minor.yy105, yymsp[0].minor.yy172, NULL, NULL); } break; case 224: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy131, &yymsp[-3].minor.yy113, NULL, &yymsp[0].minor.yy113, NULL); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy105, NULL, &yymsp[0].minor.yy105, NULL); } break; case 225: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy131, &yymsp[-3].minor.yy113, NULL, NULL, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy105, NULL, NULL, yymsp[0].minor.yy172); } break; case 226: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy131, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); } break; case 227: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy131, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy617, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105); } break; case 228: /* cmd ::= DESC full_table_name */ case 229: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==229); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy172); } break; case 230: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 231: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy131, yymsp[-1].minor.yy686, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy617, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); } break; case 233: /* analyze_opt ::= ANALYZE */ case 241: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==241); - case 389: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==389); -{ yymsp[0].minor.yy131 = true; } + case 390: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==390); +{ yymsp[0].minor.yy617 = true; } break; case 234: /* explain_options ::= */ -{ yymsp[1].minor.yy686 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy172 = createDefaultExplainOptions(pCxt); } break; case 235: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy686 = setExplainVerbose(pCxt, yymsp[-2].minor.yy686, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setExplainVerbose(pCxt, yymsp[-2].minor.yy172, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 236: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy686 = setExplainRatio(pCxt, yymsp[-2].minor.yy686, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ yylhsminor.yy172 = setExplainRatio(pCxt, yymsp[-2].minor.yy172, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 237: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ -{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy670); } +{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy60); } break; case 238: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy131, yymsp[-8].minor.yy131, &yymsp[-5].minor.yy113, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy490, yymsp[0].minor.yy550); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy617, yymsp[-8].minor.yy617, &yymsp[-5].minor.yy105, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy248, yymsp[0].minor.yy140); } break; case 239: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy131, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); } break; case 242: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy550 = 0; } +{ yymsp[1].minor.yy140 = 0; } break; case 243: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy550 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy140 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 244: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy131, &yymsp[-4].minor.yy113, yymsp[-2].minor.yy686, yymsp[-3].minor.yy686, yymsp[0].minor.yy686); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy617, &yymsp[-4].minor.yy105, yymsp[-2].minor.yy172, yymsp[-3].minor.yy172, yymsp[0].minor.yy172); } break; case 245: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy131, &yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy105); } break; case 247: /* into_opt ::= INTO full_table_name */ - case 370: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==370); - case 400: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==400); - case 423: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==423); -{ yymsp[-1].minor.yy686 = yymsp[0].minor.yy686; } + case 371: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==371); + case 401: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==401); + case 424: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==424); +{ yymsp[-1].minor.yy172 = yymsp[0].minor.yy172; } break; case 248: /* stream_options ::= */ -{ yymsp[1].minor.yy686 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy172 = createStreamOptions(pCxt); } break; case 249: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy686)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy686 = yymsp[-2].minor.yy686; } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ ((SStreamOptions*)yymsp[-2].minor.yy172)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy172 = yymsp[-2].minor.yy172; } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 250: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy686)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy686 = yymsp[-2].minor.yy686; } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ ((SStreamOptions*)yymsp[-2].minor.yy172)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy172 = yymsp[-2].minor.yy172; } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 251: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy686)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy686); yylhsminor.yy686 = yymsp[-2].minor.yy686; } - yymsp[-2].minor.yy686 = yylhsminor.yy686; +{ ((SStreamOptions*)yymsp[-2].minor.yy172)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy172); yylhsminor.yy172 = yymsp[-2].minor.yy172; } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; case 252: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } @@ -4368,527 +3904,530 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; case 256: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy670); } +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy60); } break; case 257: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; case 258: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy670 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +{ yymsp[-1].minor.yy60 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; case 260: /* cmd ::= SYNCDB db_name REPLICA */ -{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy113); } - break; - case 262: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 263: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 264: /* literal ::= NK_STRING */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 265: /* literal ::= NK_BOOL */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 266: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; - break; - case 267: /* literal ::= duration_literal */ - case 277: /* signed_literal ::= signed */ yytestcase(yyruleno==277); - case 297: /* expression ::= literal */ yytestcase(yyruleno==297); - case 298: /* expression ::= pseudo_column */ yytestcase(yyruleno==298); - case 299: /* expression ::= column_reference */ yytestcase(yyruleno==299); - case 300: /* expression ::= function_expression */ yytestcase(yyruleno==300); - case 301: /* expression ::= subquery */ yytestcase(yyruleno==301); - case 326: /* function_expression ::= literal_func */ yytestcase(yyruleno==326); - case 362: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==362); - case 366: /* boolean_primary ::= predicate */ yytestcase(yyruleno==366); - case 368: /* common_expression ::= expression */ yytestcase(yyruleno==368); - case 369: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==369); - case 371: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==371); - case 373: /* table_reference ::= table_primary */ yytestcase(yyruleno==373); - case 374: /* table_reference ::= joined_table */ yytestcase(yyruleno==374); - case 378: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==378); - case 425: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==425); - case 428: /* query_primary ::= query_specification */ yytestcase(yyruleno==428); -{ yylhsminor.yy686 = yymsp[0].minor.yy686; } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 268: /* literal ::= NULL */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 269: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 270: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 271: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 272: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - break; - case 273: /* signed ::= NK_MINUS NK_INTEGER */ +{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy105); } + break; + case 261: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); } + break; + case 263: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 264: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 265: /* literal ::= NK_STRING */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 266: /* literal ::= NK_BOOL */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 267: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; + break; + case 268: /* literal ::= duration_literal */ + case 278: /* signed_literal ::= signed */ yytestcase(yyruleno==278); + case 298: /* expression ::= literal */ yytestcase(yyruleno==298); + case 299: /* expression ::= pseudo_column */ yytestcase(yyruleno==299); + case 300: /* expression ::= column_reference */ yytestcase(yyruleno==300); + case 301: /* expression ::= function_expression */ yytestcase(yyruleno==301); + case 302: /* expression ::= subquery */ yytestcase(yyruleno==302); + case 327: /* function_expression ::= literal_func */ yytestcase(yyruleno==327); + case 363: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==363); + case 367: /* boolean_primary ::= predicate */ yytestcase(yyruleno==367); + case 369: /* common_expression ::= expression */ yytestcase(yyruleno==369); + case 370: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==370); + case 372: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==372); + case 374: /* table_reference ::= table_primary */ yytestcase(yyruleno==374); + case 375: /* table_reference ::= joined_table */ yytestcase(yyruleno==375); + case 379: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==379); + case 426: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==426); + case 429: /* query_primary ::= query_specification */ yytestcase(yyruleno==429); +{ yylhsminor.yy172 = yymsp[0].minor.yy172; } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 269: /* literal ::= NULL */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 270: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 271: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 272: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 273: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + break; + case 274: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 274: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy686 = yylhsminor.yy686; + case 275: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; - case 275: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 276: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 276: /* signed ::= NK_MINUS NK_FLOAT */ + case 277: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 278: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy686 = yylhsminor.yy686; + case 279: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; - case 279: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy686 = yylhsminor.yy686; + case 280: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; - case 280: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 281: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 281: /* signed_literal ::= duration_literal */ - case 283: /* signed_literal ::= literal_func */ yytestcase(yyruleno==283); - case 340: /* star_func_para ::= expression */ yytestcase(yyruleno==340); - case 395: /* select_item ::= common_expression */ yytestcase(yyruleno==395); - case 441: /* search_condition ::= common_expression */ yytestcase(yyruleno==441); -{ yylhsminor.yy686 = releaseRawExprNode(pCxt, yymsp[0].minor.yy686); } - yymsp[0].minor.yy686 = yylhsminor.yy686; + case 282: /* signed_literal ::= duration_literal */ + case 284: /* signed_literal ::= literal_func */ yytestcase(yyruleno==284); + case 341: /* star_func_para ::= expression */ yytestcase(yyruleno==341); + case 396: /* select_item ::= common_expression */ yytestcase(yyruleno==396); + case 442: /* search_condition ::= common_expression */ yytestcase(yyruleno==442); +{ yylhsminor.yy172 = releaseRawExprNode(pCxt, yymsp[0].minor.yy172); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; - case 282: /* signed_literal ::= NULL */ -{ yylhsminor.yy686 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy686 = yylhsminor.yy686; + case 283: /* signed_literal ::= NULL */ +{ yylhsminor.yy172 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy172 = yylhsminor.yy172; break; - case 302: /* expression ::= NK_LP expression NK_RP */ - case 367: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==367); -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy686)); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 303: /* expression ::= NK_LP expression NK_RP */ + case 368: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==368); +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 303: /* expression ::= NK_PLUS expression */ + case 304: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy686)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 304: /* expression ::= NK_MINUS expression */ + case 305: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy686), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), NULL)); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 305: /* expression ::= expression NK_PLUS expression */ + case 306: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 306: /* expression ::= expression NK_MINUS expression */ + case 307: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 307: /* expression ::= expression NK_STAR expression */ + case 308: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 308: /* expression ::= expression NK_SLASH expression */ + case 309: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 309: /* expression ::= expression NK_REM expression */ + case 310: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 310: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 311: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; - break; - case 311: /* expression_list ::= expression */ -{ yylhsminor.yy670 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy686)); } - yymsp[0].minor.yy670 = yylhsminor.yy670; - break; - case 312: /* expression_list ::= expression_list NK_COMMA expression */ -{ yylhsminor.yy670 = addNodeToList(pCxt, yymsp[-2].minor.yy670, releaseRawExprNode(pCxt, yymsp[0].minor.yy686)); } - yymsp[-2].minor.yy670 = yylhsminor.yy670; - break; - case 313: /* column_reference ::= column_name */ -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy113, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy113)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 314: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113, createColumnNode(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy113)); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; - break; - case 315: /* pseudo_column ::= ROWTS */ - case 316: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==316); - case 318: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==318); - case 319: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==319); - case 320: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==320); - case 321: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==321); - case 322: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==322); - case 328: /* literal_func ::= NOW */ yytestcase(yyruleno==328); -{ yylhsminor.yy686 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy686 = yylhsminor.yy686; - break; - case 317: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy113)))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; - break; - case 323: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 324: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==324); -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy113, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy113, yymsp[-1].minor.yy670)); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; - break; - case 325: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy686), yymsp[-1].minor.yy490)); } - yymsp[-5].minor.yy686 = yylhsminor.yy686; - break; - case 327: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy113, NULL)); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; - break; - case 336: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy670 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy670 = yylhsminor.yy670; - break; - case 341: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 398: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==398); -{ yylhsminor.yy686 = createColumnNode(pCxt, &yymsp[-2].minor.yy113, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; - break; - case 342: /* predicate ::= expression compare_op expression */ - case 347: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==347); + yymsp[-2].minor.yy172 = yylhsminor.yy172; + break; + case 312: /* expression_list ::= expression */ +{ yylhsminor.yy60 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); } + yymsp[0].minor.yy60 = yylhsminor.yy60; + break; + case 313: /* expression_list ::= expression_list NK_COMMA expression */ +{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); } + yymsp[-2].minor.yy60 = yylhsminor.yy60; + break; + case 314: /* column_reference ::= column_name */ +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy105, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy105)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 315: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105, createColumnNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105)); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; + break; + case 316: /* pseudo_column ::= ROWTS */ + case 317: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==317); + case 319: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==319); + case 320: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==320); + case 321: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==321); + case 322: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==322); + case 323: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==323); + case 329: /* literal_func ::= NOW */ yytestcase(yyruleno==329); +{ yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy172 = yylhsminor.yy172; + break; + case 318: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy105)))); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; + break; + case 324: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 325: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==325); +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60)); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; + break; + case 326: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), yymsp[-1].minor.yy248)); } + yymsp[-5].minor.yy172 = yylhsminor.yy172; + break; + case 328: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy105, NULL)); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; + break; + case 337: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy60 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy60 = yylhsminor.yy60; + break; + case 342: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 399: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==399); +{ yylhsminor.yy172 = createColumnNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; + break; + case 343: /* predicate ::= expression compare_op expression */ + case 348: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==348); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy632, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy572, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 343: /* predicate ::= expression BETWEEN expression AND expression */ + case 344: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy686), releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-4].minor.yy686 = yylhsminor.yy686; + yymsp[-4].minor.yy172 = yylhsminor.yy172; break; - case 344: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 345: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy686), releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-5].minor.yy686 = yylhsminor.yy686; + yymsp[-5].minor.yy172 = yylhsminor.yy172; break; - case 345: /* predicate ::= expression IS NULL */ + case 346: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), NULL)); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 346: /* predicate ::= expression IS NOT NULL */ + case 347: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy686), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), NULL)); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; - case 348: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy632 = OP_TYPE_LOWER_THAN; } + case 349: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy572 = OP_TYPE_LOWER_THAN; } break; - case 349: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy632 = OP_TYPE_GREATER_THAN; } + case 350: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy572 = OP_TYPE_GREATER_THAN; } break; - case 350: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy632 = OP_TYPE_LOWER_EQUAL; } + case 351: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy572 = OP_TYPE_LOWER_EQUAL; } break; - case 351: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy632 = OP_TYPE_GREATER_EQUAL; } + case 352: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy572 = OP_TYPE_GREATER_EQUAL; } break; - case 352: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy632 = OP_TYPE_NOT_EQUAL; } + case 353: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy572 = OP_TYPE_NOT_EQUAL; } break; - case 353: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy632 = OP_TYPE_EQUAL; } + case 354: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy572 = OP_TYPE_EQUAL; } break; - case 354: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy632 = OP_TYPE_LIKE; } + case 355: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy572 = OP_TYPE_LIKE; } break; - case 355: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy632 = OP_TYPE_NOT_LIKE; } + case 356: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy572 = OP_TYPE_NOT_LIKE; } break; - case 356: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy632 = OP_TYPE_MATCH; } + case 357: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy572 = OP_TYPE_MATCH; } break; - case 357: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy632 = OP_TYPE_NMATCH; } + case 358: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy572 = OP_TYPE_NMATCH; } break; - case 358: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy632 = OP_TYPE_JSON_CONTAINS; } + case 359: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy572 = OP_TYPE_JSON_CONTAINS; } break; - case 359: /* in_op ::= IN */ -{ yymsp[0].minor.yy632 = OP_TYPE_IN; } + case 360: /* in_op ::= IN */ +{ yymsp[0].minor.yy572 = OP_TYPE_IN; } break; - case 360: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy632 = OP_TYPE_NOT_IN; } + case 361: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy572 = OP_TYPE_NOT_IN; } break; - case 361: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy670)); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 362: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy60)); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 363: /* boolean_value_expression ::= NOT boolean_primary */ + case 364: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy686), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), NULL)); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 364: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 365: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 365: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 366: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy686); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy686); - yylhsminor.yy686 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172); + yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 372: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy686 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy686, yymsp[0].minor.yy686, NULL); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 373: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy172 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy172, yymsp[0].minor.yy172, NULL); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 375: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy686 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + case 376: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy172 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 376: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy686 = createRealTableNode(pCxt, &yymsp[-3].minor.yy113, &yymsp[-1].minor.yy113, &yymsp[0].minor.yy113); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; + case 377: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy172 = createRealTableNode(pCxt, &yymsp[-3].minor.yy105, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; - case 377: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy686 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy686), &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + case 378: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy172 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172), &yymsp[0].minor.yy105); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 379: /* alias_opt ::= */ -{ yymsp[1].minor.yy113 = nil_token; } + case 380: /* alias_opt ::= */ +{ yymsp[1].minor.yy105 = nil_token; } break; - case 380: /* alias_opt ::= table_alias */ -{ yylhsminor.yy113 = yymsp[0].minor.yy113; } - yymsp[0].minor.yy113 = yylhsminor.yy113; + case 381: /* alias_opt ::= table_alias */ +{ yylhsminor.yy105 = yymsp[0].minor.yy105; } + yymsp[0].minor.yy105 = yylhsminor.yy105; break; - case 381: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy113 = yymsp[0].minor.yy113; } + case 382: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy105 = yymsp[0].minor.yy105; } break; - case 382: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 383: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==383); -{ yymsp[-2].minor.yy686 = yymsp[-1].minor.yy686; } + case 383: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 384: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==384); +{ yymsp[-2].minor.yy172 = yymsp[-1].minor.yy172; } break; - case 384: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy686 = createJoinTableNode(pCxt, yymsp[-4].minor.yy120, yymsp[-5].minor.yy686, yymsp[-2].minor.yy686, yymsp[0].minor.yy686); } - yymsp[-5].minor.yy686 = yylhsminor.yy686; + case 385: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy172 = createJoinTableNode(pCxt, yymsp[-4].minor.yy636, yymsp[-5].minor.yy172, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); } + yymsp[-5].minor.yy172 = yylhsminor.yy172; break; - case 385: /* join_type ::= */ -{ yymsp[1].minor.yy120 = JOIN_TYPE_INNER; } + case 386: /* join_type ::= */ +{ yymsp[1].minor.yy636 = JOIN_TYPE_INNER; } break; - case 386: /* join_type ::= INNER */ -{ yymsp[0].minor.yy120 = JOIN_TYPE_INNER; } + case 387: /* join_type ::= INNER */ +{ yymsp[0].minor.yy636 = JOIN_TYPE_INNER; } break; - case 387: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 388: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-8].minor.yy686 = createSelectStmt(pCxt, yymsp[-7].minor.yy131, yymsp[-6].minor.yy670, yymsp[-5].minor.yy686); - yymsp[-8].minor.yy686 = addWhereClause(pCxt, yymsp[-8].minor.yy686, yymsp[-4].minor.yy686); - yymsp[-8].minor.yy686 = addPartitionByClause(pCxt, yymsp[-8].minor.yy686, yymsp[-3].minor.yy670); - yymsp[-8].minor.yy686 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy686, yymsp[-2].minor.yy686); - yymsp[-8].minor.yy686 = addGroupByClause(pCxt, yymsp[-8].minor.yy686, yymsp[-1].minor.yy670); - yymsp[-8].minor.yy686 = addHavingClause(pCxt, yymsp[-8].minor.yy686, yymsp[0].minor.yy686); + yymsp[-8].minor.yy172 = createSelectStmt(pCxt, yymsp[-7].minor.yy617, yymsp[-6].minor.yy60, yymsp[-5].minor.yy172); + yymsp[-8].minor.yy172 = addWhereClause(pCxt, yymsp[-8].minor.yy172, yymsp[-4].minor.yy172); + yymsp[-8].minor.yy172 = addPartitionByClause(pCxt, yymsp[-8].minor.yy172, yymsp[-3].minor.yy60); + yymsp[-8].minor.yy172 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy172, yymsp[-2].minor.yy172); + yymsp[-8].minor.yy172 = addGroupByClause(pCxt, yymsp[-8].minor.yy172, yymsp[-1].minor.yy60); + yymsp[-8].minor.yy172 = addHavingClause(pCxt, yymsp[-8].minor.yy172, yymsp[0].minor.yy172); } break; - case 390: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy131 = false; } + case 391: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy617 = false; } break; - case 391: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy670 = NULL; } + case 392: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy60 = NULL; } break; - case 396: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy686 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy686), &yymsp[0].minor.yy113); } - yymsp[-1].minor.yy686 = yylhsminor.yy686; + case 397: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172), &yymsp[0].minor.yy105); } + yymsp[-1].minor.yy172 = yylhsminor.yy172; break; - case 397: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy686 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), &yymsp[0].minor.yy113); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 398: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), &yymsp[0].minor.yy105); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 402: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 419: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==419); - case 431: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==431); -{ yymsp[-2].minor.yy670 = yymsp[0].minor.yy670; } + case 403: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 420: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==420); + case 432: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==432); +{ yymsp[-2].minor.yy60 = yymsp[0].minor.yy60; } break; - case 404: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy686 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy686), releaseRawExprNode(pCxt, yymsp[-1].minor.yy686)); } + case 405: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy172 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); } break; - case 405: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy686 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy686)); } + case 406: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy172 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); } break; - case 406: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy686 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy686), NULL, yymsp[-1].minor.yy686, yymsp[0].minor.yy686); } + case 407: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy172 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), NULL, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); } break; - case 407: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy686 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy686), releaseRawExprNode(pCxt, yymsp[-3].minor.yy686), yymsp[-1].minor.yy686, yymsp[0].minor.yy686); } + case 408: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy172 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy172), releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), yymsp[-1].minor.yy172, yymsp[0].minor.yy172); } break; - case 409: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy686 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy686); } + case 410: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ +{ yymsp[-3].minor.yy172 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy172); } break; - case 411: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy686 = createFillNode(pCxt, yymsp[-1].minor.yy522, NULL); } + case 412: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy172 = createFillNode(pCxt, yymsp[-1].minor.yy202, NULL); } break; - case 412: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy686 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy670)); } + case 413: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy172 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy60)); } break; - case 413: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy522 = FILL_MODE_NONE; } + case 414: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy202 = FILL_MODE_NONE; } break; - case 414: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy522 = FILL_MODE_PREV; } + case 415: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy202 = FILL_MODE_PREV; } break; - case 415: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy522 = FILL_MODE_NULL; } + case 416: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy202 = FILL_MODE_NULL; } break; - case 416: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy522 = FILL_MODE_LINEAR; } + case 417: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy202 = FILL_MODE_LINEAR; } break; - case 417: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy522 = FILL_MODE_NEXT; } + case 418: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy202 = FILL_MODE_NEXT; } break; - case 420: /* group_by_list ::= expression */ -{ yylhsminor.yy670 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); } - yymsp[0].minor.yy670 = yylhsminor.yy670; + case 421: /* group_by_list ::= expression */ +{ yylhsminor.yy60 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } + yymsp[0].minor.yy60 = yylhsminor.yy60; break; - case 421: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy670 = addNodeToList(pCxt, yymsp[-2].minor.yy670, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy686))); } - yymsp[-2].minor.yy670 = yylhsminor.yy670; + case 422: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); } + yymsp[-2].minor.yy60 = yylhsminor.yy60; break; - case 424: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 425: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy686 = addOrderByClause(pCxt, yymsp[-3].minor.yy686, yymsp[-2].minor.yy670); - yylhsminor.yy686 = addSlimitClause(pCxt, yylhsminor.yy686, yymsp[-1].minor.yy686); - yylhsminor.yy686 = addLimitClause(pCxt, yylhsminor.yy686, yymsp[0].minor.yy686); + yylhsminor.yy172 = addOrderByClause(pCxt, yymsp[-3].minor.yy172, yymsp[-2].minor.yy60); + yylhsminor.yy172 = addSlimitClause(pCxt, yylhsminor.yy172, yymsp[-1].minor.yy172); + yylhsminor.yy172 = addLimitClause(pCxt, yylhsminor.yy172, yymsp[0].minor.yy172); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; - case 426: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy686 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy686, yymsp[0].minor.yy686); } - yymsp[-3].minor.yy686 = yylhsminor.yy686; + case 427: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy172 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy172, yymsp[0].minor.yy172); } + yymsp[-3].minor.yy172 = yylhsminor.yy172; break; - case 427: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy686 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy686, yymsp[0].minor.yy686); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 428: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy172 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 429: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ -{ yymsp[-5].minor.yy686 = yymsp[-4].minor.yy686; } - yy_destructor(yypParser,349,&yymsp[-3].minor); - yy_destructor(yypParser,350,&yymsp[-2].minor); - yy_destructor(yypParser,351,&yymsp[-1].minor); + case 430: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ +{ yymsp[-5].minor.yy172 = yymsp[-4].minor.yy172; } + yy_destructor(yypParser,350,&yymsp[-3].minor); + yy_destructor(yypParser,351,&yymsp[-2].minor); + yy_destructor(yypParser,352,&yymsp[-1].minor); break; - case 433: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 437: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==437); -{ yymsp[-1].minor.yy686 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 434: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 438: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==438); +{ yymsp[-1].minor.yy172 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 434: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 438: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==438); -{ yymsp[-3].minor.yy686 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 435: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 439: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==439); +{ yymsp[-3].minor.yy172 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 435: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 439: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==439); -{ yymsp[-3].minor.yy686 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 436: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 440: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==440); +{ yymsp[-3].minor.yy172 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 440: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy686 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy686); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 441: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy172); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 444: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy686 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy686), yymsp[-1].minor.yy428, yymsp[0].minor.yy109); } - yymsp[-2].minor.yy686 = yylhsminor.yy686; + case 445: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy172 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), yymsp[-1].minor.yy14, yymsp[0].minor.yy17); } + yymsp[-2].minor.yy172 = yylhsminor.yy172; break; - case 445: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy428 = ORDER_ASC; } + case 446: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy14 = ORDER_ASC; } break; - case 446: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy428 = ORDER_ASC; } + case 447: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy14 = ORDER_ASC; } break; - case 447: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy428 = ORDER_DESC; } + case 448: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy14 = ORDER_DESC; } break; - case 448: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } + case 449: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy17 = NULL_ORDER_DEFAULT; } break; - case 449: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } + case 450: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy17 = NULL_ORDER_FIRST; } break; - case 450: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } + case 451: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy17 = NULL_ORDER_LAST; } break; default: break; /********** End reduce actions ************************************************/ }; - assert( yyruleno now - 2d and ts < now - 1d"); +} + +TEST_F(ParserInitialDTest, deleteSemanticCheck) { + useDb("root", "test"); + + run("DELETE FROM t1 WHERE c1 > 10", TSDB_CODE_PAR_INVALID_DELETE_WHERE, PARSER_STAGE_TRANSLATE); +} + // todo desc // todo describe // todo DROP account diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp index e61b060682679d526d47fe8b607573b68b45cb38..154e28a02c7fa88d5ba0f527463f7508af9e023c 100644 --- a/source/libs/parser/test/parSelectTest.cpp +++ b/source/libs/parser/test/parSelectTest.cpp @@ -229,14 +229,14 @@ TEST_F(ParserSelectTest, subquery) { run("SELECT SUM(a) FROM (SELECT MAX(c1) a, _wstartts FROM st1s1 PARTITION BY TBNAME INTERVAL(1m)) INTERVAL(1n)"); } -TEST_F(ParserSelectTest, subquerySemanticError) { +TEST_F(ParserSelectTest, subquerySemanticCheck) { useDb("root", "test"); run("SELECT SUM(a) FROM (SELECT MAX(c1) a FROM st1s1 INTERVAL(1m)) INTERVAL(1n)", TSDB_CODE_PAR_NOT_ALLOWED_WIN_QUERY, PARSER_STAGE_TRANSLATE); } -TEST_F(ParserSelectTest, semanticError) { +TEST_F(ParserSelectTest, semanticCheck) { useDb("root", "test"); // TSDB_CODE_PAR_INVALID_COLUMN diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 1cf7ae22f9eb5e64220ae443d5353df062a148a4..464004ae3bf12ab150837379c57a6c21e2fcbfed 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -21,8 +21,10 @@ typedef struct SLogicPlanContext { SPlanContext* pPlanCxt; } SLogicPlanContext; -typedef int32_t (*FCreateLogicNode)(SLogicPlanContext*, SSelectStmt*, SLogicNode**); +typedef int32_t (*FCreateLogicNode)(SLogicPlanContext*, void*, SLogicNode**); +typedef int32_t (*FCreateSelectLogicNode)(SLogicPlanContext*, SSelectStmt*, SLogicNode**); typedef int32_t (*FCreateSetOpLogicNode)(SLogicPlanContext*, SSetOperator*, SLogicNode**); +typedef int32_t (*FCreateDeleteLogicNode)(SLogicPlanContext*, SDeleteStmt*, SLogicNode**); static int32_t doCreateLogicNodeByTable(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SNode* pTable, SLogicNode** pLogicNode); @@ -119,12 +121,12 @@ static int32_t pushLogicNode(SLogicPlanContext* pCxt, SLogicNode** pOldRoot, SLo return TSDB_CODE_SUCCESS; } -static int32_t createChildLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, FCreateLogicNode func, - SLogicNode** pRoot) { +static int32_t createRootLogicNode(SLogicPlanContext* pCxt, void* pStmt, uint8_t precision, FCreateLogicNode func, + SLogicNode** pRoot) { SLogicNode* pNode = NULL; - int32_t code = func(pCxt, pSelect, &pNode); + int32_t code = func(pCxt, pStmt, &pNode); if (TSDB_CODE_SUCCESS == code && NULL != pNode) { - pNode->precision = pSelect->precision; + pNode->precision = precision; code = pushLogicNode(pCxt, pRoot, pNode); } if (TSDB_CODE_SUCCESS != code) { @@ -133,56 +135,10 @@ static int32_t createChildLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelec return code; } -// typedef struct SCreateColumnCxt { -// int32_t errCode; -// SNodeList* pList; -// } SCreateColumnCxt; - -// static EDealRes doCreateColumn(SNode* pNode, void* pContext) { -// SCreateColumnCxt* pCxt = (SCreateColumnCxt*)pContext; -// switch (nodeType(pNode)) { -// case QUERY_NODE_COLUMN: { -// SNode* pCol = nodesCloneNode(pNode); -// if (NULL == pCol) { -// return DEAL_RES_ERROR; -// } -// return (TSDB_CODE_SUCCESS == nodesListAppend(pCxt->pList, pCol) ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR); -// } -// case QUERY_NODE_OPERATOR: -// case QUERY_NODE_LOGIC_CONDITION: -// case QUERY_NODE_FUNCTION: { -// SExprNode* pExpr = (SExprNode*)pNode; -// SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); -// if (NULL == pCol) { -// return DEAL_RES_ERROR; -// } -// pCol->node.resType = pExpr->resType; -// strcpy(pCol->colName, pExpr->aliasName); -// return (TSDB_CODE_SUCCESS == nodesListAppend(pCxt->pList, pCol) ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR); -// } -// default: -// break; -// } - -// return DEAL_RES_CONTINUE; -// } - -// static int32_t createColumnByRewriteExps(SNodeList* pExprs, SNodeList** pList) { -// SCreateColumnCxt cxt = {.errCode = TSDB_CODE_SUCCESS, .pList = (NULL == *pList ? nodesMakeList() : *pList)}; -// if (NULL == cxt.pList) { -// return TSDB_CODE_OUT_OF_MEMORY; -// } - -// nodesWalkExprs(pExprs, doCreateColumn, &cxt); -// if (TSDB_CODE_SUCCESS != cxt.errCode) { -// nodesDestroyList(cxt.pList); -// return cxt.errCode; -// } -// if (NULL == *pList) { -// *pList = cxt.pList; -// } -// return cxt.errCode; -// } +static int32_t createSelectRootLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, FCreateSelectLogicNode func, + SLogicNode** pRoot) { + return createRootLogicNode(pCxt, pSelect, pSelect->precision, (FCreateLogicNode)func, pRoot); +} static EScanType getScanType(SLogicPlanContext* pCxt, SNodeList* pScanPseudoCols, SNodeList* pScanCols, STableMeta* pMeta) { @@ -783,25 +739,25 @@ static int32_t createSelectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele SLogicNode* pRoot = NULL; int32_t code = createLogicNodeByTable(pCxt, pSelect, pSelect->pFromTable, &pRoot); if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createPartitionLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createPartitionLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createWindowLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createWindowLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createFillLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createFillLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createAggLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createAggLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createDistinctLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createDistinctLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createSortLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createSortLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { - code = createChildLogicNode(pCxt, pSelect, createProjectLogicNode, &pRoot); + code = createSelectRootLogicNode(pCxt, pSelect, createProjectLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { @@ -813,17 +769,9 @@ static int32_t createSelectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele return code; } -static int32_t createSetOpChildLogicNode(SLogicPlanContext* pCxt, SSetOperator* pSetOperator, - FCreateSetOpLogicNode func, SLogicNode** pRoot) { - SLogicNode* pNode = NULL; - int32_t code = func(pCxt, pSetOperator, &pNode); - if (TSDB_CODE_SUCCESS == code && NULL != pNode) { - code = pushLogicNode(pCxt, pRoot, pNode); - } - if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(pNode); - } - return code; +static int32_t createSetOpRootLogicNode(SLogicPlanContext* pCxt, SSetOperator* pSetOperator, FCreateSetOpLogicNode func, + SLogicNode** pRoot) { + return createRootLogicNode(pCxt, pSetOperator, pSetOperator->precision, (FCreateLogicNode)func, pRoot); } static int32_t createSetOpSortLogicNode(SLogicPlanContext* pCxt, SSetOperator* pSetOperator, SLogicNode** pLogicNode) { @@ -970,7 +918,7 @@ static int32_t createSetOperatorLogicNode(SLogicPlanContext* pCxt, SSetOperator* SLogicNode* pRoot = NULL; int32_t code = createSetOpLogicNode(pCxt, pSetOperator, &pRoot); if (TSDB_CODE_SUCCESS == code) { - code = createSetOpChildLogicNode(pCxt, pSetOperator, createSetOpSortLogicNode, &pRoot); + code = createSetOpRootLogicNode(pCxt, pSetOperator, createSetOpSortLogicNode, &pRoot); } if (TSDB_CODE_SUCCESS == code) { @@ -1008,6 +956,43 @@ static int32_t createVnodeModifLogicNode(SLogicPlanContext* pCxt, SVnodeModifOpS return TSDB_CODE_SUCCESS; } +static int32_t createDeleteRootLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDelete, FCreateDeleteLogicNode func, + SLogicNode** pRoot) { + return createRootLogicNode(pCxt, pDelete, pDelete->precision, (FCreateLogicNode)func, pRoot); +} + +static int32_t createDeleteScanLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDelete, SLogicNode** pLogicNode) { + return TSDB_CODE_FAILED; +} + +static int32_t createDeleteAggLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDelete, SLogicNode** pLogicNode) { + return TSDB_CODE_FAILED; +} + +static int32_t createDeleteModifyTableLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDelete, + SLogicNode** pLogicNode) { + return TSDB_CODE_FAILED; +} + +static int32_t createDeleteLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDelete, SLogicNode** pLogicNode) { + SLogicNode* pRoot = NULL; + int32_t code = createDeleteRootLogicNode(pCxt, pDelete, createDeleteScanLogicNode, &pRoot); + if (TSDB_CODE_SUCCESS == code) { + code = createDeleteRootLogicNode(pCxt, pDelete, createDeleteAggLogicNode, &pRoot); + } + if (TSDB_CODE_SUCCESS == code) { + code = createDeleteRootLogicNode(pCxt, pDelete, createDeleteModifyTableLogicNode, &pRoot); + } + + if (TSDB_CODE_SUCCESS == code) { + *pLogicNode = pRoot; + } else { + nodesDestroyNode(pRoot); + } + + return code; +} + static int32_t createQueryLogicNode(SLogicPlanContext* pCxt, SNode* pStmt, SLogicNode** pLogicNode) { switch (nodeType(pStmt)) { case QUERY_NODE_SELECT_STMT: @@ -1018,6 +1003,8 @@ static int32_t createQueryLogicNode(SLogicPlanContext* pCxt, SNode* pStmt, SLogi return createQueryLogicNode(pCxt, ((SExplainStmt*)pStmt)->pQuery, pLogicNode); case QUERY_NODE_SET_OPERATOR: return createSetOperatorLogicNode(pCxt, (SSetOperator*)pStmt, pLogicNode); + case QUERY_NODE_DELETE_STMT: + return createDeleteLogicNode(pCxt, (SDeleteStmt*)pStmt, pLogicNode); default: break; } diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 5f88fc40e54c5e000a6e4506b30a2063acfbc8f1..873102e997dcca95c049be354a57f0a2c41c1623 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -268,30 +268,6 @@ static int32_t cpdMergeCond(SNode** pDst, SNode** pSrc) { return code; } -static int32_t cpdMergeConds(SNode** pDst, SNodeList** pSrc) { - if (NULL == *pSrc) { - return TSDB_CODE_SUCCESS; - } - - if (1 == LIST_LENGTH(*pSrc)) { - *pDst = nodesListGetNode(*pSrc, 0); - nodesClearList(*pSrc); - } else { - SLogicConditionNode* pLogicCond = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); - if (NULL == pLogicCond) { - return TSDB_CODE_OUT_OF_MEMORY; - } - pLogicCond->node.resType.type = TSDB_DATA_TYPE_BOOL; - pLogicCond->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes; - pLogicCond->condType = LOGIC_COND_TYPE_AND; - pLogicCond->pParameterList = *pSrc; - *pDst = (SNode*)pLogicCond; - } - *pSrc = NULL; - - return TSDB_CODE_SUCCESS; -} - static int32_t cpdCondAppend(SNode** pCond, SNode** pAdditionalCond) { if (NULL == *pCond) { TSWAP(*pCond, *pAdditionalCond); @@ -310,119 +286,6 @@ static int32_t cpdCondAppend(SNode** pCond, SNode** pAdditionalCond) { return code; } -static EDealRes cpdIsPrimaryKeyCondImpl(SNode* pNode, void* pContext) { - if (QUERY_NODE_COLUMN == nodeType(pNode)) { - *((bool*)pContext) = ((PRIMARYKEY_TIMESTAMP_COL_ID == ((SColumnNode*)pNode)->colId) ? true : false); - return *((bool*)pContext) ? DEAL_RES_CONTINUE : DEAL_RES_END; - } - return DEAL_RES_CONTINUE; -} - -static bool cpdIsPrimaryKeyCond(SNode* pNode) { - if (QUERY_NODE_LOGIC_CONDITION == nodeType(pNode)) { - return false; - } - bool isPrimaryKeyCond = false; - nodesWalkExpr(pNode, cpdIsPrimaryKeyCondImpl, &isPrimaryKeyCond); - return isPrimaryKeyCond; -} - -static EDealRes cpdIsTagCondImpl(SNode* pNode, void* pContext) { - if (QUERY_NODE_COLUMN == nodeType(pNode)) { - *((bool*)pContext) = ((COLUMN_TYPE_TAG == ((SColumnNode*)pNode)->colType) ? true : false); - return *((bool*)pContext) ? DEAL_RES_CONTINUE : DEAL_RES_END; - } - return DEAL_RES_CONTINUE; -} - -static bool cpdIsTagCond(SNode* pNode) { - if (QUERY_NODE_LOGIC_CONDITION == nodeType(pNode)) { - return false; - } - bool isTagCond = false; - nodesWalkExpr(pNode, cpdIsTagCondImpl, &isTagCond); - return isTagCond; -} - -static int32_t cpdPartitionScanLogicCond(SScanLogicNode* pScan, SNode** pPrimaryKeyCond, SNode** pTagCond, - SNode** pOtherCond) { - SLogicConditionNode* pLogicCond = (SLogicConditionNode*)pScan->node.pConditions; - - if (LOGIC_COND_TYPE_AND != pLogicCond->condType) { - *pPrimaryKeyCond = NULL; - *pOtherCond = pScan->node.pConditions; - pScan->node.pConditions = NULL; - return TSDB_CODE_SUCCESS; - } - - int32_t code = TSDB_CODE_SUCCESS; - - SNodeList* pPrimaryKeyConds = NULL; - SNodeList* pTagConds = NULL; - SNodeList* pOtherConds = NULL; - SNode* pCond = NULL; - FOREACH(pCond, pLogicCond->pParameterList) { - if (cpdIsPrimaryKeyCond(pCond)) { - code = nodesListMakeAppend(&pPrimaryKeyConds, nodesCloneNode(pCond)); - } else if (cpdIsTagCond(pScan->node.pConditions)) { - code = nodesListMakeAppend(&pTagConds, nodesCloneNode(pCond)); - } else { - code = nodesListMakeAppend(&pOtherConds, nodesCloneNode(pCond)); - } - if (TSDB_CODE_SUCCESS != code) { - break; - } - } - - SNode* pTempPrimaryKeyCond = NULL; - SNode* pTempTagCond = NULL; - SNode* pTempOtherCond = NULL; - if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempPrimaryKeyCond, &pPrimaryKeyConds); - } - if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempTagCond, &pTagConds); - } - if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempOtherCond, &pOtherConds); - } - - if (TSDB_CODE_SUCCESS == code) { - *pPrimaryKeyCond = pTempPrimaryKeyCond; - *pTagCond = pTempTagCond; - *pOtherCond = pTempOtherCond; - nodesDestroyNode(pScan->node.pConditions); - pScan->node.pConditions = NULL; - } else { - nodesDestroyList(pPrimaryKeyConds); - nodesDestroyList(pTagConds); - nodesDestroyList(pOtherConds); - nodesDestroyNode(pTempPrimaryKeyCond); - nodesDestroyNode(pTempTagCond); - nodesDestroyNode(pTempOtherCond); - } - - return code; -} - -static int32_t cpdPartitionScanCond(SScanLogicNode* pScan, SNode** pPrimaryKeyCond, SNode** pTagCond, - SNode** pOtherCond) { - if (QUERY_NODE_LOGIC_CONDITION == nodeType(pScan->node.pConditions)) { - return cpdPartitionScanLogicCond(pScan, pPrimaryKeyCond, pTagCond, pOtherCond); - } - - if (cpdIsPrimaryKeyCond(pScan->node.pConditions)) { - *pPrimaryKeyCond = pScan->node.pConditions; - } else if (cpdIsTagCond(pScan->node.pConditions)) { - *pTagCond = pScan->node.pConditions; - } else { - *pOtherCond = pScan->node.pConditions; - } - pScan->node.pConditions = NULL; - - return TSDB_CODE_SUCCESS; -} - static int32_t cpdCalcTimeRange(SScanLogicNode* pScan, SNode** pPrimaryKeyCond, SNode** pOtherCond) { bool isStrict = false; int32_t code = filterGetTimeRange(*pPrimaryKeyCond, &pScan->scanRange, &isStrict); @@ -472,7 +335,7 @@ static int32_t cpdOptimizeScanCondition(SOptimizeContext* pCxt, SScanLogicNode* SNode* pPrimaryKeyCond = NULL; SNode* pTagCond = NULL; SNode* pOtherCond = NULL; - int32_t code = cpdPartitionScanCond(pScan, &pPrimaryKeyCond, &pTagCond, &pOtherCond); + int32_t code = nodesPartitionCond(&pScan->node.pConditions, &pPrimaryKeyCond, &pTagCond, &pOtherCond); if (TSDB_CODE_SUCCESS == code && NULL != pPrimaryKeyCond) { code = cpdCalcTimeRange(pScan, &pPrimaryKeyCond, &pOtherCond); } @@ -565,16 +428,16 @@ static int32_t cpdPartitionLogicCond(SJoinLogicNode* pJoin, SNode** pOnCond, SNo SNode* pTempRightChildCond = NULL; SNode* pTempRemainCond = NULL; if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempOnCond, &pOnConds); + code = nodesMergeConds(&pTempOnCond, &pOnConds); } if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempLeftChildCond, &pLeftChildConds); + code = nodesMergeConds(&pTempLeftChildCond, &pLeftChildConds); } if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempRightChildCond, &pRightChildConds); + code = nodesMergeConds(&pTempRightChildCond, &pRightChildConds); } if (TSDB_CODE_SUCCESS == code) { - code = cpdMergeConds(&pTempRemainCond, &pRemainConds); + code = nodesMergeConds(&pTempRemainCond, &pRemainConds); } if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/planner/test/planOptimizeTest.cpp b/source/libs/planner/test/planOptimizeTest.cpp index 4234a1320a433da1184cdca6d5f567fa3a2005c6..84ccea668d55cbcb0edff9920c25faa0ec0b57aa 100644 --- a/source/libs/planner/test/planOptimizeTest.cpp +++ b/source/libs/planner/test/planOptimizeTest.cpp @@ -36,6 +36,10 @@ TEST_F(PlanOptimizeTest, ConditionPushDown) { useDb("root", "test"); run("SELECT ts, c1 FROM st1 WHERE tag1 > 4"); + + run("SELECT ts, c1 FROM st1 WHERE tag1 > 4 or tag1 < 2"); + + run("SELECT ts, c1 FROM st1 WHERE tag1 > 4 AND tag2 = 'hello'"); } TEST_F(PlanOptimizeTest, orderByPrimaryKey) { diff --git a/tests/system-test/1-insert/alter_stable.py b/tests/system-test/1-insert/alter_stable.py new file mode 100644 index 0000000000000000000000000000000000000000..e8c354415237f890c906931e0e75ac735bde5098 --- /dev/null +++ b/tests/system-test/1-insert/alter_stable.py @@ -0,0 +1,144 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import random +import string +from util.log import * +from util.cases import * +from util.sql import * + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor()) + + def get_long_name(self, length, mode="mixed"): + """ + generate long name + mode could be numbers/letters/letters_mixed/mixed + """ + if mode == "numbers": + population = string.digits + elif mode == "letters": + population = string.ascii_letters.lower() + elif mode == "letters_mixed": + population = string.ascii_letters.upper() + string.ascii_letters.lower() + else: + population = string.ascii_letters.lower() + string.digits + return "".join(random.choices(population, k=length)) + def alter_stable_column_check(self,dbname,stbname,tbname): + tdSql.execute(f'create database if not exists {dbname}') + tdSql.execute(f'use {dbname}') + tdSql.execute( + f'create stable {stbname} (ts timestamp, c1 tinyint, c2 smallint, c3 int, \ + c4 bigint, c5 tinyint unsigned, c6 smallint unsigned, c7 int unsigned, c8 bigint unsigned, c9 float, c10 double, c11 bool,c12 binary(20),c13 nchar(20)) tags(t0 int) ') + tdSql.execute(f'create table {tbname} using {stbname} tags(1)') + tdSql.execute(f'insert into {tbname} values (now,1,2,3,4,5,6,7,8,9.9,10.1,true,"abcd","涛思数据")') + tdSql.execute(f'alter stable {stbname} add column c14 int') + tdSql.query(f'select c14 from {stbname}') + tdSql.checkRows(1) + tdSql.execute(f'alter stable {stbname} add column `c15` int') + tdSql.query(f'select c15 from {stbname}') + tdSql.checkRows(1) + tdSql.query(f'describe {stbname}') + tdSql.checkRows(17) + tdSql.execute(f'alter stable {stbname} drop column c14') + tdSql.query(f'describe {stbname}') + tdSql.checkRows(16) + tdSql.execute(f'alter stable {stbname} drop column `c15`') + tdSql.query(f'describe {stbname}') + tdSql.checkRows(15) + tdSql.execute(f'alter stable {stbname} modify column c12 binary(30)') + tdSql.query(f'describe {stbname}') + tdSql.checkData(12,2,30) + tdSql.execute(f'alter stable {stbname} modify column `c12` binary(35)') + tdSql.query(f'describe {stbname}') + tdSql.checkData(12,2,35) + tdSql.error(f'alter stable {stbname} modify column `c12` binary(34)') + tdSql.execute(f'alter stable {stbname} modify column c13 nchar(30)') + tdSql.query(f'describe {stbname}') + tdSql.checkData(13,2,30) + tdSql.error(f'alter stable {stbname} modify column c13 nchar(29)') + tdSql.error(f'alter stable {stbname} rename column c1 c21') + tdSql.error(f'alter stable {stbname} modify column c1 int') + tdSql.error(f'alter stable {stbname} modify column c4 int') + tdSql.error(f'alter stable {stbname} modify column c8 int') + tdSql.error(f'alter stable {stbname} modify column c1 unsigned int') + tdSql.error(f'alter stable {stbname} modify column c9 double') + tdSql.error(f'alter stable {stbname} modify column c10 float') + tdSql.error(f'alter stable {stbname} modify column c11 int') + tdSql.execute(f'drop database {dbname}') + + def alter_stable_tag_check(self,dbname,stbname,tbname): + tdSql.execute(f'create database if not exists {dbname}') + tdSql.execute(f'use {dbname}') + tdSql.execute( + f'create stable {stbname} (ts timestamp, c1 int) tags(ts_tag timestamp, t1 tinyint, t2 smallint, t3 int, \ + t4 bigint, t5 tinyint unsigned, t6 smallint unsigned, t7 int unsigned, t8 bigint unsigned, t9 float, t10 double, t11 bool,t12 binary(20),t13 nchar(20)) ') + tdSql.execute(f'create table {tbname} using {stbname} tags(now,1,2,3,4,5,6,7,8,9.9,10.1,true,"abcd","涛思数据")') + tdSql.execute(f'insert into {tbname} values(now,1)') + + tdSql.execute(f'alter stable {stbname} add tag t14 int') + tdSql.query(f'select t14 from {stbname}') + tdSql.checkRows(1) + tdSql.execute(f'alter stable {stbname} add tag `t15` int') + tdSql.query(f'select t14 from {stbname}') + tdSql.checkRows(1) + tdSql.query(f'describe {stbname}') + tdSql.checkRows(18) + tdSql.execute(f'alter stable {stbname} drop tag t14') + tdSql.query(f'describe {stbname}') + tdSql.checkRows(17) + tdSql.execute(f'alter stable {stbname} drop tag `t15`') + tdSql.query(f'describe {stbname}') + tdSql.checkRows(16) + tdSql.execute(f'alter stable {stbname} modify tag t12 binary(30)') + tdSql.query(f'describe {stbname}') + tdSql.checkData(14,2,30) + tdSql.execute(f'alter stable {stbname} modify tag `t12` binary(35)') + tdSql.query(f'describe {stbname}') + tdSql.checkData(14,2,35) + tdSql.error(f'alter stable {stbname} modify tag `t12` binary(34)') + tdSql.execute(f'alter stable {stbname} modify tag t13 nchar(30)') + tdSql.query(f'describe {stbname}') + tdSql.checkData(15,2,30) + tdSql.error(f'alter stable {stbname} modify tag t13 nchar(29)') + tdSql.execute(f'alter table {stbname} rename tag t1 t21') + tdSql.query(f'describe {stbname}') + tdSql.checkData(3,0,'t21') + tdSql.execute(f'alter table {stbname} rename tag `t21` t1') + tdSql.query(f'describe {stbname}') + tdSql.checkData(3,0,'t1') + + for i in ['bigint','unsigned int','float','double','binary(10)','nchar(10)']: + for j in [1,2,3]: + tdSql.error(f'alter table {stbname} modify tag t{j} {i}') + for i in ['int','unsigned int','float','binary(10)','nchar(10)']: + tdSql.error(f'alter table {stbname} modify tag t8 {i}') + tdSql.error(f'alter table {stbname} modify tag t4 int') + tdSql.execute(f'drop database {dbname}') + + def run(self): + + dbname = self.get_long_name(length=10, mode="letters") + stbname = self.get_long_name(length=5, mode="letters") + tbname = self.get_long_name(length=5, mode="letters") + self.alter_stable_column_check(dbname,stbname,tbname) + self.alter_stable_tag_check(dbname,stbname,tbname) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/system-test/1-insert/alter_table.py b/tests/system-test/1-insert/alter_table.py new file mode 100644 index 0000000000000000000000000000000000000000..53e3793dcf9852a733730a47659b4d089f3391df --- /dev/null +++ b/tests/system-test/1-insert/alter_table.py @@ -0,0 +1,170 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import random +import string +from util.log import * +from util.cases import * +from util.sql import * + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor()) + + def get_long_name(self, length, mode="mixed"): + """ + generate long name + mode could be numbers/letters/letters_mixed/mixed + """ + if mode == "numbers": + population = string.digits + elif mode == "letters": + population = string.ascii_letters.lower() + elif mode == "letters_mixed": + population = string.ascii_letters.upper() + string.ascii_letters.lower() + else: + population = string.ascii_letters.lower() + string.digits + return "".join(random.choices(population, k=length)) + + def alter_tb_tag_check(self): + tag_tinyint = random.randint(-127,129) + tag_int = random.randint(-2147483648,2147483647) + tag_smallint = random.randint(-32768,32768) + tag_bigint = random.randint(-2147483648,2147483647) + tag_untinyint = random.randint(0,256) + tag_unsmallint = random.randint(0,65536) + tag_unint = random.randint(0,4294967296) + tag_unbigint = random.randint(0,2147483647) + tag_binary = self.get_long_name(length=10, mode="letters") + tag_nchar = self.get_long_name(length=10, mode="letters") + dbname = self.get_long_name(length=10, mode="letters") + tdSql.execute(f'create database if not exists {dbname}') + stbname = self.get_long_name(length=3, mode="letters") + tbname = self.get_long_name(length=3, mode="letters") + tdLog.info('--------------------------child table tag check--------------------------------------') + tdLog.info(f'-----------------create stable {stbname} and child table {tbname}-------------------') + tdSql.execute(f'create stable if not exists {dbname}.{stbname} (col_ts timestamp, c1 int) tags (tag_ts timestamp, t1 tinyint, t2 smallint, t3 int, \ + t4 bigint, t5 tinyint unsigned, t6 smallint unsigned, t7 int unsigned, t8 bigint unsigned, t9 float, t10 double, t11 bool,t12 binary(20),t13 nchar(20))') + tdSql.execute(f'create table if not exists {dbname}.{tbname} using {dbname}.{stbname} tags(now, 1, 2, 3, 4, 5, 6, 7, 8, 9.9, 10.1, True,"abc123","涛思数据")') + tdSql.execute(f'insert into {dbname}.{tbname} values(now, 1)') + tdSql.execute(f'alter table {dbname}.{tbname} set tag tag_ts = 1640966400000') + tdSql.execute(f'alter table {dbname}.{tbname} set tag `t1` = 11') + tdSql.query(f'select * from {dbname}.{stbname}') + tdSql.checkData(0,3,11) + tdSql.execute(f'alter table {dbname}.{tbname} set tag t1 = {tag_tinyint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t2 = {tag_smallint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t3 = {tag_int}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t4 = {tag_bigint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t5 = {tag_untinyint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t6 = {tag_unsmallint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t7 = {tag_unint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t8 = {tag_unbigint}') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t11 = false') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t12 = "{tag_binary}"') + tdSql.execute(f'alter table {dbname}.{tbname} set tag t13 = "{tag_nchar}"') + tdSql.query(f'select * from {dbname}.{stbname}') + # bug TD-15899 + tdSql.checkData(0,2,'2022-01-01 00:00:00.000') + tdSql.checkData(0,3,tag_tinyint) + tdSql.checkData(0,4,tag_smallint) + tdSql.checkData(0,5,tag_int) + tdSql.checkData(0,6,tag_bigint) + tdSql.checkData(0,7,tag_untinyint) + tdSql.checkData(0,8,tag_unsmallint) + tdSql.checkData(0,9,tag_unint) + tdSql.checkData(0,10,tag_unbigint) + + tdSql.checkData(0,13,False) + tdSql.checkData(0,14,tag_binary) + tdSql.checkData(0,15,tag_nchar) + + # bug TD-16211 insert length more than setting binary and nchar + # tag_binary = self.get_long_name(length=21, mode="letters") + # tag_nchar = self.get_long_name(length=21, mode="letters") + # tdSql.error(f'alter table {dbname}.{tbname} set tag t12 = "{tag_binary}"') + # tdSql.error(f'alter table {dbname}.{tbname} set tag t13 = "{tag_nchar}"') + + # bug TD-16210 modify binary to nchar + # tdSql.error(f'alter table {dbname}.{tbname} modify tag t12 nchar(10)') + tdSql.execute(f"drop database {dbname}") + def alter_ntb_column_check(self): + ''' + alter ntb column check + ''' + dbname = self.get_long_name(length=10, mode="letters") + tdSql.execute(f'create database if not exists {dbname}') + tbname = self.get_long_name(length=3, mode="letters") + tdLog.info('------------------normal table column check---------------------') + tdLog.info(f'-----------------create normal table {tbname}-------------------') + tdSql.execute(f'create table if not exists {dbname}.{tbname} (ts timestamp, c1 tinyint, c2 smallint, c3 int, \ + c4 bigint, c5 tinyint unsigned, c6 smallint unsigned, c7 int unsigned, c8 bigint unsigned, c9 float, c10 double, c11 bool,c12 binary(20),c13 nchar(20))') + tdSql.execute(f'insert into {dbname}.{tbname} values (now,1,2,3,4,5,6,7,8,9.9,10.1,true,"abcd","涛思数据")') + # bug TD-15757 + tdSql.execute(f'alter table {dbname}.{tbname} add column c14 int') + tdSql.query(f'select c14 from {dbname}.{tbname}') + tdSql.checkRows(1) + tdSql.execute(f'alter table {dbname}.{tbname} add column `c15` int') + tdSql.query(f'select c15 from {dbname}.{tbname}') + tdSql.checkRows(1) + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkRows(16) + tdSql.execute(f'alter table {dbname}.{tbname} drop column c14') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkRows(15) + tdSql.execute(f'alter table {dbname}.{tbname} drop column `c15`') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkRows(14) + tdSql.execute(f'alter table {dbname}.{tbname} modify column c12 binary(30)') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkData(12,2,30) + tdSql.execute(f'alter table {dbname}.{tbname} modify column `c12` binary(35)') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkData(12,2,35) + tdSql.error(f'alter table {dbname}.{tbname} modify column c12 binary(34)') + tdSql.error(f'alter table {dbname}.{tbname} modify column c12 nchar(10)') + tdSql.error(f'alter table {dbname}.{tbname} modify column c12 int') + tdSql.execute(f'alter table {dbname}.{tbname} modify column c13 nchar(30)') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkData(13,2,30) + tdSql.execute(f'alter table {dbname}.{tbname} modify column `c13` nchar(35)') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkData(13,2,35) + tdSql.error(f'alter table {dbname}.{tbname} modify column c13 nchar(34)') + tdSql.error(f'alter table {dbname}.{tbname} modify column c13 binary(10)') + tdSql.execute(f'alter table {dbname}.{tbname} rename column c1 c21') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkData(1,0,'c21') + tdSql.execute(f'alter table {dbname}.{tbname} rename column `c21` c1') + tdSql.query(f'describe {dbname}.{tbname}') + tdSql.checkData(1,0,'c1') + + tdSql.error(f'alter table {dbname}.{tbname} modify column c1 bigint') + tdSql.error(f'alter table {dbname}.{tbname} modify column c1 double') + tdSql.error(f'alter table {dbname}.{tbname} modify column c4 int') + tdSql.error(f'alter table {dbname}.{tbname} modify column `c1` double') + tdSql.error(f'alter table {dbname}.{tbname} modify column c9 double') + tdSql.error(f'alter table {dbname}.{tbname} modify column c10 float') + tdSql.error(f'alter table {dbname}.{tbname} modify column c1 bool') + tdSql.error(f'alter table {dbname}.{tbname} modify column c1 binary(10)') + tdSql.execute(f'drop database {dbname}') + def run(self): + self.alter_tb_tag_check() + self.alter_ntb_column_check() + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 8481417dbd86fc7fcbbb202eafd3701a7dbbf7e1..3991654350ee35f34ec1f7325bcf0421d8ab4d1e 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -19,7 +19,8 @@ python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py #python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py - +python3 ./test.py -f 1-insert/alter_stable.py +python3 ./test.py -f 1-insert/alter_table.py python3 ./test.py -f 2-query/between.py python3 ./test.py -f 2-query/distinct.py python3 ./test.py -f 2-query/varchar.py @@ -79,6 +80,7 @@ python3 ./test.py -f 2-query/query_cols_tags_and_or.py # TD-15983 subquery output duplicate name column. # Please Xiangyang Guo modify the following script # python3 ./test.py -f 2-query/nestedQuery_str.py + python3 ./test.py -f 2-query/avg.py python3 ./test.py -f 2-query/elapsed.py python3 ./test.py -f 2-query/csum.py