diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 95d35ab9186610e4408ae88653a835023cdbeae0..084258e48f0890b520f528b6a0d8874094ab279d 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -112,6 +112,13 @@ typedef struct SDropTableStmt { SNodeList* pTables; } SDropTableStmt; +typedef struct SDropSuperTableStmt { + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; + char tableName[TSDB_TABLE_NAME_LEN]; + bool ignoreNotExists; +} SDropSuperTableStmt; + typedef struct SCreateUserStmt { ENodeType type; char useName[TSDB_USER_LEN]; @@ -143,6 +150,11 @@ typedef struct SDropDnodeStmt { int32_t port; } SDropDnodeStmt; +typedef struct SShowStmt { + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; +} SShowStmt; + #ifdef __cplusplus } #endif diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 13b2ef7b7be9d6207977688d797c30f1b1bec455..b27150c9fbe2dc422bd0abbc23dbe6f43b31e02c 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -79,6 +79,7 @@ typedef enum ENodeType { QUERY_NODE_CREATE_MULTI_TABLE_STMT, QUERY_NODE_DROP_TABLE_CLAUSE, QUERY_NODE_DROP_TABLE_STMT, + QUERY_NODE_DROP_SUPER_TABLE_STMT, QUERY_NODE_SHOW_TABLES_STMT, // temp QUERY_NODE_SHOW_STABLES_STMT, QUERY_NODE_CREATE_USER_STMT, diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 9c45d313c661b6f4c4160c15af197017fcfd4661..27d71ff53269e94979ea681c0b660c62e4d50f02 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -34,8 +34,11 @@ (pDst)->fldname = strdup((pSrc)->fldname); \ } while (0) -#define COPY_NODE_FIELD(fldname) \ +#define CLONE_NODE_FIELD(fldname) \ do { \ + if (NULL == (pSrc)->fldname) { \ + break; \ + } \ (pDst)->fldname = nodesCloneNode((pSrc)->fldname); \ if (NULL == (pDst)->fldname) { \ nodesDestroyNode((SNode*)(pDst)); \ @@ -43,8 +46,11 @@ } \ } while (0) -#define COPY_NODE_LIST_FIELD(fldname) \ +#define CLONE_NODE_LIST_FIELD(fldname) \ do { \ + if (NULL == (pSrc)->fldname) { \ + break; \ + } \ (pDst)->fldname = nodesCloneList((pSrc)->fldname); \ if (NULL == (pDst)->fldname) { \ nodesDestroyNode((SNode*)(pDst)); \ @@ -52,6 +58,22 @@ } \ } while (0) +#define CLONE_OBJECT_FIELD(fldname, cloneFunc) \ + do { \ + (pDst)->fldname = cloneFunc((pSrc)->fldname); \ + if (NULL == (pDst)->fldname) { \ + nodesDestroyNode((SNode*)(pDst)); \ + return NULL; \ + } \ + } while (0) + +#define COPY_BASE_OBJECT_FIELD(fldname, copyFunc) \ + do { \ + if (NULL == copyFunc(&((pSrc)->fldname), &((pDst)->fldname))) { \ + return NULL; \ + } \ + } while (0) + static void dataTypeCopy(const SDataType* pSrc, SDataType* pDst) { COPY_SCALAR_FIELD(type); COPY_SCALAR_FIELD(precision); @@ -62,7 +84,7 @@ static void dataTypeCopy(const SDataType* pSrc, SDataType* pDst) { static void exprNodeCopy(const SExprNode* pSrc, SExprNode* pDst) { dataTypeCopy(&pSrc->resType, &pDst->resType); COPY_CHAR_ARRAY_FIELD(aliasName); - // COPY_NODE_LIST_FIELD(pAssociationList); + // CLONE_NODE_LIST_FIELD(pAssociationList); } static SNode* columnNodeCopy(const SColumnNode* pSrc, SColumnNode* pDst) { @@ -73,7 +95,7 @@ static SNode* columnNodeCopy(const SColumnNode* pSrc, SColumnNode* pDst) { COPY_CHAR_ARRAY_FIELD(tableName); COPY_CHAR_ARRAY_FIELD(tableAlias); COPY_CHAR_ARRAY_FIELD(colName); - // COPY_NODE_FIELD(pProjectRef); + // CLONE_NODE_FIELD(pProjectRef); COPY_SCALAR_FIELD(dataBlockId); COPY_SCALAR_FIELD(slotId); return (SNode*)pDst; @@ -125,15 +147,15 @@ static SNode* valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) { static SNode* operatorNodeCopy(const SOperatorNode* pSrc, SOperatorNode* pDst) { exprNodeCopy((const SExprNode*)pSrc, (SExprNode*)pDst); COPY_SCALAR_FIELD(opType); - COPY_NODE_FIELD(pLeft); - COPY_NODE_FIELD(pRight); + CLONE_NODE_FIELD(pLeft); + CLONE_NODE_FIELD(pRight); return (SNode*)pDst; } static SNode* logicConditionNodeCopy(const SLogicConditionNode* pSrc, SLogicConditionNode* pDst) { exprNodeCopy((const SExprNode*)pSrc, (SExprNode*)pDst); COPY_SCALAR_FIELD(condType); - COPY_NODE_LIST_FIELD(pParameterList); + CLONE_NODE_LIST_FIELD(pParameterList); return (SNode*)pDst; } @@ -142,32 +164,89 @@ static SNode* functionNodeCopy(const SFunctionNode* pSrc, SFunctionNode* pDst) { COPY_CHAR_ARRAY_FIELD(functionName); COPY_SCALAR_FIELD(funcId); COPY_SCALAR_FIELD(funcType); - COPY_NODE_LIST_FIELD(pParameterList); + CLONE_NODE_LIST_FIELD(pParameterList); return (SNode*)pDst; } static SNode* targetNodeCopy(const STargetNode* pSrc, STargetNode* pDst) { COPY_SCALAR_FIELD(dataBlockId); COPY_SCALAR_FIELD(slotId); - COPY_NODE_FIELD(pExpr); + CLONE_NODE_FIELD(pExpr); return (SNode*)pDst; } static SNode* groupingSetNodeCopy(const SGroupingSetNode* pSrc, SGroupingSetNode* pDst) { COPY_SCALAR_FIELD(groupingSetType); - COPY_NODE_LIST_FIELD(pParameterList); + CLONE_NODE_LIST_FIELD(pParameterList); + return (SNode*)pDst; +} + +static SNode* logicNodeCopy(const SLogicNode* pSrc, SLogicNode* pDst) { + COPY_SCALAR_FIELD(id); + CLONE_NODE_LIST_FIELD(pTargets); + CLONE_NODE_FIELD(pConditions); + CLONE_NODE_LIST_FIELD(pChildren); + return (SNode*)pDst; +} + +static STableMeta* tableMetaClone(const STableMeta* pSrc) { + int32_t len = sizeof(STableMeta) + (pSrc->tableInfo.numOfTags + pSrc->tableInfo.numOfColumns) * sizeof(SSchema); + STableMeta* pDst = malloc(len); + if (NULL == pDst) { + return NULL; + } + memcpy(pDst, pSrc, len); + return pDst; +} + +static SVgroupsInfo* vgroupsInfoClone(const SVgroupsInfo* pSrc) { + int32_t len = sizeof(SVgroupsInfo) + pSrc->numOfVgroups * sizeof(SVgroupInfo); + SVgroupsInfo* pDst = malloc(len); + if (NULL == pDst) { + return NULL; + } + memcpy(pDst, pSrc, len); + return pDst; +} + +static SNode* logicScanCopy(const SScanLogicNode* pSrc, SScanLogicNode* pDst) { + COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); + CLONE_NODE_LIST_FIELD(pScanCols); + CLONE_OBJECT_FIELD(pMeta, tableMetaClone); + CLONE_OBJECT_FIELD(pVgroupList, vgroupsInfoClone); + COPY_SCALAR_FIELD(scanType); + COPY_SCALAR_FIELD(scanFlag); + COPY_SCALAR_FIELD(scanRange); + return (SNode*)pDst; +} + +static SNode* logicAggCopy(const SAggLogicNode* pSrc, SAggLogicNode* pDst) { + COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); + CLONE_NODE_LIST_FIELD(pGroupKeys); + CLONE_NODE_LIST_FIELD(pAggFuncs); + return (SNode*)pDst; +} + +static SNode* logicProjectCopy(const SProjectLogicNode* pSrc, SProjectLogicNode* pDst) { + COPY_BASE_OBJECT_FIELD(node, logicNodeCopy); + CLONE_NODE_LIST_FIELD(pProjections); + return (SNode*)pDst; +} + +static SNode* logicVnodeModifCopy(const SVnodeModifLogicNode* pSrc, SVnodeModifLogicNode* pDst) { + COPY_SCALAR_FIELD(msgType); return (SNode*)pDst; } static SNode* logicSubplanCopy(const SSubLogicPlan* pSrc, SSubLogicPlan* pDst) { - COPY_NODE_FIELD(pNode); + CLONE_NODE_FIELD(pNode); COPY_SCALAR_FIELD(subplanType); return (SNode*)pDst; } static SNode* dataBlockDescCopy(const SDataBlockDescNode* pSrc, SDataBlockDescNode* pDst) { COPY_SCALAR_FIELD(dataBlockId); - COPY_NODE_LIST_FIELD(pSlots); + CLONE_NODE_LIST_FIELD(pSlots); COPY_SCALAR_FIELD(resultRowSize); COPY_SCALAR_FIELD(precision); return (SNode*)pDst; @@ -217,13 +296,22 @@ SNodeptr nodesCloneNode(const SNodeptr pNode) { return dataBlockDescCopy((const SDataBlockDescNode*)pNode, (SDataBlockDescNode*)pDst); case QUERY_NODE_SLOT_DESC: return slotDescCopy((const SSlotDescNode*)pNode, (SSlotDescNode*)pDst); + case QUERY_NODE_LOGIC_PLAN_SCAN: + return logicScanCopy((const SScanLogicNode*)pNode, (SScanLogicNode*)pDst); + case QUERY_NODE_LOGIC_PLAN_AGG: + return logicAggCopy((const SAggLogicNode*)pNode, (SAggLogicNode*)pDst); + case QUERY_NODE_LOGIC_PLAN_PROJECT: + return logicProjectCopy((const SProjectLogicNode*)pNode, (SProjectLogicNode*)pDst); + case QUERY_NODE_LOGIC_PLAN_VNODE_MODIF: + return logicVnodeModifCopy((const SVnodeModifLogicNode*)pNode, (SVnodeModifLogicNode*)pDst); case QUERY_NODE_LOGIC_SUBPLAN: return logicSubplanCopy((const SSubLogicPlan*)pNode, (SSubLogicPlan*)pDst); default: break; } - nodesWarn("nodesCloneNode unknown node = %s", nodesNodeName(nodeType(pNode))); - return pDst; + nodesDestroyNode(pDst); + nodesError("nodesCloneNode unknown node = %s", nodesNodeName(nodeType(pNode))); + return NULL; } SNodeList* nodesCloneList(const SNodeList* pList) { diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index a5f25fab28db2dfdc39dfbbe47c8a40f8d47ecbe..b28c45e55407ffcee74660813aa2c2ee133ca542 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -1532,7 +1532,8 @@ static int32_t jsonToNodeObject(const SJson* pJson, const char* pName, SNode** p int32_t nodesNodeToString(const SNodeptr pNode, bool format, char** pStr, int32_t* pLen) { if (NULL == pNode || NULL == pStr || NULL == pLen) { - return TSDB_CODE_SUCCESS; + terrno = TSDB_CODE_FAILED; + return TSDB_CODE_FAILED; } SJson* pJson = tjsonCreateObject(); diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index ce3017fa27104ce3c089f84606fb6b78d5b55291..39e64ba1075f20def7d526eb3be9027480dcafac 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -85,7 +85,7 @@ SNodeptr nodesMakeNode(ENodeType type) { case QUERY_NODE_DROP_DATABASE_STMT: return makeNode(type, sizeof(SDropDatabaseStmt)); case QUERY_NODE_SHOW_DATABASES_STMT: - return makeNode(type, sizeof(SNode)); + return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_CREATE_TABLE_STMT: return makeNode(type, sizeof(SCreateTableStmt)); case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: @@ -96,9 +96,11 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SDropTableClause)); case QUERY_NODE_DROP_TABLE_STMT: return makeNode(type, sizeof(SDropTableStmt)); + case QUERY_NODE_DROP_SUPER_TABLE_STMT: + return makeNode(type, sizeof(SDropSuperTableStmt)); case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_STABLES_STMT: - return makeNode(type, sizeof(SNode)); + return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_CREATE_USER_STMT: return makeNode(type, sizeof(SCreateUserStmt)); case QUERY_NODE_ALTER_USER_STMT: @@ -106,7 +108,7 @@ SNodeptr nodesMakeNode(ENodeType type) { case QUERY_NODE_DROP_USER_STMT: return makeNode(type, sizeof(SDropUserStmt)); case QUERY_NODE_SHOW_USERS_STMT: - return makeNode(type, sizeof(SNode)); + return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_USE_DATABASE_STMT: return makeNode(type, sizeof(SUseDatabaseStmt)); case QUERY_NODE_CREATE_DNODE_STMT: @@ -114,9 +116,9 @@ SNodeptr nodesMakeNode(ENodeType type) { case QUERY_NODE_DROP_DNODE_STMT: return makeNode(type, sizeof(SDropDnodeStmt)); case QUERY_NODE_SHOW_DNODES_STMT: - return makeNode(type, sizeof(SNode)); + return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_SHOW_VGROUPS_STMT: - return makeNode(type, sizeof(SNode)); + return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_LOGIC_PLAN_SCAN: return makeNode(type, sizeof(SScanLogicNode)); case QUERY_NODE_LOGIC_PLAN_JOIN: diff --git a/source/libs/parser/inc/astCreateFuncs.h b/source/libs/parser/inc/astCreateFuncs.h index 2618b5328fbdb35020199a71cccf0491c0c982ab..bc43b0f4e9864fc1c5c04193107abc5c9044d2d9 100644 --- a/source/libs/parser/inc/astCreateFuncs.h +++ b/source/libs/parser/inc/astCreateFuncs.h @@ -124,8 +124,9 @@ SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SN SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables); SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable); SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables); +SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable); SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName); -SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type); +SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDbName); SNode* createCreateUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, const SToken* pPassword); SNode* createAlterUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, int8_t alterType, const SToken* pVal); SNode* createDropUserStmt(SAstCreateContext* pCxt, const SToken* pUserName); diff --git a/source/libs/parser/inc/new_sql.y b/source/libs/parser/inc/new_sql.y index 221b3519902e837c6c059763cb230e5505559b4a..6e09048810757458d4edea9fe842d2b64c4ab295 100644 --- a/source/libs/parser/inc/new_sql.y +++ b/source/libs/parser/inc/new_sql.y @@ -48,14 +48,14 @@ cmd ::= CREATE USER user_name(A) PASS NK_STRING(B). cmd ::= ALTER USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PASSWD, &B);} cmd ::= ALTER USER user_name(A) PRIVILEGE NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PRIVILEGES, &B);} cmd ::= DROP USER user_name(A). { pCxt->pRootNode = createDropUserStmt(pCxt, &A); } -cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } +cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL); } /************************************************ create/drop/show dnode **********************************************/ cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL);} cmd ::= CREATE DNODE dnode_host_name(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B);} cmd ::= DROP DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A);} cmd ::= DROP DNODE dnode_endpoint(A). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A);} -cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } +cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } %type dnode_endpoint { SToken } %destructor dnode_endpoint { } @@ -69,7 +69,7 @@ dnode_host_name(A) ::= NK_IPTOKEN(B). /************************************************ create/drop/show/use database ***************************************/ cmd ::= CREATE DATABASE not_exists_opt(A) db_name(B) db_options(C). { pCxt->pRootNode = createCreateDatabaseStmt(pCxt, A, &B, C);} cmd ::= DROP DATABASE exists_opt(A) db_name(B). { pCxt->pRootNode = createDropDatabaseStmt(pCxt, A, &B); } -cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } +cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } cmd ::= USE db_name(A). { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &A);} %type not_exists_opt { bool } @@ -110,8 +110,9 @@ cmd ::= CREATE TABLE multi_create_clause(A). cmd ::= CREATE STABLE not_exists_opt(A) full_table_name(B) NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E);} cmd ::= DROP TABLE multi_drop_clause(A). { pCxt->pRootNode = createDropTableStmt(pCxt, A); } -cmd ::= SHOW TABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT); } -cmd ::= SHOW STABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT); } +cmd ::= DROP STABLE exists_opt(A) full_table_name(B). { pCxt->pRootNode = createDropSuperTableStmt(pCxt, A, B); } +cmd ::= SHOW TABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } +cmd ::= SHOW STABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } %type multi_create_clause { SNodeList* } %destructor multi_create_clause { nodesDestroyList($$); } @@ -195,10 +196,11 @@ col_name_list(A) ::= col_name_list(B) NK_COMMA col_name(C). col_name(A) ::= column_name(B). { A = createColumnNode(pCxt, NULL, &B); } -/************************************************ show ***************************************************************/ -cmd ::= SHOW VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT); } +/************************************************ show vgroups ********************************************************/ +cmd ::= SHOW VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } +cmd ::= SHOW db_name(B) NK_DOT VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &B); } -/************************************************ select *************************************************************/ +/************************************************ select **************************************************************/ cmd ::= query_expression(A). { pCxt->pRootNode = A; } /************************************************ literal *************************************************************/ diff --git a/source/libs/parser/src/astCreateFuncs.c b/source/libs/parser/src/astCreateFuncs.c index 214960081ab04f030f0249641215cf90a82ff9ed..17a3d1f7654781290ba6d1415883aec657accab9 100644 --- a/source/libs/parser/src/astCreateFuncs.c +++ b/source/libs/parser/src/astCreateFuncs.c @@ -883,6 +883,16 @@ SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables) { return (SNode*)pStmt; } +SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable) { + SDropSuperTableStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_SUPER_TABLE_STMT); + CHECK_OUT_OF_MEM(pStmt); + strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); + strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); + pStmt->ignoreNotExists = ignoreNotExists; + nodesDestroyNode(pRealTable); + return (SNode*)pStmt; +} + SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName) { SUseDatabaseStmt* pStmt = (SUseDatabaseStmt*)nodesMakeNode(QUERY_NODE_USE_DATABASE_STMT); CHECK_OUT_OF_MEM(pStmt); @@ -890,10 +900,18 @@ SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName) { return (SNode*)pStmt; } -SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { - SNode* pStmt = nodesMakeNode(type);; +SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDbName) { + if (!checkDbName(pCxt, pDbName)) { + return NULL; + } + SShowStmt* pStmt = nodesMakeNode(type);; CHECK_OUT_OF_MEM(pStmt); - return pStmt; + if (NULL != pDbName) { + strncpy(pStmt->dbName, pDbName->z, pDbName->n); + } else if (NULL != pCxt->pQueryCxt->db) { + strcpy(pStmt->dbName, pCxt->pQueryCxt->db); + } + return (SNode*)pStmt; } SNode* createCreateUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, const SToken* pPassword) { diff --git a/source/libs/parser/src/astTranslate.c b/source/libs/parser/src/astTranslate.c index e2fb84c7ed12cb1b4fba70dbd2537d906122e16b..8c45fb2bff4aca19f8f49e764f9b366db3ee5d1a 100644 --- a/source/libs/parser/src/astTranslate.c +++ b/source/libs/parser/src/astTranslate.c @@ -858,6 +858,55 @@ static int32_t translateCreateSuperTable(STranslateContext* pCxt, SCreateTableSt return TSDB_CODE_SUCCESS; } +static int32_t doTranslateDropSuperTable(STranslateContext* pCxt, const SName* pTableName, bool ignoreNotExists) { + SMDropStbReq dropReq = {0}; + tNameExtractFullName(pTableName, dropReq.name); + dropReq.igNotExists = ignoreNotExists; + + pCxt->pCmdMsg = malloc(sizeof(SCmdMsgInfo)); + if (NULL== pCxt->pCmdMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pCxt->pCmdMsg->epSet = pCxt->pParseCxt->mgmtEpSet; + pCxt->pCmdMsg->msgType = TDMT_MND_DROP_STB; + pCxt->pCmdMsg->msgLen = tSerializeSMDropStbReq(NULL, 0, &dropReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL== pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSMDropStbReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &dropReq); + + return TSDB_CODE_SUCCESS; +} + +static int32_t translateDropTable(STranslateContext* pCxt, SDropTableStmt* pStmt) { + SDropTableClause* pClause = nodesListGetNode(pStmt->pTables, 0); + + SName tableName = { .type = TSDB_TABLE_NAME_T, .acctId = pCxt->pParseCxt->acctId }; + strcpy(tableName.dbname, pClause->dbName); + strcpy(tableName.tname, pClause->tableName); + STableMeta* pTableMeta = NULL; + int32_t code = catalogGetTableMeta(pCxt->pParseCxt->pCatalog, pCxt->pParseCxt->pTransporter, &(pCxt->pParseCxt->mgmtEpSet), &tableName, &pTableMeta); + if (TSDB_CODE_SUCCESS == code) { + if (TSDB_SUPER_TABLE == pTableMeta->tableType) { + code = doTranslateDropSuperTable(pCxt, &tableName, pClause->ignoreNotExists); + } else { + // todo; + code = TSDB_CODE_FAILED; + } + } + tfree(pTableMeta); + + return code; +} + +static int32_t translateDropSuperTable(STranslateContext* pCxt, SDropSuperTableStmt* pStmt) { + SName tableName = { .type = TSDB_TABLE_NAME_T, .acctId = pCxt->pParseCxt->acctId }; + strcpy(tableName.dbname, pStmt->dbName); + strcpy(tableName.tname, pStmt->tableName); + return doTranslateDropSuperTable(pCxt, &tableName, pStmt->ignoreNotExists); +} + static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* pStmt) { SName name = {0}; tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName)); @@ -1005,17 +1054,19 @@ static int32_t nodeTypeToShowType(ENodeType nt) { return TSDB_MGMT_TABLE_USER; case QUERY_NODE_SHOW_DNODES_STMT: return TSDB_MGMT_TABLE_DNODE; + case QUERY_NODE_SHOW_VGROUPS_STMT: + return TSDB_MGMT_TABLE_VGROUP; default: break; } return 0; } -static int32_t translateShow(STranslateContext* pCxt, ENodeType type) { - SShowReq showReq = { .type = nodeTypeToShowType(type) }; - if (NULL != pCxt->pParseCxt->db) { +static int32_t translateShow(STranslateContext* pCxt, SShowStmt* pStmt) { + SShowReq showReq = { .type = nodeTypeToShowType(nodeType(pStmt)) }; + if ('\0' != pStmt->dbName[0]) { SName name = {0}; - tNameSetDbName(&name, pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, strlen(pCxt->pParseCxt->db)); + tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName)); char dbFname[TSDB_DB_FNAME_LEN] = {0}; tNameGetFullDbName(&name, showReq.db); } @@ -1079,6 +1130,12 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_CREATE_TABLE_STMT: code = translateCreateSuperTable(pCxt, (SCreateTableStmt*)pNode); break; + case QUERY_NODE_DROP_TABLE_STMT: + code = translateDropTable(pCxt, (SDropTableStmt*)pNode); + break; + case QUERY_NODE_DROP_SUPER_TABLE_STMT: + code = translateDropSuperTable(pCxt, (SDropSuperTableStmt*)pNode); + break; case QUERY_NODE_CREATE_USER_STMT: code = translateCreateUser(pCxt, (SCreateUserStmt*)pNode); break; @@ -1101,7 +1158,8 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_SHOW_STABLES_STMT: case QUERY_NODE_SHOW_USERS_STMT: case QUERY_NODE_SHOW_DNODES_STMT: - code = translateShow(pCxt, nodeType(pNode)); + case QUERY_NODE_SHOW_VGROUPS_STMT: + code = translateShow(pCxt, (SShowStmt*)pNode); break; case QUERY_NODE_SHOW_TABLES_STMT: code = translateShowTables(pCxt); diff --git a/source/libs/parser/src/new_sql.c b/source/libs/parser/src/new_sql.c index 86392b64c14ddf40bed900218892d1fdebbea53a..058e1b35cd3df5803f48fb2d2ee236a94619649e 100644 --- a/source/libs/parser/src/new_sql.c +++ b/source/libs/parser/src/new_sql.c @@ -131,17 +131,17 @@ typedef union { #define NewParseCTX_PARAM #define NewParseCTX_FETCH #define NewParseCTX_STORE -#define YYNSTATE 272 -#define YYNRULE 234 +#define YYNSTATE 278 +#define YYNRULE 236 #define YYNTOKEN 134 -#define YY_MAX_SHIFT 271 -#define YY_MIN_SHIFTREDUCE 432 -#define YY_MAX_SHIFTREDUCE 665 -#define YY_ERROR_ACTION 666 -#define YY_ACCEPT_ACTION 667 -#define YY_NO_ACTION 668 -#define YY_MIN_REDUCE 669 -#define YY_MAX_REDUCE 902 +#define YY_MAX_SHIFT 277 +#define YY_MIN_SHIFTREDUCE 438 +#define YY_MAX_SHIFTREDUCE 673 +#define YY_ERROR_ACTION 674 +#define YY_ACCEPT_ACTION 675 +#define YY_NO_ACTION 676 +#define YY_MIN_REDUCE 677 +#define YY_MAX_REDUCE 912 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -208,98 +208,99 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (892) +#define YY_ACTTAB_COUNT (903) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 135, 147, 23, 93, 761, 711, 759, 240, 148, 771, - /* 10 */ 769, 146, 30, 28, 26, 25, 24, 771, 769, 192, - /* 20 */ 175, 795, 94, 724, 65, 30, 28, 26, 25, 24, - /* 30 */ 682, 164, 192, 215, 795, 59, 719, 130, 780, 769, - /* 40 */ 193, 202, 215, 53, 781, 212, 784, 820, 722, 57, - /* 50 */ 130, 137, 816, 893, 19, 772, 769, 722, 548, 71, - /* 60 */ 827, 828, 854, 832, 30, 28, 26, 25, 24, 264, - /* 70 */ 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, - /* 80 */ 253, 252, 251, 250, 249, 248, 26, 25, 24, 22, - /* 90 */ 139, 202, 566, 567, 568, 569, 570, 571, 572, 574, - /* 100 */ 575, 576, 22, 139, 150, 566, 567, 568, 569, 570, - /* 110 */ 571, 572, 574, 575, 576, 169, 724, 65, 491, 238, - /* 120 */ 237, 236, 495, 235, 497, 498, 234, 500, 231, 529, - /* 130 */ 506, 228, 508, 509, 225, 222, 192, 527, 795, 881, - /* 140 */ 75, 182, 780, 769, 193, 214, 214, 52, 781, 247, - /* 150 */ 784, 820, 192, 880, 795, 129, 816, 879, 780, 769, - /* 160 */ 193, 709, 40, 66, 781, 152, 784, 881, 178, 60, - /* 170 */ 795, 10, 10, 717, 780, 769, 193, 724, 65, 53, - /* 180 */ 781, 74, 784, 820, 216, 879, 540, 137, 816, 69, - /* 190 */ 170, 165, 163, 214, 528, 530, 533, 247, 192, 538, - /* 200 */ 795, 92, 183, 894, 780, 769, 193, 154, 847, 123, - /* 210 */ 781, 143, 784, 178, 192, 795, 795, 268, 267, 780, - /* 220 */ 769, 193, 75, 629, 53, 781, 168, 784, 820, 192, - /* 230 */ 55, 795, 137, 816, 69, 780, 769, 193, 29, 27, - /* 240 */ 53, 781, 111, 784, 820, 752, 834, 529, 137, 816, - /* 250 */ 893, 725, 65, 848, 192, 527, 795, 144, 91, 877, - /* 260 */ 780, 769, 193, 11, 831, 53, 781, 834, 784, 820, - /* 270 */ 29, 27, 608, 137, 816, 893, 761, 151, 760, 529, - /* 280 */ 761, 834, 759, 1, 838, 830, 192, 527, 795, 144, - /* 290 */ 40, 182, 780, 769, 193, 11, 607, 116, 781, 829, - /* 300 */ 784, 718, 216, 215, 6, 603, 213, 29, 27, 44, - /* 310 */ 29, 27, 528, 530, 533, 1, 529, 881, 722, 529, - /* 320 */ 715, 839, 101, 603, 527, 541, 144, 527, 241, 144, - /* 330 */ 76, 74, 11, 75, 216, 879, 100, 30, 28, 26, - /* 340 */ 25, 24, 9, 8, 528, 530, 533, 30, 28, 26, - /* 350 */ 25, 24, 1, 161, 185, 7, 192, 86, 795, 41, - /* 360 */ 9, 8, 780, 769, 193, 21, 83, 123, 781, 155, - /* 370 */ 784, 216, 186, 80, 216, 30, 28, 26, 25, 24, - /* 380 */ 850, 528, 530, 533, 528, 530, 533, 192, 215, 795, - /* 390 */ 176, 106, 180, 780, 769, 193, 175, 77, 54, 781, - /* 400 */ 606, 784, 820, 722, 615, 75, 819, 816, 192, 175, - /* 410 */ 795, 59, 664, 665, 780, 769, 193, 584, 442, 54, - /* 420 */ 781, 538, 784, 820, 59, 57, 205, 179, 816, 182, - /* 430 */ 442, 189, 796, 187, 177, 70, 827, 828, 57, 832, - /* 440 */ 443, 444, 29, 27, 181, 96, 563, 578, 89, 827, - /* 450 */ 174, 529, 173, 215, 31, 881, 153, 29, 27, 527, - /* 460 */ 545, 144, 29, 27, 661, 662, 529, 31, 722, 74, - /* 470 */ 2, 529, 204, 879, 527, 184, 144, 50, 541, 527, - /* 480 */ 851, 144, 776, 667, 192, 61, 795, 7, 714, 774, - /* 490 */ 780, 769, 193, 201, 190, 54, 781, 200, 784, 820, - /* 500 */ 210, 199, 1, 208, 817, 127, 216, 7, 194, 211, - /* 510 */ 49, 128, 117, 861, 162, 46, 528, 530, 533, 159, - /* 520 */ 196, 216, 98, 103, 78, 533, 216, 198, 197, 157, - /* 530 */ 62, 528, 530, 533, 881, 484, 528, 530, 533, 192, - /* 540 */ 158, 795, 63, 860, 136, 780, 769, 193, 74, 82, - /* 550 */ 119, 781, 879, 784, 192, 5, 795, 479, 172, 841, - /* 560 */ 780, 769, 193, 85, 55, 123, 781, 138, 784, 156, - /* 570 */ 192, 68, 795, 4, 87, 603, 780, 769, 193, 512, - /* 580 */ 20, 66, 781, 171, 784, 537, 220, 58, 540, 573, - /* 590 */ 835, 516, 577, 192, 75, 795, 521, 32, 62, 780, - /* 600 */ 769, 193, 88, 63, 118, 781, 192, 784, 795, 64, - /* 610 */ 16, 191, 780, 769, 193, 802, 62, 120, 781, 140, - /* 620 */ 784, 895, 896, 878, 192, 710, 795, 188, 536, 95, - /* 630 */ 780, 769, 193, 195, 99, 114, 781, 203, 784, 192, - /* 640 */ 542, 795, 206, 145, 110, 780, 769, 193, 43, 45, - /* 650 */ 121, 781, 112, 784, 192, 708, 795, 723, 107, 218, - /* 660 */ 780, 769, 193, 271, 125, 115, 781, 126, 784, 113, - /* 670 */ 3, 192, 244, 795, 14, 31, 243, 780, 769, 193, - /* 680 */ 35, 79, 122, 781, 626, 784, 192, 81, 795, 628, - /* 690 */ 67, 245, 780, 769, 193, 84, 37, 792, 781, 622, - /* 700 */ 784, 192, 244, 795, 621, 166, 243, 780, 769, 193, - /* 710 */ 242, 774, 791, 781, 167, 784, 192, 38, 795, 18, - /* 720 */ 600, 245, 780, 769, 193, 15, 599, 790, 781, 90, - /* 730 */ 784, 192, 33, 795, 34, 73, 8, 780, 769, 193, - /* 740 */ 242, 564, 133, 781, 546, 784, 655, 17, 192, 39, - /* 750 */ 795, 12, 650, 649, 780, 769, 193, 141, 654, 132, - /* 760 */ 781, 192, 784, 795, 653, 142, 97, 780, 769, 193, - /* 770 */ 13, 175, 134, 781, 763, 784, 192, 685, 795, 762, - /* 780 */ 713, 712, 780, 769, 193, 684, 59, 131, 781, 632, - /* 790 */ 784, 192, 678, 795, 673, 451, 683, 780, 769, 193, - /* 800 */ 57, 102, 124, 781, 677, 784, 676, 672, 671, 207, - /* 810 */ 72, 827, 828, 670, 832, 160, 630, 631, 633, 634, - /* 820 */ 109, 209, 42, 30, 28, 26, 25, 24, 56, 46, - /* 830 */ 773, 531, 105, 36, 108, 217, 513, 505, 219, 504, - /* 840 */ 221, 149, 510, 223, 224, 226, 229, 507, 227, 232, - /* 850 */ 490, 501, 230, 503, 520, 499, 233, 51, 518, 519, - /* 860 */ 104, 449, 47, 246, 502, 470, 675, 469, 239, 548, - /* 870 */ 468, 467, 48, 466, 465, 464, 463, 462, 461, 460, - /* 880 */ 459, 458, 457, 456, 674, 455, 454, 265, 266, 669, - /* 890 */ 269, 270, + /* 0 */ 137, 149, 23, 95, 770, 719, 768, 246, 150, 781, + /* 10 */ 779, 148, 30, 28, 26, 25, 24, 781, 779, 194, + /* 20 */ 177, 805, 96, 733, 66, 30, 28, 26, 25, 24, + /* 30 */ 690, 166, 194, 221, 805, 60, 207, 132, 790, 779, + /* 40 */ 195, 208, 221, 54, 791, 728, 794, 830, 731, 58, + /* 50 */ 132, 139, 826, 903, 19, 782, 779, 731, 556, 73, + /* 60 */ 837, 838, 864, 842, 30, 28, 26, 25, 24, 270, + /* 70 */ 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, + /* 80 */ 259, 258, 257, 256, 255, 254, 26, 25, 24, 22, + /* 90 */ 141, 171, 574, 575, 576, 577, 578, 579, 580, 582, + /* 100 */ 583, 584, 22, 141, 152, 574, 575, 576, 577, 578, + /* 110 */ 579, 580, 582, 583, 584, 220, 733, 66, 498, 244, + /* 120 */ 243, 242, 502, 241, 504, 505, 240, 507, 237, 41, + /* 130 */ 513, 234, 515, 516, 231, 228, 194, 194, 805, 805, + /* 140 */ 727, 184, 790, 779, 195, 220, 220, 53, 791, 170, + /* 150 */ 794, 830, 194, 77, 805, 131, 826, 206, 790, 779, + /* 160 */ 195, 205, 544, 67, 791, 204, 794, 891, 180, 623, + /* 170 */ 805, 10, 10, 548, 790, 779, 195, 274, 273, 54, + /* 180 */ 791, 76, 794, 830, 201, 889, 546, 139, 826, 71, + /* 190 */ 208, 203, 202, 30, 28, 26, 25, 24, 194, 546, + /* 200 */ 805, 94, 185, 904, 790, 779, 195, 156, 857, 125, + /* 210 */ 791, 145, 794, 180, 20, 805, 172, 167, 165, 790, + /* 220 */ 779, 195, 77, 581, 54, 791, 585, 794, 830, 194, + /* 230 */ 253, 805, 139, 826, 71, 790, 779, 195, 29, 27, + /* 240 */ 54, 791, 247, 794, 830, 93, 200, 537, 139, 826, + /* 250 */ 903, 734, 66, 858, 194, 535, 805, 146, 844, 887, + /* 260 */ 790, 779, 195, 11, 891, 54, 791, 163, 794, 830, + /* 270 */ 29, 27, 616, 139, 826, 903, 841, 114, 890, 537, + /* 280 */ 761, 188, 889, 1, 848, 50, 194, 535, 805, 146, + /* 290 */ 47, 184, 790, 779, 195, 11, 153, 119, 791, 770, + /* 300 */ 794, 768, 222, 221, 9, 8, 218, 29, 27, 154, + /* 310 */ 29, 27, 536, 538, 541, 1, 537, 891, 731, 537, + /* 320 */ 844, 733, 66, 717, 535, 221, 146, 535, 219, 146, + /* 330 */ 41, 76, 11, 77, 222, 889, 615, 61, 840, 844, + /* 340 */ 731, 726, 189, 448, 536, 538, 541, 30, 28, 26, + /* 350 */ 25, 24, 1, 449, 450, 7, 194, 839, 805, 253, + /* 360 */ 549, 592, 790, 779, 195, 21, 178, 125, 791, 157, + /* 370 */ 794, 222, 6, 611, 222, 30, 28, 26, 25, 24, + /* 380 */ 187, 536, 538, 541, 536, 538, 541, 194, 221, 805, + /* 390 */ 770, 109, 769, 790, 779, 195, 177, 88, 55, 791, + /* 400 */ 860, 794, 830, 731, 448, 77, 829, 826, 194, 177, + /* 410 */ 805, 60, 211, 98, 790, 779, 195, 191, 221, 55, + /* 420 */ 791, 155, 794, 830, 60, 58, 2, 181, 826, 184, + /* 430 */ 45, 182, 79, 731, 179, 72, 837, 838, 58, 842, + /* 440 */ 614, 724, 29, 27, 183, 51, 806, 637, 91, 837, + /* 450 */ 176, 537, 175, 62, 56, 891, 723, 29, 27, 535, + /* 460 */ 85, 146, 29, 27, 669, 670, 537, 82, 849, 76, + /* 470 */ 611, 537, 210, 889, 535, 586, 146, 672, 673, 535, + /* 480 */ 192, 146, 31, 675, 194, 571, 805, 7, 549, 861, + /* 490 */ 790, 779, 195, 9, 8, 55, 791, 216, 794, 830, + /* 500 */ 214, 186, 1, 786, 827, 130, 222, 7, 196, 217, + /* 510 */ 784, 127, 68, 164, 871, 80, 536, 538, 541, 161, + /* 520 */ 537, 222, 100, 553, 541, 851, 222, 159, 535, 160, + /* 530 */ 31, 536, 538, 541, 891, 870, 536, 538, 541, 194, + /* 540 */ 138, 805, 106, 84, 5, 790, 779, 195, 76, 63, + /* 550 */ 121, 791, 889, 794, 194, 174, 805, 158, 87, 70, + /* 560 */ 790, 779, 195, 4, 491, 125, 791, 140, 794, 89, + /* 570 */ 194, 64, 805, 611, 545, 222, 790, 779, 195, 59, + /* 580 */ 548, 67, 791, 173, 794, 536, 538, 541, 30, 28, + /* 590 */ 26, 25, 24, 194, 77, 805, 486, 845, 32, 790, + /* 600 */ 779, 195, 90, 56, 120, 791, 194, 794, 805, 519, + /* 610 */ 16, 142, 790, 779, 195, 104, 226, 122, 791, 906, + /* 620 */ 794, 905, 193, 78, 194, 718, 805, 812, 190, 103, + /* 630 */ 790, 779, 195, 888, 556, 117, 791, 523, 794, 194, + /* 640 */ 544, 805, 528, 97, 63, 790, 779, 195, 197, 64, + /* 650 */ 123, 791, 42, 794, 194, 101, 805, 40, 209, 102, + /* 660 */ 790, 779, 195, 65, 550, 118, 791, 113, 794, 212, + /* 670 */ 63, 194, 250, 805, 147, 44, 249, 790, 779, 195, + /* 680 */ 732, 46, 124, 791, 115, 794, 194, 277, 805, 128, + /* 690 */ 224, 251, 790, 779, 195, 110, 116, 802, 791, 129, + /* 700 */ 794, 194, 14, 805, 3, 31, 81, 790, 779, 195, + /* 710 */ 248, 634, 801, 791, 83, 794, 194, 35, 805, 716, + /* 720 */ 636, 69, 790, 779, 195, 86, 37, 800, 791, 630, + /* 730 */ 794, 194, 629, 805, 168, 169, 784, 790, 779, 195, + /* 740 */ 38, 18, 135, 791, 608, 794, 15, 607, 194, 92, + /* 750 */ 805, 33, 34, 8, 790, 779, 195, 75, 572, 134, + /* 760 */ 791, 194, 794, 805, 554, 663, 250, 790, 779, 195, + /* 770 */ 249, 177, 136, 791, 17, 794, 194, 12, 805, 39, + /* 780 */ 99, 658, 790, 779, 195, 251, 60, 133, 791, 640, + /* 790 */ 794, 194, 657, 805, 143, 662, 661, 790, 779, 195, + /* 800 */ 58, 144, 126, 791, 248, 794, 13, 773, 693, 772, + /* 810 */ 74, 837, 838, 112, 842, 162, 638, 639, 641, 642, + /* 820 */ 199, 57, 198, 771, 722, 721, 692, 111, 686, 681, + /* 830 */ 720, 457, 691, 685, 684, 680, 679, 213, 678, 215, + /* 840 */ 105, 43, 47, 783, 36, 108, 223, 520, 539, 225, + /* 850 */ 52, 151, 227, 107, 517, 230, 512, 514, 233, 236, + /* 860 */ 229, 508, 506, 239, 511, 497, 232, 48, 235, 238, + /* 870 */ 510, 245, 49, 525, 527, 509, 526, 476, 475, 455, + /* 880 */ 252, 469, 474, 473, 472, 471, 470, 468, 467, 683, + /* 890 */ 466, 465, 464, 463, 462, 461, 460, 271, 272, 682, + /* 900 */ 677, 275, 276, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 151, 153, 170, 171, 156, 0, 158, 157, 151, 160, @@ -311,88 +312,88 @@ static const YYCODETYPE yy_lookahead[] = { /* 60 */ 179, 180, 184, 182, 12, 13, 14, 15, 16, 39, /* 70 */ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, /* 80 */ 50, 51, 52, 53, 54, 55, 14, 15, 16, 89, - /* 90 */ 90, 36, 92, 93, 94, 95, 96, 97, 98, 99, + /* 90 */ 90, 31, 92, 93, 94, 95, 96, 97, 98, 99, /* 100 */ 100, 101, 89, 90, 143, 92, 93, 94, 95, 96, /* 110 */ 97, 98, 99, 100, 101, 31, 155, 156, 67, 68, - /* 120 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 21, - /* 130 */ 79, 80, 81, 82, 83, 84, 154, 29, 156, 185, - /* 140 */ 107, 159, 160, 161, 162, 31, 31, 165, 166, 36, - /* 150 */ 168, 169, 154, 199, 156, 173, 174, 203, 160, 161, - /* 160 */ 162, 0, 141, 165, 166, 143, 168, 185, 154, 148, - /* 170 */ 156, 57, 57, 152, 160, 161, 162, 155, 156, 165, - /* 180 */ 166, 199, 168, 169, 76, 203, 31, 173, 174, 175, - /* 190 */ 112, 113, 114, 31, 86, 87, 88, 36, 154, 31, + /* 120 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 141, + /* 130 */ 79, 80, 81, 82, 83, 84, 154, 154, 156, 156, + /* 140 */ 152, 159, 160, 161, 162, 31, 31, 165, 166, 166, + /* 150 */ 168, 169, 154, 107, 156, 173, 174, 26, 160, 161, + /* 160 */ 162, 30, 31, 165, 166, 34, 168, 185, 154, 14, + /* 170 */ 156, 57, 57, 31, 160, 161, 162, 136, 137, 165, + /* 180 */ 166, 199, 168, 169, 53, 203, 31, 173, 174, 175, + /* 190 */ 36, 60, 61, 12, 13, 14, 15, 16, 154, 31, /* 200 */ 156, 187, 204, 205, 160, 161, 162, 193, 194, 165, - /* 210 */ 166, 167, 168, 154, 154, 156, 156, 136, 137, 160, - /* 220 */ 161, 162, 107, 58, 165, 166, 166, 168, 169, 154, - /* 230 */ 65, 156, 173, 174, 175, 160, 161, 162, 12, 13, - /* 240 */ 165, 166, 144, 168, 169, 147, 163, 21, 173, 174, - /* 250 */ 175, 155, 156, 194, 154, 29, 156, 31, 103, 184, - /* 260 */ 160, 161, 162, 37, 181, 165, 166, 163, 168, 169, - /* 270 */ 12, 13, 14, 173, 174, 175, 156, 153, 158, 21, - /* 280 */ 156, 163, 158, 57, 184, 181, 154, 29, 156, 31, - /* 290 */ 141, 159, 160, 161, 162, 37, 4, 165, 166, 181, - /* 300 */ 168, 152, 76, 139, 105, 106, 142, 12, 13, 138, + /* 210 */ 166, 167, 168, 154, 89, 156, 112, 113, 114, 160, + /* 220 */ 161, 162, 107, 98, 165, 166, 101, 168, 169, 154, + /* 230 */ 36, 156, 173, 174, 175, 160, 161, 162, 12, 13, + /* 240 */ 165, 166, 63, 168, 169, 103, 139, 21, 173, 174, + /* 250 */ 175, 155, 156, 194, 154, 29, 156, 31, 163, 184, + /* 260 */ 160, 161, 162, 37, 185, 165, 166, 197, 168, 169, + /* 270 */ 12, 13, 14, 173, 174, 175, 181, 144, 199, 21, + /* 280 */ 147, 65, 203, 57, 184, 57, 154, 29, 156, 31, + /* 290 */ 62, 159, 160, 161, 162, 37, 153, 165, 166, 156, + /* 300 */ 168, 158, 76, 139, 1, 2, 142, 12, 13, 143, /* 310 */ 12, 13, 86, 87, 88, 57, 21, 185, 154, 21, - /* 320 */ 149, 104, 19, 106, 29, 31, 31, 29, 63, 31, - /* 330 */ 27, 199, 37, 107, 76, 203, 33, 12, 13, 14, - /* 340 */ 15, 16, 1, 2, 86, 87, 88, 12, 13, 14, - /* 350 */ 15, 16, 57, 197, 3, 57, 154, 190, 156, 56, - /* 360 */ 1, 2, 160, 161, 162, 2, 58, 165, 166, 167, - /* 370 */ 168, 76, 65, 65, 76, 12, 13, 14, 15, 16, - /* 380 */ 164, 86, 87, 88, 86, 87, 88, 154, 139, 156, - /* 390 */ 183, 142, 37, 160, 161, 162, 139, 103, 165, 166, - /* 400 */ 108, 168, 169, 154, 14, 107, 173, 174, 154, 139, - /* 410 */ 156, 154, 132, 133, 160, 161, 162, 58, 21, 165, - /* 420 */ 166, 31, 168, 169, 154, 168, 29, 173, 174, 159, - /* 430 */ 21, 65, 156, 126, 177, 178, 179, 180, 168, 182, - /* 440 */ 31, 32, 12, 13, 14, 200, 91, 58, 178, 179, - /* 450 */ 180, 21, 182, 139, 65, 185, 142, 12, 13, 29, - /* 460 */ 58, 31, 12, 13, 129, 130, 21, 65, 154, 199, - /* 470 */ 186, 21, 136, 203, 29, 124, 31, 138, 31, 29, - /* 480 */ 164, 31, 57, 134, 154, 146, 156, 57, 149, 64, - /* 490 */ 160, 161, 162, 26, 128, 165, 166, 30, 168, 169, - /* 500 */ 20, 34, 57, 23, 174, 18, 76, 57, 159, 22, - /* 510 */ 57, 24, 25, 196, 116, 62, 86, 87, 88, 115, - /* 520 */ 53, 76, 35, 58, 195, 88, 76, 60, 61, 161, - /* 530 */ 65, 86, 87, 88, 185, 58, 86, 87, 88, 154, - /* 540 */ 161, 156, 65, 196, 161, 160, 161, 162, 199, 195, - /* 550 */ 165, 166, 203, 168, 154, 123, 156, 58, 122, 192, - /* 560 */ 160, 161, 162, 191, 65, 165, 166, 167, 168, 110, - /* 570 */ 154, 189, 156, 109, 188, 106, 160, 161, 162, 58, - /* 580 */ 89, 165, 166, 198, 168, 31, 65, 154, 31, 98, - /* 590 */ 163, 58, 101, 154, 107, 156, 58, 102, 65, 160, + /* 320 */ 163, 155, 156, 0, 29, 139, 31, 29, 142, 31, + /* 330 */ 141, 199, 37, 107, 76, 203, 4, 148, 181, 163, + /* 340 */ 154, 152, 126, 21, 86, 87, 88, 12, 13, 14, + /* 350 */ 15, 16, 57, 31, 32, 57, 154, 181, 156, 36, + /* 360 */ 31, 58, 160, 161, 162, 2, 183, 165, 166, 167, + /* 370 */ 168, 76, 105, 106, 76, 12, 13, 14, 15, 16, + /* 380 */ 3, 86, 87, 88, 86, 87, 88, 154, 139, 156, + /* 390 */ 156, 142, 158, 160, 161, 162, 139, 190, 165, 166, + /* 400 */ 164, 168, 169, 154, 21, 107, 173, 174, 154, 139, + /* 410 */ 156, 154, 29, 200, 160, 161, 162, 65, 139, 165, + /* 420 */ 166, 142, 168, 169, 154, 168, 186, 173, 174, 159, + /* 430 */ 138, 37, 103, 154, 177, 178, 179, 180, 168, 182, + /* 440 */ 108, 149, 12, 13, 14, 138, 156, 58, 178, 179, + /* 450 */ 180, 21, 182, 146, 65, 185, 149, 12, 13, 29, + /* 460 */ 58, 31, 12, 13, 129, 130, 21, 65, 104, 199, + /* 470 */ 106, 21, 136, 203, 29, 58, 31, 132, 133, 29, + /* 480 */ 128, 31, 65, 134, 154, 91, 156, 57, 31, 164, + /* 490 */ 160, 161, 162, 1, 2, 165, 166, 20, 168, 169, + /* 500 */ 23, 124, 57, 57, 174, 18, 76, 57, 159, 22, + /* 510 */ 64, 24, 25, 116, 196, 195, 86, 87, 88, 115, + /* 520 */ 21, 76, 35, 58, 88, 192, 76, 161, 29, 161, + /* 530 */ 65, 86, 87, 88, 185, 196, 86, 87, 88, 154, + /* 540 */ 161, 156, 58, 195, 123, 160, 161, 162, 199, 65, + /* 550 */ 165, 166, 203, 168, 154, 122, 156, 110, 191, 189, + /* 560 */ 160, 161, 162, 109, 58, 165, 166, 167, 168, 188, + /* 570 */ 154, 65, 156, 106, 31, 76, 160, 161, 162, 154, + /* 580 */ 31, 165, 166, 198, 168, 86, 87, 88, 12, 13, + /* 590 */ 14, 15, 16, 154, 107, 156, 58, 163, 102, 160, /* 600 */ 161, 162, 176, 65, 165, 166, 154, 168, 156, 58, - /* 610 */ 57, 127, 160, 161, 162, 172, 65, 165, 166, 131, - /* 620 */ 168, 205, 207, 202, 154, 0, 156, 125, 31, 201, - /* 630 */ 160, 161, 162, 139, 141, 165, 166, 139, 168, 154, - /* 640 */ 31, 156, 135, 135, 147, 160, 161, 162, 138, 57, - /* 650 */ 165, 166, 139, 168, 154, 0, 156, 154, 138, 150, - /* 660 */ 160, 161, 162, 135, 145, 165, 166, 145, 168, 140, - /* 670 */ 65, 154, 47, 156, 111, 65, 51, 160, 161, 162, - /* 680 */ 65, 58, 165, 166, 58, 168, 154, 57, 156, 58, - /* 690 */ 57, 66, 160, 161, 162, 57, 57, 165, 166, 58, - /* 700 */ 168, 154, 47, 156, 58, 29, 51, 160, 161, 162, - /* 710 */ 85, 64, 165, 166, 65, 168, 154, 57, 156, 65, - /* 720 */ 58, 66, 160, 161, 162, 111, 58, 165, 166, 64, - /* 730 */ 168, 154, 104, 156, 65, 64, 2, 160, 161, 162, - /* 740 */ 85, 91, 165, 166, 58, 168, 58, 65, 154, 4, - /* 750 */ 156, 111, 29, 29, 160, 161, 162, 29, 29, 165, - /* 760 */ 166, 154, 168, 156, 29, 29, 64, 160, 161, 162, - /* 770 */ 57, 139, 165, 166, 0, 168, 154, 0, 156, 0, - /* 780 */ 0, 0, 160, 161, 162, 0, 154, 165, 166, 91, - /* 790 */ 168, 154, 0, 156, 0, 38, 0, 160, 161, 162, - /* 800 */ 168, 19, 165, 166, 0, 168, 0, 0, 0, 21, - /* 810 */ 178, 179, 180, 0, 182, 117, 118, 119, 120, 121, - /* 820 */ 19, 21, 57, 12, 13, 14, 15, 16, 27, 62, - /* 830 */ 64, 21, 64, 57, 33, 63, 58, 78, 29, 78, - /* 840 */ 57, 29, 58, 29, 57, 29, 29, 58, 57, 29, - /* 850 */ 21, 58, 57, 78, 29, 58, 57, 56, 21, 29, - /* 860 */ 59, 38, 57, 37, 78, 29, 0, 29, 66, 58, - /* 870 */ 29, 29, 57, 29, 29, 29, 21, 29, 29, 29, - /* 880 */ 29, 29, 29, 29, 0, 29, 29, 29, 28, 0, - /* 890 */ 21, 20, 208, 208, 208, 208, 208, 208, 208, 208, - /* 900 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + /* 610 */ 57, 131, 160, 161, 162, 19, 65, 165, 166, 207, + /* 620 */ 168, 205, 127, 27, 154, 0, 156, 172, 125, 33, + /* 630 */ 160, 161, 162, 202, 58, 165, 166, 58, 168, 154, + /* 640 */ 31, 156, 58, 201, 65, 160, 161, 162, 139, 65, + /* 650 */ 165, 166, 56, 168, 154, 59, 156, 141, 139, 141, + /* 660 */ 160, 161, 162, 58, 31, 165, 166, 147, 168, 135, + /* 670 */ 65, 154, 47, 156, 135, 138, 51, 160, 161, 162, + /* 680 */ 154, 57, 165, 166, 139, 168, 154, 135, 156, 145, + /* 690 */ 150, 66, 160, 161, 162, 138, 140, 165, 166, 145, + /* 700 */ 168, 154, 111, 156, 65, 65, 58, 160, 161, 162, + /* 710 */ 85, 58, 165, 166, 57, 168, 154, 65, 156, 0, + /* 720 */ 58, 57, 160, 161, 162, 57, 57, 165, 166, 58, + /* 730 */ 168, 154, 58, 156, 29, 65, 64, 160, 161, 162, + /* 740 */ 57, 65, 165, 166, 58, 168, 111, 58, 154, 64, + /* 750 */ 156, 104, 65, 2, 160, 161, 162, 64, 91, 165, + /* 760 */ 166, 154, 168, 156, 58, 58, 47, 160, 161, 162, + /* 770 */ 51, 139, 165, 166, 65, 168, 154, 111, 156, 4, + /* 780 */ 64, 29, 160, 161, 162, 66, 154, 165, 166, 91, + /* 790 */ 168, 154, 29, 156, 29, 29, 29, 160, 161, 162, + /* 800 */ 168, 29, 165, 166, 85, 168, 57, 0, 0, 0, + /* 810 */ 178, 179, 180, 19, 182, 117, 118, 119, 120, 121, + /* 820 */ 64, 27, 53, 0, 0, 0, 0, 33, 0, 0, + /* 830 */ 0, 38, 0, 0, 0, 0, 0, 21, 0, 21, + /* 840 */ 19, 57, 62, 64, 57, 64, 63, 58, 21, 29, + /* 850 */ 56, 29, 57, 59, 58, 57, 78, 58, 57, 57, + /* 860 */ 29, 58, 58, 57, 78, 21, 29, 57, 29, 29, + /* 870 */ 78, 66, 57, 21, 29, 78, 29, 29, 29, 38, + /* 880 */ 37, 21, 29, 29, 29, 29, 29, 29, 29, 0, + /* 890 */ 29, 29, 29, 29, 29, 29, 29, 29, 28, 0, + /* 900 */ 0, 21, 20, 208, 208, 208, 208, 208, 208, 208, /* 910 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, /* 920 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, /* 930 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, @@ -404,87 +405,88 @@ static const YYCODETYPE yy_lookahead[] = { /* 990 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, /* 1000 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, /* 1010 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, - /* 1020 */ 208, 208, 208, 208, 208, 208, + /* 1020 */ 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + /* 1030 */ 208, 208, 208, 208, 208, 208, 208, }; -#define YY_SHIFT_COUNT (271) +#define YY_SHIFT_COUNT (277) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (889) +#define YY_SHIFT_MAX (900) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 487, 226, 258, 295, 295, 295, 295, 298, 295, 295, /* 10 */ 115, 445, 450, 430, 450, 450, 450, 450, 450, 450, /* 20 */ 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, - /* 30 */ 450, 450, 114, 114, 114, 108, 108, 84, 84, 33, - /* 40 */ 162, 55, 168, 162, 162, 168, 162, 168, 168, 168, - /* 50 */ 162, 113, 0, 13, 13, 108, 409, 155, 155, 155, - /* 60 */ 5, 161, 168, 168, 265, 51, 335, 698, 78, 294, - /* 70 */ 217, 199, 217, 390, 351, 292, 397, 447, 398, 404, - /* 80 */ 437, 437, 398, 404, 437, 432, 436, 459, 464, 469, - /* 90 */ 554, 557, 495, 553, 488, 484, 502, 168, 597, 597, - /* 100 */ 55, 609, 609, 265, 113, 554, 592, 597, 113, 609, - /* 110 */ 892, 892, 892, 30, 52, 363, 811, 467, 325, 325, - /* 120 */ 325, 325, 325, 325, 325, 625, 655, 801, 303, 359, - /* 130 */ 491, 72, 72, 72, 72, 165, 308, 341, 389, 355, - /* 140 */ 280, 307, 366, 402, 425, 480, 465, 477, 499, 521, - /* 150 */ 533, 538, 551, 453, 605, 610, 563, 623, 626, 630, - /* 160 */ 615, 631, 633, 638, 641, 639, 646, 676, 649, 647, - /* 170 */ 660, 654, 614, 662, 668, 665, 628, 669, 671, 734, - /* 180 */ 650, 686, 688, 682, 640, 745, 723, 724, 728, 729, - /* 190 */ 735, 736, 702, 713, 774, 777, 779, 780, 781, 785, - /* 200 */ 792, 794, 757, 796, 804, 806, 807, 808, 788, 813, - /* 210 */ 800, 782, 765, 767, 766, 768, 810, 776, 772, 778, - /* 220 */ 809, 812, 783, 784, 814, 787, 789, 816, 791, 793, - /* 230 */ 817, 795, 797, 820, 799, 759, 761, 775, 786, 829, - /* 240 */ 802, 805, 815, 825, 830, 837, 823, 826, 836, 838, - /* 250 */ 841, 842, 844, 845, 846, 855, 848, 849, 850, 851, - /* 260 */ 852, 853, 854, 856, 857, 866, 858, 860, 884, 889, - /* 270 */ 869, 871, + /* 30 */ 450, 450, 114, 114, 114, 499, 499, 60, 60, 46, + /* 40 */ 84, 84, 154, 168, 84, 84, 168, 84, 168, 168, + /* 50 */ 168, 84, 194, 0, 13, 13, 499, 322, 142, 142, + /* 60 */ 142, 5, 323, 168, 168, 179, 51, 335, 131, 698, + /* 70 */ 104, 329, 364, 267, 364, 155, 377, 332, 383, 457, + /* 80 */ 397, 404, 436, 436, 397, 404, 436, 421, 433, 447, + /* 90 */ 454, 467, 543, 549, 496, 553, 480, 495, 503, 168, + /* 100 */ 609, 154, 609, 154, 633, 633, 179, 194, 543, 624, + /* 110 */ 609, 194, 633, 903, 903, 903, 30, 52, 363, 576, + /* 120 */ 181, 181, 181, 181, 181, 181, 181, 596, 625, 719, + /* 130 */ 794, 303, 125, 72, 72, 72, 72, 389, 402, 492, + /* 140 */ 417, 394, 345, 216, 352, 465, 446, 477, 484, 506, + /* 150 */ 538, 551, 579, 584, 605, 228, 639, 640, 591, 648, + /* 160 */ 653, 657, 652, 662, 664, 668, 671, 669, 674, 705, + /* 170 */ 670, 672, 683, 676, 635, 686, 689, 685, 647, 687, + /* 180 */ 693, 751, 667, 706, 707, 709, 666, 775, 752, 763, + /* 190 */ 765, 766, 767, 772, 716, 749, 807, 808, 809, 769, + /* 200 */ 756, 823, 824, 825, 826, 828, 829, 830, 793, 832, + /* 210 */ 833, 834, 835, 836, 816, 838, 818, 821, 784, 780, + /* 220 */ 779, 781, 827, 787, 783, 789, 820, 822, 795, 796, + /* 230 */ 831, 798, 799, 837, 801, 803, 839, 802, 804, 840, + /* 240 */ 806, 778, 786, 792, 797, 844, 805, 810, 815, 845, + /* 250 */ 847, 852, 841, 843, 848, 849, 853, 854, 855, 856, + /* 260 */ 857, 860, 858, 859, 861, 862, 863, 864, 865, 866, + /* 270 */ 867, 889, 868, 870, 899, 900, 880, 882, }; -#define YY_REDUCE_COUNT (112) +#define YY_REDUCE_COUNT (115) #define YY_REDUCE_MIN (-184) #define YY_REDUCE_MAX (637) static const short yy_reduce_ofst[] = { /* 0 */ 349, -18, 14, 59, -122, 75, 100, 132, 233, 254, /* 10 */ 270, 330, -2, 44, 202, 385, 400, 416, 439, 452, /* 20 */ 470, 485, 500, 517, 532, 547, 562, 577, 594, 607, - /* 30 */ 622, 637, 257, -119, 632, -151, -143, -135, 60, -46, - /* 40 */ -106, 21, -132, -97, 164, -152, 249, -39, 124, 22, - /* 50 */ 314, 339, -168, -168, -168, -105, 81, 83, 104, 118, - /* 60 */ 149, 171, 96, 120, 98, -150, -184, 156, 167, 216, - /* 70 */ 207, 207, 207, 276, 245, 284, 336, 316, 317, 329, - /* 80 */ 368, 379, 347, 354, 383, 367, 372, 382, 386, 207, - /* 90 */ 433, 427, 426, 443, 415, 421, 428, 276, 494, 498, - /* 100 */ 493, 507, 508, 497, 510, 503, 509, 513, 520, 528, - /* 110 */ 519, 522, 529, + /* 30 */ 622, 637, 257, -119, 632, -151, -143, -135, -17, 79, + /* 40 */ -106, -97, 189, -132, 164, 186, -152, 249, -39, 143, + /* 50 */ 166, 279, 307, -168, -168, -168, -105, 41, 95, 157, + /* 60 */ 176, -12, 292, 96, 234, 133, -150, -184, 107, 70, + /* 70 */ 207, 236, 183, 183, 183, 290, 213, 240, 336, 325, + /* 80 */ 318, 320, 366, 368, 339, 348, 379, 333, 367, 370, + /* 90 */ 381, 183, 425, 434, 426, 455, 412, 431, 442, 290, + /* 100 */ 509, 516, 519, 518, 534, 539, 520, 537, 526, 540, + /* 110 */ 545, 557, 552, 544, 554, 556, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 10 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 20 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 30 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 40 */ 666, 689, 666, 666, 666, 666, 666, 666, 666, 666, - /* 50 */ 666, 687, 666, 822, 666, 666, 666, 833, 833, 833, - /* 60 */ 689, 687, 666, 666, 751, 666, 897, 666, 857, 849, - /* 70 */ 825, 839, 826, 666, 882, 842, 666, 666, 864, 862, - /* 80 */ 666, 666, 864, 862, 666, 876, 872, 855, 853, 839, - /* 90 */ 666, 666, 666, 666, 900, 888, 884, 666, 666, 666, - /* 100 */ 689, 666, 666, 666, 687, 666, 720, 666, 687, 666, - /* 110 */ 754, 754, 690, 666, 666, 666, 666, 666, 875, 874, - /* 120 */ 799, 798, 797, 793, 794, 666, 666, 666, 666, 666, - /* 130 */ 666, 788, 789, 787, 786, 666, 666, 823, 666, 666, - /* 140 */ 666, 885, 889, 666, 775, 666, 666, 666, 666, 666, - /* 150 */ 666, 666, 666, 666, 846, 856, 666, 666, 666, 666, - /* 160 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 775, - /* 170 */ 666, 873, 666, 832, 828, 666, 666, 824, 666, 818, - /* 180 */ 666, 666, 666, 883, 666, 666, 666, 666, 666, 666, - /* 190 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 200 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 210 */ 666, 666, 666, 666, 774, 666, 666, 666, 666, 666, - /* 220 */ 666, 666, 748, 666, 666, 666, 666, 666, 666, 666, - /* 230 */ 666, 666, 666, 666, 666, 733, 731, 730, 729, 666, - /* 240 */ 726, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 250 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 260 */ 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, - /* 270 */ 666, 666, + /* 0 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 10 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 20 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 30 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 40 */ 674, 674, 697, 674, 674, 674, 674, 674, 674, 674, + /* 50 */ 674, 674, 695, 674, 832, 674, 674, 674, 843, 843, + /* 60 */ 843, 697, 695, 674, 674, 760, 674, 907, 674, 674, + /* 70 */ 867, 859, 835, 849, 836, 674, 892, 852, 674, 674, + /* 80 */ 874, 872, 674, 674, 874, 872, 674, 886, 882, 865, + /* 90 */ 863, 849, 674, 674, 674, 674, 910, 898, 894, 674, + /* 100 */ 674, 697, 674, 697, 674, 674, 674, 695, 674, 729, + /* 110 */ 674, 695, 674, 763, 763, 698, 674, 674, 674, 674, + /* 120 */ 885, 884, 809, 808, 807, 803, 804, 674, 674, 674, + /* 130 */ 674, 674, 674, 798, 799, 797, 796, 674, 674, 833, + /* 140 */ 674, 674, 674, 895, 899, 674, 785, 674, 674, 674, + /* 150 */ 674, 674, 674, 674, 674, 674, 856, 866, 674, 674, + /* 160 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 170 */ 674, 785, 674, 883, 674, 842, 838, 674, 674, 834, + /* 180 */ 674, 828, 674, 674, 674, 893, 674, 674, 674, 674, + /* 190 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 200 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 210 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 220 */ 784, 674, 674, 674, 674, 674, 674, 674, 757, 674, + /* 230 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 240 */ 674, 742, 740, 739, 738, 674, 735, 674, 674, 674, + /* 250 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 260 */ 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + /* 270 */ 674, 674, 674, 674, 674, 674, 674, 674, }; /********** End of lemon-generated parsing tables *****************************/ @@ -849,197 +851,199 @@ static const char *const yyRuleName[] = { /* 40 */ "cmd ::= CREATE TABLE multi_create_clause", /* 41 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", /* 42 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 43 */ "cmd ::= SHOW TABLES", - /* 44 */ "cmd ::= SHOW STABLES", - /* 45 */ "multi_create_clause ::= create_subtable_clause", - /* 46 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 47 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", - /* 48 */ "multi_drop_clause ::= drop_table_clause", - /* 49 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 50 */ "drop_table_clause ::= exists_opt full_table_name", - /* 51 */ "specific_tags_opt ::=", - /* 52 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", - /* 53 */ "full_table_name ::= table_name", - /* 54 */ "full_table_name ::= db_name NK_DOT table_name", - /* 55 */ "column_def_list ::= column_def", - /* 56 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 57 */ "column_def ::= column_name type_name", - /* 58 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 59 */ "type_name ::= BOOL", - /* 60 */ "type_name ::= TINYINT", - /* 61 */ "type_name ::= SMALLINT", - /* 62 */ "type_name ::= INT", - /* 63 */ "type_name ::= INTEGER", - /* 64 */ "type_name ::= BIGINT", - /* 65 */ "type_name ::= FLOAT", - /* 66 */ "type_name ::= DOUBLE", - /* 67 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 68 */ "type_name ::= TIMESTAMP", - /* 69 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 70 */ "type_name ::= TINYINT UNSIGNED", - /* 71 */ "type_name ::= SMALLINT UNSIGNED", - /* 72 */ "type_name ::= INT UNSIGNED", - /* 73 */ "type_name ::= BIGINT UNSIGNED", - /* 74 */ "type_name ::= JSON", - /* 75 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 76 */ "type_name ::= MEDIUMBLOB", - /* 77 */ "type_name ::= BLOB", - /* 78 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 79 */ "type_name ::= DECIMAL", - /* 80 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 81 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 82 */ "tags_def_opt ::=", - /* 83 */ "tags_def_opt ::= tags_def", - /* 84 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 85 */ "table_options ::=", - /* 86 */ "table_options ::= table_options COMMENT NK_STRING", - /* 87 */ "table_options ::= table_options KEEP NK_INTEGER", - /* 88 */ "table_options ::= table_options TTL NK_INTEGER", - /* 89 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 90 */ "col_name_list ::= col_name", - /* 91 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 92 */ "col_name ::= column_name", - /* 93 */ "cmd ::= SHOW VGROUPS", - /* 94 */ "cmd ::= query_expression", - /* 95 */ "literal ::= NK_INTEGER", - /* 96 */ "literal ::= NK_FLOAT", - /* 97 */ "literal ::= NK_STRING", - /* 98 */ "literal ::= NK_BOOL", - /* 99 */ "literal ::= TIMESTAMP NK_STRING", - /* 100 */ "literal ::= duration_literal", - /* 101 */ "duration_literal ::= NK_VARIABLE", - /* 102 */ "literal_list ::= literal", - /* 103 */ "literal_list ::= literal_list NK_COMMA literal", - /* 104 */ "db_name ::= NK_ID", - /* 105 */ "table_name ::= NK_ID", - /* 106 */ "column_name ::= NK_ID", - /* 107 */ "function_name ::= NK_ID", - /* 108 */ "table_alias ::= NK_ID", - /* 109 */ "column_alias ::= NK_ID", - /* 110 */ "user_name ::= NK_ID", - /* 111 */ "expression ::= literal", - /* 112 */ "expression ::= column_reference", - /* 113 */ "expression ::= function_name NK_LP expression_list NK_RP", - /* 114 */ "expression ::= function_name NK_LP NK_STAR NK_RP", - /* 115 */ "expression ::= subquery", - /* 116 */ "expression ::= NK_LP expression NK_RP", - /* 117 */ "expression ::= NK_PLUS expression", - /* 118 */ "expression ::= NK_MINUS expression", - /* 119 */ "expression ::= expression NK_PLUS expression", - /* 120 */ "expression ::= expression NK_MINUS expression", - /* 121 */ "expression ::= expression NK_STAR expression", - /* 122 */ "expression ::= expression NK_SLASH expression", - /* 123 */ "expression ::= expression NK_REM expression", - /* 124 */ "expression_list ::= expression", - /* 125 */ "expression_list ::= expression_list NK_COMMA expression", - /* 126 */ "column_reference ::= column_name", - /* 127 */ "column_reference ::= table_name NK_DOT column_name", - /* 128 */ "predicate ::= expression compare_op expression", - /* 129 */ "predicate ::= expression BETWEEN expression AND expression", - /* 130 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 131 */ "predicate ::= expression IS NULL", - /* 132 */ "predicate ::= expression IS NOT NULL", - /* 133 */ "predicate ::= expression in_op in_predicate_value", - /* 134 */ "compare_op ::= NK_LT", - /* 135 */ "compare_op ::= NK_GT", - /* 136 */ "compare_op ::= NK_LE", - /* 137 */ "compare_op ::= NK_GE", - /* 138 */ "compare_op ::= NK_NE", - /* 139 */ "compare_op ::= NK_EQ", - /* 140 */ "compare_op ::= LIKE", - /* 141 */ "compare_op ::= NOT LIKE", - /* 142 */ "compare_op ::= MATCH", - /* 143 */ "compare_op ::= NMATCH", - /* 144 */ "in_op ::= IN", - /* 145 */ "in_op ::= NOT IN", - /* 146 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 147 */ "boolean_value_expression ::= boolean_primary", - /* 148 */ "boolean_value_expression ::= NOT boolean_primary", - /* 149 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 150 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 151 */ "boolean_primary ::= predicate", - /* 152 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 153 */ "common_expression ::= expression", - /* 154 */ "common_expression ::= boolean_value_expression", - /* 155 */ "from_clause ::= FROM table_reference_list", - /* 156 */ "table_reference_list ::= table_reference", - /* 157 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 158 */ "table_reference ::= table_primary", - /* 159 */ "table_reference ::= joined_table", - /* 160 */ "table_primary ::= table_name alias_opt", - /* 161 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 162 */ "table_primary ::= subquery alias_opt", - /* 163 */ "table_primary ::= parenthesized_joined_table", - /* 164 */ "alias_opt ::=", - /* 165 */ "alias_opt ::= table_alias", - /* 166 */ "alias_opt ::= AS table_alias", - /* 167 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 168 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 169 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 170 */ "join_type ::=", - /* 171 */ "join_type ::= INNER", - /* 172 */ "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", - /* 173 */ "set_quantifier_opt ::=", - /* 174 */ "set_quantifier_opt ::= DISTINCT", - /* 175 */ "set_quantifier_opt ::= ALL", - /* 176 */ "select_list ::= NK_STAR", - /* 177 */ "select_list ::= select_sublist", - /* 178 */ "select_sublist ::= select_item", - /* 179 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 180 */ "select_item ::= common_expression", - /* 181 */ "select_item ::= common_expression column_alias", - /* 182 */ "select_item ::= common_expression AS column_alias", - /* 183 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 184 */ "where_clause_opt ::=", - /* 185 */ "where_clause_opt ::= WHERE search_condition", - /* 186 */ "partition_by_clause_opt ::=", - /* 187 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 188 */ "twindow_clause_opt ::=", - /* 189 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", - /* 190 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", - /* 191 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 192 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 193 */ "sliding_opt ::=", - /* 194 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 195 */ "fill_opt ::=", - /* 196 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 197 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 198 */ "fill_mode ::= NONE", - /* 199 */ "fill_mode ::= PREV", - /* 200 */ "fill_mode ::= NULL", - /* 201 */ "fill_mode ::= LINEAR", - /* 202 */ "fill_mode ::= NEXT", - /* 203 */ "group_by_clause_opt ::=", - /* 204 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 205 */ "group_by_list ::= expression", - /* 206 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 207 */ "having_clause_opt ::=", - /* 208 */ "having_clause_opt ::= HAVING search_condition", - /* 209 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 210 */ "query_expression_body ::= query_primary", - /* 211 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 212 */ "query_primary ::= query_specification", - /* 213 */ "order_by_clause_opt ::=", - /* 214 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 215 */ "slimit_clause_opt ::=", - /* 216 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 217 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 218 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 219 */ "limit_clause_opt ::=", - /* 220 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 221 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 222 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 223 */ "subquery ::= NK_LP query_expression NK_RP", - /* 224 */ "search_condition ::= common_expression", - /* 225 */ "sort_specification_list ::= sort_specification", - /* 226 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 227 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 228 */ "ordering_specification_opt ::=", - /* 229 */ "ordering_specification_opt ::= ASC", - /* 230 */ "ordering_specification_opt ::= DESC", - /* 231 */ "null_ordering_opt ::=", - /* 232 */ "null_ordering_opt ::= NULLS FIRST", - /* 233 */ "null_ordering_opt ::= NULLS LAST", + /* 43 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 44 */ "cmd ::= SHOW TABLES", + /* 45 */ "cmd ::= SHOW STABLES", + /* 46 */ "multi_create_clause ::= create_subtable_clause", + /* 47 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 48 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", + /* 49 */ "multi_drop_clause ::= drop_table_clause", + /* 50 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 51 */ "drop_table_clause ::= exists_opt full_table_name", + /* 52 */ "specific_tags_opt ::=", + /* 53 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", + /* 54 */ "full_table_name ::= table_name", + /* 55 */ "full_table_name ::= db_name NK_DOT table_name", + /* 56 */ "column_def_list ::= column_def", + /* 57 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 58 */ "column_def ::= column_name type_name", + /* 59 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 60 */ "type_name ::= BOOL", + /* 61 */ "type_name ::= TINYINT", + /* 62 */ "type_name ::= SMALLINT", + /* 63 */ "type_name ::= INT", + /* 64 */ "type_name ::= INTEGER", + /* 65 */ "type_name ::= BIGINT", + /* 66 */ "type_name ::= FLOAT", + /* 67 */ "type_name ::= DOUBLE", + /* 68 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 69 */ "type_name ::= TIMESTAMP", + /* 70 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 71 */ "type_name ::= TINYINT UNSIGNED", + /* 72 */ "type_name ::= SMALLINT UNSIGNED", + /* 73 */ "type_name ::= INT UNSIGNED", + /* 74 */ "type_name ::= BIGINT UNSIGNED", + /* 75 */ "type_name ::= JSON", + /* 76 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 77 */ "type_name ::= MEDIUMBLOB", + /* 78 */ "type_name ::= BLOB", + /* 79 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 80 */ "type_name ::= DECIMAL", + /* 81 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 82 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 83 */ "tags_def_opt ::=", + /* 84 */ "tags_def_opt ::= tags_def", + /* 85 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 86 */ "table_options ::=", + /* 87 */ "table_options ::= table_options COMMENT NK_STRING", + /* 88 */ "table_options ::= table_options KEEP NK_INTEGER", + /* 89 */ "table_options ::= table_options TTL NK_INTEGER", + /* 90 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 91 */ "col_name_list ::= col_name", + /* 92 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 93 */ "col_name ::= column_name", + /* 94 */ "cmd ::= SHOW VGROUPS", + /* 95 */ "cmd ::= SHOW db_name NK_DOT VGROUPS", + /* 96 */ "cmd ::= query_expression", + /* 97 */ "literal ::= NK_INTEGER", + /* 98 */ "literal ::= NK_FLOAT", + /* 99 */ "literal ::= NK_STRING", + /* 100 */ "literal ::= NK_BOOL", + /* 101 */ "literal ::= TIMESTAMP NK_STRING", + /* 102 */ "literal ::= duration_literal", + /* 103 */ "duration_literal ::= NK_VARIABLE", + /* 104 */ "literal_list ::= literal", + /* 105 */ "literal_list ::= literal_list NK_COMMA literal", + /* 106 */ "db_name ::= NK_ID", + /* 107 */ "table_name ::= NK_ID", + /* 108 */ "column_name ::= NK_ID", + /* 109 */ "function_name ::= NK_ID", + /* 110 */ "table_alias ::= NK_ID", + /* 111 */ "column_alias ::= NK_ID", + /* 112 */ "user_name ::= NK_ID", + /* 113 */ "expression ::= literal", + /* 114 */ "expression ::= column_reference", + /* 115 */ "expression ::= function_name NK_LP expression_list NK_RP", + /* 116 */ "expression ::= function_name NK_LP NK_STAR NK_RP", + /* 117 */ "expression ::= subquery", + /* 118 */ "expression ::= NK_LP expression NK_RP", + /* 119 */ "expression ::= NK_PLUS expression", + /* 120 */ "expression ::= NK_MINUS expression", + /* 121 */ "expression ::= expression NK_PLUS expression", + /* 122 */ "expression ::= expression NK_MINUS expression", + /* 123 */ "expression ::= expression NK_STAR expression", + /* 124 */ "expression ::= expression NK_SLASH expression", + /* 125 */ "expression ::= expression NK_REM expression", + /* 126 */ "expression_list ::= expression", + /* 127 */ "expression_list ::= expression_list NK_COMMA expression", + /* 128 */ "column_reference ::= column_name", + /* 129 */ "column_reference ::= table_name NK_DOT column_name", + /* 130 */ "predicate ::= expression compare_op expression", + /* 131 */ "predicate ::= expression BETWEEN expression AND expression", + /* 132 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 133 */ "predicate ::= expression IS NULL", + /* 134 */ "predicate ::= expression IS NOT NULL", + /* 135 */ "predicate ::= expression in_op in_predicate_value", + /* 136 */ "compare_op ::= NK_LT", + /* 137 */ "compare_op ::= NK_GT", + /* 138 */ "compare_op ::= NK_LE", + /* 139 */ "compare_op ::= NK_GE", + /* 140 */ "compare_op ::= NK_NE", + /* 141 */ "compare_op ::= NK_EQ", + /* 142 */ "compare_op ::= LIKE", + /* 143 */ "compare_op ::= NOT LIKE", + /* 144 */ "compare_op ::= MATCH", + /* 145 */ "compare_op ::= NMATCH", + /* 146 */ "in_op ::= IN", + /* 147 */ "in_op ::= NOT IN", + /* 148 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 149 */ "boolean_value_expression ::= boolean_primary", + /* 150 */ "boolean_value_expression ::= NOT boolean_primary", + /* 151 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 152 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 153 */ "boolean_primary ::= predicate", + /* 154 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 155 */ "common_expression ::= expression", + /* 156 */ "common_expression ::= boolean_value_expression", + /* 157 */ "from_clause ::= FROM table_reference_list", + /* 158 */ "table_reference_list ::= table_reference", + /* 159 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 160 */ "table_reference ::= table_primary", + /* 161 */ "table_reference ::= joined_table", + /* 162 */ "table_primary ::= table_name alias_opt", + /* 163 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 164 */ "table_primary ::= subquery alias_opt", + /* 165 */ "table_primary ::= parenthesized_joined_table", + /* 166 */ "alias_opt ::=", + /* 167 */ "alias_opt ::= table_alias", + /* 168 */ "alias_opt ::= AS table_alias", + /* 169 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 170 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 171 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 172 */ "join_type ::=", + /* 173 */ "join_type ::= INNER", + /* 174 */ "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", + /* 175 */ "set_quantifier_opt ::=", + /* 176 */ "set_quantifier_opt ::= DISTINCT", + /* 177 */ "set_quantifier_opt ::= ALL", + /* 178 */ "select_list ::= NK_STAR", + /* 179 */ "select_list ::= select_sublist", + /* 180 */ "select_sublist ::= select_item", + /* 181 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 182 */ "select_item ::= common_expression", + /* 183 */ "select_item ::= common_expression column_alias", + /* 184 */ "select_item ::= common_expression AS column_alias", + /* 185 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 186 */ "where_clause_opt ::=", + /* 187 */ "where_clause_opt ::= WHERE search_condition", + /* 188 */ "partition_by_clause_opt ::=", + /* 189 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 190 */ "twindow_clause_opt ::=", + /* 191 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", + /* 192 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", + /* 193 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 194 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 195 */ "sliding_opt ::=", + /* 196 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 197 */ "fill_opt ::=", + /* 198 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 199 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 200 */ "fill_mode ::= NONE", + /* 201 */ "fill_mode ::= PREV", + /* 202 */ "fill_mode ::= NULL", + /* 203 */ "fill_mode ::= LINEAR", + /* 204 */ "fill_mode ::= NEXT", + /* 205 */ "group_by_clause_opt ::=", + /* 206 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 207 */ "group_by_list ::= expression", + /* 208 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 209 */ "having_clause_opt ::=", + /* 210 */ "having_clause_opt ::= HAVING search_condition", + /* 211 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 212 */ "query_expression_body ::= query_primary", + /* 213 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 214 */ "query_primary ::= query_specification", + /* 215 */ "order_by_clause_opt ::=", + /* 216 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 217 */ "slimit_clause_opt ::=", + /* 218 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 219 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 220 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 221 */ "limit_clause_opt ::=", + /* 222 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 223 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 224 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 225 */ "subquery ::= NK_LP query_expression NK_RP", + /* 226 */ "search_condition ::= common_expression", + /* 227 */ "sort_specification_list ::= sort_specification", + /* 228 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 229 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 230 */ "ordering_specification_opt ::=", + /* 231 */ "ordering_specification_opt ::= ASC", + /* 232 */ "ordering_specification_opt ::= DESC", + /* 233 */ "null_ordering_opt ::=", + /* 234 */ "null_ordering_opt ::= NULLS FIRST", + /* 235 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -1625,197 +1629,199 @@ static const struct { { 134, -3 }, /* (40) cmd ::= CREATE TABLE multi_create_clause */ { 134, -9 }, /* (41) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ { 134, -3 }, /* (42) cmd ::= DROP TABLE multi_drop_clause */ - { 134, -2 }, /* (43) cmd ::= SHOW TABLES */ - { 134, -2 }, /* (44) cmd ::= SHOW STABLES */ - { 146, -1 }, /* (45) multi_create_clause ::= create_subtable_clause */ - { 146, -2 }, /* (46) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 149, -9 }, /* (47) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ - { 148, -1 }, /* (48) multi_drop_clause ::= drop_table_clause */ - { 148, -2 }, /* (49) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 152, -2 }, /* (50) drop_table_clause ::= exists_opt full_table_name */ - { 150, 0 }, /* (51) specific_tags_opt ::= */ - { 150, -3 }, /* (52) specific_tags_opt ::= NK_LP col_name_list NK_RP */ - { 142, -1 }, /* (53) full_table_name ::= table_name */ - { 142, -3 }, /* (54) full_table_name ::= db_name NK_DOT table_name */ - { 143, -1 }, /* (55) column_def_list ::= column_def */ - { 143, -3 }, /* (56) column_def_list ::= column_def_list NK_COMMA column_def */ - { 155, -2 }, /* (57) column_def ::= column_name type_name */ - { 155, -4 }, /* (58) column_def ::= column_name type_name COMMENT NK_STRING */ - { 157, -1 }, /* (59) type_name ::= BOOL */ - { 157, -1 }, /* (60) type_name ::= TINYINT */ - { 157, -1 }, /* (61) type_name ::= SMALLINT */ - { 157, -1 }, /* (62) type_name ::= INT */ - { 157, -1 }, /* (63) type_name ::= INTEGER */ - { 157, -1 }, /* (64) type_name ::= BIGINT */ - { 157, -1 }, /* (65) type_name ::= FLOAT */ - { 157, -1 }, /* (66) type_name ::= DOUBLE */ - { 157, -4 }, /* (67) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 157, -1 }, /* (68) type_name ::= TIMESTAMP */ - { 157, -4 }, /* (69) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 157, -2 }, /* (70) type_name ::= TINYINT UNSIGNED */ - { 157, -2 }, /* (71) type_name ::= SMALLINT UNSIGNED */ - { 157, -2 }, /* (72) type_name ::= INT UNSIGNED */ - { 157, -2 }, /* (73) type_name ::= BIGINT UNSIGNED */ - { 157, -1 }, /* (74) type_name ::= JSON */ - { 157, -4 }, /* (75) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 157, -1 }, /* (76) type_name ::= MEDIUMBLOB */ - { 157, -1 }, /* (77) type_name ::= BLOB */ - { 157, -4 }, /* (78) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 157, -1 }, /* (79) type_name ::= DECIMAL */ - { 157, -4 }, /* (80) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 157, -6 }, /* (81) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 144, 0 }, /* (82) tags_def_opt ::= */ - { 144, -1 }, /* (83) tags_def_opt ::= tags_def */ - { 147, -4 }, /* (84) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 145, 0 }, /* (85) table_options ::= */ - { 145, -3 }, /* (86) table_options ::= table_options COMMENT NK_STRING */ - { 145, -3 }, /* (87) table_options ::= table_options KEEP NK_INTEGER */ - { 145, -3 }, /* (88) table_options ::= table_options TTL NK_INTEGER */ - { 145, -5 }, /* (89) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 153, -1 }, /* (90) col_name_list ::= col_name */ - { 153, -3 }, /* (91) col_name_list ::= col_name_list NK_COMMA col_name */ - { 158, -1 }, /* (92) col_name ::= column_name */ - { 134, -2 }, /* (93) cmd ::= SHOW VGROUPS */ - { 134, -1 }, /* (94) cmd ::= query_expression */ - { 160, -1 }, /* (95) literal ::= NK_INTEGER */ - { 160, -1 }, /* (96) literal ::= NK_FLOAT */ - { 160, -1 }, /* (97) literal ::= NK_STRING */ - { 160, -1 }, /* (98) literal ::= NK_BOOL */ - { 160, -2 }, /* (99) literal ::= TIMESTAMP NK_STRING */ - { 160, -1 }, /* (100) literal ::= duration_literal */ - { 161, -1 }, /* (101) duration_literal ::= NK_VARIABLE */ - { 151, -1 }, /* (102) literal_list ::= literal */ - { 151, -3 }, /* (103) literal_list ::= literal_list NK_COMMA literal */ - { 139, -1 }, /* (104) db_name ::= NK_ID */ - { 154, -1 }, /* (105) table_name ::= NK_ID */ - { 156, -1 }, /* (106) column_name ::= NK_ID */ - { 162, -1 }, /* (107) function_name ::= NK_ID */ - { 163, -1 }, /* (108) table_alias ::= NK_ID */ - { 164, -1 }, /* (109) column_alias ::= NK_ID */ - { 135, -1 }, /* (110) user_name ::= NK_ID */ - { 165, -1 }, /* (111) expression ::= literal */ - { 165, -1 }, /* (112) expression ::= column_reference */ - { 165, -4 }, /* (113) expression ::= function_name NK_LP expression_list NK_RP */ - { 165, -4 }, /* (114) expression ::= function_name NK_LP NK_STAR NK_RP */ - { 165, -1 }, /* (115) expression ::= subquery */ - { 165, -3 }, /* (116) expression ::= NK_LP expression NK_RP */ - { 165, -2 }, /* (117) expression ::= NK_PLUS expression */ - { 165, -2 }, /* (118) expression ::= NK_MINUS expression */ - { 165, -3 }, /* (119) expression ::= expression NK_PLUS expression */ - { 165, -3 }, /* (120) expression ::= expression NK_MINUS expression */ - { 165, -3 }, /* (121) expression ::= expression NK_STAR expression */ - { 165, -3 }, /* (122) expression ::= expression NK_SLASH expression */ - { 165, -3 }, /* (123) expression ::= expression NK_REM expression */ - { 167, -1 }, /* (124) expression_list ::= expression */ - { 167, -3 }, /* (125) expression_list ::= expression_list NK_COMMA expression */ - { 166, -1 }, /* (126) column_reference ::= column_name */ - { 166, -3 }, /* (127) column_reference ::= table_name NK_DOT column_name */ - { 169, -3 }, /* (128) predicate ::= expression compare_op expression */ - { 169, -5 }, /* (129) predicate ::= expression BETWEEN expression AND expression */ - { 169, -6 }, /* (130) predicate ::= expression NOT BETWEEN expression AND expression */ - { 169, -3 }, /* (131) predicate ::= expression IS NULL */ - { 169, -4 }, /* (132) predicate ::= expression IS NOT NULL */ - { 169, -3 }, /* (133) predicate ::= expression in_op in_predicate_value */ - { 170, -1 }, /* (134) compare_op ::= NK_LT */ - { 170, -1 }, /* (135) compare_op ::= NK_GT */ - { 170, -1 }, /* (136) compare_op ::= NK_LE */ - { 170, -1 }, /* (137) compare_op ::= NK_GE */ - { 170, -1 }, /* (138) compare_op ::= NK_NE */ - { 170, -1 }, /* (139) compare_op ::= NK_EQ */ - { 170, -1 }, /* (140) compare_op ::= LIKE */ - { 170, -2 }, /* (141) compare_op ::= NOT LIKE */ - { 170, -1 }, /* (142) compare_op ::= MATCH */ - { 170, -1 }, /* (143) compare_op ::= NMATCH */ - { 171, -1 }, /* (144) in_op ::= IN */ - { 171, -2 }, /* (145) in_op ::= NOT IN */ - { 172, -3 }, /* (146) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 173, -1 }, /* (147) boolean_value_expression ::= boolean_primary */ - { 173, -2 }, /* (148) boolean_value_expression ::= NOT boolean_primary */ - { 173, -3 }, /* (149) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 173, -3 }, /* (150) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 174, -1 }, /* (151) boolean_primary ::= predicate */ - { 174, -3 }, /* (152) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 175, -1 }, /* (153) common_expression ::= expression */ - { 175, -1 }, /* (154) common_expression ::= boolean_value_expression */ - { 176, -2 }, /* (155) from_clause ::= FROM table_reference_list */ - { 177, -1 }, /* (156) table_reference_list ::= table_reference */ - { 177, -3 }, /* (157) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 178, -1 }, /* (158) table_reference ::= table_primary */ - { 178, -1 }, /* (159) table_reference ::= joined_table */ - { 179, -2 }, /* (160) table_primary ::= table_name alias_opt */ - { 179, -4 }, /* (161) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 179, -2 }, /* (162) table_primary ::= subquery alias_opt */ - { 179, -1 }, /* (163) table_primary ::= parenthesized_joined_table */ - { 181, 0 }, /* (164) alias_opt ::= */ - { 181, -1 }, /* (165) alias_opt ::= table_alias */ - { 181, -2 }, /* (166) alias_opt ::= AS table_alias */ - { 182, -3 }, /* (167) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 182, -3 }, /* (168) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 180, -6 }, /* (169) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 183, 0 }, /* (170) join_type ::= */ - { 183, -1 }, /* (171) join_type ::= INNER */ - { 185, -9 }, /* (172) 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 */ - { 186, 0 }, /* (173) set_quantifier_opt ::= */ - { 186, -1 }, /* (174) set_quantifier_opt ::= DISTINCT */ - { 186, -1 }, /* (175) set_quantifier_opt ::= ALL */ - { 187, -1 }, /* (176) select_list ::= NK_STAR */ - { 187, -1 }, /* (177) select_list ::= select_sublist */ - { 193, -1 }, /* (178) select_sublist ::= select_item */ - { 193, -3 }, /* (179) select_sublist ::= select_sublist NK_COMMA select_item */ - { 194, -1 }, /* (180) select_item ::= common_expression */ - { 194, -2 }, /* (181) select_item ::= common_expression column_alias */ - { 194, -3 }, /* (182) select_item ::= common_expression AS column_alias */ - { 194, -3 }, /* (183) select_item ::= table_name NK_DOT NK_STAR */ - { 188, 0 }, /* (184) where_clause_opt ::= */ - { 188, -2 }, /* (185) where_clause_opt ::= WHERE search_condition */ - { 189, 0 }, /* (186) partition_by_clause_opt ::= */ - { 189, -3 }, /* (187) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 190, 0 }, /* (188) twindow_clause_opt ::= */ - { 190, -6 }, /* (189) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ - { 190, -4 }, /* (190) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ - { 190, -6 }, /* (191) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 190, -8 }, /* (192) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 195, 0 }, /* (193) sliding_opt ::= */ - { 195, -4 }, /* (194) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 196, 0 }, /* (195) fill_opt ::= */ - { 196, -4 }, /* (196) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 196, -6 }, /* (197) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 197, -1 }, /* (198) fill_mode ::= NONE */ - { 197, -1 }, /* (199) fill_mode ::= PREV */ - { 197, -1 }, /* (200) fill_mode ::= NULL */ - { 197, -1 }, /* (201) fill_mode ::= LINEAR */ - { 197, -1 }, /* (202) fill_mode ::= NEXT */ - { 191, 0 }, /* (203) group_by_clause_opt ::= */ - { 191, -3 }, /* (204) group_by_clause_opt ::= GROUP BY group_by_list */ - { 198, -1 }, /* (205) group_by_list ::= expression */ - { 198, -3 }, /* (206) group_by_list ::= group_by_list NK_COMMA expression */ - { 192, 0 }, /* (207) having_clause_opt ::= */ - { 192, -2 }, /* (208) having_clause_opt ::= HAVING search_condition */ - { 159, -4 }, /* (209) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 199, -1 }, /* (210) query_expression_body ::= query_primary */ - { 199, -4 }, /* (211) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 203, -1 }, /* (212) query_primary ::= query_specification */ - { 200, 0 }, /* (213) order_by_clause_opt ::= */ - { 200, -3 }, /* (214) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 201, 0 }, /* (215) slimit_clause_opt ::= */ - { 201, -2 }, /* (216) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 201, -4 }, /* (217) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 201, -4 }, /* (218) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 202, 0 }, /* (219) limit_clause_opt ::= */ - { 202, -2 }, /* (220) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 202, -4 }, /* (221) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 202, -4 }, /* (222) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 168, -3 }, /* (223) subquery ::= NK_LP query_expression NK_RP */ - { 184, -1 }, /* (224) search_condition ::= common_expression */ - { 204, -1 }, /* (225) sort_specification_list ::= sort_specification */ - { 204, -3 }, /* (226) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 205, -3 }, /* (227) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 206, 0 }, /* (228) ordering_specification_opt ::= */ - { 206, -1 }, /* (229) ordering_specification_opt ::= ASC */ - { 206, -1 }, /* (230) ordering_specification_opt ::= DESC */ - { 207, 0 }, /* (231) null_ordering_opt ::= */ - { 207, -2 }, /* (232) null_ordering_opt ::= NULLS FIRST */ - { 207, -2 }, /* (233) null_ordering_opt ::= NULLS LAST */ + { 134, -4 }, /* (43) cmd ::= DROP STABLE exists_opt full_table_name */ + { 134, -2 }, /* (44) cmd ::= SHOW TABLES */ + { 134, -2 }, /* (45) cmd ::= SHOW STABLES */ + { 146, -1 }, /* (46) multi_create_clause ::= create_subtable_clause */ + { 146, -2 }, /* (47) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 149, -9 }, /* (48) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ + { 148, -1 }, /* (49) multi_drop_clause ::= drop_table_clause */ + { 148, -2 }, /* (50) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 152, -2 }, /* (51) drop_table_clause ::= exists_opt full_table_name */ + { 150, 0 }, /* (52) specific_tags_opt ::= */ + { 150, -3 }, /* (53) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 142, -1 }, /* (54) full_table_name ::= table_name */ + { 142, -3 }, /* (55) full_table_name ::= db_name NK_DOT table_name */ + { 143, -1 }, /* (56) column_def_list ::= column_def */ + { 143, -3 }, /* (57) column_def_list ::= column_def_list NK_COMMA column_def */ + { 155, -2 }, /* (58) column_def ::= column_name type_name */ + { 155, -4 }, /* (59) column_def ::= column_name type_name COMMENT NK_STRING */ + { 157, -1 }, /* (60) type_name ::= BOOL */ + { 157, -1 }, /* (61) type_name ::= TINYINT */ + { 157, -1 }, /* (62) type_name ::= SMALLINT */ + { 157, -1 }, /* (63) type_name ::= INT */ + { 157, -1 }, /* (64) type_name ::= INTEGER */ + { 157, -1 }, /* (65) type_name ::= BIGINT */ + { 157, -1 }, /* (66) type_name ::= FLOAT */ + { 157, -1 }, /* (67) type_name ::= DOUBLE */ + { 157, -4 }, /* (68) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 157, -1 }, /* (69) type_name ::= TIMESTAMP */ + { 157, -4 }, /* (70) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 157, -2 }, /* (71) type_name ::= TINYINT UNSIGNED */ + { 157, -2 }, /* (72) type_name ::= SMALLINT UNSIGNED */ + { 157, -2 }, /* (73) type_name ::= INT UNSIGNED */ + { 157, -2 }, /* (74) type_name ::= BIGINT UNSIGNED */ + { 157, -1 }, /* (75) type_name ::= JSON */ + { 157, -4 }, /* (76) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 157, -1 }, /* (77) type_name ::= MEDIUMBLOB */ + { 157, -1 }, /* (78) type_name ::= BLOB */ + { 157, -4 }, /* (79) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 157, -1 }, /* (80) type_name ::= DECIMAL */ + { 157, -4 }, /* (81) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 157, -6 }, /* (82) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 144, 0 }, /* (83) tags_def_opt ::= */ + { 144, -1 }, /* (84) tags_def_opt ::= tags_def */ + { 147, -4 }, /* (85) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 145, 0 }, /* (86) table_options ::= */ + { 145, -3 }, /* (87) table_options ::= table_options COMMENT NK_STRING */ + { 145, -3 }, /* (88) table_options ::= table_options KEEP NK_INTEGER */ + { 145, -3 }, /* (89) table_options ::= table_options TTL NK_INTEGER */ + { 145, -5 }, /* (90) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 153, -1 }, /* (91) col_name_list ::= col_name */ + { 153, -3 }, /* (92) col_name_list ::= col_name_list NK_COMMA col_name */ + { 158, -1 }, /* (93) col_name ::= column_name */ + { 134, -2 }, /* (94) cmd ::= SHOW VGROUPS */ + { 134, -4 }, /* (95) cmd ::= SHOW db_name NK_DOT VGROUPS */ + { 134, -1 }, /* (96) cmd ::= query_expression */ + { 160, -1 }, /* (97) literal ::= NK_INTEGER */ + { 160, -1 }, /* (98) literal ::= NK_FLOAT */ + { 160, -1 }, /* (99) literal ::= NK_STRING */ + { 160, -1 }, /* (100) literal ::= NK_BOOL */ + { 160, -2 }, /* (101) literal ::= TIMESTAMP NK_STRING */ + { 160, -1 }, /* (102) literal ::= duration_literal */ + { 161, -1 }, /* (103) duration_literal ::= NK_VARIABLE */ + { 151, -1 }, /* (104) literal_list ::= literal */ + { 151, -3 }, /* (105) literal_list ::= literal_list NK_COMMA literal */ + { 139, -1 }, /* (106) db_name ::= NK_ID */ + { 154, -1 }, /* (107) table_name ::= NK_ID */ + { 156, -1 }, /* (108) column_name ::= NK_ID */ + { 162, -1 }, /* (109) function_name ::= NK_ID */ + { 163, -1 }, /* (110) table_alias ::= NK_ID */ + { 164, -1 }, /* (111) column_alias ::= NK_ID */ + { 135, -1 }, /* (112) user_name ::= NK_ID */ + { 165, -1 }, /* (113) expression ::= literal */ + { 165, -1 }, /* (114) expression ::= column_reference */ + { 165, -4 }, /* (115) expression ::= function_name NK_LP expression_list NK_RP */ + { 165, -4 }, /* (116) expression ::= function_name NK_LP NK_STAR NK_RP */ + { 165, -1 }, /* (117) expression ::= subquery */ + { 165, -3 }, /* (118) expression ::= NK_LP expression NK_RP */ + { 165, -2 }, /* (119) expression ::= NK_PLUS expression */ + { 165, -2 }, /* (120) expression ::= NK_MINUS expression */ + { 165, -3 }, /* (121) expression ::= expression NK_PLUS expression */ + { 165, -3 }, /* (122) expression ::= expression NK_MINUS expression */ + { 165, -3 }, /* (123) expression ::= expression NK_STAR expression */ + { 165, -3 }, /* (124) expression ::= expression NK_SLASH expression */ + { 165, -3 }, /* (125) expression ::= expression NK_REM expression */ + { 167, -1 }, /* (126) expression_list ::= expression */ + { 167, -3 }, /* (127) expression_list ::= expression_list NK_COMMA expression */ + { 166, -1 }, /* (128) column_reference ::= column_name */ + { 166, -3 }, /* (129) column_reference ::= table_name NK_DOT column_name */ + { 169, -3 }, /* (130) predicate ::= expression compare_op expression */ + { 169, -5 }, /* (131) predicate ::= expression BETWEEN expression AND expression */ + { 169, -6 }, /* (132) predicate ::= expression NOT BETWEEN expression AND expression */ + { 169, -3 }, /* (133) predicate ::= expression IS NULL */ + { 169, -4 }, /* (134) predicate ::= expression IS NOT NULL */ + { 169, -3 }, /* (135) predicate ::= expression in_op in_predicate_value */ + { 170, -1 }, /* (136) compare_op ::= NK_LT */ + { 170, -1 }, /* (137) compare_op ::= NK_GT */ + { 170, -1 }, /* (138) compare_op ::= NK_LE */ + { 170, -1 }, /* (139) compare_op ::= NK_GE */ + { 170, -1 }, /* (140) compare_op ::= NK_NE */ + { 170, -1 }, /* (141) compare_op ::= NK_EQ */ + { 170, -1 }, /* (142) compare_op ::= LIKE */ + { 170, -2 }, /* (143) compare_op ::= NOT LIKE */ + { 170, -1 }, /* (144) compare_op ::= MATCH */ + { 170, -1 }, /* (145) compare_op ::= NMATCH */ + { 171, -1 }, /* (146) in_op ::= IN */ + { 171, -2 }, /* (147) in_op ::= NOT IN */ + { 172, -3 }, /* (148) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 173, -1 }, /* (149) boolean_value_expression ::= boolean_primary */ + { 173, -2 }, /* (150) boolean_value_expression ::= NOT boolean_primary */ + { 173, -3 }, /* (151) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 173, -3 }, /* (152) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 174, -1 }, /* (153) boolean_primary ::= predicate */ + { 174, -3 }, /* (154) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 175, -1 }, /* (155) common_expression ::= expression */ + { 175, -1 }, /* (156) common_expression ::= boolean_value_expression */ + { 176, -2 }, /* (157) from_clause ::= FROM table_reference_list */ + { 177, -1 }, /* (158) table_reference_list ::= table_reference */ + { 177, -3 }, /* (159) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 178, -1 }, /* (160) table_reference ::= table_primary */ + { 178, -1 }, /* (161) table_reference ::= joined_table */ + { 179, -2 }, /* (162) table_primary ::= table_name alias_opt */ + { 179, -4 }, /* (163) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 179, -2 }, /* (164) table_primary ::= subquery alias_opt */ + { 179, -1 }, /* (165) table_primary ::= parenthesized_joined_table */ + { 181, 0 }, /* (166) alias_opt ::= */ + { 181, -1 }, /* (167) alias_opt ::= table_alias */ + { 181, -2 }, /* (168) alias_opt ::= AS table_alias */ + { 182, -3 }, /* (169) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 182, -3 }, /* (170) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 180, -6 }, /* (171) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 183, 0 }, /* (172) join_type ::= */ + { 183, -1 }, /* (173) join_type ::= INNER */ + { 185, -9 }, /* (174) 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 */ + { 186, 0 }, /* (175) set_quantifier_opt ::= */ + { 186, -1 }, /* (176) set_quantifier_opt ::= DISTINCT */ + { 186, -1 }, /* (177) set_quantifier_opt ::= ALL */ + { 187, -1 }, /* (178) select_list ::= NK_STAR */ + { 187, -1 }, /* (179) select_list ::= select_sublist */ + { 193, -1 }, /* (180) select_sublist ::= select_item */ + { 193, -3 }, /* (181) select_sublist ::= select_sublist NK_COMMA select_item */ + { 194, -1 }, /* (182) select_item ::= common_expression */ + { 194, -2 }, /* (183) select_item ::= common_expression column_alias */ + { 194, -3 }, /* (184) select_item ::= common_expression AS column_alias */ + { 194, -3 }, /* (185) select_item ::= table_name NK_DOT NK_STAR */ + { 188, 0 }, /* (186) where_clause_opt ::= */ + { 188, -2 }, /* (187) where_clause_opt ::= WHERE search_condition */ + { 189, 0 }, /* (188) partition_by_clause_opt ::= */ + { 189, -3 }, /* (189) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 190, 0 }, /* (190) twindow_clause_opt ::= */ + { 190, -6 }, /* (191) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ + { 190, -4 }, /* (192) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + { 190, -6 }, /* (193) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 190, -8 }, /* (194) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 195, 0 }, /* (195) sliding_opt ::= */ + { 195, -4 }, /* (196) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 196, 0 }, /* (197) fill_opt ::= */ + { 196, -4 }, /* (198) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 196, -6 }, /* (199) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 197, -1 }, /* (200) fill_mode ::= NONE */ + { 197, -1 }, /* (201) fill_mode ::= PREV */ + { 197, -1 }, /* (202) fill_mode ::= NULL */ + { 197, -1 }, /* (203) fill_mode ::= LINEAR */ + { 197, -1 }, /* (204) fill_mode ::= NEXT */ + { 191, 0 }, /* (205) group_by_clause_opt ::= */ + { 191, -3 }, /* (206) group_by_clause_opt ::= GROUP BY group_by_list */ + { 198, -1 }, /* (207) group_by_list ::= expression */ + { 198, -3 }, /* (208) group_by_list ::= group_by_list NK_COMMA expression */ + { 192, 0 }, /* (209) having_clause_opt ::= */ + { 192, -2 }, /* (210) having_clause_opt ::= HAVING search_condition */ + { 159, -4 }, /* (211) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 199, -1 }, /* (212) query_expression_body ::= query_primary */ + { 199, -4 }, /* (213) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 203, -1 }, /* (214) query_primary ::= query_specification */ + { 200, 0 }, /* (215) order_by_clause_opt ::= */ + { 200, -3 }, /* (216) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 201, 0 }, /* (217) slimit_clause_opt ::= */ + { 201, -2 }, /* (218) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 201, -4 }, /* (219) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 201, -4 }, /* (220) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 202, 0 }, /* (221) limit_clause_opt ::= */ + { 202, -2 }, /* (222) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 202, -4 }, /* (223) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 202, -4 }, /* (224) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 168, -3 }, /* (225) subquery ::= NK_LP query_expression NK_RP */ + { 184, -1 }, /* (226) search_condition ::= common_expression */ + { 204, -1 }, /* (227) sort_specification_list ::= sort_specification */ + { 204, -3 }, /* (228) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 205, -3 }, /* (229) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 206, 0 }, /* (230) ordering_specification_opt ::= */ + { 206, -1 }, /* (231) ordering_specification_opt ::= ASC */ + { 206, -1 }, /* (232) ordering_specification_opt ::= DESC */ + { 207, 0 }, /* (233) null_ordering_opt ::= */ + { 207, -2 }, /* (234) null_ordering_opt ::= NULLS FIRST */ + { 207, -2 }, /* (235) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1915,7 +1921,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy161); } break; case 4: /* cmd ::= SHOW USERS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL); } break; case 5: /* cmd ::= CREATE DNODE dnode_endpoint */ { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy161, NULL);} @@ -1930,18 +1936,18 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy161);} break; case 9: /* cmd ::= SHOW DNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } break; case 10: /* dnode_endpoint ::= NK_STRING */ case 11: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==11); case 12: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==12); - case 104: /* db_name ::= NK_ID */ yytestcase(yyruleno==104); - case 105: /* table_name ::= NK_ID */ yytestcase(yyruleno==105); - case 106: /* column_name ::= NK_ID */ yytestcase(yyruleno==106); - case 107: /* function_name ::= NK_ID */ yytestcase(yyruleno==107); - case 108: /* table_alias ::= NK_ID */ yytestcase(yyruleno==108); - case 109: /* column_alias ::= NK_ID */ yytestcase(yyruleno==109); - case 110: /* user_name ::= NK_ID */ yytestcase(yyruleno==110); + case 106: /* db_name ::= NK_ID */ yytestcase(yyruleno==106); + case 107: /* table_name ::= NK_ID */ yytestcase(yyruleno==107); + case 108: /* column_name ::= NK_ID */ yytestcase(yyruleno==108); + case 109: /* function_name ::= NK_ID */ yytestcase(yyruleno==109); + case 110: /* table_alias ::= NK_ID */ yytestcase(yyruleno==110); + case 111: /* column_alias ::= NK_ID */ yytestcase(yyruleno==111); + case 112: /* user_name ::= NK_ID */ yytestcase(yyruleno==112); { yylhsminor.yy161 = yymsp[0].minor.yy0; } yymsp[0].minor.yy161 = yylhsminor.yy161; break; @@ -1952,7 +1958,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy377, &yymsp[0].minor.yy161); } break; case 15: /* cmd ::= SHOW DATABASES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } break; case 16: /* cmd ::= USE db_name */ { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy161);} @@ -1962,7 +1968,7 @@ static YYACTIONTYPE yy_reduce( break; case 18: /* not_exists_opt ::= */ case 20: /* exists_opt ::= */ yytestcase(yyruleno==20); - case 173: /* set_quantifier_opt ::= */ yytestcase(yyruleno==173); + case 175: /* set_quantifier_opt ::= */ yytestcase(yyruleno==175); { yymsp[1].minor.yy377 = false; } break; case 19: /* exists_opt ::= IF EXISTS */ @@ -2049,250 +2055,256 @@ static YYACTIONTYPE yy_reduce( case 42: /* cmd ::= DROP TABLE multi_drop_clause */ { pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy184); } break; - case 43: /* cmd ::= SHOW TABLES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT); } + case 43: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy377, yymsp[0].minor.yy392); } break; - case 44: /* cmd ::= SHOW STABLES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT); } + case 44: /* cmd ::= SHOW TABLES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } break; - case 45: /* multi_create_clause ::= create_subtable_clause */ - case 48: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==48); - case 55: /* column_def_list ::= column_def */ yytestcase(yyruleno==55); - case 90: /* col_name_list ::= col_name */ yytestcase(yyruleno==90); - case 178: /* select_sublist ::= select_item */ yytestcase(yyruleno==178); - case 225: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==225); + case 45: /* cmd ::= SHOW STABLES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } + break; + case 46: /* multi_create_clause ::= create_subtable_clause */ + case 49: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==49); + case 56: /* column_def_list ::= column_def */ yytestcase(yyruleno==56); + case 91: /* col_name_list ::= col_name */ yytestcase(yyruleno==91); + case 180: /* select_sublist ::= select_item */ yytestcase(yyruleno==180); + case 227: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==227); { yylhsminor.yy184 = createNodeList(pCxt, yymsp[0].minor.yy392); } yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 46: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 49: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==49); + case 47: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 50: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==50); { yylhsminor.yy184 = addNodeToList(pCxt, yymsp[-1].minor.yy184, yymsp[0].minor.yy392); } yymsp[-1].minor.yy184 = yylhsminor.yy184; break; - case 47: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ + case 48: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ { yylhsminor.yy392 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy377, yymsp[-7].minor.yy392, yymsp[-5].minor.yy392, yymsp[-4].minor.yy184, yymsp[-1].minor.yy184); } yymsp[-8].minor.yy392 = yylhsminor.yy392; break; - case 50: /* drop_table_clause ::= exists_opt full_table_name */ + case 51: /* drop_table_clause ::= exists_opt full_table_name */ { yylhsminor.yy392 = createDropTableClause(pCxt, yymsp[-1].minor.yy377, yymsp[0].minor.yy392); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 51: /* specific_tags_opt ::= */ - case 82: /* tags_def_opt ::= */ yytestcase(yyruleno==82); - case 186: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==186); - case 203: /* group_by_clause_opt ::= */ yytestcase(yyruleno==203); - case 213: /* order_by_clause_opt ::= */ yytestcase(yyruleno==213); + case 52: /* specific_tags_opt ::= */ + case 83: /* tags_def_opt ::= */ yytestcase(yyruleno==83); + case 188: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==188); + case 205: /* group_by_clause_opt ::= */ yytestcase(yyruleno==205); + case 215: /* order_by_clause_opt ::= */ yytestcase(yyruleno==215); { yymsp[1].minor.yy184 = NULL; } break; - case 52: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ + case 53: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ { yymsp[-2].minor.yy184 = yymsp[-1].minor.yy184; } break; - case 53: /* full_table_name ::= table_name */ + case 54: /* full_table_name ::= table_name */ { yylhsminor.yy392 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy161, NULL); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 54: /* full_table_name ::= db_name NK_DOT table_name */ + case 55: /* full_table_name ::= db_name NK_DOT table_name */ { yylhsminor.yy392 = createRealTableNode(pCxt, &yymsp[-2].minor.yy161, &yymsp[0].minor.yy161, NULL); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 56: /* column_def_list ::= column_def_list NK_COMMA column_def */ - case 91: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==91); - case 179: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==179); - case 226: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==226); + case 57: /* column_def_list ::= column_def_list NK_COMMA column_def */ + case 92: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==92); + case 181: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==181); + case 228: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==228); { yylhsminor.yy184 = addNodeToList(pCxt, yymsp[-2].minor.yy184, yymsp[0].minor.yy392); } yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 57: /* column_def ::= column_name type_name */ + case 58: /* column_def ::= column_name type_name */ { yylhsminor.yy392 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy161, yymsp[0].minor.yy240, NULL); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 58: /* column_def ::= column_name type_name COMMENT NK_STRING */ + case 59: /* column_def ::= column_name type_name COMMENT NK_STRING */ { yylhsminor.yy392 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy161, yymsp[-2].minor.yy240, &yymsp[0].minor.yy0); } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 59: /* type_name ::= BOOL */ + case 60: /* type_name ::= BOOL */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 60: /* type_name ::= TINYINT */ + case 61: /* type_name ::= TINYINT */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 61: /* type_name ::= SMALLINT */ + case 62: /* type_name ::= SMALLINT */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 62: /* type_name ::= INT */ - case 63: /* type_name ::= INTEGER */ yytestcase(yyruleno==63); + case 63: /* type_name ::= INT */ + case 64: /* type_name ::= INTEGER */ yytestcase(yyruleno==64); { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 64: /* type_name ::= BIGINT */ + case 65: /* type_name ::= BIGINT */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 65: /* type_name ::= FLOAT */ + case 66: /* type_name ::= FLOAT */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 66: /* type_name ::= DOUBLE */ + case 67: /* type_name ::= DOUBLE */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 67: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + case 68: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy240 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 68: /* type_name ::= TIMESTAMP */ + case 69: /* type_name ::= TIMESTAMP */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 69: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + case 70: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy240 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 70: /* type_name ::= TINYINT UNSIGNED */ + case 71: /* type_name ::= TINYINT UNSIGNED */ { yymsp[-1].minor.yy240 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 71: /* type_name ::= SMALLINT UNSIGNED */ + case 72: /* type_name ::= SMALLINT UNSIGNED */ { yymsp[-1].minor.yy240 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 72: /* type_name ::= INT UNSIGNED */ + case 73: /* type_name ::= INT UNSIGNED */ { yymsp[-1].minor.yy240 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 73: /* type_name ::= BIGINT UNSIGNED */ + case 74: /* type_name ::= BIGINT UNSIGNED */ { yymsp[-1].minor.yy240 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 74: /* type_name ::= JSON */ + case 75: /* type_name ::= JSON */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 75: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + case 76: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy240 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 76: /* type_name ::= MEDIUMBLOB */ + case 77: /* type_name ::= MEDIUMBLOB */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 77: /* type_name ::= BLOB */ + case 78: /* type_name ::= BLOB */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 78: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + case 79: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy240 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 79: /* type_name ::= DECIMAL */ + case 80: /* type_name ::= DECIMAL */ { yymsp[0].minor.yy240 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 80: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + case 81: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy240 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 81: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + case 82: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ { yymsp[-5].minor.yy240 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 83: /* tags_def_opt ::= tags_def */ - case 177: /* select_list ::= select_sublist */ yytestcase(yyruleno==177); + case 84: /* tags_def_opt ::= tags_def */ + case 179: /* select_list ::= select_sublist */ yytestcase(yyruleno==179); { yylhsminor.yy184 = yymsp[0].minor.yy184; } yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 84: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 85: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ { yymsp[-3].minor.yy184 = yymsp[-1].minor.yy184; } break; - case 85: /* table_options ::= */ + case 86: /* table_options ::= */ { yymsp[1].minor.yy334 = createDefaultTableOptions(pCxt);} break; - case 86: /* table_options ::= table_options COMMENT NK_STRING */ + case 87: /* table_options ::= table_options COMMENT NK_STRING */ { yylhsminor.yy334 = setTableOption(pCxt, yymsp[-2].minor.yy334, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy334 = yylhsminor.yy334; break; - case 87: /* table_options ::= table_options KEEP NK_INTEGER */ + case 88: /* table_options ::= table_options KEEP NK_INTEGER */ { yylhsminor.yy334 = setTableOption(pCxt, yymsp[-2].minor.yy334, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy334 = yylhsminor.yy334; break; - case 88: /* table_options ::= table_options TTL NK_INTEGER */ + case 89: /* table_options ::= table_options TTL NK_INTEGER */ { yylhsminor.yy334 = setTableOption(pCxt, yymsp[-2].minor.yy334, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy334 = yylhsminor.yy334; break; - case 89: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + case 90: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ { yylhsminor.yy334 = setTableSmaOption(pCxt, yymsp[-4].minor.yy334, yymsp[-1].minor.yy184); } yymsp[-4].minor.yy334 = yylhsminor.yy334; break; - case 92: /* col_name ::= column_name */ + case 93: /* col_name ::= column_name */ { yylhsminor.yy392 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy161); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 93: /* cmd ::= SHOW VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT); } + case 94: /* cmd ::= SHOW VGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } + break; + case 95: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy161); } break; - case 94: /* cmd ::= query_expression */ + case 96: /* cmd ::= query_expression */ { pCxt->pRootNode = yymsp[0].minor.yy392; } break; - case 95: /* literal ::= NK_INTEGER */ + case 97: /* literal ::= NK_INTEGER */ { yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 96: /* literal ::= NK_FLOAT */ + case 98: /* literal ::= NK_FLOAT */ { yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 97: /* literal ::= NK_STRING */ + case 99: /* literal ::= NK_STRING */ { yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 98: /* literal ::= NK_BOOL */ + case 100: /* literal ::= NK_BOOL */ { yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 99: /* literal ::= TIMESTAMP NK_STRING */ + case 101: /* literal ::= TIMESTAMP NK_STRING */ { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 100: /* literal ::= duration_literal */ - case 111: /* expression ::= literal */ yytestcase(yyruleno==111); - case 112: /* expression ::= column_reference */ yytestcase(yyruleno==112); - case 115: /* expression ::= subquery */ yytestcase(yyruleno==115); - case 147: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==147); - case 151: /* boolean_primary ::= predicate */ yytestcase(yyruleno==151); - case 153: /* common_expression ::= expression */ yytestcase(yyruleno==153); - case 154: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==154); - case 156: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==156); - case 158: /* table_reference ::= table_primary */ yytestcase(yyruleno==158); - case 159: /* table_reference ::= joined_table */ yytestcase(yyruleno==159); - case 163: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==163); - case 210: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==210); - case 212: /* query_primary ::= query_specification */ yytestcase(yyruleno==212); + case 102: /* literal ::= duration_literal */ + case 113: /* expression ::= literal */ yytestcase(yyruleno==113); + case 114: /* expression ::= column_reference */ yytestcase(yyruleno==114); + case 117: /* expression ::= subquery */ yytestcase(yyruleno==117); + case 149: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==149); + case 153: /* boolean_primary ::= predicate */ yytestcase(yyruleno==153); + case 155: /* common_expression ::= expression */ yytestcase(yyruleno==155); + case 156: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==156); + case 158: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==158); + case 160: /* table_reference ::= table_primary */ yytestcase(yyruleno==160); + case 161: /* table_reference ::= joined_table */ yytestcase(yyruleno==161); + case 165: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==165); + case 212: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==212); + case 214: /* query_primary ::= query_specification */ yytestcase(yyruleno==214); { yylhsminor.yy392 = yymsp[0].minor.yy392; } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 101: /* duration_literal ::= NK_VARIABLE */ + case 103: /* duration_literal ::= NK_VARIABLE */ { yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 102: /* literal_list ::= literal */ - case 124: /* expression_list ::= expression */ yytestcase(yyruleno==124); + case 104: /* literal_list ::= literal */ + case 126: /* expression_list ::= expression */ yytestcase(yyruleno==126); { yylhsminor.yy184 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 103: /* literal_list ::= literal_list NK_COMMA literal */ - case 125: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==125); + case 105: /* literal_list ::= literal_list NK_COMMA literal */ + case 127: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==127); { yylhsminor.yy184 = addNodeToList(pCxt, yymsp[-2].minor.yy184, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 113: /* expression ::= function_name NK_LP expression_list NK_RP */ + case 115: /* expression ::= function_name NK_LP expression_list NK_RP */ { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy161, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy161, yymsp[-1].minor.yy184)); } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 114: /* expression ::= function_name NK_LP NK_STAR NK_RP */ + case 116: /* expression ::= function_name NK_LP NK_STAR NK_RP */ { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy161, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy161, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 116: /* expression ::= NK_LP expression NK_RP */ - case 152: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==152); + case 118: /* expression ::= NK_LP expression NK_RP */ + case 154: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==154); { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 117: /* expression ::= NK_PLUS expression */ + case 119: /* expression ::= NK_PLUS expression */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy392)); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 118: /* expression ::= NK_MINUS expression */ + case 120: /* expression ::= NK_MINUS expression */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), NULL)); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 119: /* expression ::= expression NK_PLUS expression */ + case 121: /* expression ::= expression NK_PLUS expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2300,7 +2312,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 120: /* expression ::= expression NK_MINUS expression */ + case 122: /* expression ::= expression NK_MINUS expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2308,7 +2320,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 121: /* expression ::= expression NK_STAR expression */ + case 123: /* expression ::= expression NK_STAR expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2316,7 +2328,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 122: /* expression ::= expression NK_SLASH expression */ + case 124: /* expression ::= expression NK_SLASH expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2324,7 +2336,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 123: /* expression ::= expression NK_REM expression */ + case 125: /* expression ::= expression NK_REM expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2332,16 +2344,16 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 126: /* column_reference ::= column_name */ + case 128: /* column_reference ::= column_name */ { yylhsminor.yy392 = createRawExprNode(pCxt, &yymsp[0].minor.yy161, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy161)); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 127: /* column_reference ::= table_name NK_DOT column_name */ + case 129: /* column_reference ::= table_name NK_DOT column_name */ { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy161, &yymsp[0].minor.yy161, createColumnNode(pCxt, &yymsp[-2].minor.yy161, &yymsp[0].minor.yy161)); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 128: /* predicate ::= expression compare_op expression */ - case 133: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==133); + case 130: /* predicate ::= expression compare_op expression */ + case 135: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==135); { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2349,7 +2361,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 129: /* predicate ::= expression BETWEEN expression AND expression */ + case 131: /* predicate ::= expression BETWEEN expression AND expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2357,7 +2369,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy392 = yylhsminor.yy392; break; - case 130: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 132: /* predicate ::= expression NOT BETWEEN expression AND expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2365,68 +2377,68 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy392 = yylhsminor.yy392; break; - case 131: /* predicate ::= expression IS NULL */ + case 133: /* predicate ::= expression IS NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), NULL)); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 132: /* predicate ::= expression IS NOT NULL */ + case 134: /* predicate ::= expression IS NOT NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy392); yylhsminor.yy392 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), NULL)); } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 134: /* compare_op ::= NK_LT */ + case 136: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy220 = OP_TYPE_LOWER_THAN; } break; - case 135: /* compare_op ::= NK_GT */ + case 137: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy220 = OP_TYPE_GREATER_THAN; } break; - case 136: /* compare_op ::= NK_LE */ + case 138: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy220 = OP_TYPE_LOWER_EQUAL; } break; - case 137: /* compare_op ::= NK_GE */ + case 139: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy220 = OP_TYPE_GREATER_EQUAL; } break; - case 138: /* compare_op ::= NK_NE */ + case 140: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy220 = OP_TYPE_NOT_EQUAL; } break; - case 139: /* compare_op ::= NK_EQ */ + case 141: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy220 = OP_TYPE_EQUAL; } break; - case 140: /* compare_op ::= LIKE */ + case 142: /* compare_op ::= LIKE */ { yymsp[0].minor.yy220 = OP_TYPE_LIKE; } break; - case 141: /* compare_op ::= NOT LIKE */ + case 143: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy220 = OP_TYPE_NOT_LIKE; } break; - case 142: /* compare_op ::= MATCH */ + case 144: /* compare_op ::= MATCH */ { yymsp[0].minor.yy220 = OP_TYPE_MATCH; } break; - case 143: /* compare_op ::= NMATCH */ + case 145: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy220 = OP_TYPE_NMATCH; } break; - case 144: /* in_op ::= IN */ + case 146: /* in_op ::= IN */ { yymsp[0].minor.yy220 = OP_TYPE_IN; } break; - case 145: /* in_op ::= NOT IN */ + case 147: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy220 = OP_TYPE_NOT_IN; } break; - case 146: /* in_predicate_value ::= NK_LP expression_list NK_RP */ + case 148: /* in_predicate_value ::= NK_LP expression_list NK_RP */ { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy184)); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 148: /* boolean_value_expression ::= NOT boolean_primary */ + case 150: /* boolean_value_expression ::= NOT boolean_primary */ { SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), NULL)); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 149: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 151: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2434,7 +2446,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 150: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 152: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy392); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); @@ -2442,52 +2454,52 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 155: /* from_clause ::= FROM table_reference_list */ - case 185: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==185); - case 208: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==208); + case 157: /* from_clause ::= FROM table_reference_list */ + case 187: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==187); + case 210: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==210); { yymsp[-1].minor.yy392 = yymsp[0].minor.yy392; } break; - case 157: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + case 159: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ { yylhsminor.yy392 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy392, yymsp[0].minor.yy392, NULL); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 160: /* table_primary ::= table_name alias_opt */ + case 162: /* table_primary ::= table_name alias_opt */ { yylhsminor.yy392 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy161, &yymsp[0].minor.yy161); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 161: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + case 163: /* table_primary ::= db_name NK_DOT table_name alias_opt */ { yylhsminor.yy392 = createRealTableNode(pCxt, &yymsp[-3].minor.yy161, &yymsp[-1].minor.yy161, &yymsp[0].minor.yy161); } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 162: /* table_primary ::= subquery alias_opt */ + case 164: /* table_primary ::= subquery alias_opt */ { yylhsminor.yy392 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392), &yymsp[0].minor.yy161); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 164: /* alias_opt ::= */ + case 166: /* alias_opt ::= */ { yymsp[1].minor.yy161 = nil_token; } break; - case 165: /* alias_opt ::= table_alias */ + case 167: /* alias_opt ::= table_alias */ { yylhsminor.yy161 = yymsp[0].minor.yy161; } yymsp[0].minor.yy161 = yylhsminor.yy161; break; - case 166: /* alias_opt ::= AS table_alias */ + case 168: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy161 = yymsp[0].minor.yy161; } break; - case 167: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 168: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==168); + case 169: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 170: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==170); { yymsp[-2].minor.yy392 = yymsp[-1].minor.yy392; } break; - case 169: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + case 171: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ { yylhsminor.yy392 = createJoinTableNode(pCxt, yymsp[-4].minor.yy308, yymsp[-5].minor.yy392, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); } yymsp[-5].minor.yy392 = yylhsminor.yy392; break; - case 170: /* join_type ::= */ + case 172: /* join_type ::= */ { yymsp[1].minor.yy308 = JOIN_TYPE_INNER; } break; - case 171: /* join_type ::= INNER */ + case 173: /* join_type ::= INNER */ { yymsp[0].minor.yy308 = JOIN_TYPE_INNER; } break; - case 172: /* 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 174: /* 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.yy392 = createSelectStmt(pCxt, yymsp[-7].minor.yy377, yymsp[-6].minor.yy184, yymsp[-5].minor.yy392); yymsp[-8].minor.yy392 = addWhereClause(pCxt, yymsp[-8].minor.yy392, yymsp[-4].minor.yy392); @@ -2497,93 +2509,93 @@ static YYACTIONTYPE yy_reduce( yymsp[-8].minor.yy392 = addHavingClause(pCxt, yymsp[-8].minor.yy392, yymsp[0].minor.yy392); } break; - case 174: /* set_quantifier_opt ::= DISTINCT */ + case 176: /* set_quantifier_opt ::= DISTINCT */ { yymsp[0].minor.yy377 = true; } break; - case 175: /* set_quantifier_opt ::= ALL */ + case 177: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy377 = false; } break; - case 176: /* select_list ::= NK_STAR */ + case 178: /* select_list ::= NK_STAR */ { yymsp[0].minor.yy184 = NULL; } break; - case 180: /* select_item ::= common_expression */ + case 182: /* select_item ::= common_expression */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy392); yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392), &t); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 181: /* select_item ::= common_expression column_alias */ + case 183: /* select_item ::= common_expression column_alias */ { yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392), &yymsp[0].minor.yy161); } yymsp[-1].minor.yy392 = yylhsminor.yy392; break; - case 182: /* select_item ::= common_expression AS column_alias */ + case 184: /* select_item ::= common_expression AS column_alias */ { yylhsminor.yy392 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), &yymsp[0].minor.yy161); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 183: /* select_item ::= table_name NK_DOT NK_STAR */ + case 185: /* select_item ::= table_name NK_DOT NK_STAR */ { yylhsminor.yy392 = createColumnNode(pCxt, &yymsp[-2].minor.yy161, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 184: /* where_clause_opt ::= */ - case 188: /* twindow_clause_opt ::= */ yytestcase(yyruleno==188); - case 193: /* sliding_opt ::= */ yytestcase(yyruleno==193); - case 195: /* fill_opt ::= */ yytestcase(yyruleno==195); - case 207: /* having_clause_opt ::= */ yytestcase(yyruleno==207); - case 215: /* slimit_clause_opt ::= */ yytestcase(yyruleno==215); - case 219: /* limit_clause_opt ::= */ yytestcase(yyruleno==219); + case 186: /* where_clause_opt ::= */ + case 190: /* twindow_clause_opt ::= */ yytestcase(yyruleno==190); + case 195: /* sliding_opt ::= */ yytestcase(yyruleno==195); + case 197: /* fill_opt ::= */ yytestcase(yyruleno==197); + case 209: /* having_clause_opt ::= */ yytestcase(yyruleno==209); + case 217: /* slimit_clause_opt ::= */ yytestcase(yyruleno==217); + case 221: /* limit_clause_opt ::= */ yytestcase(yyruleno==221); { yymsp[1].minor.yy392 = NULL; } break; - case 187: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 204: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==204); - case 214: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==214); + case 189: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 206: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==206); + case 216: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==216); { yymsp[-2].minor.yy184 = yymsp[0].minor.yy184; } break; - case 189: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ + case 191: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ { yymsp[-5].minor.yy392 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy392), &yymsp[-1].minor.yy0); } break; - case 190: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + case 192: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ { yymsp[-3].minor.yy392 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy392)); } break; - case 191: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + case 193: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-5].minor.yy392 = createIntervalWindowNode(pCxt, yymsp[-3].minor.yy392, NULL, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } break; - case 192: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + case 194: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-7].minor.yy392 = createIntervalWindowNode(pCxt, yymsp[-5].minor.yy392, yymsp[-3].minor.yy392, yymsp[-1].minor.yy392, yymsp[0].minor.yy392); } break; - case 194: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + case 196: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ { yymsp[-3].minor.yy392 = yymsp[-1].minor.yy392; } break; - case 196: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 198: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy392 = createFillNode(pCxt, yymsp[-1].minor.yy166, NULL); } break; - case 197: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + case 199: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ { yymsp[-5].minor.yy392 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy184)); } break; - case 198: /* fill_mode ::= NONE */ + case 200: /* fill_mode ::= NONE */ { yymsp[0].minor.yy166 = FILL_MODE_NONE; } break; - case 199: /* fill_mode ::= PREV */ + case 201: /* fill_mode ::= PREV */ { yymsp[0].minor.yy166 = FILL_MODE_PREV; } break; - case 200: /* fill_mode ::= NULL */ + case 202: /* fill_mode ::= NULL */ { yymsp[0].minor.yy166 = FILL_MODE_NULL; } break; - case 201: /* fill_mode ::= LINEAR */ + case 203: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy166 = FILL_MODE_LINEAR; } break; - case 202: /* fill_mode ::= NEXT */ + case 204: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy166 = FILL_MODE_NEXT; } break; - case 205: /* group_by_list ::= expression */ + case 207: /* group_by_list ::= expression */ { yylhsminor.yy184 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } yymsp[0].minor.yy184 = yylhsminor.yy184; break; - case 206: /* group_by_list ::= group_by_list NK_COMMA expression */ + case 208: /* group_by_list ::= group_by_list NK_COMMA expression */ { yylhsminor.yy184 = addNodeToList(pCxt, yymsp[-2].minor.yy184, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy392))); } yymsp[-2].minor.yy184 = yylhsminor.yy184; break; - case 209: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 211: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy392 = addOrderByClause(pCxt, yymsp[-3].minor.yy392, yymsp[-2].minor.yy184); yylhsminor.yy392 = addSlimitClause(pCxt, yylhsminor.yy392, yymsp[-1].minor.yy392); @@ -2591,50 +2603,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 211: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + case 213: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ { yylhsminor.yy392 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy392, yymsp[0].minor.yy392); } yymsp[-3].minor.yy392 = yylhsminor.yy392; break; - case 216: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 220: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==220); + case 218: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 222: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==222); { yymsp[-1].minor.yy392 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 217: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 221: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==221); + case 219: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 223: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==223); { yymsp[-3].minor.yy392 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 218: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 222: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==222); + case 220: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 224: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==224); { yymsp[-3].minor.yy392 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 223: /* subquery ::= NK_LP query_expression NK_RP */ + case 225: /* subquery ::= NK_LP query_expression NK_RP */ { yylhsminor.yy392 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy392); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 224: /* search_condition ::= common_expression */ + case 226: /* search_condition ::= common_expression */ { yylhsminor.yy392 = releaseRawExprNode(pCxt, yymsp[0].minor.yy392); } yymsp[0].minor.yy392 = yylhsminor.yy392; break; - case 227: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + case 229: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ { yylhsminor.yy392 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy392), yymsp[-1].minor.yy162, yymsp[0].minor.yy9); } yymsp[-2].minor.yy392 = yylhsminor.yy392; break; - case 228: /* ordering_specification_opt ::= */ + case 230: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy162 = ORDER_ASC; } break; - case 229: /* ordering_specification_opt ::= ASC */ + case 231: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy162 = ORDER_ASC; } break; - case 230: /* ordering_specification_opt ::= DESC */ + case 232: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy162 = ORDER_DESC; } break; - case 231: /* null_ordering_opt ::= */ + case 233: /* null_ordering_opt ::= */ { yymsp[1].minor.yy9 = NULL_ORDER_DEFAULT; } break; - case 232: /* null_ordering_opt ::= NULLS FIRST */ + case 234: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy9 = NULL_ORDER_FIRST; } break; - case 233: /* null_ordering_opt ::= NULLS LAST */ + case 235: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy9 = NULL_ORDER_LAST; } break; default: diff --git a/source/libs/planner/src/physicalPlan.c b/source/libs/planner/src/physicalPlan.c index 6a522d4e9314955eeab0fb39fc054bc9017ccb5b..61c5f517a72c0de3da00b8ee0b00a395e37adaf6 100644 --- a/source/libs/planner/src/physicalPlan.c +++ b/source/libs/planner/src/physicalPlan.c @@ -546,10 +546,12 @@ static SSubplan* createPhysiSubplan(SPhysiPlanContext* pCxt, SSubLogicPlan* pLog static int32_t splitLogicPlan(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode, SSubLogicPlan** pSubLogicPlan) { *pSubLogicPlan = (SSubLogicPlan*)nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); CHECK_ALLOC(*pSubLogicPlan, TSDB_CODE_OUT_OF_MEMORY); - // todo pSubplan->pNode = nodesCloneNode(pLogicNode); - (*pSubLogicPlan)->pNode = pLogicNode; + (*pSubLogicPlan)->pNode = nodesCloneNode(pLogicNode); if (QUERY_NODE_LOGIC_PLAN_VNODE_MODIF == nodeType(pLogicNode)) { (*pSubLogicPlan)->subplanType = SUBPLAN_TYPE_MODIFY; + TSWAP(((SVnodeModifLogicNode*)pLogicNode)->pDataBlocks, ((SVnodeModifLogicNode*)(*pSubLogicPlan)->pNode)->pDataBlocks, SArray*); + } else { + (*pSubLogicPlan)->subplanType = SUBPLAN_TYPE_MERGE; } // todo split return TSDB_CODE_SUCCESS; @@ -574,8 +576,7 @@ static int32_t pushSubplan(SPhysiPlanContext* pCxt, SNodeptr pSubplan, int32_t l SSubLogicPlan* singleCloneSubLogicPlan(SPhysiPlanContext* pCxt, SSubLogicPlan* pSrc, int32_t level) { SSubLogicPlan* pDst = nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); CHECK_ALLOC(pDst, NULL); - // todo pDst->pNode = nodesCloneNode(pSrc->pNode); - pDst->pNode = pSrc->pNode; + pDst->pNode = nodesCloneNode(pSrc->pNode); if (NULL == pDst->pNode) { nodesDestroyNode(pDst); return NULL; @@ -690,6 +691,7 @@ int32_t createPhysiPlan(SPlanContext* pCxt, SLogicNode* pLogicNode, SQueryPlan** if (TSDB_CODE_SUCCESS == code) { code = buildPhysiPlan(&cxt, pLogicPlan, pPlan); } - nodesDestroyNode((SNode*)pLogicPlan); + nodesDestroyNode(pSubLogicPlan); + nodesDestroyNode(pLogicPlan); return code; } diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c index 3481cb33526d5e45e7899f272b7e6c4d0c6f8a5f..d7d9f1d129b80b9c43d845f7cb5754cecd7c0a47 100644 --- a/source/libs/planner/src/planner.c +++ b/source/libs/planner/src/planner.c @@ -30,6 +30,7 @@ int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNo if (TSDB_CODE_SUCCESS == code) { code = createPhysiPlan(pCxt, pLogicNode, pPlan, pExecNodeList); } + nodesDestroyNode(pLogicNode); return code; }