diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 40bf9a7f62364a1aaf399b3d44591108f973ea7f..22cedcd5716a6441bd306c20a937c4c0b7fa3cca 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -24,6 +24,7 @@ #include "thash.h" #include "tlist.h" #include "trow.h" +#include "tuuid.h" #ifdef __cplusplus extern "C" { @@ -171,7 +172,7 @@ typedef struct { char db[TSDB_DB_FNAME_LEN]; int64_t dbId; int32_t vgVersion; - int32_t numOfTable; // unit is TSDB_TABLE_NUM_UNIT + int32_t numOfTable; // unit is TSDB_TABLE_NUM_UNIT } SBuildUseDBInput; typedef struct SField { @@ -427,10 +428,10 @@ typedef struct { int16_t slotId; }; - int16_t type; - int32_t bytes; - uint8_t precision; - uint8_t scale; + int16_t type; + int32_t bytes; + uint8_t precision; + uint8_t scale; } SColumnInfo; typedef struct { @@ -526,7 +527,7 @@ typedef struct { char db[TSDB_DB_FNAME_LEN]; int64_t dbId; int32_t vgVersion; - int32_t numOfTable; // unit is TSDB_TABLE_NUM_UNIT + int32_t numOfTable; // unit is TSDB_TABLE_NUM_UNIT } SUseDbReq; int32_t tSerializeSUseDbReq(void* buf, int32_t bufLen, SUseDbReq* pReq); @@ -553,15 +554,13 @@ int32_t tSerializeSQnodeListReq(void* buf, int32_t bufLen, SQnodeListReq* pReq); int32_t tDeserializeSQnodeListReq(void* buf, int32_t bufLen, SQnodeListReq* pReq); typedef struct { - SArray *epSetList; // SArray + SArray* epSetList; // SArray } SQnodeListRsp; int32_t tSerializeSQnodeListRsp(void* buf, int32_t bufLen, SQnodeListRsp* pRsp); int32_t tDeserializeSQnodeListRsp(void* buf, int32_t bufLen, SQnodeListRsp* pRsp); void tFreeSQnodeListRsp(SQnodeListRsp* pRsp); - - typedef struct { SArray* pArray; // Array of SUseDbRsp } SUseDbBatchRsp; @@ -777,7 +776,6 @@ typedef struct SVgroupInfo { int32_t numOfTable; // unit is TSDB_TABLE_NUM_UNIT } SVgroupInfo; - typedef struct { int32_t numOfVgroups; SVgroupInfo vgroups[]; @@ -1062,8 +1060,8 @@ typedef struct { } STaskStatus; typedef struct { - int64_t refId; - SArray *taskStatus; //SArray + int64_t refId; + SArray* taskStatus; // SArray } SSchedulerStatusRsp; typedef struct { @@ -1072,35 +1070,31 @@ typedef struct { int8_t action; } STaskAction; - typedef struct SQueryNodeEpId { int32_t nodeId; // vgId or qnodeId SEp ep; } SQueryNodeEpId; - typedef struct { SMsgHead header; uint64_t sId; SQueryNodeEpId epId; - SArray *taskAction; //SArray + SArray* taskAction; // SArray } SSchedulerHbReq; -int32_t tSerializeSSchedulerHbReq(void *buf, int32_t bufLen, SSchedulerHbReq *pReq); -int32_t tDeserializeSSchedulerHbReq(void *buf, int32_t bufLen, SSchedulerHbReq *pReq); -void tFreeSSchedulerHbReq(SSchedulerHbReq *pReq); - +int32_t tSerializeSSchedulerHbReq(void* buf, int32_t bufLen, SSchedulerHbReq* pReq); +int32_t tDeserializeSSchedulerHbReq(void* buf, int32_t bufLen, SSchedulerHbReq* pReq); +void tFreeSSchedulerHbReq(SSchedulerHbReq* pReq); typedef struct { uint64_t seqId; SQueryNodeEpId epId; - SArray *taskStatus; //SArray + SArray* taskStatus; // SArray } SSchedulerHbRsp; -int32_t tSerializeSSchedulerHbRsp(void *buf, int32_t bufLen, SSchedulerHbRsp *pRsp); -int32_t tDeserializeSSchedulerHbRsp(void *buf, int32_t bufLen, SSchedulerHbRsp *pRsp); -void tFreeSSchedulerHbRsp(SSchedulerHbRsp *pRsp); - +int32_t tSerializeSSchedulerHbRsp(void* buf, int32_t bufLen, SSchedulerHbRsp* pRsp); +int32_t tDeserializeSSchedulerHbRsp(void* buf, int32_t bufLen, SSchedulerHbRsp* pRsp); +void tFreeSSchedulerHbRsp(SSchedulerHbRsp* pRsp); typedef struct { SMsgHead header; @@ -1157,8 +1151,8 @@ typedef struct { char name[TSDB_TOPIC_FNAME_LEN]; int8_t igExists; char* sql; - char* physicalPlan; - char* logicalPlan; + char* ast; + char subscribeDbName[TSDB_DB_NAME_LEN]; } SCMCreateTopicReq; int32_t tSerializeSCMCreateTopicReq(void* buf, int32_t bufLen, const SCMCreateTopicReq* pReq); @@ -1370,7 +1364,7 @@ typedef struct SVCreateTbReq { } SVCreateTbReq, SVUpdateTbReq; typedef struct { - int tmp; // TODO: to avoid compile error + int tmp; // TODO: to avoid compile error } SVCreateTbRsp, SVUpdateTbRsp; int32_t tSerializeSVCreateTbReq(void** buf, SVCreateTbReq* pReq); @@ -1382,7 +1376,7 @@ typedef struct { } SVCreateTbBatchReq; typedef struct { - int tmp; // TODO: to avoid compile error + int tmp; // TODO: to avoid compile error } SVCreateTbBatchRsp; int32_t tSerializeSVCreateTbBatchReq(void** buf, SVCreateTbBatchReq* pReq); @@ -1396,7 +1390,7 @@ typedef struct { } SVDropTbReq; typedef struct { - int tmp; // TODO: to avoid compile error + int tmp; // TODO: to avoid compile error } SVDropTbRsp; int32_t tSerializeSVDropTbReq(void** buf, SVDropTbReq* pReq); @@ -1919,7 +1913,7 @@ typedef struct { } SVCreateTSmaReq; typedef struct { - int8_t type; // 0 status report, 1 update data + int8_t type; // 0 status report, 1 update data char indexName[TSDB_INDEX_NAME_LEN]; // STimeWindow windows; } STSmaMsg; @@ -1930,7 +1924,7 @@ typedef struct { } SVDropTSmaReq; typedef struct { - int tmp; // TODO: to avoid compile error + int tmp; // TODO: to avoid compile error } SVCreateTSmaRsp, SVDropTSmaRsp; int32_t tSerializeSVCreateTSmaReq(void** buf, SVCreateTSmaReq* pReq); @@ -2016,7 +2010,7 @@ static FORCE_INLINE int32_t tEncodeTSma(void** buf, const STSma* pSma) { tlen += taosEncodeFixedI64(buf, pSma->interval); tlen += taosEncodeFixedI64(buf, pSma->offset); tlen += taosEncodeFixedI64(buf, pSma->sliding); - + if (pSma->exprLen > 0) { tlen += taosEncodeString(buf, pSma->expr); } @@ -2252,6 +2246,51 @@ static FORCE_INLINE void* tDecodeSMqCMGetSubEpRsp(void* buf, SMqCMGetSubEpRsp* p return buf; } +enum { + STREAM_TASK_STATUS__RUNNING = 1, + STREAM_TASK_STATUS__STOP, +}; + +typedef struct { + int64_t streamId; + int32_t taskId; + int32_t level; + int8_t status; + char* qmsg; + void* executor; + // void* stateStore; + // storage handle +} SStreamTask; + +static FORCE_INLINE SStreamTask* streamTaskNew(int64_t streamId, int32_t level) { + SStreamTask* pTask = (SStreamTask*)calloc(1, sizeof(SStreamTask)); + if (pTask == NULL) { + return NULL; + } + pTask->taskId = tGenIdPI32(); + pTask->status = STREAM_TASK_STATUS__RUNNING; + pTask->qmsg = NULL; + return pTask; +} + +int32_t tEncodeSStreamTask(SCoder* pEncoder, const SStreamTask* pTask); +int32_t tDecodeSStreamTask(SCoder* pDecoder, SStreamTask* pTask); +void tFreeSStreamTask(SStreamTask* pTask); + +typedef struct { + SMsgHead head; + SStreamTask* task; +} SStreamTaskDeployReq; + +typedef struct { + int32_t reserved; +} SStreamTaskDeployRsp; + +typedef struct { + SMsgHead head; + // TODO: other info needed by task +} SStreamTaskExecReq; + #pragma pack(pop) #ifdef __cplusplus diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 03f8daad42e1106b2acecfc2097c456fc049c7af..b30a325d7cc962c09730d3293a6acc5b9995f27c 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -199,6 +199,7 @@ enum { // Requests handled by SNODE TD_NEW_MSG_SEG(TDMT_SND_MSG) + TD_DEF_MSG_TYPE(TDMT_SND_TASK_DEPLOY, "snode-task-deploy", SStreamTaskDeployReq, SStreamTaskDeployRsp) #if defined(TD_MSG_NUMBER_) TDMT_MAX diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 5693091bd522d326726e94564b5d9397ea7e9f6e..167c72a778a1bef50bdf8ebfc3b20ae665bdfab6 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -108,53 +108,54 @@ #define TK_FULLTEXT 90 #define TK_FUNCTION 91 #define TK_INTERVAL 92 -#define TK_MNODES 93 -#define TK_NK_FLOAT 94 -#define TK_NK_BOOL 95 -#define TK_NK_VARIABLE 96 -#define TK_BETWEEN 97 -#define TK_IS 98 -#define TK_NULL 99 -#define TK_NK_LT 100 -#define TK_NK_GT 101 -#define TK_NK_LE 102 -#define TK_NK_GE 103 -#define TK_NK_NE 104 -#define TK_NK_EQ 105 -#define TK_LIKE 106 -#define TK_MATCH 107 -#define TK_NMATCH 108 -#define TK_IN 109 -#define TK_FROM 110 -#define TK_AS 111 -#define TK_JOIN 112 -#define TK_INNER 113 -#define TK_SELECT 114 -#define TK_DISTINCT 115 -#define TK_WHERE 116 -#define TK_PARTITION 117 -#define TK_BY 118 -#define TK_SESSION 119 -#define TK_STATE_WINDOW 120 -#define TK_SLIDING 121 -#define TK_FILL 122 -#define TK_VALUE 123 -#define TK_NONE 124 -#define TK_PREV 125 -#define TK_LINEAR 126 -#define TK_NEXT 127 -#define TK_GROUP 128 -#define TK_HAVING 129 -#define TK_ORDER 130 -#define TK_SLIMIT 131 -#define TK_SOFFSET 132 -#define TK_LIMIT 133 -#define TK_OFFSET 134 -#define TK_ASC 135 -#define TK_DESC 136 -#define TK_NULLS 137 -#define TK_FIRST 138 -#define TK_LAST 139 +#define TK_TOPIC 93 +#define TK_AS 94 +#define TK_MNODES 95 +#define TK_NK_FLOAT 96 +#define TK_NK_BOOL 97 +#define TK_NK_VARIABLE 98 +#define TK_BETWEEN 99 +#define TK_IS 100 +#define TK_NULL 101 +#define TK_NK_LT 102 +#define TK_NK_GT 103 +#define TK_NK_LE 104 +#define TK_NK_GE 105 +#define TK_NK_NE 106 +#define TK_NK_EQ 107 +#define TK_LIKE 108 +#define TK_MATCH 109 +#define TK_NMATCH 110 +#define TK_IN 111 +#define TK_FROM 112 +#define TK_JOIN 113 +#define TK_INNER 114 +#define TK_SELECT 115 +#define TK_DISTINCT 116 +#define TK_WHERE 117 +#define TK_PARTITION 118 +#define TK_BY 119 +#define TK_SESSION 120 +#define TK_STATE_WINDOW 121 +#define TK_SLIDING 122 +#define TK_FILL 123 +#define TK_VALUE 124 +#define TK_NONE 125 +#define TK_PREV 126 +#define TK_LINEAR 127 +#define TK_NEXT 128 +#define TK_GROUP 129 +#define TK_HAVING 130 +#define TK_ORDER 131 +#define TK_SLIMIT 132 +#define TK_SOFFSET 133 +#define TK_LIMIT 134 +#define TK_OFFSET 135 +#define TK_ASC 136 +#define TK_DESC 137 +#define TK_NULLS 138 +#define TK_FIRST 139 +#define TK_LAST 140 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/dnode/snode/snode.h b/include/dnode/snode/snode.h index 21a93532e0d77b3c8f5e6157380e7804b393d622..b25f8a8666bec1e76ef394572ae24f9fba0e14dd 100644 --- a/include/dnode/snode/snode.h +++ b/include/dnode/snode/snode.h @@ -16,6 +16,7 @@ #ifndef _TD_SNODE_H_ #define _TD_SNODE_H_ +#include "tcommon.h" #include "tmsg.h" #include "trpc.h" @@ -78,7 +79,7 @@ int32_t sndGetLoad(SSnode *pSnode, SSnodeLoad *pLoad); * @param pRsp The response message * @return int32_t 0 for success, -1 for failure */ -int32_t sndProcessMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg **pRsp); +// int32_t sndProcessMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg **pRsp); int32_t sndProcessUMsg(SSnode *pSnode, SRpcMsg *pMsg); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 21d9ff83c89d5d671f0af12a2d0ccd13c059bda8..5d7174fc0887f644c9924889ef5f199e93b38f30 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -61,6 +61,12 @@ typedef struct SDropDatabaseStmt { bool ignoreNotExists; } SDropDatabaseStmt; +typedef struct SAlterDatabaseStmt { + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; + SDatabaseOptions* pOptions; +} SAlterDatabaseStmt; + typedef struct STableOptions { ENodeType type; int32_t keep; @@ -179,11 +185,36 @@ typedef struct SCreateIndexStmt { SIndexOptions* pOptions; } SCreateIndexStmt; +typedef struct SDropIndexStmt { + ENodeType type; + char indexName[TSDB_INDEX_NAME_LEN]; + char tableName[TSDB_TABLE_NAME_LEN]; +} SDropIndexStmt; + typedef struct SCreateQnodeStmt { ENodeType type; int32_t dnodeId; } SCreateQnodeStmt; +typedef struct SDropQnodeStmt { + ENodeType type; + int32_t dnodeId; +} SDropQnodeStmt; + +typedef struct SCreateTopicStmt { + ENodeType type; + char topicName[TSDB_TABLE_NAME_LEN]; + char subscribeDbName[TSDB_DB_NAME_LEN]; + bool ignoreExists; + SNode* pQuery; +} SCreateTopicStmt; + +typedef struct SDropTopicStmt { + ENodeType type; + char topicName[TSDB_TABLE_NAME_LEN]; + bool ignoreNotExists; +} SDropTopicStmt; + #ifdef __cplusplus } #endif diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index cf34c6665ac71b1a192bbb27e36d951623445a1c..4ef70fc7ab868a2b4dee52c87d815e0ee8834c73 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -77,6 +77,7 @@ typedef enum ENodeType { QUERY_NODE_VNODE_MODIF_STMT, QUERY_NODE_CREATE_DATABASE_STMT, QUERY_NODE_DROP_DATABASE_STMT, + QUERY_NODE_ALTER_DATABASE_STMT, QUERY_NODE_SHOW_DATABASES_STMT, // temp QUERY_NODE_CREATE_TABLE_STMT, QUERY_NODE_CREATE_SUBTABLE_CLAUSE, @@ -98,7 +99,11 @@ typedef enum ENodeType { QUERY_NODE_SHOW_MNODES_STMT, QUERY_NODE_SHOW_QNODES_STMT, QUERY_NODE_CREATE_INDEX_STMT, + QUERY_NODE_DROP_INDEX_STMT, QUERY_NODE_CREATE_QNODE_STMT, + QUERY_NODE_DROP_QNODE_STMT, + QUERY_NODE_CREATE_TOPIC_STMT, + QUERY_NODE_DROP_TOPIC_STMT, // logic plan node QUERY_NODE_LOGIC_PLAN_SCAN, diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c index b3f71c107534d3ab1daf0cf763d287be8cad3e05..0ddd53be0838bf7c633a43b6849470b35f4c8be5 100644 --- a/source/client/src/tmq.c +++ b/source/client/src/tmq.c @@ -482,7 +482,7 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i } tscDebug("start to create topic, %s", topicName); - +#if 0 CHECK_CODE_GOTO(buildRequest(pTscObj, sql, sqlLen, &pRequest), _return); CHECK_CODE_GOTO(parseSql(pRequest, &pQueryNode), _return); @@ -536,7 +536,7 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo); tsem_wait(&pRequest->body.rspSem); - +#endif _return: qDestroyQuery(pQueryNode); /*if (sendInfo != NULL) {*/ diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index f26f19f3b2b6c1bc122fac359442a5481b265bd7..469090c05b38713f55aae1fd8cf368c4f77ecccd 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1467,8 +1467,7 @@ int32_t tDeserializeSUseDbReq(void *buf, int32_t bufLen, SUseDbReq *pReq) { return 0; } - -int32_t tSerializeSQnodeListReq(void* buf, int32_t bufLen, SQnodeListReq* pReq) { +int32_t tSerializeSQnodeListReq(void *buf, int32_t bufLen, SQnodeListReq *pReq) { SCoder encoder = {0}; tCoderInit(&encoder, TD_LITTLE_ENDIAN, buf, bufLen, TD_ENCODER); @@ -1499,7 +1498,7 @@ int32_t tSerializeSQnodeListRsp(void *buf, int32_t bufLen, SQnodeListRsp *pRsp) if (tStartEncode(&encoder) < 0) return -1; int32_t num = taosArrayGetSize(pRsp->epSetList); - if (tEncodeI32(&encoder, num) < 0) return -1; + if (tEncodeI32(&encoder, num) < 0) return -1; for (int32_t i = 0; i < num; ++i) { SEpSet *epSet = taosArrayGet(pRsp->epSetList, i); if (tEncodeSEpSet(&encoder, epSet) < 0) return -1; @@ -1990,11 +1989,9 @@ int32_t tDeserializeSMDropTopicReq(void *buf, int32_t bufLen, SMDropTopicReq *pR int32_t tSerializeSCMCreateTopicReq(void *buf, int32_t bufLen, const SCMCreateTopicReq *pReq) { int32_t sqlLen = 0; - int32_t physicalPlanLen = 0; - int32_t logicalPlanLen = 0; + int32_t astLen = 0; if (pReq->sql != NULL) sqlLen = (int32_t)strlen(pReq->sql); - if (pReq->physicalPlan != NULL) physicalPlanLen = (int32_t)strlen(pReq->physicalPlan); - if (pReq->logicalPlan != NULL) logicalPlanLen = (int32_t)strlen(pReq->logicalPlan); + if (pReq->ast != NULL) astLen = (int32_t)strlen(pReq->ast); SCoder encoder = {0}; tCoderInit(&encoder, TD_LITTLE_ENDIAN, buf, bufLen, TD_ENCODER); @@ -2003,11 +2000,9 @@ int32_t tSerializeSCMCreateTopicReq(void *buf, int32_t bufLen, const SCMCreateTo if (tEncodeCStr(&encoder, pReq->name) < 0) return -1; if (tEncodeI8(&encoder, pReq->igExists) < 0) return -1; if (tEncodeI32(&encoder, sqlLen) < 0) return -1; - if (tEncodeI32(&encoder, physicalPlanLen) < 0) return -1; - if (tEncodeI32(&encoder, logicalPlanLen) < 0) return -1; - if (tEncodeCStr(&encoder, pReq->sql) < 0) return -1; - if (tEncodeCStr(&encoder, pReq->physicalPlan) < 0) return -1; - if (tEncodeCStr(&encoder, pReq->logicalPlan) < 0) return -1; + if (tEncodeI32(&encoder, astLen) < 0) return -1; + if (sqlLen > 0 && tEncodeCStr(&encoder, pReq->sql) < 0) return -1; + if (astLen > 0 && tEncodeCStr(&encoder, pReq->ast) < 0) return -1; tEndEncode(&encoder); @@ -2018,8 +2013,7 @@ int32_t tSerializeSCMCreateTopicReq(void *buf, int32_t bufLen, const SCMCreateTo int32_t tDeserializeSCMCreateTopicReq(void *buf, int32_t bufLen, SCMCreateTopicReq *pReq) { int32_t sqlLen = 0; - int32_t physicalPlanLen = 0; - int32_t logicalPlanLen = 0; + int32_t astLen = 0; SCoder decoder = {0}; tCoderInit(&decoder, TD_LITTLE_ENDIAN, buf, bufLen, TD_DECODER); @@ -2028,17 +2022,20 @@ int32_t tDeserializeSCMCreateTopicReq(void *buf, int32_t bufLen, SCMCreateTopicR if (tDecodeCStrTo(&decoder, pReq->name) < 0) return -1; if (tDecodeI8(&decoder, &pReq->igExists) < 0) return -1; if (tDecodeI32(&decoder, &sqlLen) < 0) return -1; - if (tDecodeI32(&decoder, &physicalPlanLen) < 0) return -1; - if (tDecodeI32(&decoder, &logicalPlanLen) < 0) return -1; + if (tDecodeI32(&decoder, &astLen) < 0) return -1; + + if (sqlLen > 0) { + pReq->sql = calloc(1, sqlLen + 1); + if (pReq->sql == NULL) return -1; + if (tDecodeCStrTo(&decoder, pReq->sql) < 0) return -1; + } - pReq->sql = calloc(1, sqlLen + 1); - pReq->physicalPlan = calloc(1, physicalPlanLen + 1); - pReq->logicalPlan = calloc(1, logicalPlanLen + 1); - if (pReq->sql == NULL || pReq->physicalPlan == NULL || pReq->logicalPlan == NULL) return -1; + if (astLen > 0) { + pReq->ast = calloc(1, astLen + 1); + if (pReq->ast == NULL) return -1; + if (tDecodeCStrTo(&decoder, pReq->ast) < 0) return -1; + } - if (tDecodeCStrTo(&decoder, pReq->sql) < 0) return -1; - if (tDecodeCStrTo(&decoder, pReq->physicalPlan) < 0) return -1; - if (tDecodeCStrTo(&decoder, pReq->logicalPlan) < 0) return -1; tEndDecode(&decoder); tCoderClear(&decoder); @@ -2047,8 +2044,7 @@ int32_t tDeserializeSCMCreateTopicReq(void *buf, int32_t bufLen, SCMCreateTopicR void tFreeSCMCreateTopicReq(SCMCreateTopicReq *pReq) { tfree(pReq->sql); - tfree(pReq->physicalPlan); - tfree(pReq->logicalPlan); + tfree(pReq->ast); } int32_t tSerializeSCMCreateTopicRsp(void *buf, int32_t bufLen, const SCMCreateTopicRsp *pRsp) { @@ -2491,27 +2487,27 @@ int32_t tSerializeSSchedulerHbReq(void *buf, int32_t bufLen, SSchedulerHbReq *pR tCoderInit(&encoder, TD_LITTLE_ENDIAN, buf, bufLen, TD_ENCODER); if (tStartEncode(&encoder) < 0) return -1; - if (tEncodeU64(&encoder, pReq->sId) < 0) return -1; - if (tEncodeI32(&encoder, pReq->epId.nodeId) < 0) return -1; + if (tEncodeU64(&encoder, pReq->sId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->epId.nodeId) < 0) return -1; if (tEncodeU16(&encoder, pReq->epId.ep.port) < 0) return -1; - if (tEncodeCStr(&encoder, pReq->epId.ep.fqdn) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->epId.ep.fqdn) < 0) return -1; if (pReq->taskAction) { int32_t num = taosArrayGetSize(pReq->taskAction); - if (tEncodeI32(&encoder, num) < 0) return -1; + if (tEncodeI32(&encoder, num) < 0) return -1; for (int32_t i = 0; i < num; ++i) { STaskAction *action = taosArrayGet(pReq->taskAction, i); - if (tEncodeU64(&encoder, action->queryId) < 0) return -1; - if (tEncodeU64(&encoder, action->taskId) < 0) return -1; - if (tEncodeI8(&encoder, action->action) < 0) return -1; + if (tEncodeU64(&encoder, action->queryId) < 0) return -1; + if (tEncodeU64(&encoder, action->taskId) < 0) return -1; + if (tEncodeI8(&encoder, action->action) < 0) return -1; } } else { - if (tEncodeI32(&encoder, 0) < 0) return -1; + if (tEncodeI32(&encoder, 0) < 0) return -1; } tEndEncode(&encoder); int32_t tlen = encoder.pos; tCoderClear(&encoder); - + if (buf != NULL) { SMsgHead *pHead = (SMsgHead *)((char *)buf - headLen); pHead->vgId = htonl(pReq->header.vgId); @@ -2559,29 +2555,27 @@ int32_t tDeserializeSSchedulerHbReq(void *buf, int32_t bufLen, SSchedulerHbReq * void tFreeSSchedulerHbReq(SSchedulerHbReq *pReq) { taosArrayDestroy(pReq->taskAction); } - - int32_t tSerializeSSchedulerHbRsp(void *buf, int32_t bufLen, SSchedulerHbRsp *pRsp) { SCoder encoder = {0}; tCoderInit(&encoder, TD_LITTLE_ENDIAN, buf, bufLen, TD_ENCODER); if (tStartEncode(&encoder) < 0) return -1; - if (tEncodeU64(&encoder, pRsp->seqId) < 0) return -1; - if (tEncodeI32(&encoder, pRsp->epId.nodeId) < 0) return -1; + if (tEncodeU64(&encoder, pRsp->seqId) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->epId.nodeId) < 0) return -1; if (tEncodeU16(&encoder, pRsp->epId.ep.port) < 0) return -1; - if (tEncodeCStr(&encoder, pRsp->epId.ep.fqdn) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->epId.ep.fqdn) < 0) return -1; if (pRsp->taskStatus) { int32_t num = taosArrayGetSize(pRsp->taskStatus); - if (tEncodeI32(&encoder, num) < 0) return -1; + if (tEncodeI32(&encoder, num) < 0) return -1; for (int32_t i = 0; i < num; ++i) { STaskStatus *status = taosArrayGet(pRsp->taskStatus, i); - if (tEncodeU64(&encoder, status->queryId) < 0) return -1; - if (tEncodeU64(&encoder, status->taskId) < 0) return -1; - if (tEncodeI64(&encoder, status->refId) < 0) return -1; - if (tEncodeI8(&encoder, status->status) < 0) return -1; + if (tEncodeU64(&encoder, status->queryId) < 0) return -1; + if (tEncodeU64(&encoder, status->taskId) < 0) return -1; + if (tEncodeI64(&encoder, status->refId) < 0) return -1; + if (tEncodeI8(&encoder, status->status) < 0) return -1; } } else { - if (tEncodeI32(&encoder, 0) < 0) return -1; + if (tEncodeI32(&encoder, 0) < 0) return -1; } tEndEncode(&encoder); @@ -2694,3 +2688,32 @@ void tFreeSCMCreateStreamReq(SCMCreateStreamReq *pReq) { tfree(pReq->physicalPlan); tfree(pReq->logicalPlan); } + +int32_t tEncodeSStreamTask(SCoder *pEncoder, const SStreamTask *pTask) { + if (tStartEncode(pEncoder) < 0) return -1; + if (tEncodeI64(pEncoder, pTask->streamId) < 0) return -1; + if (tEncodeI32(pEncoder, pTask->taskId) < 0) return -1; + if (tEncodeI32(pEncoder, pTask->level) < 0) return -1; + if (tEncodeI8(pEncoder, pTask->status) < 0) return -1; + if (tEncodeCStr(pEncoder, pTask->qmsg) < 0) return -1; + tEndEncode(pEncoder); + return pEncoder->pos; +} + +int32_t tDecodeSStreamTask(SCoder *pDecoder, SStreamTask *pTask) { + if (tStartDecode(pDecoder) < 0) return -1; + if (tDecodeI64(pDecoder, &pTask->streamId) < 0) return -1; + if (tDecodeI32(pDecoder, &pTask->taskId) < 0) return -1; + if (tDecodeI32(pDecoder, &pTask->level) < 0) return -1; + if (tDecodeI8(pDecoder, &pTask->status) < 0) return -1; + if (tDecodeCStr(pDecoder, (const char **)&pTask->qmsg) < 0) return -1; + tEndDecode(pDecoder); + return 0; +} + +void tFreeSStreamTask(SStreamTask *pTask) { + // TODO + /*free(pTask->qmsg);*/ + /*free(pTask->executor);*/ + /*free(pTask);*/ +} diff --git a/source/dnode/mgmt/impl/src/dndSnode.c b/source/dnode/mgmt/impl/src/dndSnode.c index 5ea8a841d22a1b0cf03c554285d5c7107aca7205..8667952f2c71a5febe171e0eae6af4e61ad725f4 100644 --- a/source/dnode/mgmt/impl/src/dndSnode.c +++ b/source/dnode/mgmt/impl/src/dndSnode.c @@ -323,8 +323,8 @@ int32_t dndProcessDropSnodeReq(SDnode *pDnode, SRpcMsg *pReq) { } static void dndProcessSnodeUniqueQueue(SDnode *pDnode, STaosQall *qall, int32_t numOfMsgs) { - SSnodeMgmt *pMgmt = &pDnode->smgmt; - int32_t code = TSDB_CODE_DND_SNODE_NOT_DEPLOYED; + /*SSnodeMgmt *pMgmt = &pDnode->smgmt;*/ + int32_t code = TSDB_CODE_DND_SNODE_NOT_DEPLOYED; SSnode *pSnode = dndAcquireSnode(pDnode); if (pSnode != NULL) { @@ -334,22 +334,35 @@ static void dndProcessSnodeUniqueQueue(SDnode *pDnode, STaosQall *qall, int32_t sndProcessUMsg(pSnode, pMsg); + rpcFreeCont(pMsg->pCont); + taosFreeQitem(pMsg); + } + dndReleaseSnode(pDnode, pSnode); + } else { + for (int32_t i = 0; i < numOfMsgs; i++) { + SRpcMsg *pMsg = NULL; + taosGetQitem(qall, (void **)&pMsg); + SRpcMsg rpcRsp = {.handle = pMsg->handle, .ahandle = pMsg->ahandle, .code = code}; + rpcSendResponse(&rpcRsp); + rpcFreeCont(pMsg->pCont); taosFreeQitem(pMsg); } } - dndReleaseSnode(pDnode, pSnode); } static void dndProcessSnodeSharedQueue(SDnode *pDnode, SRpcMsg *pMsg) { - SSnodeMgmt *pMgmt = &pDnode->smgmt; - int32_t code = TSDB_CODE_DND_SNODE_NOT_DEPLOYED; + /*SSnodeMgmt *pMgmt = &pDnode->smgmt;*/ + int32_t code = TSDB_CODE_DND_SNODE_NOT_DEPLOYED; SSnode *pSnode = dndAcquireSnode(pDnode); if (pSnode != NULL) { - code = sndProcessSMsg(pSnode, pMsg); + sndProcessSMsg(pSnode, pMsg); + dndReleaseSnode(pDnode, pSnode); + } else { + SRpcMsg rpcRsp = {.handle = pMsg->handle, .ahandle = pMsg->ahandle, .code = code}; + rpcSendResponse(&rpcRsp); } - dndReleaseSnode(pDnode, pSnode); #if 0 if (pMsg->msgType & 1u) { diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index a7116b72ffe66df005ae46441053df0e1d79bcc8..8ea9cc141f8d673efc8e33cb734a6854f2d8bbe9 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -85,6 +85,8 @@ typedef enum { TRN_TYPE_REBALANCE = 1017, TRN_TYPE_COMMIT_OFFSET = 1018, TRN_TYPE_CREATE_STREAM = 1019, + TRN_TYPE_DROP_STREAM = 1020, + TRN_TYPE_ALTER_STREAM = 1021, TRN_TYPE_BASIC_SCOPE_END, TRN_TYPE_GLOBAL_SCOPE = 2000, TRN_TYPE_CREATE_DNODE = 2001, @@ -679,12 +681,6 @@ static FORCE_INLINE void* tDecodeSMqConsumerObj(void* buf, SMqConsumerObj* pCons return buf; } -typedef struct { - int32_t taskId; - int32_t level; - SSubplan* plan; -} SStreamTaskMeta; - typedef struct { char name[TSDB_TOPIC_FNAME_LEN]; char db[TSDB_DB_FNAME_LEN]; @@ -700,7 +696,7 @@ typedef struct { char* sql; char* logicalPlan; char* physicalPlan; - SArray* tasks; // SArray> + SArray* tasks; // SArray> } SStreamObj; int32_t tEncodeSStreamObj(SCoder* pEncoder, const SStreamObj* pObj); diff --git a/source/dnode/mnode/impl/inc/mndScheduler.h b/source/dnode/mnode/impl/inc/mndScheduler.h index 3bf6e0c33a6a07c633c38323c133099fed62e17b..42951beca2e414611543d92e08b86d19f6247636 100644 --- a/source/dnode/mnode/impl/inc/mndScheduler.h +++ b/source/dnode/mnode/impl/inc/mndScheduler.h @@ -27,6 +27,8 @@ void mndCleanupScheduler(SMnode* pMnode); int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscribeObj* pSub); +int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream); + #ifdef __cplusplus } #endif diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index 855e244daafc2ed247348b7141d3d41d45aa399b..16b1ba8a5c9cc86db1735e7a87da81c969eda4cf 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -31,7 +31,7 @@ #include "tname.h" #include "tuuid.h" -int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { +int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream) { SSdb* pSdb = pMnode->pSdb; SVgObj* pVgroup = NULL; SQueryPlan* pPlan = qStringToQueryPlan(pStream->physicalPlan); @@ -41,17 +41,18 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { } ASSERT(pStream->vgNum == 0); - int32_t levelNum = LIST_LENGTH(pPlan->pSubplans); - pStream->tasks = taosArrayInit(levelNum, sizeof(SArray)); + int32_t totLevel = LIST_LENGTH(pPlan->pSubplans); + pStream->tasks = taosArrayInit(totLevel, sizeof(SArray)); - for (int32_t i = 0; i < levelNum; i++) { - SArray* taskOneLevel = taosArrayInit(0, sizeof(SStreamTaskMeta)); - SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, i); + int32_t msgLen; + for (int32_t level = 0; level < totLevel; level++) { + SArray* taskOneLevel = taosArrayInit(0, sizeof(SStreamTask)); + SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, level); int32_t opNum = LIST_LENGTH(inner->pNodeList); ASSERT(opNum == 1); - SSubplan* plan = nodesListGetNode(inner->pNodeList, 0); - if (i == 0) { + SSubplan* plan = nodesListGetNode(inner->pNodeList, level); + if (level == 0) { ASSERT(plan->type == SUBPLAN_TYPE_SCAN); void* pIter = NULL; while (1) { @@ -63,15 +64,19 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { } pStream->vgNum++; + // send to vnode + + SStreamTask* pTask = streamTaskNew(pStream->uid, level); + plan->execNode.nodeId = pVgroup->vgId; plan->execNode.epSet = mndGetVgroupEpset(pMnode, pVgroup); - SStreamTaskMeta task = { - .taskId = tGenIdPI32(), - .level = i, - .plan = plan, - }; - // send to vnode - taosArrayPush(taskOneLevel, &task); + if (qSubPlanToString(plan, &pTask->qmsg, &msgLen) < 0) { + sdbRelease(pSdb, pVgroup); + qDestroyQueryPlan(pPlan); + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } + taosArrayPush(taskOneLevel, pTask); } } else if (plan->subplanType == SUBPLAN_TYPE_SCAN) { // duplicatable @@ -82,22 +87,36 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { // if has snode, set to shared thread num in snode parallel = SND_SHARED_THREAD_NUM; - for (int32_t j = 0; j < parallel; j++) { - SStreamTaskMeta task = { - .taskId = tGenIdPI32(), - .level = i, - .plan = plan, - }; - taosArrayPush(taskOneLevel, &task); + for (int32_t i = 0; i < parallel; i++) { + SStreamTask* pTask = streamTaskNew(pStream->uid, level); + + // TODO:get snode id and ep + plan->execNode.nodeId = pVgroup->vgId; + plan->execNode.epSet = mndGetVgroupEpset(pMnode, pVgroup); + + if (qSubPlanToString(plan, &pTask->qmsg, &msgLen) < 0) { + qDestroyQueryPlan(pPlan); + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } + + taosArrayPush(taskOneLevel, pTask); } } else { // not duplicatable - SStreamTaskMeta task = { - .taskId = tGenIdPI32(), - .level = i, - .plan = plan, - }; - taosArrayPush(taskOneLevel, &task); + SStreamTask* pTask = streamTaskNew(pStream->uid, level); + + // TODO:get snode id and ep + plan->execNode.nodeId = pVgroup->vgId; + plan->execNode.epSet = mndGetVgroupEpset(pMnode, pVgroup); + + if (qSubPlanToString(plan, &pTask->qmsg, &msgLen) < 0) { + sdbRelease(pSdb, pVgroup); + qDestroyQueryPlan(pPlan); + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } + taosArrayPush(taskOneLevel, pTask); } taosArrayPush(pStream->tasks, taskOneLevel); } diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 54ad9cd7e239b20a84eaa6f7c791b1942413598f..67011dfe8a3979e315eb234a0223ee245dcb9ea0 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -18,6 +18,7 @@ #include "mndDb.h" #include "mndDnode.h" #include "mndMnode.h" +#include "mndScheduler.h" #include "mndShow.h" #include "mndStb.h" #include "mndTrans.h" @@ -237,6 +238,12 @@ static int32_t mndCreateStream(SMnode *pMnode, SMnodeMsg *pReq, SCMCreateStreamR } sdbSetRawStatus(pRedoRaw, SDB_STATUS_READY); + if (mndScheduleStream(pMnode, pTrans, &streamObj) < 0) { + mError("stream:%ld, schedule stream since %s", streamObj.uid, terrstr()); + mndTransDrop(pTrans); + return -1; + } + if (mndTransPrepare(pMnode, pTrans) != 0) { mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); mndTransDrop(pTrans); diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index 7d7c5f9975f3498f34ffb54640dcbb59a0bfd891..e913cae1ace56445bb44c46a77f711b21000507d 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -236,6 +236,29 @@ static int32_t mndCheckCreateTopicReq(SCMCreateTopicReq *pCreate) { return 0; } +static int32_t mndGetPlanString(SCMCreateTopicReq *pCreate, char **pStr) { + if (NULL == pCreate->ast) { + return TSDB_CODE_SUCCESS; + } + + SNode* pAst = NULL; + int32_t code = nodesStringToNode(pCreate->ast, &pAst); + + SQueryPlan* pPlan = NULL; + if (TSDB_CODE_SUCCESS == code) { + SPlanContext cxt = { .pAstRoot = pAst, .streamQuery = true }; + code = qCreateQueryPlan(&cxt, &pPlan, NULL); + } + + if (TSDB_CODE_SUCCESS == code) { + code = nodesNodeToString(pPlan, false, pStr, NULL); + } + nodesDestroyNode(pAst); + nodesDestroyNode(pPlan); + terrno = code; + return code; +} + static int32_t mndCreateTopic(SMnode *pMnode, SMnodeMsg *pReq, SCMCreateTopicReq *pCreate, SDbObj *pDb) { mDebug("topic:%s to create", pCreate->name); SMqTopicObj topicObj = {0}; @@ -247,13 +270,23 @@ static int32_t mndCreateTopic(SMnode *pMnode, SMnodeMsg *pReq, SCMCreateTopicReq topicObj.dbUid = pDb->uid; topicObj.version = 1; topicObj.sql = pCreate->sql; - topicObj.physicalPlan = pCreate->physicalPlan; - topicObj.logicalPlan = pCreate->logicalPlan; + topicObj.physicalPlan = ""; + topicObj.logicalPlan = ""; topicObj.sqlLen = strlen(pCreate->sql); + char* pPlanStr = NULL; + if (TSDB_CODE_SUCCESS != mndGetPlanString(pCreate, &pPlanStr)) { + mError("topic:%s, failed to get plan since %s", pCreate->name, terrstr()); + return -1; + } + if (NULL != pPlanStr) { + topicObj.physicalPlan = pPlanStr; + } + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_TYPE_CREATE_TOPIC, &pReq->rpcMsg); if (pTrans == NULL) { mError("topic:%s, failed to create since %s", pCreate->name, terrstr()); + tfree(pPlanStr); return -1; } mDebug("trans:%d, used to create topic:%s", pTrans->id, pCreate->name); @@ -261,6 +294,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SMnodeMsg *pReq, SCMCreateTopicReq SSdbRaw *pRedoRaw = mndTopicActionEncode(&topicObj); if (pRedoRaw == NULL || mndTransAppendRedolog(pTrans, pRedoRaw) != 0) { mError("trans:%d, failed to append redo log since %s", pTrans->id, terrstr()); + tfree(pPlanStr); mndTransDrop(pTrans); return -1; } @@ -268,10 +302,12 @@ static int32_t mndCreateTopic(SMnode *pMnode, SMnodeMsg *pReq, SCMCreateTopicReq if (mndTransPrepare(pMnode, pTrans) != 0) { mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); + tfree(pPlanStr); mndTransDrop(pTrans); return -1; } + tfree(pPlanStr); mndTransDrop(pTrans); return 0; } diff --git a/source/dnode/mnode/impl/test/topic/topic.cpp b/source/dnode/mnode/impl/test/topic/topic.cpp index f58d0a67717bddc9a47cde4c3e3245a6ba70a096..73eefd875d28b48fb6e62601bba3dfaa857e8c79 100644 --- a/source/dnode/mnode/impl/test/topic/topic.cpp +++ b/source/dnode/mnode/impl/test/topic/topic.cpp @@ -65,8 +65,7 @@ void* MndTestTopic::BuildCreateTopicReq(const char* topicName, const char* sql, strcpy(createReq.name, topicName); createReq.igExists = 0; createReq.sql = (char*)sql; - createReq.physicalPlan = (char*)"physicalPlan"; - createReq.logicalPlan = (char*)"logicalPlan"; + createReq.ast = NULL; int32_t contLen = tSerializeSCMCreateTopicReq(NULL, 0, &createReq); void* pReq = rpcMallocCont(contLen); diff --git a/source/dnode/snode/CMakeLists.txt b/source/dnode/snode/CMakeLists.txt index dafd5d659416b04f027e85aa33122c6371e6d153..d1b1abdf1d523aca7fd0ccb56180b7535fde40fd 100644 --- a/source/dnode/snode/CMakeLists.txt +++ b/source/dnode/snode/CMakeLists.txt @@ -7,8 +7,9 @@ target_include_directories( ) target_link_libraries( snode + PRIVATE executor PRIVATE transport PRIVATE os PRIVATE common PRIVATE util -) \ No newline at end of file +) diff --git a/source/dnode/snode/inc/sndInt.h b/source/dnode/snode/inc/sndInt.h index 3fe816845ddb3272b0f99c1e2d5fb5fcce9a03cd..e5f6c3c266109d314fd7f171d94261da0449e002 100644 --- a/source/dnode/snode/inc/sndInt.h +++ b/source/dnode/snode/inc/sndInt.h @@ -38,13 +38,8 @@ enum { STREAM_STATUS__DELETING, }; -enum { - STREAM_TASK_STATUS__RUNNING = 1, - STREAM_TASK_STATUS__STOP, -}; - typedef struct { - SHashObj* pHash; // taskId -> streamTask + SHashObj* pHash; // taskId -> SStreamTask } SStreamMeta; typedef struct SSnode { @@ -52,26 +47,16 @@ typedef struct SSnode { SSnodeOpt cfg; } SSnode; -typedef struct { - int64_t streamId; - int32_t taskId; - int32_t IdxInLevel; - int32_t level; -} SStreamTaskInfo; +SStreamMeta* sndMetaNew(); +void sndMetaDelete(SStreamMeta* pMeta); -typedef struct { - SStreamTaskInfo meta; - int8_t status; - void* executor; - void* stateStore; - // storage handle -} SStreamTask; +int32_t sndMetaDeployTask(SStreamMeta* pMeta, SStreamTask* pTask); +int32_t sndMetaRemoveTask(SStreamMeta* pMeta, int32_t taskId); -int32_t sndCreateTask(); -int32_t sndDropTaskOfStream(int64_t streamId); +int32_t sndDropTaskOfStream(SStreamMeta* pMeta, int64_t streamId); -int32_t sndStopTaskOfStream(int64_t streamId); -int32_t sndResumeTaskOfStream(int64_t streamId); +int32_t sndStopTaskOfStream(SStreamMeta* pMeta, int64_t streamId); +int32_t sndResumeTaskOfStream(SStreamMeta* pMeta, int64_t streamId); #ifdef __cplusplus } diff --git a/source/dnode/snode/src/snode.c b/source/dnode/snode/src/snode.c index 74e41d45c527f3a1de2cfbc353e25159dc82cfc6..80e33bd9719c950f6c8ce8d158f8aae03bcec2c6 100644 --- a/source/dnode/snode/src/snode.c +++ b/source/dnode/snode/src/snode.c @@ -13,40 +13,91 @@ * along with this program. If not, see . */ +#include "executor.h" #include "sndInt.h" #include "tuuid.h" SSnode *sndOpen(const char *path, const SSnodeOpt *pOption) { SSnode *pSnode = calloc(1, sizeof(SSnode)); + if (pSnode == NULL) { + return NULL; + } memcpy(&pSnode->cfg, pOption, sizeof(SSnodeOpt)); + pSnode->pMeta = sndMetaNew(); + if (pSnode->pMeta == NULL) { + free(pSnode); + return NULL; + } return pSnode; } -void sndClose(SSnode *pSnode) { free(pSnode); } +void sndClose(SSnode *pSnode) { + sndMetaDelete(pSnode->pMeta); + free(pSnode); +} int32_t sndGetLoad(SSnode *pSnode, SSnodeLoad *pLoad) { return 0; } -int32_t sndProcessMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { - *pRsp = NULL; - return 0; -} +/*int32_t sndProcessMsg(SSnode *pSnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {*/ +/**pRsp = NULL;*/ +/*return 0;*/ +/*}*/ void sndDestroy(const char *path) {} -static int32_t sndDeployTask(SSnode *pSnode, SRpcMsg *pMsg) { - SStreamTask *task = malloc(sizeof(SStreamTask)); - if (task == NULL) { +SStreamMeta *sndMetaNew() { + SStreamMeta *pMeta = calloc(1, sizeof(SStreamMeta)); + if (pMeta == NULL) { + return NULL; + } + pMeta->pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK); + if (pMeta->pHash == NULL) { + free(pMeta); + return NULL; + } + return pMeta; +} + +void sndMetaDelete(SStreamMeta *pMeta) { + taosHashCleanup(pMeta->pHash); + free(pMeta); +} + +int32_t sndMetaDeployTask(SStreamMeta *pMeta, SStreamTask *pTask) { + pTask->executor = qCreateStreamExecTaskInfo(pTask->qmsg, NULL); + return taosHashPut(pMeta->pHash, &pTask->taskId, sizeof(int32_t), pTask, sizeof(void *)); +} + +int32_t sndMetaRemoveTask(SStreamMeta *pMeta, int32_t taskId) { + SStreamTask *pTask = taosHashGet(pMeta->pHash, &taskId, sizeof(int32_t)); + if (pTask == NULL) { return -1; } - task->meta.taskId = tGenIdPI32(); - taosHashPut(pSnode->pMeta->pHash, &task->meta.taskId, sizeof(int32_t), &task, sizeof(void *)); - return 0; + free(pTask->qmsg); + // TODO:free executor + free(pTask); + return taosHashRemove(pMeta->pHash, &taskId, sizeof(int32_t)); } int32_t sndProcessUMsg(SSnode *pSnode, SRpcMsg *pMsg) { - // stream deployment + // stream deploy // stream stop/resume // operator exec + if (pMsg->msgType == TDMT_SND_TASK_DEPLOY) { + void *msg = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)); + SStreamTask *pTask = malloc(sizeof(SStreamTask)); + if (pTask == NULL) { + return -1; + } + SCoder decoder; + tCoderInit(&decoder, TD_LITTLE_ENDIAN, msg, pMsg->contLen - sizeof(SMsgHead), TD_DECODER); + tDecodeSStreamTask(&decoder, pTask); + tCoderClear(&decoder); + + sndMetaDeployTask(pSnode->pMeta, pTask); + } else { + // + } return 0; } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 457f863a5e7d80e1e27b7f45d980a9200746998d..a2fd32d23899e56ae2992fa1263a11023e404af5 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -1730,7 +1730,7 @@ 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) { + if (NULL == pNode || NULL == pStr) { terrno = TSDB_CODE_FAILED; return TSDB_CODE_FAILED; } @@ -1750,7 +1750,10 @@ int32_t nodesNodeToString(const SNodeptr pNode, bool format, char** pStr, int32_ *pStr = format ? tjsonToString(pJson) : tjsonToUnformattedString(pJson); tjsonDelete(pJson); - *pLen = strlen(*pStr) + 1; + if (NULL != pLen) { + *pLen = strlen(*pStr) + 1; + } + return TSDB_CODE_SUCCESS; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index b17a4904dae349dec5c085a497163245547a5476..75568019cb3c5991b3aadc11f9bf2fb68e74e230 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -92,6 +92,8 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SCreateDatabaseStmt)); case QUERY_NODE_DROP_DATABASE_STMT: return makeNode(type, sizeof(SDropDatabaseStmt)); + case QUERY_NODE_ALTER_DATABASE_STMT: + return makeNode(type, sizeof(SAlterDatabaseStmt)); case QUERY_NODE_SHOW_DATABASES_STMT: return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_CREATE_TABLE_STMT: @@ -131,8 +133,16 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_CREATE_INDEX_STMT: return makeNode(type, sizeof(SCreateIndexStmt)); + case QUERY_NODE_DROP_INDEX_STMT: + return makeNode(type, sizeof(SDropIndexStmt)); case QUERY_NODE_CREATE_QNODE_STMT: return makeNode(type, sizeof(SCreateQnodeStmt)); + case QUERY_NODE_DROP_QNODE_STMT: + return makeNode(type, sizeof(SDropQnodeStmt)); + case QUERY_NODE_CREATE_TOPIC_STMT: + return makeNode(type, sizeof(SCreateTopicStmt)); + case QUERY_NODE_DROP_TOPIC_STMT: + return makeNode(type, sizeof(SDropTopicStmt)); case QUERY_NODE_LOGIC_PLAN_SCAN: return makeNode(type, sizeof(SScanLogicNode)); case QUERY_NODE_LOGIC_PLAN_JOIN: diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index f2fcced1a9edf51440e830e71c2f081ac337f2b5..31d7331d0eff7a631de28849907bf3b886855ebc 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -113,6 +113,7 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt); SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, const SToken* pVal); SNode* createCreateDatabaseStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pDbName, SNode* pOptions); SNode* createDropDatabaseStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pDbName); +SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName, SNode* pOptions); SNode* createDefaultTableOptions(SAstCreateContext* pCxt); SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, const SToken* pVal); SNode* setTableSmaOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pSma); @@ -134,7 +135,11 @@ SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode); SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, const SToken* pIndexName, const SToken* pTableName, SNodeList* pCols, SNode* pOptions); SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding); +SNode* createDropIndexStmt(SAstCreateContext* pCxt, const SToken* pIndexName, const SToken* pTableName); SNode* createCreateQnodeStmt(SAstCreateContext* pCxt, const SToken* pDnodeId); +SNode* createDropQnodeStmt(SAstCreateContext* pCxt, const SToken* pDnodeId); +SNode* createCreateTopicStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName, SNode* pQuery, const SToken* pSubscribeDbName); +SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pTopicName); #ifdef __cplusplus } diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index af2fb12c52f6a4b68d638290f5bcc9a1431fb0a2..31c26e1e40862dd5975194b050f74adb0af83f9b 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -42,17 +42,17 @@ //%right NK_BITNOT. /************************************************ create/alter/drop/show user *****************************************/ -cmd ::= CREATE USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &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 ::= CREATE USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &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, 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 ::= 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, NULL); } %type dnode_endpoint { SToken } @@ -64,15 +64,17 @@ dnode_endpoint(A) ::= NK_STRING(B). dnode_host_name(A) ::= NK_ID(B). { A = B; } dnode_host_name(A) ::= NK_IPTOKEN(B). { A = B; } -/************************************************ create qnode ********************************************************/ +/************************************************ create/drop qnode ***************************************************/ cmd ::= CREATE QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createCreateQnodeStmt(pCxt, &A); } +cmd ::= DROP QNODE ON DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropQnodeStmt(pCxt, &A); } cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL); } /************************************************ 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 ::= 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, NULL); } -cmd ::= USE db_name(A). { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &A);} +cmd ::= USE db_name(A). { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &A); } +cmd ::= ALTER DATABASE db_name(A) db_options(B). { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &A, B); } %type not_exists_opt { bool } %destructor not_exists_opt { } @@ -198,6 +200,7 @@ col_name(A) ::= column_name(B). cmd ::= CREATE SMA INDEX index_name(A) ON table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &A, &B, NULL, C); } cmd ::= CREATE FULLTEXT INDEX index_name(A) ON table_name(B) NK_LP col_name_list(C) NK_RP. { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &A, &B, C, NULL); } +cmd ::= DROP INDEX index_name(A) ON table_name(B). { pCxt->pRootNode = createDropIndexStmt(pCxt, &A, &B); } index_options(A) ::= . { A = NULL; } index_options(A) ::= FUNCTION NK_LP func_list(B) NK_RP INTERVAL @@ -212,6 +215,11 @@ func_list(A) ::= func_list(B) NK_COMMA func(C). func(A) ::= function_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); } +/************************************************ create/drop topic ***************************************************/ +cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B) AS query_expression(C). { pCxt->pRootNode = createCreateTopicStmt(pCxt, A, &B, C, NULL); } +cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B) AS db_name(C). { pCxt->pRootNode = createCreateTopicStmt(pCxt, A, &B, NULL, &C); } +cmd ::= DROP TOPIC exists_opt(A) topic_name(B). { pCxt->pRootNode = createDropTopicStmt(pCxt, A, &B); } + /************************************************ 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); } @@ -270,6 +278,10 @@ user_name(A) ::= NK_ID(B). %destructor index_name { } index_name(A) ::= NK_ID(B). { A = B; } +%type topic_name { SToken } +%destructor topic_name { } +topic_name(A) ::= NK_ID(B). { A = B; } + /************************************************ expression **********************************************************/ expression(A) ::= literal(B). { A = B; } //expression(A) ::= NK_QUESTION(B). { A = B; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index b7ecf160fd34124e3ab5dcaad2569176c5adf99c..034346362c794f2dff94c96a69f671533410a0f7 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -799,6 +799,17 @@ SNode* createDropDatabaseStmt(SAstCreateContext* pCxt, bool ignoreNotExists, con return (SNode*)pStmt; } +SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName, SNode* pOptions) { + if (!checkDbName(pCxt, pDbName)) { + return NULL; + } + SAlterDatabaseStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_DATABASE_STMT); + CHECK_OUT_OF_MEM(pStmt); + strncpy(pStmt->dbName, pDbName->z, pDbName->n); + pStmt->pOptions = (SDatabaseOptions*)pOptions; + return (SNode*)pStmt; +} + SNode* createDefaultTableOptions(SAstCreateContext* pCxt) { STableOptions* pOptions = nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); @@ -1022,9 +1033,47 @@ SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInt return (SNode*)pOptions; } +SNode* createDropIndexStmt(SAstCreateContext* pCxt, const SToken* pIndexName, const SToken* pTableName) { + if (!checkIndexName(pCxt, pIndexName) || !checkTableName(pCxt, pTableName)) { + return NULL; + } + SDropIndexStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_INDEX_STMT); + CHECK_OUT_OF_MEM(pStmt); + strncpy(pStmt->indexName, pIndexName->z, pIndexName->n); + strncpy(pStmt->tableName, pTableName->z, pTableName->n); + return (SNode*)pStmt; +} + SNode* createCreateQnodeStmt(SAstCreateContext* pCxt, const SToken* pDnodeId) { SCreateQnodeStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_QNODE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->dnodeId = strtol(pDnodeId->z, NULL, 10);; return (SNode*)pStmt; } + +SNode* createDropQnodeStmt(SAstCreateContext* pCxt, const SToken* pDnodeId) { + SDropQnodeStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_QNODE_STMT); + CHECK_OUT_OF_MEM(pStmt); + pStmt->dnodeId = strtol(pDnodeId->z, NULL, 10);; + return (SNode*)pStmt; +} + +SNode* createCreateTopicStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName, SNode* pQuery, const SToken* pSubscribeDbName) { + SCreateTopicStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT); + CHECK_OUT_OF_MEM(pStmt); + strncpy(pStmt->topicName, pTopicName->z, pTopicName->n); + pStmt->ignoreExists = ignoreExists; + pStmt->pQuery = pQuery; + if (NULL != pSubscribeDbName) { + strncpy(pStmt->subscribeDbName, pSubscribeDbName->z, pSubscribeDbName->n); + } + return (SNode*)pStmt; +} + +SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pTopicName) { + SDropTopicStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_TOPIC_STMT); + CHECK_OUT_OF_MEM(pStmt); + strncpy(pStmt->topicName, pTopicName->z, pTopicName->n); + pStmt->ignoreNotExists = ignoreNotExists; + return (SNode*)pStmt; +} diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 4d50d92d9e40c3d8bb6c8afe1f686709c9d4ef54..2d58d4e1e3821ea624a1abd1d7db3258112d618d 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -121,6 +121,7 @@ static SKeyword keywordTable[] = { {"TAGS", TK_TAGS}, {"TIMESTAMP", TK_TIMESTAMP}, {"TINYINT", TK_TINYINT}, + {"TOPIC", TK_TOPIC}, {"TTL", TK_TTL}, {"UNION", TK_UNION}, {"UNSIGNED", TK_UNSIGNED}, @@ -230,7 +231,6 @@ static SKeyword keywordTable[] = { // {"TBNAME", TK_TBNAME}, // {"VNODES", TK_VNODES}, // {"PARTITIONS", TK_PARTITIONS}, - // {"TOPIC", TK_TOPIC}, // {"TOPICS", TK_TOPICS}, // {"COMPACT", TK_COMPACT}, // {"MODIFY", TK_MODIFY}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 4f89e7e703eb2f34841d7a5150b713df1b4798d8..af7a38b702c275d18287f8496860ae81c6665300 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -21,14 +21,6 @@ #include "parUtil.h" #include "ttime.h" -static bool afterGroupBy(ESqlClause clause) { - return clause > SQL_CLAUSE_GROUP_BY; -} - -static bool beforeHaving(ESqlClause clause) { - return clause < SQL_CLAUSE_HAVING; -} - typedef struct STranslateContext { SParseContext* pParseCxt; int32_t errCode; @@ -41,6 +33,15 @@ typedef struct STranslateContext { } STranslateContext; static int32_t translateSubquery(STranslateContext* pCxt, SNode* pNode); +static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode); + +static bool afterGroupBy(ESqlClause clause) { + return clause > SQL_CLAUSE_GROUP_BY; +} + +static bool beforeHaving(ESqlClause clause) { + return clause < SQL_CLAUSE_HAVING; +} static EDealRes generateDealNodeErrMsg(STranslateContext* pCxt, int32_t errCode, ...) { va_list vArgList; @@ -833,6 +834,41 @@ static int32_t translateDropDatabase(STranslateContext* pCxt, SDropDatabaseStmt* return TSDB_CODE_SUCCESS; } +static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt, SAlterDbReq* pReq) { + SName name = {0}; + tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName)); + tNameGetFullDbName(&name, pReq->db); + pReq->totalBlocks = pStmt->pOptions->numOfBlocks; + pReq->daysToKeep0 = pStmt->pOptions->keep; + pReq->daysToKeep1 = -1; + pReq->daysToKeep2 = -1; + pReq->fsyncPeriod = pStmt->pOptions->fsyncPeriod; + pReq->walLevel = pStmt->pOptions->walLevel; + pReq->quorum = pStmt->pOptions->quorum; + pReq->cacheLastRow = pStmt->pOptions->cachelast; + return; +} + +static int32_t translateAlterDatabase(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt) { + SAlterDbReq alterReq = {0}; + buildAlterDbReq(pCxt, pStmt, &alterReq); + + 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_ALTER_DB; + pCxt->pCmdMsg->msgLen = tSerializeSAlterDbReq(NULL, 0, &alterReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSAlterDbReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &alterReq); + + return TSDB_CODE_SUCCESS; +} + static int32_t columnNodeToField(SNodeList* pList, SArray** pArray) { *pArray = taosArrayInit(LIST_LENGTH(pList), sizeof(SField)); SNode* pNode; @@ -1201,6 +1237,27 @@ static int32_t translateCreateIndex(STranslateContext* pCxt, SCreateIndexStmt* p } } +static int32_t translateDropIndex(STranslateContext* pCxt, SDropIndexStmt* pStmt) { + SVDropTSmaReq dropSmaReq = {0}; + strcpy(dropSmaReq.indexName, pStmt->indexName); + + 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_VND_DROP_SMA; + pCxt->pCmdMsg->msgLen = tSerializeSVDropTSmaReq(NULL, &dropSmaReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + void* pBuf = pCxt->pCmdMsg->pMsg; + tSerializeSVDropTSmaReq(&pBuf, &dropSmaReq); + + return TSDB_CODE_SUCCESS; +} + static int32_t translateCreateQnode(STranslateContext* pCxt, SCreateQnodeStmt* pStmt) { SMCreateQnodeReq createReq = { .dnodeId = pStmt->dnodeId }; @@ -1220,6 +1277,93 @@ static int32_t translateCreateQnode(STranslateContext* pCxt, SCreateQnodeStmt* p return TSDB_CODE_SUCCESS; } +static int32_t translateDropQnode(STranslateContext* pCxt, SDropQnodeStmt* pStmt) { + SDDropQnodeReq dropReq = { .dnodeId = pStmt->dnodeId }; + + 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_DND_DROP_QNODE; + pCxt->pCmdMsg->msgLen = tSerializeSMCreateDropQSBNodeReq(NULL, 0, &dropReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSMCreateDropQSBNodeReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &dropReq); + + return TSDB_CODE_SUCCESS; +} + +static int32_t translateCreateTopic(STranslateContext* pCxt, SCreateTopicStmt* pStmt) { + SCMCreateTopicReq createReq = {0}; + + if (NULL != pStmt->pQuery) { + int32_t code = translateQuery(pCxt, pStmt->pQuery); + if (TSDB_CODE_SUCCESS == code) { + code = nodesNodeToString(pStmt->pQuery, false, &createReq.ast, NULL); + } + if (TSDB_CODE_SUCCESS != code ) { + return code; + } + } else { + strcpy(createReq.subscribeDbName, pStmt->subscribeDbName); + } + + createReq.sql = strdup(pCxt->pParseCxt->pSql); + if (NULL == createReq.sql) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SName name = { .type = TSDB_TABLE_NAME_T, .acctId = pCxt->pParseCxt->acctId }; + strcpy(name.dbname, pCxt->pParseCxt->db); + strcpy(name.tname, pStmt->topicName); + tNameExtractFullName(&name, createReq.name); + createReq.igExists = pStmt->ignoreExists; + + 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_CREATE_TOPIC; + pCxt->pCmdMsg->msgLen = tSerializeSCMCreateTopicReq(NULL, 0, &createReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSCMCreateTopicReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &createReq); + tFreeSCMCreateTopicReq(&createReq); + + return TSDB_CODE_SUCCESS; +} + +static int32_t translateDropTopic(STranslateContext* pCxt, SDropTopicStmt* pStmt) { + SMDropTopicReq dropReq = {0}; + + SName name = { .type = TSDB_TABLE_NAME_T, .acctId = pCxt->pParseCxt->acctId }; + strcpy(name.dbname, pCxt->pParseCxt->db); + strcpy(name.tname, pStmt->topicName); + tNameExtractFullName(&name, dropReq.name); + dropReq.igNotExists = pStmt->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_TOPIC; + pCxt->pCmdMsg->msgLen = tSerializeSMDropTopicReq(NULL, 0, &dropReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSMDropTopicReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &dropReq); + + return TSDB_CODE_SUCCESS; +} + static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pNode)) { @@ -1232,6 +1376,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_DROP_DATABASE_STMT: code = translateDropDatabase(pCxt, (SDropDatabaseStmt*)pNode); break; + case QUERY_NODE_ALTER_DATABASE_STMT: + code = translateAlterDatabase(pCxt, (SAlterDatabaseStmt*)pNode); + break; case QUERY_NODE_CREATE_TABLE_STMT: code = translateCreateSuperTable(pCxt, (SCreateTableStmt*)pNode); break; @@ -1274,9 +1421,21 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_CREATE_INDEX_STMT: code = translateCreateIndex(pCxt, (SCreateIndexStmt*)pNode); break; + case QUERY_NODE_DROP_INDEX_STMT: + code = translateDropIndex(pCxt, (SDropIndexStmt*)pNode); + break; case QUERY_NODE_CREATE_QNODE_STMT: code = translateCreateQnode(pCxt, (SCreateQnodeStmt*)pNode); break; + case QUERY_NODE_DROP_QNODE_STMT: + code = translateDropQnode(pCxt, (SDropQnodeStmt*)pNode); + break; + case QUERY_NODE_CREATE_TOPIC_STMT: + code = translateCreateTopic(pCxt, (SCreateTopicStmt*)pNode); + break; + case QUERY_NODE_DROP_TOPIC_STMT: + code = translateDropTopic(pCxt, (SDropTopicStmt*)pNode); + break; default: break; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 8b46d3600bc21ceb494b3b06893a1b74b7a37e4c..18b507c1b00705dd2f5a120c4b924a54ce313c92 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -99,22 +99,22 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char -#define YYNOCODE 218 +#define YYNOCODE 220 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SToken yy5; - bool yy25; - SNodeList* yy40; - ENullOrder yy53; - EOrder yy54; - SNode* yy68; - EJoinType yy92; - EFillMode yy94; - SDataType yy372; - EOperatorType yy416; + SNodeList* yy24; + bool yy97; + SToken yy129; + SDataType yy224; + ENullOrder yy257; + EOperatorType yy260; + EFillMode yy294; + EJoinType yy332; + EOrder yy378; + SNode* yy432; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -129,17 +129,17 @@ typedef union { #define ParseCTX_PARAM #define ParseCTX_FETCH #define ParseCTX_STORE -#define YYNSTATE 313 -#define YYNRULE 248 -#define YYNTOKEN 140 -#define YY_MAX_SHIFT 312 -#define YY_MIN_SHIFTREDUCE 480 -#define YY_MAX_SHIFTREDUCE 727 -#define YY_ERROR_ACTION 728 -#define YY_ACCEPT_ACTION 729 -#define YY_NO_ACTION 730 -#define YY_MIN_REDUCE 731 -#define YY_MAX_REDUCE 978 +#define YYNSTATE 333 +#define YYNRULE 255 +#define YYNTOKEN 141 +#define YY_MAX_SHIFT 332 +#define YY_MIN_SHIFTREDUCE 501 +#define YY_MAX_SHIFTREDUCE 755 +#define YY_ERROR_ACTION 756 +#define YY_ACCEPT_ACTION 757 +#define YY_NO_ACTION 758 +#define YY_MIN_REDUCE 759 +#define YY_MAX_REDUCE 1013 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -206,307 +206,322 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (963) +#define YY_ACTTAB_COUNT (1012) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 152, 236, 277, 871, 844, 252, 252, 167, 186, 784, - /* 10 */ 847, 844, 31, 29, 27, 26, 25, 846, 844, 209, - /* 20 */ 787, 787, 309, 308, 846, 31, 29, 27, 26, 25, - /* 30 */ 746, 236, 151, 871, 106, 826, 39, 824, 251, 844, - /* 40 */ 145, 957, 238, 61, 236, 856, 871, 782, 57, 857, - /* 50 */ 860, 896, 910, 145, 956, 154, 892, 969, 955, 187, - /* 60 */ 164, 610, 213, 832, 239, 166, 930, 10, 826, 907, - /* 70 */ 824, 251, 301, 300, 299, 298, 297, 296, 295, 294, - /* 80 */ 293, 292, 291, 290, 289, 288, 287, 286, 285, 599, - /* 90 */ 31, 29, 27, 26, 25, 24, 109, 23, 159, 228, - /* 100 */ 628, 629, 630, 631, 632, 633, 634, 636, 637, 638, - /* 110 */ 23, 159, 39, 628, 629, 630, 631, 632, 633, 634, - /* 120 */ 636, 637, 638, 783, 542, 275, 274, 273, 546, 272, - /* 130 */ 548, 549, 271, 551, 268, 165, 557, 265, 559, 560, - /* 140 */ 262, 259, 236, 54, 871, 694, 251, 789, 70, 252, - /* 150 */ 844, 65, 249, 238, 779, 224, 856, 208, 214, 56, - /* 160 */ 857, 860, 896, 229, 787, 601, 144, 892, 775, 205, - /* 170 */ 692, 693, 695, 696, 220, 10, 910, 82, 957, 31, - /* 180 */ 29, 27, 26, 25, 215, 210, 223, 170, 871, 64, - /* 190 */ 826, 81, 824, 906, 844, 955, 600, 238, 773, 826, - /* 200 */ 856, 825, 224, 57, 857, 860, 896, 187, 62, 910, - /* 210 */ 154, 892, 76, 723, 724, 27, 26, 25, 102, 903, - /* 220 */ 219, 220, 218, 284, 105, 957, 905, 729, 610, 82, - /* 230 */ 201, 923, 87, 223, 21, 871, 64, 284, 81, 227, - /* 240 */ 75, 844, 955, 635, 238, 104, 639, 856, 490, 86, - /* 250 */ 57, 857, 860, 896, 197, 62, 190, 154, 892, 76, - /* 260 */ 173, 68, 236, 278, 871, 78, 903, 904, 127, 908, - /* 270 */ 844, 817, 40, 238, 252, 84, 856, 250, 924, 57, - /* 280 */ 857, 860, 896, 957, 9, 8, 154, 892, 969, 787, - /* 290 */ 236, 48, 871, 178, 30, 28, 81, 953, 844, 206, - /* 300 */ 955, 238, 780, 590, 856, 833, 239, 57, 857, 860, - /* 310 */ 896, 588, 6, 161, 154, 892, 969, 30, 28, 670, - /* 320 */ 169, 99, 12, 790, 70, 914, 590, 31, 29, 27, - /* 330 */ 26, 25, 789, 70, 588, 774, 161, 189, 490, 236, - /* 340 */ 602, 871, 1, 677, 646, 12, 53, 844, 491, 492, - /* 350 */ 238, 50, 224, 856, 30, 28, 133, 857, 860, 252, - /* 360 */ 599, 253, 122, 590, 252, 1, 226, 172, 915, 665, - /* 370 */ 235, 588, 590, 161, 787, 957, 589, 591, 594, 787, - /* 380 */ 588, 171, 12, 926, 253, 281, 30, 28, 81, 280, - /* 390 */ 669, 665, 955, 789, 70, 590, 82, 9, 8, 589, - /* 400 */ 591, 594, 1, 588, 282, 161, 691, 96, 236, 195, - /* 410 */ 871, 130, 193, 59, 94, 196, 844, 134, 71, 238, - /* 420 */ 91, 253, 856, 279, 221, 58, 857, 860, 896, 625, - /* 430 */ 253, 83, 895, 892, 7, 872, 589, 591, 594, 108, - /* 440 */ 236, 2, 871, 597, 174, 589, 591, 594, 844, 772, - /* 450 */ 231, 238, 188, 253, 856, 38, 640, 58, 857, 860, - /* 460 */ 896, 726, 727, 32, 234, 892, 30, 28, 589, 591, - /* 470 */ 594, 85, 30, 28, 237, 590, 236, 603, 871, 607, - /* 480 */ 191, 590, 150, 588, 844, 161, 32, 238, 82, 588, - /* 490 */ 856, 161, 198, 72, 857, 860, 30, 28, 20, 281, - /* 500 */ 598, 668, 604, 280, 602, 590, 207, 82, 31, 29, - /* 510 */ 27, 26, 25, 588, 7, 161, 232, 199, 282, 927, - /* 520 */ 7, 851, 242, 92, 236, 937, 871, 583, 849, 594, - /* 530 */ 225, 970, 844, 253, 32, 238, 160, 279, 856, 253, - /* 540 */ 114, 138, 857, 860, 1, 204, 936, 112, 589, 591, - /* 550 */ 594, 244, 95, 119, 589, 591, 594, 236, 66, 871, - /* 560 */ 67, 5, 153, 253, 917, 844, 217, 98, 238, 203, - /* 570 */ 74, 856, 4, 63, 58, 857, 860, 896, 589, 591, - /* 580 */ 594, 665, 893, 236, 220, 871, 535, 100, 601, 530, - /* 590 */ 911, 844, 33, 68, 238, 202, 59, 856, 101, 64, - /* 600 */ 138, 857, 860, 236, 155, 871, 563, 972, 233, 567, - /* 610 */ 954, 844, 572, 257, 238, 107, 67, 856, 62, 68, - /* 620 */ 137, 857, 860, 17, 230, 236, 831, 871, 79, 903, - /* 630 */ 904, 878, 908, 844, 245, 47, 238, 49, 240, 856, - /* 640 */ 241, 69, 72, 857, 860, 236, 830, 871, 67, 163, - /* 650 */ 126, 216, 246, 844, 116, 788, 238, 158, 236, 856, - /* 660 */ 871, 255, 138, 857, 860, 247, 844, 128, 123, 238, - /* 670 */ 162, 312, 856, 125, 185, 138, 857, 860, 184, 597, - /* 680 */ 971, 60, 129, 183, 22, 182, 142, 305, 143, 838, - /* 690 */ 124, 236, 749, 871, 31, 29, 27, 26, 25, 844, - /* 700 */ 176, 177, 238, 837, 179, 856, 836, 835, 136, 857, - /* 710 */ 860, 181, 180, 55, 778, 236, 120, 871, 777, 748, - /* 720 */ 745, 740, 735, 844, 776, 501, 238, 747, 739, 856, - /* 730 */ 738, 734, 139, 857, 860, 236, 733, 871, 192, 732, - /* 740 */ 828, 175, 248, 844, 200, 41, 238, 194, 88, 856, - /* 750 */ 89, 90, 131, 857, 860, 236, 3, 871, 32, 14, - /* 760 */ 93, 36, 690, 844, 73, 97, 238, 211, 42, 856, - /* 770 */ 212, 684, 140, 857, 860, 236, 683, 871, 849, 15, - /* 780 */ 19, 34, 11, 844, 662, 43, 238, 44, 236, 856, - /* 790 */ 871, 712, 132, 857, 860, 661, 844, 711, 156, 238, - /* 800 */ 35, 716, 856, 717, 103, 141, 857, 860, 80, 715, - /* 810 */ 157, 16, 236, 8, 871, 110, 608, 13, 18, 113, - /* 820 */ 844, 111, 688, 238, 115, 236, 856, 871, 827, 868, - /* 830 */ 857, 860, 117, 844, 626, 45, 238, 243, 236, 856, - /* 840 */ 871, 118, 867, 857, 860, 46, 844, 50, 592, 238, - /* 850 */ 37, 848, 856, 121, 220, 866, 857, 860, 254, 256, - /* 860 */ 236, 564, 871, 168, 258, 260, 561, 261, 844, 64, - /* 870 */ 558, 238, 263, 236, 856, 871, 264, 148, 857, 860, - /* 880 */ 552, 844, 266, 267, 238, 550, 269, 856, 62, 270, - /* 890 */ 147, 857, 860, 236, 556, 871, 555, 222, 77, 903, - /* 900 */ 904, 844, 908, 554, 238, 541, 553, 856, 276, 51, - /* 910 */ 149, 857, 860, 236, 52, 871, 571, 570, 569, 499, - /* 920 */ 283, 844, 520, 519, 238, 518, 744, 856, 517, 516, - /* 930 */ 146, 857, 860, 236, 515, 871, 514, 513, 512, 511, - /* 940 */ 510, 844, 509, 508, 238, 303, 507, 856, 506, 505, - /* 950 */ 135, 857, 860, 504, 302, 304, 737, 306, 307, 736, - /* 960 */ 731, 310, 311, + /* 0 */ 163, 856, 240, 855, 272, 162, 272, 200, 856, 814, + /* 10 */ 854, 878, 31, 29, 27, 26, 25, 65, 880, 817, + /* 20 */ 178, 817, 256, 176, 906, 31, 29, 27, 26, 25, + /* 30 */ 779, 878, 40, 705, 55, 819, 71, 63, 880, 62, + /* 40 */ 155, 229, 66, 812, 243, 809, 906, 79, 938, 939, + /* 50 */ 626, 943, 878, 155, 175, 258, 511, 863, 259, 891, + /* 60 */ 511, 638, 58, 892, 895, 931, 512, 513, 208, 165, + /* 70 */ 927, 77, 321, 320, 319, 318, 317, 316, 315, 314, + /* 80 */ 313, 312, 311, 310, 309, 308, 307, 306, 305, 775, + /* 90 */ 959, 27, 26, 25, 31, 29, 27, 26, 25, 23, + /* 100 */ 170, 271, 656, 657, 658, 659, 660, 661, 662, 664, + /* 110 */ 665, 666, 23, 170, 271, 656, 657, 658, 659, 660, + /* 120 */ 661, 662, 664, 665, 666, 31, 29, 27, 26, 25, + /* 130 */ 10, 321, 320, 319, 318, 317, 316, 315, 314, 313, + /* 140 */ 312, 311, 310, 309, 308, 307, 306, 305, 565, 295, + /* 150 */ 294, 293, 569, 292, 571, 572, 291, 574, 288, 804, + /* 160 */ 580, 285, 582, 583, 282, 279, 24, 117, 256, 196, + /* 170 */ 906, 992, 626, 195, 624, 256, 177, 906, 194, 856, + /* 180 */ 193, 854, 83, 878, 991, 83, 258, 233, 990, 244, + /* 190 */ 891, 180, 271, 57, 892, 895, 931, 54, 182, 190, + /* 200 */ 154, 927, 51, 819, 71, 272, 192, 191, 269, 301, + /* 210 */ 819, 71, 992, 300, 805, 243, 624, 906, 751, 752, + /* 220 */ 817, 10, 234, 878, 298, 82, 258, 945, 302, 990, + /* 230 */ 891, 757, 627, 58, 892, 895, 931, 256, 186, 906, + /* 240 */ 165, 927, 77, 228, 942, 878, 201, 299, 258, 628, + /* 250 */ 30, 28, 891, 201, 113, 58, 892, 895, 931, 617, + /* 260 */ 221, 958, 165, 927, 1004, 184, 256, 615, 906, 172, + /* 270 */ 629, 235, 230, 965, 878, 304, 878, 258, 12, 272, + /* 280 */ 297, 891, 270, 881, 58, 892, 895, 931, 992, 9, + /* 290 */ 8, 165, 927, 1004, 817, 256, 272, 906, 1, 130, + /* 300 */ 83, 82, 988, 878, 181, 990, 258, 856, 40, 854, + /* 310 */ 891, 817, 112, 58, 892, 895, 931, 273, 21, 813, + /* 320 */ 165, 927, 1004, 30, 28, 698, 272, 663, 189, 183, + /* 330 */ 667, 949, 617, 99, 616, 618, 621, 114, 30, 28, + /* 340 */ 615, 817, 172, 329, 328, 803, 247, 617, 256, 674, + /* 350 */ 906, 12, 722, 83, 140, 615, 878, 172, 161, 258, + /* 360 */ 141, 72, 244, 891, 30, 28, 144, 892, 895, 49, + /* 370 */ 945, 1, 945, 617, 84, 225, 720, 721, 723, 724, + /* 380 */ 810, 615, 226, 172, 304, 992, 7, 941, 6, 940, + /* 390 */ 273, 697, 12, 864, 259, 256, 248, 906, 82, 820, + /* 400 */ 71, 136, 990, 878, 847, 273, 258, 616, 618, 621, + /* 410 */ 891, 240, 1, 59, 892, 895, 931, 256, 107, 906, + /* 420 */ 930, 927, 616, 618, 621, 878, 65, 217, 258, 950, + /* 430 */ 693, 273, 891, 251, 69, 59, 892, 895, 931, 207, + /* 440 */ 244, 83, 254, 927, 213, 961, 63, 211, 616, 618, + /* 450 */ 621, 83, 94, 30, 28, 257, 110, 938, 239, 241, + /* 460 */ 238, 249, 617, 992, 719, 617, 30, 28, 693, 93, + /* 470 */ 615, 60, 172, 615, 246, 617, 82, 104, 907, 256, + /* 480 */ 990, 906, 668, 615, 102, 172, 116, 878, 255, 32, + /* 490 */ 258, 2, 754, 755, 891, 635, 624, 73, 892, 895, + /* 500 */ 252, 7, 32, 696, 607, 9, 8, 30, 28, 185, + /* 510 */ 256, 32, 906, 632, 7, 885, 617, 625, 878, 85, + /* 520 */ 273, 258, 883, 273, 615, 891, 172, 631, 59, 892, + /* 530 */ 895, 931, 214, 273, 245, 1005, 928, 616, 618, 621, + /* 540 */ 616, 618, 621, 197, 198, 256, 199, 906, 39, 653, + /* 550 */ 616, 618, 621, 878, 202, 1, 258, 171, 90, 122, + /* 560 */ 891, 215, 209, 148, 892, 895, 120, 256, 630, 906, + /* 570 */ 264, 134, 160, 127, 273, 878, 558, 67, 258, 222, + /* 580 */ 68, 216, 891, 69, 992, 148, 892, 895, 256, 218, + /* 590 */ 906, 616, 618, 621, 629, 553, 878, 82, 95, 258, + /* 600 */ 962, 990, 60, 891, 586, 133, 147, 892, 895, 590, + /* 610 */ 256, 277, 906, 61, 802, 227, 68, 219, 878, 325, + /* 620 */ 972, 258, 132, 262, 256, 891, 906, 100, 73, 892, + /* 630 */ 895, 621, 878, 224, 971, 258, 169, 236, 256, 891, + /* 640 */ 906, 103, 148, 892, 895, 56, 878, 164, 128, 258, + /* 650 */ 173, 5, 256, 891, 906, 952, 148, 892, 895, 237, + /* 660 */ 878, 75, 106, 258, 301, 223, 1006, 891, 300, 108, + /* 670 */ 146, 892, 895, 240, 268, 4, 220, 64, 256, 96, + /* 680 */ 906, 693, 628, 302, 595, 946, 878, 33, 65, 258, + /* 690 */ 253, 69, 256, 891, 906, 109, 149, 892, 895, 70, + /* 700 */ 878, 989, 299, 258, 1007, 250, 68, 891, 63, 166, + /* 710 */ 142, 892, 895, 256, 17, 906, 115, 242, 78, 938, + /* 720 */ 939, 878, 943, 913, 258, 862, 260, 256, 891, 906, + /* 730 */ 261, 150, 892, 895, 861, 878, 265, 174, 258, 266, + /* 740 */ 124, 256, 891, 906, 267, 143, 892, 895, 48, 878, + /* 750 */ 135, 818, 258, 50, 275, 256, 891, 906, 137, 151, + /* 760 */ 892, 895, 131, 878, 872, 138, 258, 332, 152, 256, + /* 770 */ 891, 906, 153, 903, 892, 895, 139, 878, 778, 871, + /* 780 */ 258, 870, 187, 256, 891, 906, 188, 902, 892, 895, + /* 790 */ 869, 878, 808, 807, 258, 777, 774, 256, 891, 906, + /* 800 */ 768, 901, 892, 895, 763, 878, 868, 859, 258, 87, + /* 810 */ 806, 256, 891, 906, 524, 158, 892, 895, 776, 878, + /* 820 */ 773, 205, 258, 203, 204, 256, 891, 906, 767, 157, + /* 830 */ 892, 895, 766, 878, 762, 761, 258, 210, 760, 867, + /* 840 */ 891, 866, 212, 159, 892, 895, 36, 858, 256, 42, + /* 850 */ 906, 97, 98, 3, 240, 14, 878, 15, 74, 258, + /* 860 */ 101, 105, 256, 891, 906, 43, 156, 892, 895, 65, + /* 870 */ 878, 32, 231, 258, 718, 712, 92, 891, 34, 37, + /* 880 */ 145, 892, 895, 711, 76, 44, 11, 232, 690, 63, + /* 890 */ 206, 883, 689, 91, 19, 45, 20, 111, 745, 80, + /* 900 */ 938, 939, 740, 943, 35, 739, 31, 29, 27, 26, + /* 910 */ 25, 22, 81, 167, 16, 744, 41, 743, 168, 89, + /* 920 */ 8, 31, 29, 27, 26, 25, 118, 636, 13, 31, + /* 930 */ 29, 27, 26, 25, 654, 18, 263, 857, 119, 716, + /* 940 */ 121, 123, 46, 126, 125, 47, 88, 619, 51, 276, + /* 950 */ 86, 179, 38, 280, 882, 579, 587, 129, 278, 274, + /* 960 */ 584, 281, 283, 581, 284, 286, 575, 287, 289, 573, + /* 970 */ 564, 290, 52, 53, 594, 296, 593, 578, 638, 592, + /* 980 */ 303, 577, 522, 543, 576, 542, 541, 536, 540, 539, + /* 990 */ 538, 537, 535, 534, 533, 772, 532, 531, 530, 529, + /* 1000 */ 528, 527, 322, 323, 765, 764, 326, 327, 324, 759, + /* 1010 */ 330, 331, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 157, 160, 163, 162, 168, 145, 145, 157, 148, 148, - /* 10 */ 174, 168, 12, 13, 14, 15, 16, 174, 168, 178, - /* 20 */ 160, 160, 142, 143, 174, 12, 13, 14, 15, 16, - /* 30 */ 0, 160, 159, 162, 216, 162, 147, 164, 31, 168, - /* 40 */ 40, 196, 171, 154, 160, 174, 162, 158, 177, 178, - /* 50 */ 179, 180, 175, 40, 209, 184, 185, 186, 213, 39, - /* 60 */ 167, 61, 178, 170, 171, 159, 195, 60, 162, 192, - /* 70 */ 164, 31, 42, 43, 44, 45, 46, 47, 48, 49, - /* 80 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 31, - /* 90 */ 12, 13, 14, 15, 16, 181, 182, 97, 98, 68, - /* 100 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - /* 110 */ 97, 98, 147, 100, 101, 102, 103, 104, 105, 106, - /* 120 */ 107, 108, 109, 158, 70, 71, 72, 73, 74, 75, - /* 130 */ 76, 77, 78, 79, 80, 149, 82, 83, 84, 85, - /* 140 */ 86, 87, 160, 144, 162, 99, 31, 161, 162, 145, - /* 150 */ 168, 152, 148, 171, 155, 173, 174, 92, 31, 177, - /* 160 */ 178, 179, 180, 132, 160, 31, 184, 185, 0, 123, - /* 170 */ 124, 125, 126, 127, 145, 60, 175, 114, 196, 12, - /* 180 */ 13, 14, 15, 16, 119, 120, 160, 159, 162, 160, - /* 190 */ 162, 209, 164, 192, 168, 213, 31, 171, 0, 162, - /* 200 */ 174, 164, 173, 177, 178, 179, 180, 39, 179, 175, - /* 210 */ 184, 185, 186, 135, 136, 14, 15, 16, 189, 190, - /* 220 */ 191, 145, 193, 39, 198, 196, 192, 140, 61, 114, - /* 230 */ 204, 205, 19, 160, 97, 162, 160, 39, 209, 3, - /* 240 */ 27, 168, 213, 106, 171, 111, 109, 174, 21, 36, - /* 250 */ 177, 178, 179, 180, 61, 179, 29, 184, 185, 186, - /* 260 */ 173, 68, 160, 66, 162, 189, 190, 191, 150, 193, - /* 270 */ 168, 153, 59, 171, 145, 62, 174, 148, 205, 177, - /* 280 */ 178, 179, 180, 196, 1, 2, 184, 185, 186, 160, - /* 290 */ 160, 144, 162, 145, 12, 13, 209, 195, 168, 207, - /* 300 */ 213, 171, 155, 21, 174, 170, 171, 177, 178, 179, - /* 310 */ 180, 29, 34, 31, 184, 185, 186, 12, 13, 14, - /* 320 */ 149, 201, 40, 161, 162, 195, 21, 12, 13, 14, - /* 330 */ 15, 16, 161, 162, 29, 0, 31, 142, 21, 160, - /* 340 */ 31, 162, 60, 14, 61, 40, 60, 168, 31, 32, - /* 350 */ 171, 65, 173, 174, 12, 13, 177, 178, 179, 145, - /* 360 */ 31, 79, 148, 21, 145, 60, 130, 148, 112, 113, - /* 370 */ 40, 29, 21, 31, 160, 196, 94, 95, 96, 160, - /* 380 */ 29, 149, 40, 176, 79, 50, 12, 13, 209, 54, - /* 390 */ 4, 113, 213, 161, 162, 21, 114, 1, 2, 94, - /* 400 */ 95, 96, 60, 29, 69, 31, 61, 61, 160, 20, - /* 410 */ 162, 18, 23, 68, 68, 22, 168, 24, 25, 171, - /* 420 */ 111, 79, 174, 88, 194, 177, 178, 179, 180, 99, - /* 430 */ 79, 38, 184, 185, 60, 162, 94, 95, 96, 210, - /* 440 */ 160, 197, 162, 31, 145, 94, 95, 96, 168, 0, - /* 450 */ 68, 171, 145, 79, 174, 147, 61, 177, 178, 179, - /* 460 */ 180, 138, 139, 68, 184, 185, 12, 13, 94, 95, - /* 470 */ 96, 147, 12, 13, 14, 21, 160, 31, 162, 61, - /* 480 */ 141, 21, 141, 29, 168, 31, 68, 171, 114, 29, - /* 490 */ 174, 31, 160, 177, 178, 179, 12, 13, 2, 50, - /* 500 */ 31, 115, 31, 54, 31, 21, 122, 114, 12, 13, - /* 510 */ 14, 15, 16, 29, 60, 31, 134, 165, 69, 176, - /* 520 */ 60, 60, 121, 169, 160, 206, 162, 61, 67, 96, - /* 530 */ 214, 215, 168, 79, 68, 171, 172, 88, 174, 79, - /* 540 */ 61, 177, 178, 179, 60, 168, 206, 68, 94, 95, - /* 550 */ 96, 61, 169, 61, 94, 95, 96, 160, 68, 162, - /* 560 */ 68, 129, 168, 79, 203, 168, 128, 202, 171, 117, - /* 570 */ 200, 174, 116, 160, 177, 178, 179, 180, 94, 95, - /* 580 */ 96, 113, 185, 160, 145, 162, 61, 199, 31, 61, - /* 590 */ 175, 168, 110, 68, 171, 172, 68, 174, 187, 160, - /* 600 */ 177, 178, 179, 160, 137, 162, 61, 217, 133, 61, - /* 610 */ 212, 168, 61, 68, 171, 211, 68, 174, 179, 68, - /* 620 */ 177, 178, 179, 60, 131, 160, 169, 162, 189, 190, - /* 630 */ 191, 183, 193, 168, 91, 144, 171, 60, 168, 174, - /* 640 */ 168, 61, 177, 178, 179, 160, 169, 162, 68, 168, - /* 650 */ 153, 208, 166, 168, 160, 160, 171, 172, 160, 174, - /* 660 */ 162, 156, 177, 178, 179, 165, 168, 145, 144, 171, - /* 670 */ 172, 141, 174, 19, 26, 177, 178, 179, 30, 31, - /* 680 */ 215, 27, 146, 35, 2, 37, 151, 33, 151, 0, - /* 690 */ 36, 160, 0, 162, 12, 13, 14, 15, 16, 168, - /* 700 */ 56, 67, 171, 0, 56, 174, 0, 0, 177, 178, - /* 710 */ 179, 63, 64, 59, 0, 160, 62, 162, 0, 0, - /* 720 */ 0, 0, 0, 168, 0, 41, 171, 0, 0, 174, - /* 730 */ 0, 0, 177, 178, 179, 160, 0, 162, 21, 0, - /* 740 */ 0, 93, 88, 168, 90, 60, 171, 21, 19, 174, - /* 750 */ 34, 89, 177, 178, 179, 160, 68, 162, 68, 118, - /* 760 */ 61, 68, 61, 168, 60, 60, 171, 29, 60, 174, - /* 770 */ 68, 61, 177, 178, 179, 160, 61, 162, 67, 118, - /* 780 */ 68, 112, 118, 168, 61, 60, 171, 4, 160, 174, - /* 790 */ 162, 29, 177, 178, 179, 61, 168, 29, 29, 171, - /* 800 */ 68, 29, 174, 61, 67, 177, 178, 179, 67, 29, - /* 810 */ 29, 68, 160, 2, 162, 67, 61, 60, 60, 60, - /* 820 */ 168, 61, 61, 171, 60, 160, 174, 162, 0, 177, - /* 830 */ 178, 179, 34, 168, 99, 60, 171, 92, 160, 174, - /* 840 */ 162, 89, 177, 178, 179, 60, 168, 65, 21, 171, - /* 850 */ 60, 67, 174, 67, 145, 177, 178, 179, 66, 29, - /* 860 */ 160, 61, 162, 29, 60, 29, 61, 60, 168, 160, - /* 870 */ 61, 171, 29, 160, 174, 162, 60, 177, 178, 179, - /* 880 */ 61, 168, 29, 60, 171, 61, 29, 174, 179, 60, - /* 890 */ 177, 178, 179, 160, 81, 162, 81, 188, 189, 190, - /* 900 */ 191, 168, 193, 81, 171, 21, 81, 174, 69, 60, - /* 910 */ 177, 178, 179, 160, 60, 162, 29, 29, 21, 41, - /* 920 */ 40, 168, 29, 29, 171, 29, 0, 174, 29, 29, - /* 930 */ 177, 178, 179, 160, 29, 162, 29, 21, 29, 29, - /* 940 */ 29, 168, 29, 29, 171, 27, 29, 174, 29, 29, - /* 950 */ 177, 178, 179, 29, 29, 34, 0, 29, 28, 0, - /* 960 */ 0, 21, 20, 218, 218, 218, 218, 218, 218, 218, - /* 970 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 980 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 990 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1000 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1010 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1020 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1030 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1040 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1050 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1060 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1070 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1080 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1090 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - /* 1100 */ 218, 218, 218, + /* 0 */ 158, 163, 146, 165, 146, 160, 146, 149, 163, 149, + /* 10 */ 165, 169, 12, 13, 14, 15, 16, 161, 176, 161, + /* 20 */ 158, 161, 161, 150, 163, 12, 13, 14, 15, 16, + /* 30 */ 0, 169, 148, 14, 145, 162, 163, 181, 176, 155, + /* 40 */ 40, 180, 153, 159, 161, 156, 163, 191, 192, 193, + /* 50 */ 31, 195, 169, 40, 168, 172, 21, 171, 172, 176, + /* 60 */ 21, 61, 179, 180, 181, 182, 31, 32, 29, 186, + /* 70 */ 187, 188, 42, 43, 44, 45, 46, 47, 48, 49, + /* 80 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 0, + /* 90 */ 207, 14, 15, 16, 12, 13, 14, 15, 16, 99, + /* 100 */ 100, 31, 102, 103, 104, 105, 106, 107, 108, 109, + /* 110 */ 110, 111, 99, 100, 31, 102, 103, 104, 105, 106, + /* 120 */ 107, 108, 109, 110, 111, 12, 13, 14, 15, 16, + /* 130 */ 60, 42, 43, 44, 45, 46, 47, 48, 49, 50, + /* 140 */ 51, 52, 53, 54, 55, 56, 57, 58, 70, 71, + /* 150 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 0, + /* 160 */ 82, 83, 84, 85, 86, 87, 183, 184, 161, 26, + /* 170 */ 163, 198, 31, 30, 31, 161, 160, 163, 35, 163, + /* 180 */ 37, 165, 115, 169, 211, 115, 172, 180, 215, 175, + /* 190 */ 176, 150, 31, 179, 180, 181, 182, 60, 150, 56, + /* 200 */ 186, 187, 65, 162, 163, 146, 63, 64, 149, 50, + /* 210 */ 162, 163, 198, 54, 0, 161, 31, 163, 136, 137, + /* 220 */ 161, 60, 31, 169, 66, 211, 172, 177, 69, 215, + /* 230 */ 176, 141, 31, 179, 180, 181, 182, 161, 95, 163, + /* 240 */ 186, 187, 188, 92, 194, 169, 39, 88, 172, 31, + /* 250 */ 12, 13, 176, 39, 200, 179, 180, 181, 182, 21, + /* 260 */ 206, 207, 186, 187, 188, 175, 161, 29, 163, 31, + /* 270 */ 31, 120, 121, 197, 169, 39, 169, 172, 40, 146, + /* 280 */ 164, 176, 149, 176, 179, 180, 181, 182, 198, 1, + /* 290 */ 2, 186, 187, 188, 161, 161, 146, 163, 60, 149, + /* 300 */ 115, 211, 197, 169, 160, 215, 172, 163, 148, 165, + /* 310 */ 176, 161, 94, 179, 180, 181, 182, 79, 99, 159, + /* 320 */ 186, 187, 188, 12, 13, 14, 146, 108, 146, 149, + /* 330 */ 111, 197, 21, 94, 96, 97, 98, 218, 12, 13, + /* 340 */ 29, 161, 31, 143, 144, 0, 3, 21, 161, 61, + /* 350 */ 163, 40, 101, 115, 18, 29, 169, 31, 22, 172, + /* 360 */ 24, 25, 175, 176, 12, 13, 179, 180, 181, 145, + /* 370 */ 177, 60, 177, 21, 38, 124, 125, 126, 127, 128, + /* 380 */ 156, 29, 209, 31, 39, 198, 60, 194, 34, 194, + /* 390 */ 79, 4, 40, 171, 172, 161, 68, 163, 211, 162, + /* 400 */ 163, 151, 215, 169, 154, 79, 172, 96, 97, 98, + /* 410 */ 176, 146, 60, 179, 180, 181, 182, 161, 203, 163, + /* 420 */ 186, 187, 96, 97, 98, 169, 161, 61, 172, 113, + /* 430 */ 114, 79, 176, 68, 68, 179, 180, 181, 182, 143, + /* 440 */ 175, 115, 186, 187, 20, 178, 181, 23, 96, 97, + /* 450 */ 98, 115, 19, 12, 13, 14, 191, 192, 193, 196, + /* 460 */ 195, 133, 21, 198, 61, 21, 12, 13, 114, 36, + /* 470 */ 29, 68, 31, 29, 131, 21, 211, 61, 163, 161, + /* 480 */ 215, 163, 61, 29, 68, 31, 212, 169, 40, 68, + /* 490 */ 172, 199, 139, 140, 176, 61, 31, 179, 180, 181, + /* 500 */ 135, 60, 68, 116, 61, 1, 2, 12, 13, 146, + /* 510 */ 161, 68, 163, 31, 60, 60, 21, 31, 169, 148, + /* 520 */ 79, 172, 67, 79, 29, 176, 31, 31, 179, 180, + /* 530 */ 181, 182, 146, 79, 216, 217, 187, 96, 97, 98, + /* 540 */ 96, 97, 98, 174, 161, 161, 166, 163, 148, 101, + /* 550 */ 96, 97, 98, 169, 146, 60, 172, 173, 148, 61, + /* 560 */ 176, 175, 142, 179, 180, 181, 68, 161, 31, 163, + /* 570 */ 61, 146, 142, 61, 79, 169, 61, 68, 172, 173, + /* 580 */ 68, 174, 176, 68, 198, 179, 180, 181, 161, 161, + /* 590 */ 163, 96, 97, 98, 31, 61, 169, 211, 145, 172, + /* 600 */ 178, 215, 68, 176, 61, 19, 179, 180, 181, 61, + /* 610 */ 161, 68, 163, 27, 0, 123, 68, 166, 169, 33, + /* 620 */ 208, 172, 36, 122, 161, 176, 163, 170, 179, 180, + /* 630 */ 181, 98, 169, 169, 208, 172, 173, 210, 161, 176, + /* 640 */ 163, 170, 179, 180, 181, 59, 169, 169, 62, 172, + /* 650 */ 173, 130, 161, 176, 163, 205, 179, 180, 181, 129, + /* 660 */ 169, 202, 204, 172, 50, 118, 217, 176, 54, 201, + /* 670 */ 179, 180, 181, 146, 88, 117, 90, 161, 161, 93, + /* 680 */ 163, 114, 31, 69, 61, 177, 169, 112, 161, 172, + /* 690 */ 134, 68, 161, 176, 163, 189, 179, 180, 181, 61, + /* 700 */ 169, 214, 88, 172, 219, 132, 68, 176, 181, 138, + /* 710 */ 179, 180, 181, 161, 60, 163, 213, 190, 191, 192, + /* 720 */ 193, 169, 195, 185, 172, 170, 169, 161, 176, 163, + /* 730 */ 169, 179, 180, 181, 170, 169, 91, 169, 172, 167, + /* 740 */ 161, 161, 176, 163, 166, 179, 180, 181, 145, 169, + /* 750 */ 154, 161, 172, 60, 157, 161, 176, 163, 146, 179, + /* 760 */ 180, 181, 145, 169, 0, 147, 172, 142, 152, 161, + /* 770 */ 176, 163, 152, 179, 180, 181, 147, 169, 0, 0, + /* 780 */ 172, 0, 56, 161, 176, 163, 67, 179, 180, 181, + /* 790 */ 0, 169, 0, 0, 172, 0, 0, 161, 176, 163, + /* 800 */ 0, 179, 180, 181, 0, 169, 0, 0, 172, 34, + /* 810 */ 0, 161, 176, 163, 41, 179, 180, 181, 0, 169, + /* 820 */ 0, 34, 172, 29, 27, 161, 176, 163, 0, 179, + /* 830 */ 180, 181, 0, 169, 0, 0, 172, 21, 0, 0, + /* 840 */ 176, 0, 21, 179, 180, 181, 94, 0, 161, 60, + /* 850 */ 163, 34, 89, 68, 146, 119, 169, 119, 60, 172, + /* 860 */ 61, 60, 161, 176, 163, 60, 179, 180, 181, 161, + /* 870 */ 169, 68, 29, 172, 61, 61, 19, 176, 113, 68, + /* 880 */ 179, 180, 181, 61, 27, 60, 119, 68, 61, 181, + /* 890 */ 33, 67, 61, 36, 68, 4, 2, 67, 61, 191, + /* 900 */ 192, 193, 29, 195, 68, 29, 12, 13, 14, 15, + /* 910 */ 16, 2, 67, 29, 68, 29, 59, 29, 29, 62, + /* 920 */ 2, 12, 13, 14, 15, 16, 67, 61, 60, 12, + /* 930 */ 13, 14, 15, 16, 101, 60, 92, 0, 61, 61, + /* 940 */ 60, 60, 60, 89, 34, 60, 89, 21, 65, 29, + /* 950 */ 93, 29, 60, 29, 67, 81, 61, 67, 60, 66, + /* 960 */ 61, 60, 29, 61, 60, 29, 61, 60, 29, 61, + /* 970 */ 21, 60, 60, 60, 29, 69, 29, 81, 61, 21, + /* 980 */ 40, 81, 41, 29, 81, 29, 29, 21, 29, 29, + /* 990 */ 29, 29, 29, 29, 29, 0, 29, 29, 29, 29, + /* 1000 */ 29, 29, 29, 27, 0, 0, 29, 28, 34, 0, + /* 1010 */ 21, 20, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1020 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1030 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1040 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1050 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1060 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1070 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1080 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1090 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1100 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1110 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1120 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1130 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1140 */ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + /* 1150 */ 220, 220, 220, }; -#define YY_SHIFT_COUNT (312) +#define YY_SHIFT_COUNT (332) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (960) +#define YY_SHIFT_MAX (1009) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 393, 282, 305, 342, 342, 342, 342, 374, 342, 342, - /* 10 */ 115, 454, 484, 460, 454, 454, 454, 454, 454, 454, + /* 0 */ 336, 238, 311, 352, 352, 352, 352, 326, 352, 352, + /* 10 */ 70, 454, 495, 441, 454, 454, 454, 454, 454, 454, /* 20 */ 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, - /* 30 */ 454, 454, 454, 7, 7, 7, 351, 351, 40, 40, - /* 40 */ 20, 58, 127, 127, 63, 165, 58, 40, 40, 58, - /* 50 */ 40, 58, 58, 58, 40, 184, 0, 13, 13, 351, - /* 60 */ 317, 168, 134, 134, 134, 198, 165, 58, 58, 197, - /* 70 */ 54, 648, 78, 46, 65, 227, 309, 256, 278, 256, - /* 80 */ 329, 236, 386, 412, 20, 412, 20, 446, 446, 469, - /* 90 */ 471, 473, 384, 401, 433, 384, 401, 433, 432, 438, - /* 100 */ 452, 456, 468, 469, 557, 482, 467, 475, 493, 563, - /* 110 */ 58, 401, 433, 433, 401, 433, 543, 469, 471, 197, - /* 120 */ 184, 469, 577, 412, 184, 446, 963, 963, 963, 30, - /* 130 */ 654, 496, 682, 167, 213, 315, 315, 315, 315, 315, - /* 140 */ 315, 315, 335, 449, 283, 137, 201, 201, 201, 201, - /* 150 */ 389, 193, 345, 346, 396, 323, 31, 382, 395, 330, - /* 160 */ 418, 461, 466, 479, 490, 492, 525, 528, 545, 548, - /* 170 */ 551, 580, 286, 689, 692, 703, 706, 644, 634, 707, - /* 180 */ 714, 718, 719, 720, 721, 722, 724, 684, 727, 728, - /* 190 */ 730, 731, 736, 717, 739, 726, 729, 740, 685, 716, - /* 200 */ 662, 688, 690, 641, 699, 693, 701, 704, 705, 710, - /* 210 */ 708, 715, 738, 702, 711, 725, 712, 661, 723, 734, - /* 220 */ 737, 669, 732, 741, 742, 743, 664, 783, 762, 768, - /* 230 */ 769, 772, 780, 781, 811, 735, 748, 755, 757, 758, - /* 240 */ 760, 761, 759, 764, 745, 775, 828, 798, 752, 785, - /* 250 */ 782, 784, 786, 827, 790, 792, 800, 830, 834, 804, - /* 260 */ 805, 836, 807, 809, 843, 816, 819, 853, 823, 824, - /* 270 */ 857, 829, 813, 815, 822, 825, 884, 839, 849, 854, - /* 280 */ 887, 888, 897, 878, 880, 893, 894, 896, 899, 900, - /* 290 */ 905, 907, 916, 909, 910, 911, 913, 914, 917, 919, - /* 300 */ 920, 924, 926, 925, 918, 921, 956, 928, 930, 959, - /* 310 */ 960, 940, 942, + /* 30 */ 454, 454, 454, 161, 161, 161, 185, 444, 444, 83, + /* 40 */ 83, 207, 141, 191, 191, 67, 201, 141, 83, 83, + /* 50 */ 141, 83, 141, 141, 141, 83, 236, 0, 13, 13, + /* 60 */ 444, 35, 214, 218, 218, 218, 345, 201, 141, 141, + /* 70 */ 158, 78, 143, 82, 251, 151, 39, 239, 316, 354, + /* 80 */ 316, 19, 343, 387, 465, 482, 207, 486, 496, 207, + /* 90 */ 465, 207, 537, 465, 537, 482, 236, 486, 496, 563, + /* 100 */ 492, 501, 533, 492, 501, 533, 521, 530, 547, 558, + /* 110 */ 567, 486, 651, 575, 571, 556, 573, 654, 141, 501, + /* 120 */ 533, 533, 501, 533, 645, 486, 496, 158, 236, 486, + /* 130 */ 693, 465, 236, 537, 1012, 1012, 1012, 1012, 30, 89, + /* 140 */ 586, 857, 894, 909, 917, 113, 113, 113, 113, 113, + /* 150 */ 113, 113, 159, 614, 288, 219, 77, 77, 77, 77, + /* 160 */ 424, 433, 366, 403, 416, 504, 353, 328, 365, 421, + /* 170 */ 448, 434, 455, 443, 498, 509, 512, 515, 534, 543, + /* 180 */ 548, 623, 638, 137, 764, 778, 779, 781, 726, 719, + /* 190 */ 790, 792, 793, 795, 796, 800, 804, 806, 807, 775, + /* 200 */ 810, 773, 818, 820, 794, 797, 787, 828, 832, 834, + /* 210 */ 835, 816, 838, 821, 839, 841, 752, 847, 789, 817, + /* 220 */ 763, 785, 803, 736, 799, 811, 813, 798, 801, 814, + /* 230 */ 805, 822, 843, 819, 824, 825, 826, 738, 827, 831, + /* 240 */ 830, 765, 836, 845, 837, 846, 767, 891, 873, 876, + /* 250 */ 884, 886, 888, 889, 918, 833, 859, 866, 868, 875, + /* 260 */ 877, 878, 880, 881, 844, 882, 937, 910, 854, 885, + /* 270 */ 883, 887, 890, 926, 892, 893, 895, 920, 922, 898, + /* 280 */ 899, 924, 901, 902, 933, 904, 905, 936, 907, 908, + /* 290 */ 939, 911, 874, 896, 900, 903, 949, 906, 912, 913, + /* 300 */ 945, 947, 958, 941, 940, 954, 956, 957, 959, 960, + /* 310 */ 961, 962, 966, 963, 964, 965, 967, 968, 969, 970, + /* 320 */ 971, 972, 995, 973, 976, 974, 1004, 977, 979, 1005, + /* 330 */ 1009, 989, 991, }; -#define YY_REDUCE_COUNT (128) -#define YY_REDUCE_MIN (-182) -#define YY_REDUCE_MAX (773) +#define YY_REDUCE_COUNT (137) +#define YY_REDUCE_MIN (-162) +#define YY_REDUCE_MAX (708) static const short yy_reduce_ofst[] = { - /* 0 */ 87, -18, 26, 73, -129, 102, 130, 179, 248, 280, - /* 10 */ 29, 316, 397, 364, 423, 443, 465, 485, 498, 531, - /* 20 */ 555, 575, 595, 615, 628, 652, 665, 678, 700, 713, - /* 30 */ 733, 753, 773, 709, 76, 439, -157, -150, -140, -139, - /* 40 */ -111, -127, -159, -116, -155, -107, -14, 4, 129, -94, - /* 50 */ 214, 171, 28, 232, 219, -1, -86, -86, -86, -164, - /* 60 */ -120, -35, -123, 1, 34, 147, 135, 162, 37, 118, - /* 70 */ -161, 148, -182, 92, 120, 195, 207, 230, 230, 230, - /* 80 */ 273, 229, 244, 299, 308, 307, 324, 339, 341, 332, - /* 90 */ 352, 343, 319, 354, 377, 340, 383, 394, 361, 365, - /* 100 */ 370, 388, 230, 413, 415, 411, 390, 398, 404, 448, - /* 110 */ 273, 457, 470, 472, 477, 481, 486, 494, 500, 497, - /* 120 */ 491, 495, 505, 522, 524, 530, 535, 537, 536, + /* 0 */ 90, 14, 54, -117, 76, 105, 134, 187, 234, 256, + /* 10 */ 265, 318, 349, 384, 406, 427, 449, 463, 477, 491, + /* 20 */ 517, 531, 552, 566, 580, 594, 608, 622, 636, 650, + /* 30 */ 664, 687, 701, 527, -144, 708, 386, -158, -138, -142, + /* 40 */ -140, -116, -155, -139, 7, -27, -114, -127, 59, 133, + /* 50 */ 16, 150, 41, 144, 48, 180, -111, -17, -17, -17, + /* 60 */ 107, 200, 160, 50, 193, 195, 224, 222, 237, -162, + /* 70 */ 250, 116, 182, 119, 173, 215, 296, 267, 263, 263, + /* 80 */ 263, 315, 274, 292, 363, 369, 371, 383, 380, 400, + /* 90 */ 408, 410, 420, 425, 430, 407, 453, 428, 451, 422, + /* 100 */ 412, 457, 464, 426, 471, 478, 450, 458, 459, 468, + /* 110 */ 263, 516, 508, 506, 485, 487, 503, 538, 315, 555, + /* 120 */ 557, 561, 564, 568, 572, 579, 578, 596, 603, 590, + /* 130 */ 597, 612, 617, 625, 618, 616, 620, 629, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 10 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 20 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 30 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 40 */ 753, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 50 */ 728, 728, 728, 728, 728, 751, 728, 898, 728, 728, - /* 60 */ 728, 753, 909, 909, 909, 751, 728, 728, 728, 816, - /* 70 */ 728, 728, 973, 728, 933, 728, 925, 901, 915, 902, - /* 80 */ 728, 958, 918, 728, 753, 728, 753, 728, 728, 728, - /* 90 */ 728, 728, 940, 938, 728, 940, 938, 728, 952, 948, - /* 100 */ 931, 929, 915, 728, 728, 728, 976, 964, 960, 728, - /* 110 */ 728, 938, 728, 728, 938, 728, 829, 728, 728, 728, - /* 120 */ 751, 728, 785, 728, 751, 728, 819, 819, 754, 728, - /* 130 */ 728, 728, 728, 728, 728, 870, 951, 950, 869, 875, - /* 140 */ 874, 873, 728, 728, 728, 728, 864, 865, 863, 862, - /* 150 */ 728, 728, 728, 728, 899, 728, 961, 965, 728, 728, - /* 160 */ 728, 850, 728, 728, 728, 728, 728, 728, 728, 728, - /* 170 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 180 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 190 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 200 */ 728, 922, 932, 728, 728, 728, 728, 728, 728, 728, - /* 210 */ 728, 728, 728, 728, 850, 728, 949, 728, 908, 904, - /* 220 */ 728, 728, 900, 728, 728, 959, 728, 728, 728, 728, - /* 230 */ 728, 728, 728, 728, 894, 728, 728, 728, 728, 728, - /* 240 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 250 */ 728, 849, 728, 728, 728, 728, 728, 728, 728, 813, - /* 260 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 270 */ 728, 728, 798, 796, 795, 794, 728, 791, 728, 728, - /* 280 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 290 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 300 */ 728, 728, 728, 728, 728, 728, 728, 728, 728, 728, - /* 310 */ 728, 728, 728, + /* 0 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 10 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 20 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 30 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 40 */ 756, 783, 756, 756, 756, 756, 756, 756, 756, 756, + /* 50 */ 756, 756, 756, 756, 756, 756, 781, 756, 933, 756, + /* 60 */ 756, 756, 783, 944, 944, 944, 781, 756, 756, 756, + /* 70 */ 846, 756, 756, 1008, 756, 968, 756, 960, 936, 950, + /* 80 */ 937, 756, 993, 953, 756, 756, 783, 756, 756, 783, + /* 90 */ 756, 783, 756, 756, 756, 756, 781, 756, 756, 756, + /* 100 */ 975, 973, 756, 975, 973, 756, 987, 983, 966, 964, + /* 110 */ 950, 756, 756, 756, 1011, 999, 995, 756, 756, 973, + /* 120 */ 756, 756, 973, 756, 860, 756, 756, 756, 781, 756, + /* 130 */ 815, 756, 781, 756, 784, 849, 849, 784, 756, 756, + /* 140 */ 756, 756, 756, 756, 756, 905, 986, 985, 904, 910, + /* 150 */ 909, 908, 756, 756, 756, 756, 899, 900, 898, 897, + /* 160 */ 756, 756, 756, 756, 756, 934, 756, 996, 1000, 756, + /* 170 */ 756, 756, 884, 756, 756, 756, 756, 756, 756, 756, + /* 180 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 190 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 200 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 210 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 220 */ 756, 957, 967, 756, 756, 756, 756, 756, 756, 756, + /* 230 */ 756, 756, 756, 756, 884, 756, 984, 756, 943, 939, + /* 240 */ 756, 756, 935, 756, 756, 994, 756, 756, 756, 756, + /* 250 */ 756, 756, 756, 756, 929, 756, 756, 756, 756, 756, + /* 260 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 270 */ 756, 883, 756, 756, 756, 756, 756, 756, 756, 843, + /* 280 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 290 */ 756, 756, 828, 826, 825, 824, 756, 821, 756, 756, + /* 300 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 310 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 320 */ 756, 756, 756, 756, 756, 756, 756, 756, 756, 756, + /* 330 */ 756, 756, 756, }; /********** End of lemon-generated parsing tables *****************************/ @@ -706,131 +721,133 @@ static const char *const yyTokenName[] = { /* 90 */ "FULLTEXT", /* 91 */ "FUNCTION", /* 92 */ "INTERVAL", - /* 93 */ "MNODES", - /* 94 */ "NK_FLOAT", - /* 95 */ "NK_BOOL", - /* 96 */ "NK_VARIABLE", - /* 97 */ "BETWEEN", - /* 98 */ "IS", - /* 99 */ "NULL", - /* 100 */ "NK_LT", - /* 101 */ "NK_GT", - /* 102 */ "NK_LE", - /* 103 */ "NK_GE", - /* 104 */ "NK_NE", - /* 105 */ "NK_EQ", - /* 106 */ "LIKE", - /* 107 */ "MATCH", - /* 108 */ "NMATCH", - /* 109 */ "IN", - /* 110 */ "FROM", - /* 111 */ "AS", - /* 112 */ "JOIN", - /* 113 */ "INNER", - /* 114 */ "SELECT", - /* 115 */ "DISTINCT", - /* 116 */ "WHERE", - /* 117 */ "PARTITION", - /* 118 */ "BY", - /* 119 */ "SESSION", - /* 120 */ "STATE_WINDOW", - /* 121 */ "SLIDING", - /* 122 */ "FILL", - /* 123 */ "VALUE", - /* 124 */ "NONE", - /* 125 */ "PREV", - /* 126 */ "LINEAR", - /* 127 */ "NEXT", - /* 128 */ "GROUP", - /* 129 */ "HAVING", - /* 130 */ "ORDER", - /* 131 */ "SLIMIT", - /* 132 */ "SOFFSET", - /* 133 */ "LIMIT", - /* 134 */ "OFFSET", - /* 135 */ "ASC", - /* 136 */ "DESC", - /* 137 */ "NULLS", - /* 138 */ "FIRST", - /* 139 */ "LAST", - /* 140 */ "cmd", - /* 141 */ "user_name", - /* 142 */ "dnode_endpoint", - /* 143 */ "dnode_host_name", - /* 144 */ "not_exists_opt", - /* 145 */ "db_name", - /* 146 */ "db_options", - /* 147 */ "exists_opt", - /* 148 */ "full_table_name", - /* 149 */ "column_def_list", - /* 150 */ "tags_def_opt", - /* 151 */ "table_options", - /* 152 */ "multi_create_clause", - /* 153 */ "tags_def", - /* 154 */ "multi_drop_clause", - /* 155 */ "create_subtable_clause", - /* 156 */ "specific_tags_opt", - /* 157 */ "literal_list", - /* 158 */ "drop_table_clause", - /* 159 */ "col_name_list", - /* 160 */ "table_name", - /* 161 */ "column_def", - /* 162 */ "column_name", - /* 163 */ "type_name", - /* 164 */ "col_name", - /* 165 */ "index_name", - /* 166 */ "index_options", - /* 167 */ "func_list", - /* 168 */ "duration_literal", - /* 169 */ "sliding_opt", - /* 170 */ "func", - /* 171 */ "function_name", - /* 172 */ "expression_list", - /* 173 */ "query_expression", - /* 174 */ "literal", - /* 175 */ "table_alias", - /* 176 */ "column_alias", - /* 177 */ "expression", - /* 178 */ "column_reference", - /* 179 */ "subquery", - /* 180 */ "predicate", - /* 181 */ "compare_op", - /* 182 */ "in_op", - /* 183 */ "in_predicate_value", - /* 184 */ "boolean_value_expression", - /* 185 */ "boolean_primary", - /* 186 */ "common_expression", - /* 187 */ "from_clause", - /* 188 */ "table_reference_list", - /* 189 */ "table_reference", - /* 190 */ "table_primary", - /* 191 */ "joined_table", - /* 192 */ "alias_opt", - /* 193 */ "parenthesized_joined_table", - /* 194 */ "join_type", - /* 195 */ "search_condition", - /* 196 */ "query_specification", - /* 197 */ "set_quantifier_opt", - /* 198 */ "select_list", - /* 199 */ "where_clause_opt", - /* 200 */ "partition_by_clause_opt", - /* 201 */ "twindow_clause_opt", - /* 202 */ "group_by_clause_opt", - /* 203 */ "having_clause_opt", - /* 204 */ "select_sublist", - /* 205 */ "select_item", - /* 206 */ "fill_opt", - /* 207 */ "fill_mode", - /* 208 */ "group_by_list", - /* 209 */ "query_expression_body", - /* 210 */ "order_by_clause_opt", - /* 211 */ "slimit_clause_opt", - /* 212 */ "limit_clause_opt", - /* 213 */ "query_primary", - /* 214 */ "sort_specification_list", - /* 215 */ "sort_specification", - /* 216 */ "ordering_specification_opt", - /* 217 */ "null_ordering_opt", + /* 93 */ "TOPIC", + /* 94 */ "AS", + /* 95 */ "MNODES", + /* 96 */ "NK_FLOAT", + /* 97 */ "NK_BOOL", + /* 98 */ "NK_VARIABLE", + /* 99 */ "BETWEEN", + /* 100 */ "IS", + /* 101 */ "NULL", + /* 102 */ "NK_LT", + /* 103 */ "NK_GT", + /* 104 */ "NK_LE", + /* 105 */ "NK_GE", + /* 106 */ "NK_NE", + /* 107 */ "NK_EQ", + /* 108 */ "LIKE", + /* 109 */ "MATCH", + /* 110 */ "NMATCH", + /* 111 */ "IN", + /* 112 */ "FROM", + /* 113 */ "JOIN", + /* 114 */ "INNER", + /* 115 */ "SELECT", + /* 116 */ "DISTINCT", + /* 117 */ "WHERE", + /* 118 */ "PARTITION", + /* 119 */ "BY", + /* 120 */ "SESSION", + /* 121 */ "STATE_WINDOW", + /* 122 */ "SLIDING", + /* 123 */ "FILL", + /* 124 */ "VALUE", + /* 125 */ "NONE", + /* 126 */ "PREV", + /* 127 */ "LINEAR", + /* 128 */ "NEXT", + /* 129 */ "GROUP", + /* 130 */ "HAVING", + /* 131 */ "ORDER", + /* 132 */ "SLIMIT", + /* 133 */ "SOFFSET", + /* 134 */ "LIMIT", + /* 135 */ "OFFSET", + /* 136 */ "ASC", + /* 137 */ "DESC", + /* 138 */ "NULLS", + /* 139 */ "FIRST", + /* 140 */ "LAST", + /* 141 */ "cmd", + /* 142 */ "user_name", + /* 143 */ "dnode_endpoint", + /* 144 */ "dnode_host_name", + /* 145 */ "not_exists_opt", + /* 146 */ "db_name", + /* 147 */ "db_options", + /* 148 */ "exists_opt", + /* 149 */ "full_table_name", + /* 150 */ "column_def_list", + /* 151 */ "tags_def_opt", + /* 152 */ "table_options", + /* 153 */ "multi_create_clause", + /* 154 */ "tags_def", + /* 155 */ "multi_drop_clause", + /* 156 */ "create_subtable_clause", + /* 157 */ "specific_tags_opt", + /* 158 */ "literal_list", + /* 159 */ "drop_table_clause", + /* 160 */ "col_name_list", + /* 161 */ "table_name", + /* 162 */ "column_def", + /* 163 */ "column_name", + /* 164 */ "type_name", + /* 165 */ "col_name", + /* 166 */ "index_name", + /* 167 */ "index_options", + /* 168 */ "func_list", + /* 169 */ "duration_literal", + /* 170 */ "sliding_opt", + /* 171 */ "func", + /* 172 */ "function_name", + /* 173 */ "expression_list", + /* 174 */ "topic_name", + /* 175 */ "query_expression", + /* 176 */ "literal", + /* 177 */ "table_alias", + /* 178 */ "column_alias", + /* 179 */ "expression", + /* 180 */ "column_reference", + /* 181 */ "subquery", + /* 182 */ "predicate", + /* 183 */ "compare_op", + /* 184 */ "in_op", + /* 185 */ "in_predicate_value", + /* 186 */ "boolean_value_expression", + /* 187 */ "boolean_primary", + /* 188 */ "common_expression", + /* 189 */ "from_clause", + /* 190 */ "table_reference_list", + /* 191 */ "table_reference", + /* 192 */ "table_primary", + /* 193 */ "joined_table", + /* 194 */ "alias_opt", + /* 195 */ "parenthesized_joined_table", + /* 196 */ "join_type", + /* 197 */ "search_condition", + /* 198 */ "query_specification", + /* 199 */ "set_quantifier_opt", + /* 200 */ "select_list", + /* 201 */ "where_clause_opt", + /* 202 */ "partition_by_clause_opt", + /* 203 */ "twindow_clause_opt", + /* 204 */ "group_by_clause_opt", + /* 205 */ "having_clause_opt", + /* 206 */ "select_sublist", + /* 207 */ "select_item", + /* 208 */ "fill_opt", + /* 209 */ "fill_mode", + /* 210 */ "group_by_list", + /* 211 */ "query_expression_body", + /* 212 */ "order_by_clause_opt", + /* 213 */ "slimit_clause_opt", + /* 214 */ "limit_clause_opt", + /* 215 */ "query_primary", + /* 216 */ "sort_specification_list", + /* 217 */ "sort_specification", + /* 218 */ "ordering_specification_opt", + /* 219 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -852,240 +869,247 @@ static const char *const yyRuleName[] = { /* 11 */ "dnode_host_name ::= NK_ID", /* 12 */ "dnode_host_name ::= NK_IPTOKEN", /* 13 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 14 */ "cmd ::= SHOW QNODES", - /* 15 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", - /* 16 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 17 */ "cmd ::= SHOW DATABASES", - /* 18 */ "cmd ::= USE db_name", - /* 19 */ "not_exists_opt ::= IF NOT EXISTS", - /* 20 */ "not_exists_opt ::=", - /* 21 */ "exists_opt ::= IF EXISTS", - /* 22 */ "exists_opt ::=", - /* 23 */ "db_options ::=", - /* 24 */ "db_options ::= db_options BLOCKS NK_INTEGER", - /* 25 */ "db_options ::= db_options CACHE NK_INTEGER", - /* 26 */ "db_options ::= db_options CACHELAST NK_INTEGER", - /* 27 */ "db_options ::= db_options COMP NK_INTEGER", - /* 28 */ "db_options ::= db_options DAYS NK_INTEGER", - /* 29 */ "db_options ::= db_options FSYNC NK_INTEGER", - /* 30 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 31 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 32 */ "db_options ::= db_options KEEP NK_INTEGER", - /* 33 */ "db_options ::= db_options PRECISION NK_STRING", - /* 34 */ "db_options ::= db_options QUORUM NK_INTEGER", - /* 35 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 36 */ "db_options ::= db_options TTL NK_INTEGER", - /* 37 */ "db_options ::= db_options WAL NK_INTEGER", - /* 38 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 39 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 40 */ "db_options ::= db_options STREAM_MODE NK_INTEGER", - /* 41 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 42 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 43 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 44 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 45 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 46 */ "cmd ::= SHOW TABLES", - /* 47 */ "cmd ::= SHOW STABLES", - /* 48 */ "multi_create_clause ::= create_subtable_clause", - /* 49 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 50 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", - /* 51 */ "multi_drop_clause ::= drop_table_clause", - /* 52 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 53 */ "drop_table_clause ::= exists_opt full_table_name", - /* 54 */ "specific_tags_opt ::=", - /* 55 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", - /* 56 */ "full_table_name ::= table_name", - /* 57 */ "full_table_name ::= db_name NK_DOT table_name", - /* 58 */ "column_def_list ::= column_def", - /* 59 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 60 */ "column_def ::= column_name type_name", - /* 61 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 62 */ "type_name ::= BOOL", - /* 63 */ "type_name ::= TINYINT", - /* 64 */ "type_name ::= SMALLINT", - /* 65 */ "type_name ::= INT", - /* 66 */ "type_name ::= INTEGER", - /* 67 */ "type_name ::= BIGINT", - /* 68 */ "type_name ::= FLOAT", - /* 69 */ "type_name ::= DOUBLE", - /* 70 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 71 */ "type_name ::= TIMESTAMP", - /* 72 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 73 */ "type_name ::= TINYINT UNSIGNED", - /* 74 */ "type_name ::= SMALLINT UNSIGNED", - /* 75 */ "type_name ::= INT UNSIGNED", - /* 76 */ "type_name ::= BIGINT UNSIGNED", - /* 77 */ "type_name ::= JSON", - /* 78 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 79 */ "type_name ::= MEDIUMBLOB", - /* 80 */ "type_name ::= BLOB", - /* 81 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 82 */ "type_name ::= DECIMAL", - /* 83 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 84 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 85 */ "tags_def_opt ::=", - /* 86 */ "tags_def_opt ::= tags_def", - /* 87 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 88 */ "table_options ::=", - /* 89 */ "table_options ::= table_options COMMENT NK_STRING", - /* 90 */ "table_options ::= table_options KEEP NK_INTEGER", - /* 91 */ "table_options ::= table_options TTL NK_INTEGER", - /* 92 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 93 */ "col_name_list ::= col_name", - /* 94 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 95 */ "col_name ::= column_name", - /* 96 */ "cmd ::= CREATE SMA INDEX index_name ON table_name index_options", - /* 97 */ "cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP", - /* 98 */ "index_options ::=", - /* 99 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt", - /* 100 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt", - /* 101 */ "func_list ::= func", - /* 102 */ "func_list ::= func_list NK_COMMA func", - /* 103 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 104 */ "cmd ::= SHOW VGROUPS", - /* 105 */ "cmd ::= SHOW db_name NK_DOT VGROUPS", - /* 106 */ "cmd ::= SHOW MNODES", - /* 107 */ "cmd ::= query_expression", - /* 108 */ "literal ::= NK_INTEGER", - /* 109 */ "literal ::= NK_FLOAT", - /* 110 */ "literal ::= NK_STRING", - /* 111 */ "literal ::= NK_BOOL", - /* 112 */ "literal ::= TIMESTAMP NK_STRING", - /* 113 */ "literal ::= duration_literal", - /* 114 */ "duration_literal ::= NK_VARIABLE", - /* 115 */ "literal_list ::= literal", - /* 116 */ "literal_list ::= literal_list NK_COMMA literal", - /* 117 */ "db_name ::= NK_ID", - /* 118 */ "table_name ::= NK_ID", - /* 119 */ "column_name ::= NK_ID", - /* 120 */ "function_name ::= NK_ID", - /* 121 */ "table_alias ::= NK_ID", - /* 122 */ "column_alias ::= NK_ID", - /* 123 */ "user_name ::= NK_ID", - /* 124 */ "index_name ::= NK_ID", - /* 125 */ "expression ::= literal", - /* 126 */ "expression ::= column_reference", - /* 127 */ "expression ::= function_name NK_LP expression_list NK_RP", - /* 128 */ "expression ::= function_name NK_LP NK_STAR NK_RP", - /* 129 */ "expression ::= subquery", - /* 130 */ "expression ::= NK_LP expression NK_RP", - /* 131 */ "expression ::= NK_PLUS expression", - /* 132 */ "expression ::= NK_MINUS expression", - /* 133 */ "expression ::= expression NK_PLUS expression", - /* 134 */ "expression ::= expression NK_MINUS expression", - /* 135 */ "expression ::= expression NK_STAR expression", - /* 136 */ "expression ::= expression NK_SLASH expression", - /* 137 */ "expression ::= expression NK_REM expression", - /* 138 */ "expression_list ::= expression", - /* 139 */ "expression_list ::= expression_list NK_COMMA expression", - /* 140 */ "column_reference ::= column_name", - /* 141 */ "column_reference ::= table_name NK_DOT column_name", - /* 142 */ "predicate ::= expression compare_op expression", - /* 143 */ "predicate ::= expression BETWEEN expression AND expression", - /* 144 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 145 */ "predicate ::= expression IS NULL", - /* 146 */ "predicate ::= expression IS NOT NULL", - /* 147 */ "predicate ::= expression in_op in_predicate_value", - /* 148 */ "compare_op ::= NK_LT", - /* 149 */ "compare_op ::= NK_GT", - /* 150 */ "compare_op ::= NK_LE", - /* 151 */ "compare_op ::= NK_GE", - /* 152 */ "compare_op ::= NK_NE", - /* 153 */ "compare_op ::= NK_EQ", - /* 154 */ "compare_op ::= LIKE", - /* 155 */ "compare_op ::= NOT LIKE", - /* 156 */ "compare_op ::= MATCH", - /* 157 */ "compare_op ::= NMATCH", - /* 158 */ "in_op ::= IN", - /* 159 */ "in_op ::= NOT IN", - /* 160 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 161 */ "boolean_value_expression ::= boolean_primary", - /* 162 */ "boolean_value_expression ::= NOT boolean_primary", - /* 163 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 164 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 165 */ "boolean_primary ::= predicate", - /* 166 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 167 */ "common_expression ::= expression", - /* 168 */ "common_expression ::= boolean_value_expression", - /* 169 */ "from_clause ::= FROM table_reference_list", - /* 170 */ "table_reference_list ::= table_reference", - /* 171 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 172 */ "table_reference ::= table_primary", - /* 173 */ "table_reference ::= joined_table", - /* 174 */ "table_primary ::= table_name alias_opt", - /* 175 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 176 */ "table_primary ::= subquery alias_opt", - /* 177 */ "table_primary ::= parenthesized_joined_table", - /* 178 */ "alias_opt ::=", - /* 179 */ "alias_opt ::= table_alias", - /* 180 */ "alias_opt ::= AS table_alias", - /* 181 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 182 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 183 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 184 */ "join_type ::=", - /* 185 */ "join_type ::= INNER", - /* 186 */ "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", - /* 187 */ "set_quantifier_opt ::=", - /* 188 */ "set_quantifier_opt ::= DISTINCT", - /* 189 */ "set_quantifier_opt ::= ALL", - /* 190 */ "select_list ::= NK_STAR", - /* 191 */ "select_list ::= select_sublist", - /* 192 */ "select_sublist ::= select_item", - /* 193 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 194 */ "select_item ::= common_expression", - /* 195 */ "select_item ::= common_expression column_alias", - /* 196 */ "select_item ::= common_expression AS column_alias", - /* 197 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 198 */ "where_clause_opt ::=", - /* 199 */ "where_clause_opt ::= WHERE search_condition", - /* 200 */ "partition_by_clause_opt ::=", - /* 201 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 202 */ "twindow_clause_opt ::=", - /* 203 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", - /* 204 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", - /* 205 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 206 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 207 */ "sliding_opt ::=", - /* 208 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 209 */ "fill_opt ::=", - /* 210 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 211 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 212 */ "fill_mode ::= NONE", - /* 213 */ "fill_mode ::= PREV", - /* 214 */ "fill_mode ::= NULL", - /* 215 */ "fill_mode ::= LINEAR", - /* 216 */ "fill_mode ::= NEXT", - /* 217 */ "group_by_clause_opt ::=", - /* 218 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 219 */ "group_by_list ::= expression", - /* 220 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 221 */ "having_clause_opt ::=", - /* 222 */ "having_clause_opt ::= HAVING search_condition", - /* 223 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 224 */ "query_expression_body ::= query_primary", - /* 225 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 226 */ "query_primary ::= query_specification", - /* 227 */ "order_by_clause_opt ::=", - /* 228 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 229 */ "slimit_clause_opt ::=", - /* 230 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 231 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 232 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 233 */ "limit_clause_opt ::=", - /* 234 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 235 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 236 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 237 */ "subquery ::= NK_LP query_expression NK_RP", - /* 238 */ "search_condition ::= common_expression", - /* 239 */ "sort_specification_list ::= sort_specification", - /* 240 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 241 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 242 */ "ordering_specification_opt ::=", - /* 243 */ "ordering_specification_opt ::= ASC", - /* 244 */ "ordering_specification_opt ::= DESC", - /* 245 */ "null_ordering_opt ::=", - /* 246 */ "null_ordering_opt ::= NULLS FIRST", - /* 247 */ "null_ordering_opt ::= NULLS LAST", + /* 14 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", + /* 15 */ "cmd ::= SHOW QNODES", + /* 16 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 17 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 18 */ "cmd ::= SHOW DATABASES", + /* 19 */ "cmd ::= USE db_name", + /* 20 */ "cmd ::= ALTER DATABASE db_name db_options", + /* 21 */ "not_exists_opt ::= IF NOT EXISTS", + /* 22 */ "not_exists_opt ::=", + /* 23 */ "exists_opt ::= IF EXISTS", + /* 24 */ "exists_opt ::=", + /* 25 */ "db_options ::=", + /* 26 */ "db_options ::= db_options BLOCKS NK_INTEGER", + /* 27 */ "db_options ::= db_options CACHE NK_INTEGER", + /* 28 */ "db_options ::= db_options CACHELAST NK_INTEGER", + /* 29 */ "db_options ::= db_options COMP NK_INTEGER", + /* 30 */ "db_options ::= db_options DAYS NK_INTEGER", + /* 31 */ "db_options ::= db_options FSYNC NK_INTEGER", + /* 32 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 33 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 34 */ "db_options ::= db_options KEEP NK_INTEGER", + /* 35 */ "db_options ::= db_options PRECISION NK_STRING", + /* 36 */ "db_options ::= db_options QUORUM NK_INTEGER", + /* 37 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 38 */ "db_options ::= db_options TTL NK_INTEGER", + /* 39 */ "db_options ::= db_options WAL NK_INTEGER", + /* 40 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 41 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 42 */ "db_options ::= db_options STREAM_MODE NK_INTEGER", + /* 43 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 44 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 45 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 46 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 47 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 48 */ "cmd ::= SHOW TABLES", + /* 49 */ "cmd ::= SHOW STABLES", + /* 50 */ "multi_create_clause ::= create_subtable_clause", + /* 51 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 52 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", + /* 53 */ "multi_drop_clause ::= drop_table_clause", + /* 54 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 55 */ "drop_table_clause ::= exists_opt full_table_name", + /* 56 */ "specific_tags_opt ::=", + /* 57 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", + /* 58 */ "full_table_name ::= table_name", + /* 59 */ "full_table_name ::= db_name NK_DOT table_name", + /* 60 */ "column_def_list ::= column_def", + /* 61 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 62 */ "column_def ::= column_name type_name", + /* 63 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 64 */ "type_name ::= BOOL", + /* 65 */ "type_name ::= TINYINT", + /* 66 */ "type_name ::= SMALLINT", + /* 67 */ "type_name ::= INT", + /* 68 */ "type_name ::= INTEGER", + /* 69 */ "type_name ::= BIGINT", + /* 70 */ "type_name ::= FLOAT", + /* 71 */ "type_name ::= DOUBLE", + /* 72 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 73 */ "type_name ::= TIMESTAMP", + /* 74 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 75 */ "type_name ::= TINYINT UNSIGNED", + /* 76 */ "type_name ::= SMALLINT UNSIGNED", + /* 77 */ "type_name ::= INT UNSIGNED", + /* 78 */ "type_name ::= BIGINT UNSIGNED", + /* 79 */ "type_name ::= JSON", + /* 80 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 81 */ "type_name ::= MEDIUMBLOB", + /* 82 */ "type_name ::= BLOB", + /* 83 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 84 */ "type_name ::= DECIMAL", + /* 85 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 86 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 87 */ "tags_def_opt ::=", + /* 88 */ "tags_def_opt ::= tags_def", + /* 89 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 90 */ "table_options ::=", + /* 91 */ "table_options ::= table_options COMMENT NK_STRING", + /* 92 */ "table_options ::= table_options KEEP NK_INTEGER", + /* 93 */ "table_options ::= table_options TTL NK_INTEGER", + /* 94 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 95 */ "col_name_list ::= col_name", + /* 96 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 97 */ "col_name ::= column_name", + /* 98 */ "cmd ::= CREATE SMA INDEX index_name ON table_name index_options", + /* 99 */ "cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP", + /* 100 */ "cmd ::= DROP INDEX index_name ON table_name", + /* 101 */ "index_options ::=", + /* 102 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt", + /* 103 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt", + /* 104 */ "func_list ::= func", + /* 105 */ "func_list ::= func_list NK_COMMA func", + /* 106 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 107 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression", + /* 108 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name", + /* 109 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 110 */ "cmd ::= SHOW VGROUPS", + /* 111 */ "cmd ::= SHOW db_name NK_DOT VGROUPS", + /* 112 */ "cmd ::= SHOW MNODES", + /* 113 */ "cmd ::= query_expression", + /* 114 */ "literal ::= NK_INTEGER", + /* 115 */ "literal ::= NK_FLOAT", + /* 116 */ "literal ::= NK_STRING", + /* 117 */ "literal ::= NK_BOOL", + /* 118 */ "literal ::= TIMESTAMP NK_STRING", + /* 119 */ "literal ::= duration_literal", + /* 120 */ "duration_literal ::= NK_VARIABLE", + /* 121 */ "literal_list ::= literal", + /* 122 */ "literal_list ::= literal_list NK_COMMA literal", + /* 123 */ "db_name ::= NK_ID", + /* 124 */ "table_name ::= NK_ID", + /* 125 */ "column_name ::= NK_ID", + /* 126 */ "function_name ::= NK_ID", + /* 127 */ "table_alias ::= NK_ID", + /* 128 */ "column_alias ::= NK_ID", + /* 129 */ "user_name ::= NK_ID", + /* 130 */ "index_name ::= NK_ID", + /* 131 */ "topic_name ::= NK_ID", + /* 132 */ "expression ::= literal", + /* 133 */ "expression ::= column_reference", + /* 134 */ "expression ::= function_name NK_LP expression_list NK_RP", + /* 135 */ "expression ::= function_name NK_LP NK_STAR NK_RP", + /* 136 */ "expression ::= subquery", + /* 137 */ "expression ::= NK_LP expression NK_RP", + /* 138 */ "expression ::= NK_PLUS expression", + /* 139 */ "expression ::= NK_MINUS expression", + /* 140 */ "expression ::= expression NK_PLUS expression", + /* 141 */ "expression ::= expression NK_MINUS expression", + /* 142 */ "expression ::= expression NK_STAR expression", + /* 143 */ "expression ::= expression NK_SLASH expression", + /* 144 */ "expression ::= expression NK_REM expression", + /* 145 */ "expression_list ::= expression", + /* 146 */ "expression_list ::= expression_list NK_COMMA expression", + /* 147 */ "column_reference ::= column_name", + /* 148 */ "column_reference ::= table_name NK_DOT column_name", + /* 149 */ "predicate ::= expression compare_op expression", + /* 150 */ "predicate ::= expression BETWEEN expression AND expression", + /* 151 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 152 */ "predicate ::= expression IS NULL", + /* 153 */ "predicate ::= expression IS NOT NULL", + /* 154 */ "predicate ::= expression in_op in_predicate_value", + /* 155 */ "compare_op ::= NK_LT", + /* 156 */ "compare_op ::= NK_GT", + /* 157 */ "compare_op ::= NK_LE", + /* 158 */ "compare_op ::= NK_GE", + /* 159 */ "compare_op ::= NK_NE", + /* 160 */ "compare_op ::= NK_EQ", + /* 161 */ "compare_op ::= LIKE", + /* 162 */ "compare_op ::= NOT LIKE", + /* 163 */ "compare_op ::= MATCH", + /* 164 */ "compare_op ::= NMATCH", + /* 165 */ "in_op ::= IN", + /* 166 */ "in_op ::= NOT IN", + /* 167 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 168 */ "boolean_value_expression ::= boolean_primary", + /* 169 */ "boolean_value_expression ::= NOT boolean_primary", + /* 170 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 171 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 172 */ "boolean_primary ::= predicate", + /* 173 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 174 */ "common_expression ::= expression", + /* 175 */ "common_expression ::= boolean_value_expression", + /* 176 */ "from_clause ::= FROM table_reference_list", + /* 177 */ "table_reference_list ::= table_reference", + /* 178 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 179 */ "table_reference ::= table_primary", + /* 180 */ "table_reference ::= joined_table", + /* 181 */ "table_primary ::= table_name alias_opt", + /* 182 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 183 */ "table_primary ::= subquery alias_opt", + /* 184 */ "table_primary ::= parenthesized_joined_table", + /* 185 */ "alias_opt ::=", + /* 186 */ "alias_opt ::= table_alias", + /* 187 */ "alias_opt ::= AS table_alias", + /* 188 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 189 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 190 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 191 */ "join_type ::=", + /* 192 */ "join_type ::= INNER", + /* 193 */ "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", + /* 194 */ "set_quantifier_opt ::=", + /* 195 */ "set_quantifier_opt ::= DISTINCT", + /* 196 */ "set_quantifier_opt ::= ALL", + /* 197 */ "select_list ::= NK_STAR", + /* 198 */ "select_list ::= select_sublist", + /* 199 */ "select_sublist ::= select_item", + /* 200 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 201 */ "select_item ::= common_expression", + /* 202 */ "select_item ::= common_expression column_alias", + /* 203 */ "select_item ::= common_expression AS column_alias", + /* 204 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 205 */ "where_clause_opt ::=", + /* 206 */ "where_clause_opt ::= WHERE search_condition", + /* 207 */ "partition_by_clause_opt ::=", + /* 208 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 209 */ "twindow_clause_opt ::=", + /* 210 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", + /* 211 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", + /* 212 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 213 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 214 */ "sliding_opt ::=", + /* 215 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 216 */ "fill_opt ::=", + /* 217 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 218 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 219 */ "fill_mode ::= NONE", + /* 220 */ "fill_mode ::= PREV", + /* 221 */ "fill_mode ::= NULL", + /* 222 */ "fill_mode ::= LINEAR", + /* 223 */ "fill_mode ::= NEXT", + /* 224 */ "group_by_clause_opt ::=", + /* 225 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 226 */ "group_by_list ::= expression", + /* 227 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 228 */ "having_clause_opt ::=", + /* 229 */ "having_clause_opt ::= HAVING search_condition", + /* 230 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 231 */ "query_expression_body ::= query_primary", + /* 232 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 233 */ "query_primary ::= query_specification", + /* 234 */ "order_by_clause_opt ::=", + /* 235 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 236 */ "slimit_clause_opt ::=", + /* 237 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 238 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 239 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 240 */ "limit_clause_opt ::=", + /* 241 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 242 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 243 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 244 */ "subquery ::= NK_LP query_expression NK_RP", + /* 245 */ "search_condition ::= common_expression", + /* 246 */ "sort_specification_list ::= sort_specification", + /* 247 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 248 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 249 */ "ordering_specification_opt ::=", + /* 250 */ "ordering_specification_opt ::= ASC", + /* 251 */ "ordering_specification_opt ::= DESC", + /* 252 */ "null_ordering_opt ::=", + /* 253 */ "null_ordering_opt ::= NULLS FIRST", + /* 254 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -1212,120 +1236,121 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 140: /* cmd */ - case 146: /* db_options */ - case 148: /* full_table_name */ - case 151: /* table_options */ - case 155: /* create_subtable_clause */ - case 158: /* drop_table_clause */ - case 161: /* column_def */ - case 164: /* col_name */ - case 166: /* index_options */ - case 168: /* duration_literal */ - case 169: /* sliding_opt */ - case 170: /* func */ - case 173: /* query_expression */ - case 174: /* literal */ - case 177: /* expression */ - case 178: /* column_reference */ - case 179: /* subquery */ - case 180: /* predicate */ - case 183: /* in_predicate_value */ - case 184: /* boolean_value_expression */ - case 185: /* boolean_primary */ - case 186: /* common_expression */ - case 187: /* from_clause */ - case 188: /* table_reference_list */ - case 189: /* table_reference */ - case 190: /* table_primary */ - case 191: /* joined_table */ - case 193: /* parenthesized_joined_table */ - case 195: /* search_condition */ - case 196: /* query_specification */ - case 199: /* where_clause_opt */ - case 201: /* twindow_clause_opt */ - case 203: /* having_clause_opt */ - case 205: /* select_item */ - case 206: /* fill_opt */ - case 209: /* query_expression_body */ - case 211: /* slimit_clause_opt */ - case 212: /* limit_clause_opt */ - case 213: /* query_primary */ - case 215: /* sort_specification */ + case 141: /* cmd */ + case 147: /* db_options */ + case 149: /* full_table_name */ + case 152: /* table_options */ + case 156: /* create_subtable_clause */ + case 159: /* drop_table_clause */ + case 162: /* column_def */ + case 165: /* col_name */ + case 167: /* index_options */ + case 169: /* duration_literal */ + case 170: /* sliding_opt */ + case 171: /* func */ + case 175: /* query_expression */ + case 176: /* literal */ + case 179: /* expression */ + case 180: /* column_reference */ + case 181: /* subquery */ + case 182: /* predicate */ + case 185: /* in_predicate_value */ + case 186: /* boolean_value_expression */ + case 187: /* boolean_primary */ + case 188: /* common_expression */ + case 189: /* from_clause */ + case 190: /* table_reference_list */ + case 191: /* table_reference */ + case 192: /* table_primary */ + case 193: /* joined_table */ + case 195: /* parenthesized_joined_table */ + case 197: /* search_condition */ + case 198: /* query_specification */ + case 201: /* where_clause_opt */ + case 203: /* twindow_clause_opt */ + case 205: /* having_clause_opt */ + case 207: /* select_item */ + case 208: /* fill_opt */ + case 211: /* query_expression_body */ + case 213: /* slimit_clause_opt */ + case 214: /* limit_clause_opt */ + case 215: /* query_primary */ + case 217: /* sort_specification */ { - nodesDestroyNode((yypminor->yy68)); + nodesDestroyNode((yypminor->yy432)); } break; - case 141: /* user_name */ - case 142: /* dnode_endpoint */ - case 143: /* dnode_host_name */ - case 145: /* db_name */ - case 160: /* table_name */ - case 162: /* column_name */ - case 165: /* index_name */ - case 171: /* function_name */ - case 175: /* table_alias */ - case 176: /* column_alias */ - case 192: /* alias_opt */ + case 142: /* user_name */ + case 143: /* dnode_endpoint */ + case 144: /* dnode_host_name */ + case 146: /* db_name */ + case 161: /* table_name */ + case 163: /* column_name */ + case 166: /* index_name */ + case 172: /* function_name */ + case 174: /* topic_name */ + case 177: /* table_alias */ + case 178: /* column_alias */ + case 194: /* alias_opt */ { } break; - case 144: /* not_exists_opt */ - case 147: /* exists_opt */ - case 197: /* set_quantifier_opt */ + case 145: /* not_exists_opt */ + case 148: /* exists_opt */ + case 199: /* set_quantifier_opt */ { } break; - case 149: /* column_def_list */ - case 150: /* tags_def_opt */ - case 152: /* multi_create_clause */ - case 153: /* tags_def */ - case 154: /* multi_drop_clause */ - case 156: /* specific_tags_opt */ - case 157: /* literal_list */ - case 159: /* col_name_list */ - case 167: /* func_list */ - case 172: /* expression_list */ - case 198: /* select_list */ - case 200: /* partition_by_clause_opt */ - case 202: /* group_by_clause_opt */ - case 204: /* select_sublist */ - case 208: /* group_by_list */ - case 210: /* order_by_clause_opt */ - case 214: /* sort_specification_list */ + case 150: /* column_def_list */ + case 151: /* tags_def_opt */ + case 153: /* multi_create_clause */ + case 154: /* tags_def */ + case 155: /* multi_drop_clause */ + case 157: /* specific_tags_opt */ + case 158: /* literal_list */ + case 160: /* col_name_list */ + case 168: /* func_list */ + case 173: /* expression_list */ + case 200: /* select_list */ + case 202: /* partition_by_clause_opt */ + case 204: /* group_by_clause_opt */ + case 206: /* select_sublist */ + case 210: /* group_by_list */ + case 212: /* order_by_clause_opt */ + case 216: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy40)); + nodesDestroyList((yypminor->yy24)); } break; - case 163: /* type_name */ + case 164: /* type_name */ { } break; - case 181: /* compare_op */ - case 182: /* in_op */ + case 183: /* compare_op */ + case 184: /* in_op */ { } break; - case 194: /* join_type */ + case 196: /* join_type */ { } break; - case 207: /* fill_mode */ + case 209: /* fill_mode */ { } break; - case 216: /* ordering_specification_opt */ + case 218: /* ordering_specification_opt */ { } break; - case 217: /* null_ordering_opt */ + case 219: /* null_ordering_opt */ { } @@ -1624,254 +1649,261 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 140, -5 }, /* (0) cmd ::= CREATE USER user_name PASS NK_STRING */ - { 140, -5 }, /* (1) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 140, -5 }, /* (2) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ - { 140, -3 }, /* (3) cmd ::= DROP USER user_name */ - { 140, -2 }, /* (4) cmd ::= SHOW USERS */ - { 140, -3 }, /* (5) cmd ::= CREATE DNODE dnode_endpoint */ - { 140, -5 }, /* (6) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ - { 140, -3 }, /* (7) cmd ::= DROP DNODE NK_INTEGER */ - { 140, -3 }, /* (8) cmd ::= DROP DNODE dnode_endpoint */ - { 140, -2 }, /* (9) cmd ::= SHOW DNODES */ - { 142, -1 }, /* (10) dnode_endpoint ::= NK_STRING */ - { 143, -1 }, /* (11) dnode_host_name ::= NK_ID */ - { 143, -1 }, /* (12) dnode_host_name ::= NK_IPTOKEN */ - { 140, -5 }, /* (13) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 140, -2 }, /* (14) cmd ::= SHOW QNODES */ - { 140, -5 }, /* (15) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 140, -4 }, /* (16) cmd ::= DROP DATABASE exists_opt db_name */ - { 140, -2 }, /* (17) cmd ::= SHOW DATABASES */ - { 140, -2 }, /* (18) cmd ::= USE db_name */ - { 144, -3 }, /* (19) not_exists_opt ::= IF NOT EXISTS */ - { 144, 0 }, /* (20) not_exists_opt ::= */ - { 147, -2 }, /* (21) exists_opt ::= IF EXISTS */ - { 147, 0 }, /* (22) exists_opt ::= */ - { 146, 0 }, /* (23) db_options ::= */ - { 146, -3 }, /* (24) db_options ::= db_options BLOCKS NK_INTEGER */ - { 146, -3 }, /* (25) db_options ::= db_options CACHE NK_INTEGER */ - { 146, -3 }, /* (26) db_options ::= db_options CACHELAST NK_INTEGER */ - { 146, -3 }, /* (27) db_options ::= db_options COMP NK_INTEGER */ - { 146, -3 }, /* (28) db_options ::= db_options DAYS NK_INTEGER */ - { 146, -3 }, /* (29) db_options ::= db_options FSYNC NK_INTEGER */ - { 146, -3 }, /* (30) db_options ::= db_options MAXROWS NK_INTEGER */ - { 146, -3 }, /* (31) db_options ::= db_options MINROWS NK_INTEGER */ - { 146, -3 }, /* (32) db_options ::= db_options KEEP NK_INTEGER */ - { 146, -3 }, /* (33) db_options ::= db_options PRECISION NK_STRING */ - { 146, -3 }, /* (34) db_options ::= db_options QUORUM NK_INTEGER */ - { 146, -3 }, /* (35) db_options ::= db_options REPLICA NK_INTEGER */ - { 146, -3 }, /* (36) db_options ::= db_options TTL NK_INTEGER */ - { 146, -3 }, /* (37) db_options ::= db_options WAL NK_INTEGER */ - { 146, -3 }, /* (38) db_options ::= db_options VGROUPS NK_INTEGER */ - { 146, -3 }, /* (39) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 146, -3 }, /* (40) db_options ::= db_options STREAM_MODE NK_INTEGER */ - { 140, -9 }, /* (41) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 140, -3 }, /* (42) cmd ::= CREATE TABLE multi_create_clause */ - { 140, -9 }, /* (43) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 140, -3 }, /* (44) cmd ::= DROP TABLE multi_drop_clause */ - { 140, -4 }, /* (45) cmd ::= DROP STABLE exists_opt full_table_name */ - { 140, -2 }, /* (46) cmd ::= SHOW TABLES */ - { 140, -2 }, /* (47) cmd ::= SHOW STABLES */ - { 152, -1 }, /* (48) multi_create_clause ::= create_subtable_clause */ - { 152, -2 }, /* (49) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 155, -9 }, /* (50) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ - { 154, -1 }, /* (51) multi_drop_clause ::= drop_table_clause */ - { 154, -2 }, /* (52) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 158, -2 }, /* (53) drop_table_clause ::= exists_opt full_table_name */ - { 156, 0 }, /* (54) specific_tags_opt ::= */ - { 156, -3 }, /* (55) specific_tags_opt ::= NK_LP col_name_list NK_RP */ - { 148, -1 }, /* (56) full_table_name ::= table_name */ - { 148, -3 }, /* (57) full_table_name ::= db_name NK_DOT table_name */ - { 149, -1 }, /* (58) column_def_list ::= column_def */ - { 149, -3 }, /* (59) column_def_list ::= column_def_list NK_COMMA column_def */ - { 161, -2 }, /* (60) column_def ::= column_name type_name */ - { 161, -4 }, /* (61) column_def ::= column_name type_name COMMENT NK_STRING */ - { 163, -1 }, /* (62) type_name ::= BOOL */ - { 163, -1 }, /* (63) type_name ::= TINYINT */ - { 163, -1 }, /* (64) type_name ::= SMALLINT */ - { 163, -1 }, /* (65) type_name ::= INT */ - { 163, -1 }, /* (66) type_name ::= INTEGER */ - { 163, -1 }, /* (67) type_name ::= BIGINT */ - { 163, -1 }, /* (68) type_name ::= FLOAT */ - { 163, -1 }, /* (69) type_name ::= DOUBLE */ - { 163, -4 }, /* (70) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 163, -1 }, /* (71) type_name ::= TIMESTAMP */ - { 163, -4 }, /* (72) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 163, -2 }, /* (73) type_name ::= TINYINT UNSIGNED */ - { 163, -2 }, /* (74) type_name ::= SMALLINT UNSIGNED */ - { 163, -2 }, /* (75) type_name ::= INT UNSIGNED */ - { 163, -2 }, /* (76) type_name ::= BIGINT UNSIGNED */ - { 163, -1 }, /* (77) type_name ::= JSON */ - { 163, -4 }, /* (78) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 163, -1 }, /* (79) type_name ::= MEDIUMBLOB */ - { 163, -1 }, /* (80) type_name ::= BLOB */ - { 163, -4 }, /* (81) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 163, -1 }, /* (82) type_name ::= DECIMAL */ - { 163, -4 }, /* (83) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 163, -6 }, /* (84) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 150, 0 }, /* (85) tags_def_opt ::= */ - { 150, -1 }, /* (86) tags_def_opt ::= tags_def */ - { 153, -4 }, /* (87) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 151, 0 }, /* (88) table_options ::= */ - { 151, -3 }, /* (89) table_options ::= table_options COMMENT NK_STRING */ - { 151, -3 }, /* (90) table_options ::= table_options KEEP NK_INTEGER */ - { 151, -3 }, /* (91) table_options ::= table_options TTL NK_INTEGER */ - { 151, -5 }, /* (92) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 159, -1 }, /* (93) col_name_list ::= col_name */ - { 159, -3 }, /* (94) col_name_list ::= col_name_list NK_COMMA col_name */ - { 164, -1 }, /* (95) col_name ::= column_name */ - { 140, -7 }, /* (96) cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ - { 140, -9 }, /* (97) cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */ - { 166, 0 }, /* (98) index_options ::= */ - { 166, -9 }, /* (99) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ - { 166, -11 }, /* (100) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ - { 167, -1 }, /* (101) func_list ::= func */ - { 167, -3 }, /* (102) func_list ::= func_list NK_COMMA func */ - { 170, -4 }, /* (103) func ::= function_name NK_LP expression_list NK_RP */ - { 140, -2 }, /* (104) cmd ::= SHOW VGROUPS */ - { 140, -4 }, /* (105) cmd ::= SHOW db_name NK_DOT VGROUPS */ - { 140, -2 }, /* (106) cmd ::= SHOW MNODES */ - { 140, -1 }, /* (107) cmd ::= query_expression */ - { 174, -1 }, /* (108) literal ::= NK_INTEGER */ - { 174, -1 }, /* (109) literal ::= NK_FLOAT */ - { 174, -1 }, /* (110) literal ::= NK_STRING */ - { 174, -1 }, /* (111) literal ::= NK_BOOL */ - { 174, -2 }, /* (112) literal ::= TIMESTAMP NK_STRING */ - { 174, -1 }, /* (113) literal ::= duration_literal */ - { 168, -1 }, /* (114) duration_literal ::= NK_VARIABLE */ - { 157, -1 }, /* (115) literal_list ::= literal */ - { 157, -3 }, /* (116) literal_list ::= literal_list NK_COMMA literal */ - { 145, -1 }, /* (117) db_name ::= NK_ID */ - { 160, -1 }, /* (118) table_name ::= NK_ID */ - { 162, -1 }, /* (119) column_name ::= NK_ID */ - { 171, -1 }, /* (120) function_name ::= NK_ID */ - { 175, -1 }, /* (121) table_alias ::= NK_ID */ - { 176, -1 }, /* (122) column_alias ::= NK_ID */ - { 141, -1 }, /* (123) user_name ::= NK_ID */ - { 165, -1 }, /* (124) index_name ::= NK_ID */ - { 177, -1 }, /* (125) expression ::= literal */ - { 177, -1 }, /* (126) expression ::= column_reference */ - { 177, -4 }, /* (127) expression ::= function_name NK_LP expression_list NK_RP */ - { 177, -4 }, /* (128) expression ::= function_name NK_LP NK_STAR NK_RP */ - { 177, -1 }, /* (129) expression ::= subquery */ - { 177, -3 }, /* (130) expression ::= NK_LP expression NK_RP */ - { 177, -2 }, /* (131) expression ::= NK_PLUS expression */ - { 177, -2 }, /* (132) expression ::= NK_MINUS expression */ - { 177, -3 }, /* (133) expression ::= expression NK_PLUS expression */ - { 177, -3 }, /* (134) expression ::= expression NK_MINUS expression */ - { 177, -3 }, /* (135) expression ::= expression NK_STAR expression */ - { 177, -3 }, /* (136) expression ::= expression NK_SLASH expression */ - { 177, -3 }, /* (137) expression ::= expression NK_REM expression */ - { 172, -1 }, /* (138) expression_list ::= expression */ - { 172, -3 }, /* (139) expression_list ::= expression_list NK_COMMA expression */ - { 178, -1 }, /* (140) column_reference ::= column_name */ - { 178, -3 }, /* (141) column_reference ::= table_name NK_DOT column_name */ - { 180, -3 }, /* (142) predicate ::= expression compare_op expression */ - { 180, -5 }, /* (143) predicate ::= expression BETWEEN expression AND expression */ - { 180, -6 }, /* (144) predicate ::= expression NOT BETWEEN expression AND expression */ - { 180, -3 }, /* (145) predicate ::= expression IS NULL */ - { 180, -4 }, /* (146) predicate ::= expression IS NOT NULL */ - { 180, -3 }, /* (147) predicate ::= expression in_op in_predicate_value */ - { 181, -1 }, /* (148) compare_op ::= NK_LT */ - { 181, -1 }, /* (149) compare_op ::= NK_GT */ - { 181, -1 }, /* (150) compare_op ::= NK_LE */ - { 181, -1 }, /* (151) compare_op ::= NK_GE */ - { 181, -1 }, /* (152) compare_op ::= NK_NE */ - { 181, -1 }, /* (153) compare_op ::= NK_EQ */ - { 181, -1 }, /* (154) compare_op ::= LIKE */ - { 181, -2 }, /* (155) compare_op ::= NOT LIKE */ - { 181, -1 }, /* (156) compare_op ::= MATCH */ - { 181, -1 }, /* (157) compare_op ::= NMATCH */ - { 182, -1 }, /* (158) in_op ::= IN */ - { 182, -2 }, /* (159) in_op ::= NOT IN */ - { 183, -3 }, /* (160) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 184, -1 }, /* (161) boolean_value_expression ::= boolean_primary */ - { 184, -2 }, /* (162) boolean_value_expression ::= NOT boolean_primary */ - { 184, -3 }, /* (163) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 184, -3 }, /* (164) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 185, -1 }, /* (165) boolean_primary ::= predicate */ - { 185, -3 }, /* (166) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 186, -1 }, /* (167) common_expression ::= expression */ - { 186, -1 }, /* (168) common_expression ::= boolean_value_expression */ - { 187, -2 }, /* (169) from_clause ::= FROM table_reference_list */ - { 188, -1 }, /* (170) table_reference_list ::= table_reference */ - { 188, -3 }, /* (171) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 189, -1 }, /* (172) table_reference ::= table_primary */ - { 189, -1 }, /* (173) table_reference ::= joined_table */ - { 190, -2 }, /* (174) table_primary ::= table_name alias_opt */ - { 190, -4 }, /* (175) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 190, -2 }, /* (176) table_primary ::= subquery alias_opt */ - { 190, -1 }, /* (177) table_primary ::= parenthesized_joined_table */ - { 192, 0 }, /* (178) alias_opt ::= */ - { 192, -1 }, /* (179) alias_opt ::= table_alias */ - { 192, -2 }, /* (180) alias_opt ::= AS table_alias */ - { 193, -3 }, /* (181) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 193, -3 }, /* (182) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 191, -6 }, /* (183) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 194, 0 }, /* (184) join_type ::= */ - { 194, -1 }, /* (185) join_type ::= INNER */ - { 196, -9 }, /* (186) 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 */ - { 197, 0 }, /* (187) set_quantifier_opt ::= */ - { 197, -1 }, /* (188) set_quantifier_opt ::= DISTINCT */ - { 197, -1 }, /* (189) set_quantifier_opt ::= ALL */ - { 198, -1 }, /* (190) select_list ::= NK_STAR */ - { 198, -1 }, /* (191) select_list ::= select_sublist */ - { 204, -1 }, /* (192) select_sublist ::= select_item */ - { 204, -3 }, /* (193) select_sublist ::= select_sublist NK_COMMA select_item */ - { 205, -1 }, /* (194) select_item ::= common_expression */ - { 205, -2 }, /* (195) select_item ::= common_expression column_alias */ - { 205, -3 }, /* (196) select_item ::= common_expression AS column_alias */ - { 205, -3 }, /* (197) select_item ::= table_name NK_DOT NK_STAR */ - { 199, 0 }, /* (198) where_clause_opt ::= */ - { 199, -2 }, /* (199) where_clause_opt ::= WHERE search_condition */ - { 200, 0 }, /* (200) partition_by_clause_opt ::= */ - { 200, -3 }, /* (201) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 201, 0 }, /* (202) twindow_clause_opt ::= */ - { 201, -6 }, /* (203) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ - { 201, -4 }, /* (204) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ - { 201, -6 }, /* (205) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 201, -8 }, /* (206) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 169, 0 }, /* (207) sliding_opt ::= */ - { 169, -4 }, /* (208) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 206, 0 }, /* (209) fill_opt ::= */ - { 206, -4 }, /* (210) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 206, -6 }, /* (211) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 207, -1 }, /* (212) fill_mode ::= NONE */ - { 207, -1 }, /* (213) fill_mode ::= PREV */ - { 207, -1 }, /* (214) fill_mode ::= NULL */ - { 207, -1 }, /* (215) fill_mode ::= LINEAR */ - { 207, -1 }, /* (216) fill_mode ::= NEXT */ - { 202, 0 }, /* (217) group_by_clause_opt ::= */ - { 202, -3 }, /* (218) group_by_clause_opt ::= GROUP BY group_by_list */ - { 208, -1 }, /* (219) group_by_list ::= expression */ - { 208, -3 }, /* (220) group_by_list ::= group_by_list NK_COMMA expression */ - { 203, 0 }, /* (221) having_clause_opt ::= */ - { 203, -2 }, /* (222) having_clause_opt ::= HAVING search_condition */ - { 173, -4 }, /* (223) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 209, -1 }, /* (224) query_expression_body ::= query_primary */ - { 209, -4 }, /* (225) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 213, -1 }, /* (226) query_primary ::= query_specification */ - { 210, 0 }, /* (227) order_by_clause_opt ::= */ - { 210, -3 }, /* (228) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 211, 0 }, /* (229) slimit_clause_opt ::= */ - { 211, -2 }, /* (230) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 211, -4 }, /* (231) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 211, -4 }, /* (232) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 212, 0 }, /* (233) limit_clause_opt ::= */ - { 212, -2 }, /* (234) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 212, -4 }, /* (235) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 212, -4 }, /* (236) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 179, -3 }, /* (237) subquery ::= NK_LP query_expression NK_RP */ - { 195, -1 }, /* (238) search_condition ::= common_expression */ - { 214, -1 }, /* (239) sort_specification_list ::= sort_specification */ - { 214, -3 }, /* (240) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 215, -3 }, /* (241) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 216, 0 }, /* (242) ordering_specification_opt ::= */ - { 216, -1 }, /* (243) ordering_specification_opt ::= ASC */ - { 216, -1 }, /* (244) ordering_specification_opt ::= DESC */ - { 217, 0 }, /* (245) null_ordering_opt ::= */ - { 217, -2 }, /* (246) null_ordering_opt ::= NULLS FIRST */ - { 217, -2 }, /* (247) null_ordering_opt ::= NULLS LAST */ + { 141, -5 }, /* (0) cmd ::= CREATE USER user_name PASS NK_STRING */ + { 141, -5 }, /* (1) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 141, -5 }, /* (2) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ + { 141, -3 }, /* (3) cmd ::= DROP USER user_name */ + { 141, -2 }, /* (4) cmd ::= SHOW USERS */ + { 141, -3 }, /* (5) cmd ::= CREATE DNODE dnode_endpoint */ + { 141, -5 }, /* (6) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ + { 141, -3 }, /* (7) cmd ::= DROP DNODE NK_INTEGER */ + { 141, -3 }, /* (8) cmd ::= DROP DNODE dnode_endpoint */ + { 141, -2 }, /* (9) cmd ::= SHOW DNODES */ + { 143, -1 }, /* (10) dnode_endpoint ::= NK_STRING */ + { 144, -1 }, /* (11) dnode_host_name ::= NK_ID */ + { 144, -1 }, /* (12) dnode_host_name ::= NK_IPTOKEN */ + { 141, -5 }, /* (13) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 141, -5 }, /* (14) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 141, -2 }, /* (15) cmd ::= SHOW QNODES */ + { 141, -5 }, /* (16) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 141, -4 }, /* (17) cmd ::= DROP DATABASE exists_opt db_name */ + { 141, -2 }, /* (18) cmd ::= SHOW DATABASES */ + { 141, -2 }, /* (19) cmd ::= USE db_name */ + { 141, -4 }, /* (20) cmd ::= ALTER DATABASE db_name db_options */ + { 145, -3 }, /* (21) not_exists_opt ::= IF NOT EXISTS */ + { 145, 0 }, /* (22) not_exists_opt ::= */ + { 148, -2 }, /* (23) exists_opt ::= IF EXISTS */ + { 148, 0 }, /* (24) exists_opt ::= */ + { 147, 0 }, /* (25) db_options ::= */ + { 147, -3 }, /* (26) db_options ::= db_options BLOCKS NK_INTEGER */ + { 147, -3 }, /* (27) db_options ::= db_options CACHE NK_INTEGER */ + { 147, -3 }, /* (28) db_options ::= db_options CACHELAST NK_INTEGER */ + { 147, -3 }, /* (29) db_options ::= db_options COMP NK_INTEGER */ + { 147, -3 }, /* (30) db_options ::= db_options DAYS NK_INTEGER */ + { 147, -3 }, /* (31) db_options ::= db_options FSYNC NK_INTEGER */ + { 147, -3 }, /* (32) db_options ::= db_options MAXROWS NK_INTEGER */ + { 147, -3 }, /* (33) db_options ::= db_options MINROWS NK_INTEGER */ + { 147, -3 }, /* (34) db_options ::= db_options KEEP NK_INTEGER */ + { 147, -3 }, /* (35) db_options ::= db_options PRECISION NK_STRING */ + { 147, -3 }, /* (36) db_options ::= db_options QUORUM NK_INTEGER */ + { 147, -3 }, /* (37) db_options ::= db_options REPLICA NK_INTEGER */ + { 147, -3 }, /* (38) db_options ::= db_options TTL NK_INTEGER */ + { 147, -3 }, /* (39) db_options ::= db_options WAL NK_INTEGER */ + { 147, -3 }, /* (40) db_options ::= db_options VGROUPS NK_INTEGER */ + { 147, -3 }, /* (41) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 147, -3 }, /* (42) db_options ::= db_options STREAM_MODE NK_INTEGER */ + { 141, -9 }, /* (43) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 141, -3 }, /* (44) cmd ::= CREATE TABLE multi_create_clause */ + { 141, -9 }, /* (45) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 141, -3 }, /* (46) cmd ::= DROP TABLE multi_drop_clause */ + { 141, -4 }, /* (47) cmd ::= DROP STABLE exists_opt full_table_name */ + { 141, -2 }, /* (48) cmd ::= SHOW TABLES */ + { 141, -2 }, /* (49) cmd ::= SHOW STABLES */ + { 153, -1 }, /* (50) multi_create_clause ::= create_subtable_clause */ + { 153, -2 }, /* (51) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 156, -9 }, /* (52) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ + { 155, -1 }, /* (53) multi_drop_clause ::= drop_table_clause */ + { 155, -2 }, /* (54) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 159, -2 }, /* (55) drop_table_clause ::= exists_opt full_table_name */ + { 157, 0 }, /* (56) specific_tags_opt ::= */ + { 157, -3 }, /* (57) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 149, -1 }, /* (58) full_table_name ::= table_name */ + { 149, -3 }, /* (59) full_table_name ::= db_name NK_DOT table_name */ + { 150, -1 }, /* (60) column_def_list ::= column_def */ + { 150, -3 }, /* (61) column_def_list ::= column_def_list NK_COMMA column_def */ + { 162, -2 }, /* (62) column_def ::= column_name type_name */ + { 162, -4 }, /* (63) column_def ::= column_name type_name COMMENT NK_STRING */ + { 164, -1 }, /* (64) type_name ::= BOOL */ + { 164, -1 }, /* (65) type_name ::= TINYINT */ + { 164, -1 }, /* (66) type_name ::= SMALLINT */ + { 164, -1 }, /* (67) type_name ::= INT */ + { 164, -1 }, /* (68) type_name ::= INTEGER */ + { 164, -1 }, /* (69) type_name ::= BIGINT */ + { 164, -1 }, /* (70) type_name ::= FLOAT */ + { 164, -1 }, /* (71) type_name ::= DOUBLE */ + { 164, -4 }, /* (72) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 164, -1 }, /* (73) type_name ::= TIMESTAMP */ + { 164, -4 }, /* (74) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 164, -2 }, /* (75) type_name ::= TINYINT UNSIGNED */ + { 164, -2 }, /* (76) type_name ::= SMALLINT UNSIGNED */ + { 164, -2 }, /* (77) type_name ::= INT UNSIGNED */ + { 164, -2 }, /* (78) type_name ::= BIGINT UNSIGNED */ + { 164, -1 }, /* (79) type_name ::= JSON */ + { 164, -4 }, /* (80) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 164, -1 }, /* (81) type_name ::= MEDIUMBLOB */ + { 164, -1 }, /* (82) type_name ::= BLOB */ + { 164, -4 }, /* (83) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 164, -1 }, /* (84) type_name ::= DECIMAL */ + { 164, -4 }, /* (85) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 164, -6 }, /* (86) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 151, 0 }, /* (87) tags_def_opt ::= */ + { 151, -1 }, /* (88) tags_def_opt ::= tags_def */ + { 154, -4 }, /* (89) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 152, 0 }, /* (90) table_options ::= */ + { 152, -3 }, /* (91) table_options ::= table_options COMMENT NK_STRING */ + { 152, -3 }, /* (92) table_options ::= table_options KEEP NK_INTEGER */ + { 152, -3 }, /* (93) table_options ::= table_options TTL NK_INTEGER */ + { 152, -5 }, /* (94) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 160, -1 }, /* (95) col_name_list ::= col_name */ + { 160, -3 }, /* (96) col_name_list ::= col_name_list NK_COMMA col_name */ + { 165, -1 }, /* (97) col_name ::= column_name */ + { 141, -7 }, /* (98) cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ + { 141, -9 }, /* (99) cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */ + { 141, -5 }, /* (100) cmd ::= DROP INDEX index_name ON table_name */ + { 167, 0 }, /* (101) index_options ::= */ + { 167, -9 }, /* (102) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ + { 167, -11 }, /* (103) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ + { 168, -1 }, /* (104) func_list ::= func */ + { 168, -3 }, /* (105) func_list ::= func_list NK_COMMA func */ + { 171, -4 }, /* (106) func ::= function_name NK_LP expression_list NK_RP */ + { 141, -6 }, /* (107) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ + { 141, -6 }, /* (108) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */ + { 141, -4 }, /* (109) cmd ::= DROP TOPIC exists_opt topic_name */ + { 141, -2 }, /* (110) cmd ::= SHOW VGROUPS */ + { 141, -4 }, /* (111) cmd ::= SHOW db_name NK_DOT VGROUPS */ + { 141, -2 }, /* (112) cmd ::= SHOW MNODES */ + { 141, -1 }, /* (113) cmd ::= query_expression */ + { 176, -1 }, /* (114) literal ::= NK_INTEGER */ + { 176, -1 }, /* (115) literal ::= NK_FLOAT */ + { 176, -1 }, /* (116) literal ::= NK_STRING */ + { 176, -1 }, /* (117) literal ::= NK_BOOL */ + { 176, -2 }, /* (118) literal ::= TIMESTAMP NK_STRING */ + { 176, -1 }, /* (119) literal ::= duration_literal */ + { 169, -1 }, /* (120) duration_literal ::= NK_VARIABLE */ + { 158, -1 }, /* (121) literal_list ::= literal */ + { 158, -3 }, /* (122) literal_list ::= literal_list NK_COMMA literal */ + { 146, -1 }, /* (123) db_name ::= NK_ID */ + { 161, -1 }, /* (124) table_name ::= NK_ID */ + { 163, -1 }, /* (125) column_name ::= NK_ID */ + { 172, -1 }, /* (126) function_name ::= NK_ID */ + { 177, -1 }, /* (127) table_alias ::= NK_ID */ + { 178, -1 }, /* (128) column_alias ::= NK_ID */ + { 142, -1 }, /* (129) user_name ::= NK_ID */ + { 166, -1 }, /* (130) index_name ::= NK_ID */ + { 174, -1 }, /* (131) topic_name ::= NK_ID */ + { 179, -1 }, /* (132) expression ::= literal */ + { 179, -1 }, /* (133) expression ::= column_reference */ + { 179, -4 }, /* (134) expression ::= function_name NK_LP expression_list NK_RP */ + { 179, -4 }, /* (135) expression ::= function_name NK_LP NK_STAR NK_RP */ + { 179, -1 }, /* (136) expression ::= subquery */ + { 179, -3 }, /* (137) expression ::= NK_LP expression NK_RP */ + { 179, -2 }, /* (138) expression ::= NK_PLUS expression */ + { 179, -2 }, /* (139) expression ::= NK_MINUS expression */ + { 179, -3 }, /* (140) expression ::= expression NK_PLUS expression */ + { 179, -3 }, /* (141) expression ::= expression NK_MINUS expression */ + { 179, -3 }, /* (142) expression ::= expression NK_STAR expression */ + { 179, -3 }, /* (143) expression ::= expression NK_SLASH expression */ + { 179, -3 }, /* (144) expression ::= expression NK_REM expression */ + { 173, -1 }, /* (145) expression_list ::= expression */ + { 173, -3 }, /* (146) expression_list ::= expression_list NK_COMMA expression */ + { 180, -1 }, /* (147) column_reference ::= column_name */ + { 180, -3 }, /* (148) column_reference ::= table_name NK_DOT column_name */ + { 182, -3 }, /* (149) predicate ::= expression compare_op expression */ + { 182, -5 }, /* (150) predicate ::= expression BETWEEN expression AND expression */ + { 182, -6 }, /* (151) predicate ::= expression NOT BETWEEN expression AND expression */ + { 182, -3 }, /* (152) predicate ::= expression IS NULL */ + { 182, -4 }, /* (153) predicate ::= expression IS NOT NULL */ + { 182, -3 }, /* (154) predicate ::= expression in_op in_predicate_value */ + { 183, -1 }, /* (155) compare_op ::= NK_LT */ + { 183, -1 }, /* (156) compare_op ::= NK_GT */ + { 183, -1 }, /* (157) compare_op ::= NK_LE */ + { 183, -1 }, /* (158) compare_op ::= NK_GE */ + { 183, -1 }, /* (159) compare_op ::= NK_NE */ + { 183, -1 }, /* (160) compare_op ::= NK_EQ */ + { 183, -1 }, /* (161) compare_op ::= LIKE */ + { 183, -2 }, /* (162) compare_op ::= NOT LIKE */ + { 183, -1 }, /* (163) compare_op ::= MATCH */ + { 183, -1 }, /* (164) compare_op ::= NMATCH */ + { 184, -1 }, /* (165) in_op ::= IN */ + { 184, -2 }, /* (166) in_op ::= NOT IN */ + { 185, -3 }, /* (167) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 186, -1 }, /* (168) boolean_value_expression ::= boolean_primary */ + { 186, -2 }, /* (169) boolean_value_expression ::= NOT boolean_primary */ + { 186, -3 }, /* (170) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 186, -3 }, /* (171) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 187, -1 }, /* (172) boolean_primary ::= predicate */ + { 187, -3 }, /* (173) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 188, -1 }, /* (174) common_expression ::= expression */ + { 188, -1 }, /* (175) common_expression ::= boolean_value_expression */ + { 189, -2 }, /* (176) from_clause ::= FROM table_reference_list */ + { 190, -1 }, /* (177) table_reference_list ::= table_reference */ + { 190, -3 }, /* (178) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 191, -1 }, /* (179) table_reference ::= table_primary */ + { 191, -1 }, /* (180) table_reference ::= joined_table */ + { 192, -2 }, /* (181) table_primary ::= table_name alias_opt */ + { 192, -4 }, /* (182) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 192, -2 }, /* (183) table_primary ::= subquery alias_opt */ + { 192, -1 }, /* (184) table_primary ::= parenthesized_joined_table */ + { 194, 0 }, /* (185) alias_opt ::= */ + { 194, -1 }, /* (186) alias_opt ::= table_alias */ + { 194, -2 }, /* (187) alias_opt ::= AS table_alias */ + { 195, -3 }, /* (188) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 195, -3 }, /* (189) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 193, -6 }, /* (190) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 196, 0 }, /* (191) join_type ::= */ + { 196, -1 }, /* (192) join_type ::= INNER */ + { 198, -9 }, /* (193) 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 */ + { 199, 0 }, /* (194) set_quantifier_opt ::= */ + { 199, -1 }, /* (195) set_quantifier_opt ::= DISTINCT */ + { 199, -1 }, /* (196) set_quantifier_opt ::= ALL */ + { 200, -1 }, /* (197) select_list ::= NK_STAR */ + { 200, -1 }, /* (198) select_list ::= select_sublist */ + { 206, -1 }, /* (199) select_sublist ::= select_item */ + { 206, -3 }, /* (200) select_sublist ::= select_sublist NK_COMMA select_item */ + { 207, -1 }, /* (201) select_item ::= common_expression */ + { 207, -2 }, /* (202) select_item ::= common_expression column_alias */ + { 207, -3 }, /* (203) select_item ::= common_expression AS column_alias */ + { 207, -3 }, /* (204) select_item ::= table_name NK_DOT NK_STAR */ + { 201, 0 }, /* (205) where_clause_opt ::= */ + { 201, -2 }, /* (206) where_clause_opt ::= WHERE search_condition */ + { 202, 0 }, /* (207) partition_by_clause_opt ::= */ + { 202, -3 }, /* (208) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 203, 0 }, /* (209) twindow_clause_opt ::= */ + { 203, -6 }, /* (210) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ + { 203, -4 }, /* (211) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + { 203, -6 }, /* (212) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 203, -8 }, /* (213) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 170, 0 }, /* (214) sliding_opt ::= */ + { 170, -4 }, /* (215) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 208, 0 }, /* (216) fill_opt ::= */ + { 208, -4 }, /* (217) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 208, -6 }, /* (218) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 209, -1 }, /* (219) fill_mode ::= NONE */ + { 209, -1 }, /* (220) fill_mode ::= PREV */ + { 209, -1 }, /* (221) fill_mode ::= NULL */ + { 209, -1 }, /* (222) fill_mode ::= LINEAR */ + { 209, -1 }, /* (223) fill_mode ::= NEXT */ + { 204, 0 }, /* (224) group_by_clause_opt ::= */ + { 204, -3 }, /* (225) group_by_clause_opt ::= GROUP BY group_by_list */ + { 210, -1 }, /* (226) group_by_list ::= expression */ + { 210, -3 }, /* (227) group_by_list ::= group_by_list NK_COMMA expression */ + { 205, 0 }, /* (228) having_clause_opt ::= */ + { 205, -2 }, /* (229) having_clause_opt ::= HAVING search_condition */ + { 175, -4 }, /* (230) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 211, -1 }, /* (231) query_expression_body ::= query_primary */ + { 211, -4 }, /* (232) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 215, -1 }, /* (233) query_primary ::= query_specification */ + { 212, 0 }, /* (234) order_by_clause_opt ::= */ + { 212, -3 }, /* (235) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 213, 0 }, /* (236) slimit_clause_opt ::= */ + { 213, -2 }, /* (237) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 213, -4 }, /* (238) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 213, -4 }, /* (239) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 214, 0 }, /* (240) limit_clause_opt ::= */ + { 214, -2 }, /* (241) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 214, -4 }, /* (242) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 214, -4 }, /* (243) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 181, -3 }, /* (244) subquery ::= NK_LP query_expression NK_RP */ + { 197, -1 }, /* (245) search_condition ::= common_expression */ + { 216, -1 }, /* (246) sort_specification_list ::= sort_specification */ + { 216, -3 }, /* (247) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 217, -3 }, /* (248) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 218, 0 }, /* (249) ordering_specification_opt ::= */ + { 218, -1 }, /* (250) ordering_specification_opt ::= ASC */ + { 218, -1 }, /* (251) ordering_specification_opt ::= DESC */ + { 219, 0 }, /* (252) null_ordering_opt ::= */ + { 219, -2 }, /* (253) null_ordering_opt ::= NULLS FIRST */ + { 219, -2 }, /* (254) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1959,31 +1991,31 @@ static YYACTIONTYPE yy_reduce( /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy0);} +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } break; case 1: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy5, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0);} +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 2: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy5, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0);} +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } break; case 3: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy5); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); } break; case 4: /* cmd ::= SHOW USERS */ { 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.yy5, NULL);} +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy129, NULL); } break; case 6: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy0);} +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } break; case 7: /* cmd ::= DROP DNODE NK_INTEGER */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0);} +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 8: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy5);} +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy129); } break; case 9: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } @@ -1991,742 +2023,761 @@ static YYACTIONTYPE yy_reduce( 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 117: /* db_name ::= NK_ID */ yytestcase(yyruleno==117); - case 118: /* table_name ::= NK_ID */ yytestcase(yyruleno==118); - case 119: /* column_name ::= NK_ID */ yytestcase(yyruleno==119); - case 120: /* function_name ::= NK_ID */ yytestcase(yyruleno==120); - case 121: /* table_alias ::= NK_ID */ yytestcase(yyruleno==121); - case 122: /* column_alias ::= NK_ID */ yytestcase(yyruleno==122); - case 123: /* user_name ::= NK_ID */ yytestcase(yyruleno==123); - case 124: /* index_name ::= NK_ID */ yytestcase(yyruleno==124); -{ yylhsminor.yy5 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy5 = yylhsminor.yy5; + case 123: /* db_name ::= NK_ID */ yytestcase(yyruleno==123); + case 124: /* table_name ::= NK_ID */ yytestcase(yyruleno==124); + case 125: /* column_name ::= NK_ID */ yytestcase(yyruleno==125); + case 126: /* function_name ::= NK_ID */ yytestcase(yyruleno==126); + case 127: /* table_alias ::= NK_ID */ yytestcase(yyruleno==127); + case 128: /* column_alias ::= NK_ID */ yytestcase(yyruleno==128); + case 129: /* user_name ::= NK_ID */ yytestcase(yyruleno==129); + case 130: /* index_name ::= NK_ID */ yytestcase(yyruleno==130); + case 131: /* topic_name ::= NK_ID */ yytestcase(yyruleno==131); +{ yylhsminor.yy129 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy129 = yylhsminor.yy129; break; case 13: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateQnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 14: /* cmd ::= SHOW QNODES */ + case 14: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ +{ pCxt->pRootNode = createDropQnodeStmt(pCxt, &yymsp[0].minor.yy0); } + break; + case 15: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL); } break; - case 15: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy25, &yymsp[-1].minor.yy5, yymsp[0].minor.yy68);} + case 16: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy97, &yymsp[-1].minor.yy129, yymsp[0].minor.yy432); } break; - case 16: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy25, &yymsp[0].minor.yy5); } + case 17: /* cmd ::= DROP DATABASE exists_opt db_name */ +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy129); } break; - case 17: /* cmd ::= SHOW DATABASES */ + case 18: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } break; - case 18: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy5);} + case 19: /* cmd ::= USE db_name */ +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } + break; + case 20: /* cmd ::= ALTER DATABASE db_name db_options */ +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy432); } break; - case 19: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy25 = true; } + case 21: /* not_exists_opt ::= IF NOT EXISTS */ +{ yymsp[-2].minor.yy97 = true; } break; - case 20: /* not_exists_opt ::= */ - case 22: /* exists_opt ::= */ yytestcase(yyruleno==22); - case 187: /* set_quantifier_opt ::= */ yytestcase(yyruleno==187); -{ yymsp[1].minor.yy25 = false; } + case 22: /* not_exists_opt ::= */ + case 24: /* exists_opt ::= */ yytestcase(yyruleno==24); + case 194: /* set_quantifier_opt ::= */ yytestcase(yyruleno==194); +{ yymsp[1].minor.yy97 = false; } break; - case 21: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy25 = true; } + case 23: /* exists_opt ::= IF EXISTS */ +{ yymsp[-1].minor.yy97 = true; } break; - case 23: /* db_options ::= */ -{ yymsp[1].minor.yy68 = createDefaultDatabaseOptions(pCxt); } + case 25: /* db_options ::= */ +{ yymsp[1].minor.yy432 = createDefaultDatabaseOptions(pCxt); } break; - case 24: /* db_options ::= db_options BLOCKS NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 26: /* db_options ::= db_options BLOCKS NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 25: /* db_options ::= db_options CACHE NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 27: /* db_options ::= db_options CACHE NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 26: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 28: /* db_options ::= db_options CACHELAST NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 27: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 29: /* db_options ::= db_options COMP NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 28: /* db_options ::= db_options DAYS NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 30: /* db_options ::= db_options DAYS NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 29: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 31: /* db_options ::= db_options FSYNC NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 30: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 32: /* db_options ::= db_options MAXROWS NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 31: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 33: /* db_options ::= db_options MINROWS NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 32: /* db_options ::= db_options KEEP NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 34: /* db_options ::= db_options KEEP NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 33: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 35: /* db_options ::= db_options PRECISION NK_STRING */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 34: /* db_options ::= db_options QUORUM NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 36: /* db_options ::= db_options QUORUM NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 35: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 37: /* db_options ::= db_options REPLICA NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 36: /* db_options ::= db_options TTL NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 38: /* db_options ::= db_options TTL NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 37: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 39: /* db_options ::= db_options WAL NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 38: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 40: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 39: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 41: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 40: /* db_options ::= db_options STREAM_MODE NK_INTEGER */ -{ yylhsminor.yy68 = setDatabaseOption(pCxt, yymsp[-2].minor.yy68, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 42: /* db_options ::= db_options STREAM_MODE NK_INTEGER */ +{ yylhsminor.yy432 = setDatabaseOption(pCxt, yymsp[-2].minor.yy432, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 41: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 43: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==43); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy25, yymsp[-5].minor.yy68, yymsp[-3].minor.yy40, yymsp[-1].minor.yy40, yymsp[0].minor.yy68);} + case 43: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 45: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==45); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy97, yymsp[-5].minor.yy432, yymsp[-3].minor.yy24, yymsp[-1].minor.yy24, yymsp[0].minor.yy432);} break; - case 42: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy40);} + case 44: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy24);} break; - case 44: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy40); } + case 46: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy24); } break; - case 45: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy25, yymsp[0].minor.yy68); } + case 47: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy432); } break; - case 46: /* cmd ::= SHOW TABLES */ + case 48: /* cmd ::= SHOW TABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } break; - case 47: /* cmd ::= SHOW STABLES */ + case 49: /* cmd ::= SHOW STABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } break; - case 48: /* multi_create_clause ::= create_subtable_clause */ - case 51: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==51); - case 58: /* column_def_list ::= column_def */ yytestcase(yyruleno==58); - case 93: /* col_name_list ::= col_name */ yytestcase(yyruleno==93); - case 101: /* func_list ::= func */ yytestcase(yyruleno==101); - case 192: /* select_sublist ::= select_item */ yytestcase(yyruleno==192); - case 239: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==239); -{ yylhsminor.yy40 = createNodeList(pCxt, yymsp[0].minor.yy68); } - yymsp[0].minor.yy40 = yylhsminor.yy40; + case 50: /* multi_create_clause ::= create_subtable_clause */ + case 53: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==53); + case 60: /* column_def_list ::= column_def */ yytestcase(yyruleno==60); + case 95: /* col_name_list ::= col_name */ yytestcase(yyruleno==95); + case 104: /* func_list ::= func */ yytestcase(yyruleno==104); + case 199: /* select_sublist ::= select_item */ yytestcase(yyruleno==199); + case 246: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==246); +{ yylhsminor.yy24 = createNodeList(pCxt, yymsp[0].minor.yy432); } + yymsp[0].minor.yy24 = yylhsminor.yy24; + break; + case 51: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 54: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==54); +{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-1].minor.yy24, yymsp[0].minor.yy432); } + yymsp[-1].minor.yy24 = yylhsminor.yy24; + break; + case 52: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ +{ yylhsminor.yy432 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy97, yymsp[-7].minor.yy432, yymsp[-5].minor.yy432, yymsp[-4].minor.yy24, yymsp[-1].minor.yy24); } + yymsp[-8].minor.yy432 = yylhsminor.yy432; + break; + case 55: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy432 = createDropTableClause(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy432); } + yymsp[-1].minor.yy432 = yylhsminor.yy432; + break; + case 56: /* specific_tags_opt ::= */ + case 87: /* tags_def_opt ::= */ yytestcase(yyruleno==87); + case 207: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==207); + case 224: /* group_by_clause_opt ::= */ yytestcase(yyruleno==224); + case 234: /* order_by_clause_opt ::= */ yytestcase(yyruleno==234); +{ yymsp[1].minor.yy24 = NULL; } break; - case 49: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 52: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==52); -{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-1].minor.yy40, yymsp[0].minor.yy68); } - yymsp[-1].minor.yy40 = yylhsminor.yy40; + case 57: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ +{ yymsp[-2].minor.yy24 = yymsp[-1].minor.yy24; } break; - case 50: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ -{ yylhsminor.yy68 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy25, yymsp[-7].minor.yy68, yymsp[-5].minor.yy68, yymsp[-4].minor.yy40, yymsp[-1].minor.yy40); } - yymsp[-8].minor.yy68 = yylhsminor.yy68; + case 58: /* full_table_name ::= table_name */ +{ yylhsminor.yy432 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); } + yymsp[0].minor.yy432 = yylhsminor.yy432; break; - case 53: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy68 = createDropTableClause(pCxt, yymsp[-1].minor.yy25, yymsp[0].minor.yy68); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + case 59: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy432 = createRealTableNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, NULL); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 54: /* specific_tags_opt ::= */ - case 85: /* tags_def_opt ::= */ yytestcase(yyruleno==85); - case 200: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==200); - case 217: /* group_by_clause_opt ::= */ yytestcase(yyruleno==217); - case 227: /* order_by_clause_opt ::= */ yytestcase(yyruleno==227); -{ yymsp[1].minor.yy40 = NULL; } + case 61: /* column_def_list ::= column_def_list NK_COMMA column_def */ + case 96: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==96); + case 105: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==105); + case 200: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==200); + case 247: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==247); +{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, yymsp[0].minor.yy432); } + yymsp[-2].minor.yy24 = yylhsminor.yy24; break; - case 55: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy40 = yymsp[-1].minor.yy40; } + case 62: /* column_def ::= column_name type_name */ +{ yylhsminor.yy432 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy224, NULL); } + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 56: /* full_table_name ::= table_name */ -{ yylhsminor.yy68 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy5, NULL); } - yymsp[0].minor.yy68 = yylhsminor.yy68; + case 63: /* column_def ::= column_name type_name COMMENT NK_STRING */ +{ yylhsminor.yy432 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-2].minor.yy224, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy432 = yylhsminor.yy432; break; - case 57: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy68 = createRealTableNode(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy5, NULL); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 64: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 59: /* column_def_list ::= column_def_list NK_COMMA column_def */ - case 94: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==94); - case 102: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==102); - case 193: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==193); - case 240: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==240); -{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-2].minor.yy40, yymsp[0].minor.yy68); } - yymsp[-2].minor.yy40 = yylhsminor.yy40; + case 65: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 60: /* column_def ::= column_name type_name */ -{ yylhsminor.yy68 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy5, yymsp[0].minor.yy372, NULL); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + case 66: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 61: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy68 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy5, yymsp[-2].minor.yy372, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; + case 67: /* type_name ::= INT */ + case 68: /* type_name ::= INTEGER */ yytestcase(yyruleno==68); +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 62: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 69: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 63: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 70: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 64: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 71: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 65: /* type_name ::= INT */ - case 66: /* type_name ::= INTEGER */ yytestcase(yyruleno==66); -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_INT); } + case 72: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 67: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 73: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 68: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 74: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 69: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 75: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 70: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 76: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 71: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 77: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 72: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 78: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 73: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 79: /* type_name ::= JSON */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 74: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 80: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 75: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_UINT); } + case 81: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 76: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 82: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 77: /* type_name ::= JSON */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_JSON); } + case 83: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 78: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 84: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 79: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 85: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 80: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 86: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 81: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 88: /* tags_def_opt ::= tags_def */ + case 198: /* select_list ::= select_sublist */ yytestcase(yyruleno==198); +{ yylhsminor.yy24 = yymsp[0].minor.yy24; } + yymsp[0].minor.yy24 = yylhsminor.yy24; break; - case 82: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 89: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ +{ yymsp[-3].minor.yy24 = yymsp[-1].minor.yy24; } break; - case 83: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy372 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 90: /* table_options ::= */ +{ yymsp[1].minor.yy432 = createDefaultTableOptions(pCxt);} break; - case 84: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy372 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 91: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy432 = setTableOption(pCxt, yymsp[-2].minor.yy432, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 86: /* tags_def_opt ::= tags_def */ - case 191: /* select_list ::= select_sublist */ yytestcase(yyruleno==191); -{ yylhsminor.yy40 = yymsp[0].minor.yy40; } - yymsp[0].minor.yy40 = yylhsminor.yy40; + case 92: /* table_options ::= table_options KEEP NK_INTEGER */ +{ yylhsminor.yy432 = setTableOption(pCxt, yymsp[-2].minor.yy432, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 87: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy40 = yymsp[-1].minor.yy40; } + case 93: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy432 = setTableOption(pCxt, yymsp[-2].minor.yy432, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 88: /* table_options ::= */ -{ yymsp[1].minor.yy68 = createDefaultTableOptions(pCxt);} + case 94: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy432 = setTableSmaOption(pCxt, yymsp[-4].minor.yy432, yymsp[-1].minor.yy24); } + yymsp[-4].minor.yy432 = yylhsminor.yy432; break; - case 89: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy68 = setTableOption(pCxt, yymsp[-2].minor.yy68, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 97: /* col_name ::= column_name */ +{ yylhsminor.yy432 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); } + yymsp[0].minor.yy432 = yylhsminor.yy432; break; - case 90: /* table_options ::= table_options KEEP NK_INTEGER */ -{ yylhsminor.yy68 = setTableOption(pCxt, yymsp[-2].minor.yy68, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 98: /* cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, NULL, yymsp[0].minor.yy432); } break; - case 91: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy68 = setTableOption(pCxt, yymsp[-2].minor.yy68, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 99: /* cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &yymsp[-5].minor.yy129, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy24, NULL); } break; - case 92: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy68 = setTableSmaOption(pCxt, yymsp[-4].minor.yy68, yymsp[-1].minor.yy40); } - yymsp[-4].minor.yy68 = yylhsminor.yy68; + case 100: /* cmd ::= DROP INDEX index_name ON table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } break; - case 95: /* col_name ::= column_name */ -{ yylhsminor.yy68 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy5); } - yymsp[0].minor.yy68 = yylhsminor.yy68; + case 101: /* index_options ::= */ + case 205: /* where_clause_opt ::= */ yytestcase(yyruleno==205); + case 209: /* twindow_clause_opt ::= */ yytestcase(yyruleno==209); + case 214: /* sliding_opt ::= */ yytestcase(yyruleno==214); + case 216: /* fill_opt ::= */ yytestcase(yyruleno==216); + case 228: /* having_clause_opt ::= */ yytestcase(yyruleno==228); + case 236: /* slimit_clause_opt ::= */ yytestcase(yyruleno==236); + case 240: /* limit_clause_opt ::= */ yytestcase(yyruleno==240); +{ yymsp[1].minor.yy432 = NULL; } break; - case 96: /* cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy5, &yymsp[-1].minor.yy5, NULL, yymsp[0].minor.yy68); } + case 102: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ +{ yymsp[-8].minor.yy432 = createIndexOption(pCxt, yymsp[-6].minor.yy24, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), NULL, yymsp[0].minor.yy432); } break; - case 97: /* cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &yymsp[-5].minor.yy5, &yymsp[-3].minor.yy5, yymsp[-1].minor.yy40, NULL); } + case 103: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ +{ yymsp[-10].minor.yy432 = createIndexOption(pCxt, yymsp[-8].minor.yy24, releaseRawExprNode(pCxt, yymsp[-4].minor.yy432), releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), yymsp[0].minor.yy432); } break; - case 98: /* index_options ::= */ - case 198: /* where_clause_opt ::= */ yytestcase(yyruleno==198); - case 202: /* twindow_clause_opt ::= */ yytestcase(yyruleno==202); - case 207: /* sliding_opt ::= */ yytestcase(yyruleno==207); - case 209: /* fill_opt ::= */ yytestcase(yyruleno==209); - case 221: /* having_clause_opt ::= */ yytestcase(yyruleno==221); - case 229: /* slimit_clause_opt ::= */ yytestcase(yyruleno==229); - case 233: /* limit_clause_opt ::= */ yytestcase(yyruleno==233); -{ yymsp[1].minor.yy68 = NULL; } + case 106: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy432 = createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy24); } + yymsp[-3].minor.yy432 = yylhsminor.yy432; break; - case 99: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ -{ yymsp[-8].minor.yy68 = createIndexOption(pCxt, yymsp[-6].minor.yy40, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), NULL, yymsp[0].minor.yy68); } + case 107: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy97, &yymsp[-2].minor.yy129, yymsp[0].minor.yy432, NULL); } break; - case 100: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ -{ yymsp[-10].minor.yy68 = createIndexOption(pCxt, yymsp[-8].minor.yy40, releaseRawExprNode(pCxt, yymsp[-4].minor.yy68), releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), yymsp[0].minor.yy68); } + case 108: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy97, &yymsp[-2].minor.yy129, NULL, &yymsp[0].minor.yy129); } break; - case 103: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy68 = createFunctionNode(pCxt, &yymsp[-3].minor.yy5, yymsp[-1].minor.yy40); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; + case 109: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy129); } break; - case 104: /* cmd ::= SHOW VGROUPS */ + case 110: /* cmd ::= SHOW VGROUPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } break; - case 105: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy5); } + case 111: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy129); } break; - case 106: /* cmd ::= SHOW MNODES */ + case 112: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); } break; - case 107: /* cmd ::= query_expression */ -{ pCxt->pRootNode = yymsp[0].minor.yy68; } - break; - case 108: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy68 = yylhsminor.yy68; - break; - case 109: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy68 = yylhsminor.yy68; - break; - case 110: /* literal ::= NK_STRING */ -{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy68 = yylhsminor.yy68; - break; - case 111: /* literal ::= NK_BOOL */ -{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy68 = yylhsminor.yy68; - break; - case 112: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; - break; - case 113: /* literal ::= duration_literal */ - case 125: /* expression ::= literal */ yytestcase(yyruleno==125); - case 126: /* expression ::= column_reference */ yytestcase(yyruleno==126); - case 129: /* expression ::= subquery */ yytestcase(yyruleno==129); - case 161: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==161); - case 165: /* boolean_primary ::= predicate */ yytestcase(yyruleno==165); - case 167: /* common_expression ::= expression */ yytestcase(yyruleno==167); - case 168: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==168); - case 170: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==170); - case 172: /* table_reference ::= table_primary */ yytestcase(yyruleno==172); - case 173: /* table_reference ::= joined_table */ yytestcase(yyruleno==173); - case 177: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==177); - case 224: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==224); - case 226: /* query_primary ::= query_specification */ yytestcase(yyruleno==226); -{ yylhsminor.yy68 = yymsp[0].minor.yy68; } - yymsp[0].minor.yy68 = yylhsminor.yy68; - break; - case 114: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy68 = yylhsminor.yy68; - break; - case 115: /* literal_list ::= literal */ - case 138: /* expression_list ::= expression */ yytestcase(yyruleno==138); -{ yylhsminor.yy40 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68)); } - yymsp[0].minor.yy40 = yylhsminor.yy40; - break; - case 116: /* literal_list ::= literal_list NK_COMMA literal */ - case 139: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==139); -{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-2].minor.yy40, releaseRawExprNode(pCxt, yymsp[0].minor.yy68)); } - yymsp[-2].minor.yy40 = yylhsminor.yy40; - break; - case 127: /* expression ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy5, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy5, yymsp[-1].minor.yy40)); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; - break; - case 128: /* expression ::= function_name NK_LP NK_STAR NK_RP */ -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy5, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy5, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; - break; - case 130: /* expression ::= NK_LP expression NK_RP */ - case 166: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==166); -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68)); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; - break; - case 131: /* expression ::= NK_PLUS expression */ + case 113: /* cmd ::= query_expression */ +{ pCxt->pRootNode = yymsp[0].minor.yy432; } + break; + case 114: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy432 = yylhsminor.yy432; + break; + case 115: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy432 = yylhsminor.yy432; + break; + case 116: /* literal ::= NK_STRING */ +{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy432 = yylhsminor.yy432; + break; + case 117: /* literal ::= NK_BOOL */ +{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy432 = yylhsminor.yy432; + break; + case 118: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy432 = yylhsminor.yy432; + break; + case 119: /* literal ::= duration_literal */ + case 132: /* expression ::= literal */ yytestcase(yyruleno==132); + case 133: /* expression ::= column_reference */ yytestcase(yyruleno==133); + case 136: /* expression ::= subquery */ yytestcase(yyruleno==136); + case 168: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==168); + case 172: /* boolean_primary ::= predicate */ yytestcase(yyruleno==172); + case 174: /* common_expression ::= expression */ yytestcase(yyruleno==174); + case 175: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==175); + case 177: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==177); + case 179: /* table_reference ::= table_primary */ yytestcase(yyruleno==179); + case 180: /* table_reference ::= joined_table */ yytestcase(yyruleno==180); + case 184: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==184); + case 231: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==231); + case 233: /* query_primary ::= query_specification */ yytestcase(yyruleno==233); +{ yylhsminor.yy432 = yymsp[0].minor.yy432; } + yymsp[0].minor.yy432 = yylhsminor.yy432; + break; + case 120: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy432 = yylhsminor.yy432; + break; + case 121: /* literal_list ::= literal */ + case 145: /* expression_list ::= expression */ yytestcase(yyruleno==145); +{ yylhsminor.yy24 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432)); } + yymsp[0].minor.yy24 = yylhsminor.yy24; + break; + case 122: /* literal_list ::= literal_list NK_COMMA literal */ + case 146: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==146); +{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, releaseRawExprNode(pCxt, yymsp[0].minor.yy432)); } + yymsp[-2].minor.yy24 = yylhsminor.yy24; + break; + case 134: /* expression ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy24)); } + yymsp[-3].minor.yy432 = yylhsminor.yy432; + break; + case 135: /* expression ::= function_name NK_LP NK_STAR NK_RP */ +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } + yymsp[-3].minor.yy432 = yylhsminor.yy432; + break; + case 137: /* expression ::= NK_LP expression NK_RP */ + case 173: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==173); +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432)); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; + break; + case 138: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy68)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy432)); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 132: /* expression ::= NK_MINUS expression */ + case 139: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy68), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), NULL)); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 133: /* expression ::= expression NK_PLUS expression */ + case 140: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 134: /* expression ::= expression NK_MINUS expression */ + case 141: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 135: /* expression ::= expression NK_STAR expression */ + case 142: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 136: /* expression ::= expression NK_SLASH expression */ + case 143: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 137: /* expression ::= expression NK_REM expression */ + case 144: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 140: /* column_reference ::= column_name */ -{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy5, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy5)); } - yymsp[0].minor.yy68 = yylhsminor.yy68; + case 147: /* column_reference ::= column_name */ +{ yylhsminor.yy432 = createRawExprNode(pCxt, &yymsp[0].minor.yy129, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129)); } + yymsp[0].minor.yy432 = yylhsminor.yy432; break; - case 141: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy5, createColumnNode(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy5)); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 148: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129)); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 142: /* predicate ::= expression compare_op expression */ - case 147: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==147); + case 149: /* predicate ::= expression compare_op expression */ + case 154: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==154); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy416, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy260, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 143: /* predicate ::= expression BETWEEN expression AND expression */ + case 150: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy68), releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy432), releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-4].minor.yy68 = yylhsminor.yy68; + yymsp[-4].minor.yy432 = yylhsminor.yy432; break; - case 144: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 151: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[-5].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[-5].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-5].minor.yy68 = yylhsminor.yy68; + yymsp[-5].minor.yy432 = yylhsminor.yy432; break; - case 145: /* predicate ::= expression IS NULL */ + case 152: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), NULL)); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 146: /* predicate ::= expression IS NOT NULL */ + case 153: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy68), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), NULL)); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; + yymsp[-3].minor.yy432 = yylhsminor.yy432; break; - case 148: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy416 = OP_TYPE_LOWER_THAN; } + case 155: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy260 = OP_TYPE_LOWER_THAN; } break; - case 149: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy416 = OP_TYPE_GREATER_THAN; } + case 156: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy260 = OP_TYPE_GREATER_THAN; } break; - case 150: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy416 = OP_TYPE_LOWER_EQUAL; } + case 157: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy260 = OP_TYPE_LOWER_EQUAL; } break; - case 151: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy416 = OP_TYPE_GREATER_EQUAL; } + case 158: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy260 = OP_TYPE_GREATER_EQUAL; } break; - case 152: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy416 = OP_TYPE_NOT_EQUAL; } + case 159: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy260 = OP_TYPE_NOT_EQUAL; } break; - case 153: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy416 = OP_TYPE_EQUAL; } + case 160: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy260 = OP_TYPE_EQUAL; } break; - case 154: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy416 = OP_TYPE_LIKE; } + case 161: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy260 = OP_TYPE_LIKE; } break; - case 155: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy416 = OP_TYPE_NOT_LIKE; } + case 162: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy260 = OP_TYPE_NOT_LIKE; } break; - case 156: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy416 = OP_TYPE_MATCH; } + case 163: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy260 = OP_TYPE_MATCH; } break; - case 157: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy416 = OP_TYPE_NMATCH; } + case 164: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy260 = OP_TYPE_NMATCH; } break; - case 158: /* in_op ::= IN */ -{ yymsp[0].minor.yy416 = OP_TYPE_IN; } + case 165: /* in_op ::= IN */ +{ yymsp[0].minor.yy260 = OP_TYPE_IN; } break; - case 159: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy416 = OP_TYPE_NOT_IN; } + case 166: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy260 = OP_TYPE_NOT_IN; } break; - case 160: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy40)); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 167: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy24)); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 162: /* boolean_value_expression ::= NOT boolean_primary */ + case 169: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy68), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), NULL)); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 163: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 170: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 164: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 171: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy432); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 169: /* from_clause ::= FROM table_reference_list */ - case 199: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==199); - case 222: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==222); -{ yymsp[-1].minor.yy68 = yymsp[0].minor.yy68; } + case 176: /* from_clause ::= FROM table_reference_list */ + case 206: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==206); + case 229: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==229); +{ yymsp[-1].minor.yy432 = yymsp[0].minor.yy432; } break; - case 171: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy68 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy68, yymsp[0].minor.yy68, NULL); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 178: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy432 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy432, yymsp[0].minor.yy432, NULL); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 174: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy68 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy5, &yymsp[0].minor.yy5); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + case 181: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy432 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 175: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy68 = createRealTableNode(pCxt, &yymsp[-3].minor.yy5, &yymsp[-1].minor.yy5, &yymsp[0].minor.yy5); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; + case 182: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy432 = createRealTableNode(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } + yymsp[-3].minor.yy432 = yylhsminor.yy432; break; - case 176: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy68 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68), &yymsp[0].minor.yy5); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + case 183: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy432 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432), &yymsp[0].minor.yy129); } + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 178: /* alias_opt ::= */ -{ yymsp[1].minor.yy5 = nil_token; } + case 185: /* alias_opt ::= */ +{ yymsp[1].minor.yy129 = nil_token; } break; - case 179: /* alias_opt ::= table_alias */ -{ yylhsminor.yy5 = yymsp[0].minor.yy5; } - yymsp[0].minor.yy5 = yylhsminor.yy5; + case 186: /* alias_opt ::= table_alias */ +{ yylhsminor.yy129 = yymsp[0].minor.yy129; } + yymsp[0].minor.yy129 = yylhsminor.yy129; break; - case 180: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy5 = yymsp[0].minor.yy5; } + case 187: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; } break; - case 181: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 182: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==182); -{ yymsp[-2].minor.yy68 = yymsp[-1].minor.yy68; } + case 188: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 189: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==189); +{ yymsp[-2].minor.yy432 = yymsp[-1].minor.yy432; } break; - case 183: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy68 = createJoinTableNode(pCxt, yymsp[-4].minor.yy92, yymsp[-5].minor.yy68, yymsp[-2].minor.yy68, yymsp[0].minor.yy68); } - yymsp[-5].minor.yy68 = yylhsminor.yy68; + case 190: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy432 = createJoinTableNode(pCxt, yymsp[-4].minor.yy332, yymsp[-5].minor.yy432, yymsp[-2].minor.yy432, yymsp[0].minor.yy432); } + yymsp[-5].minor.yy432 = yylhsminor.yy432; break; - case 184: /* join_type ::= */ -{ yymsp[1].minor.yy92 = JOIN_TYPE_INNER; } + case 191: /* join_type ::= */ +{ yymsp[1].minor.yy332 = JOIN_TYPE_INNER; } break; - case 185: /* join_type ::= INNER */ -{ yymsp[0].minor.yy92 = JOIN_TYPE_INNER; } + case 192: /* join_type ::= INNER */ +{ yymsp[0].minor.yy332 = JOIN_TYPE_INNER; } break; - case 186: /* 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 193: /* 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.yy68 = createSelectStmt(pCxt, yymsp[-7].minor.yy25, yymsp[-6].minor.yy40, yymsp[-5].minor.yy68); - yymsp[-8].minor.yy68 = addWhereClause(pCxt, yymsp[-8].minor.yy68, yymsp[-4].minor.yy68); - yymsp[-8].minor.yy68 = addPartitionByClause(pCxt, yymsp[-8].minor.yy68, yymsp[-3].minor.yy40); - yymsp[-8].minor.yy68 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy68, yymsp[-2].minor.yy68); - yymsp[-8].minor.yy68 = addGroupByClause(pCxt, yymsp[-8].minor.yy68, yymsp[-1].minor.yy40); - yymsp[-8].minor.yy68 = addHavingClause(pCxt, yymsp[-8].minor.yy68, yymsp[0].minor.yy68); + yymsp[-8].minor.yy432 = createSelectStmt(pCxt, yymsp[-7].minor.yy97, yymsp[-6].minor.yy24, yymsp[-5].minor.yy432); + yymsp[-8].minor.yy432 = addWhereClause(pCxt, yymsp[-8].minor.yy432, yymsp[-4].minor.yy432); + yymsp[-8].minor.yy432 = addPartitionByClause(pCxt, yymsp[-8].minor.yy432, yymsp[-3].minor.yy24); + yymsp[-8].minor.yy432 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy432, yymsp[-2].minor.yy432); + yymsp[-8].minor.yy432 = addGroupByClause(pCxt, yymsp[-8].minor.yy432, yymsp[-1].minor.yy24); + yymsp[-8].minor.yy432 = addHavingClause(pCxt, yymsp[-8].minor.yy432, yymsp[0].minor.yy432); } break; - case 188: /* set_quantifier_opt ::= DISTINCT */ -{ yymsp[0].minor.yy25 = true; } + case 195: /* set_quantifier_opt ::= DISTINCT */ +{ yymsp[0].minor.yy97 = true; } break; - case 189: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy25 = false; } + case 196: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy97 = false; } break; - case 190: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy40 = NULL; } + case 197: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy24 = NULL; } break; - case 194: /* select_item ::= common_expression */ + case 201: /* select_item ::= common_expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); - yylhsminor.yy68 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68), &t); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); + yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), &t); } - yymsp[0].minor.yy68 = yylhsminor.yy68; + yymsp[0].minor.yy432 = yylhsminor.yy432; break; - case 195: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy68 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68), &yymsp[0].minor.yy5); } - yymsp[-1].minor.yy68 = yylhsminor.yy68; + case 202: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432), &yymsp[0].minor.yy129); } + yymsp[-1].minor.yy432 = yylhsminor.yy432; break; - case 196: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy68 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), &yymsp[0].minor.yy5); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 203: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), &yymsp[0].minor.yy129); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 197: /* select_item ::= table_name NK_DOT NK_STAR */ -{ yylhsminor.yy68 = createColumnNode(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 204: /* select_item ::= table_name NK_DOT NK_STAR */ +{ yylhsminor.yy432 = createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 201: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 218: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==218); - case 228: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==228); -{ yymsp[-2].minor.yy40 = yymsp[0].minor.yy40; } + case 208: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 225: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==225); + case 235: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==235); +{ yymsp[-2].minor.yy24 = yymsp[0].minor.yy24; } break; - case 203: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy68 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy68), &yymsp[-1].minor.yy0); } + case 210: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy432 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), &yymsp[-1].minor.yy0); } break; - case 204: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ -{ yymsp[-3].minor.yy68 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68)); } + case 211: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ +{ yymsp[-3].minor.yy432 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy432)); } break; - case 205: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy68 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy68), NULL, yymsp[-1].minor.yy68, yymsp[0].minor.yy68); } + case 212: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy432 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), NULL, yymsp[-1].minor.yy432, yymsp[0].minor.yy432); } break; - case 206: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy68 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy68), releaseRawExprNode(pCxt, yymsp[-3].minor.yy68), yymsp[-1].minor.yy68, yymsp[0].minor.yy68); } + case 213: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy432 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy432), releaseRawExprNode(pCxt, yymsp[-3].minor.yy432), yymsp[-1].minor.yy432, yymsp[0].minor.yy432); } break; - case 208: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy68 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy68); } + case 215: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ +{ yymsp[-3].minor.yy432 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy432); } break; - case 210: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy68 = createFillNode(pCxt, yymsp[-1].minor.yy94, NULL); } + case 217: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy432 = createFillNode(pCxt, yymsp[-1].minor.yy294, NULL); } break; - case 211: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy68 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy40)); } + case 218: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy432 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy24)); } break; - case 212: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy94 = FILL_MODE_NONE; } + case 219: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy294 = FILL_MODE_NONE; } break; - case 213: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy94 = FILL_MODE_PREV; } + case 220: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy294 = FILL_MODE_PREV; } break; - case 214: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy94 = FILL_MODE_NULL; } + case 221: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy294 = FILL_MODE_NULL; } break; - case 215: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy94 = FILL_MODE_LINEAR; } + case 222: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy294 = FILL_MODE_LINEAR; } break; - case 216: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy94 = FILL_MODE_NEXT; } + case 223: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy294 = FILL_MODE_NEXT; } break; - case 219: /* group_by_list ::= expression */ -{ yylhsminor.yy40 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[0].minor.yy40 = yylhsminor.yy40; + case 226: /* group_by_list ::= expression */ +{ yylhsminor.yy24 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } + yymsp[0].minor.yy24 = yylhsminor.yy24; break; - case 220: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-2].minor.yy40, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy40 = yylhsminor.yy40; + case 227: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy24 = addNodeToList(pCxt, yymsp[-2].minor.yy24, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } + yymsp[-2].minor.yy24 = yylhsminor.yy24; break; - case 223: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 230: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy68 = addOrderByClause(pCxt, yymsp[-3].minor.yy68, yymsp[-2].minor.yy40); - yylhsminor.yy68 = addSlimitClause(pCxt, yylhsminor.yy68, yymsp[-1].minor.yy68); - yylhsminor.yy68 = addLimitClause(pCxt, yylhsminor.yy68, yymsp[0].minor.yy68); + yylhsminor.yy432 = addOrderByClause(pCxt, yymsp[-3].minor.yy432, yymsp[-2].minor.yy24); + yylhsminor.yy432 = addSlimitClause(pCxt, yylhsminor.yy432, yymsp[-1].minor.yy432); + yylhsminor.yy432 = addLimitClause(pCxt, yylhsminor.yy432, yymsp[0].minor.yy432); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; + yymsp[-3].minor.yy432 = yylhsminor.yy432; break; - case 225: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy68 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy68, yymsp[0].minor.yy68); } - yymsp[-3].minor.yy68 = yylhsminor.yy68; + case 232: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy432 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy432, yymsp[0].minor.yy432); } + yymsp[-3].minor.yy432 = yylhsminor.yy432; break; - case 230: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 234: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==234); -{ yymsp[-1].minor.yy68 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 237: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 241: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==241); +{ yymsp[-1].minor.yy432 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 231: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 235: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==235); -{ yymsp[-3].minor.yy68 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 238: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 242: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==242); +{ yymsp[-3].minor.yy432 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 232: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 236: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==236); -{ yymsp[-3].minor.yy68 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 239: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 243: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==243); +{ yymsp[-3].minor.yy432 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 237: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy68); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 244: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy432); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 238: /* search_condition ::= common_expression */ -{ yylhsminor.yy68 = releaseRawExprNode(pCxt, yymsp[0].minor.yy68); } - yymsp[0].minor.yy68 = yylhsminor.yy68; + case 245: /* search_condition ::= common_expression */ +{ yylhsminor.yy432 = releaseRawExprNode(pCxt, yymsp[0].minor.yy432); } + yymsp[0].minor.yy432 = yylhsminor.yy432; break; - case 241: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy68 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), yymsp[-1].minor.yy54, yymsp[0].minor.yy53); } - yymsp[-2].minor.yy68 = yylhsminor.yy68; + case 248: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy432 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy432), yymsp[-1].minor.yy378, yymsp[0].minor.yy257); } + yymsp[-2].minor.yy432 = yylhsminor.yy432; break; - case 242: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy54 = ORDER_ASC; } + case 249: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy378 = ORDER_ASC; } break; - case 243: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy54 = ORDER_ASC; } + case 250: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy378 = ORDER_ASC; } break; - case 244: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy54 = ORDER_DESC; } + case 251: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy378 = ORDER_DESC; } break; - case 245: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy53 = NULL_ORDER_DEFAULT; } + case 252: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy257 = NULL_ORDER_DEFAULT; } break; - case 246: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy53 = NULL_ORDER_FIRST; } + case 253: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy257 = NULL_ORDER_FIRST; } break; - case 247: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy53 = NULL_ORDER_LAST; } + case 254: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy257 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parserAstTest.cpp b/source/libs/parser/test/parserAstTest.cpp index 259c4712baa74a3ca69a3ef4e5c771b57ccaed2d..f4c1bde478bd82e22df89a45681c925cb81126fb 100644 --- a/source/libs/parser/test/parserAstTest.cpp +++ b/source/libs/parser/test/parserAstTest.cpp @@ -340,6 +340,23 @@ TEST_F(ParserTest, createDatabase) { ASSERT_TRUE(run()); } +TEST_F(ParserTest, alterDatabase) { + setDatabase("root", "test"); + + bind("alter database wxy_db BLOCKS 200"); + ASSERT_TRUE(run()); + + bind("alter database wxy_db " + "BLOCKS 200 " + "CACHELAST 1 " + "FSYNC 200 " + "KEEP 200 " + "QUORUM 2 " + "WAL 1 " + ); + ASSERT_TRUE(run()); +} + TEST_F(ParserTest, showDatabase) { setDatabase("root", "test"); @@ -406,9 +423,49 @@ TEST_F(ParserTest, createSmaIndex) { ASSERT_TRUE(run()); } +TEST_F(ParserTest, dropIndex) { + setDatabase("root", "test"); + + bind("drop index index1 on t1"); + ASSERT_TRUE(run()); +} + TEST_F(ParserTest, createQnode) { setDatabase("root", "test"); bind("create qnode on dnode 1"); ASSERT_TRUE(run()); } + +TEST_F(ParserTest, dropQnode) { + setDatabase("root", "test"); + + bind("drop qnode on dnode 1"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, createTopic) { + setDatabase("root", "test"); + + bind("create topic tp1 as select * from t1"); + ASSERT_TRUE(run()); + + bind("create topic if not exists tp1 as select * from t1"); + ASSERT_TRUE(run()); + + bind("create topic tp1 as test"); + ASSERT_TRUE(run()); + + bind("create topic if not exists tp1 as test"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, dropTopic) { + setDatabase("root", "test"); + + bind("drop topic tp1"); + ASSERT_TRUE(run()); + + bind("drop topic if exists tp1"); + ASSERT_TRUE(run()); +} diff --git a/source/libs/transport/src/transSrv.c b/source/libs/transport/src/transSrv.c index 040c12b8805f877d89c9c32d530074f951e63371..ec42ab6402e45d4c0381a249b34cfd4a374be830 100644 --- a/source/libs/transport/src/transSrv.c +++ b/source/libs/transport/src/transSrv.c @@ -214,7 +214,9 @@ static void uvHandleReq(SSrvConn* pConn) { // pHead = rpcDecompresSTransMsg(pHead); } else { pHead->msgLen = htonl(pHead->msgLen); - // impl later + if (pHead->secured == 1) { + pHead->msgLen -= sizeof(STransUserMsg); + } // } diff --git a/source/util/src/tuuid.c b/source/util/src/tuuid.c index ceca33436aaf6118e8dd4583185fbe7e1cf0e840..69cf7baaadf9d1a282a91ba1f2ea4faca363a7ad 100644 --- a/source/util/src/tuuid.c +++ b/source/util/src/tuuid.c @@ -15,43 +15,43 @@ #include "tuuid.h" -static int64_t hashId = 0; -static int32_t SerialNo = 0; +static int64_t tUUIDHashId = 0; +static int32_t tUUIDSerialNo = 0; int32_t tGenIdPI32(void) { - if (hashId == 0) { + if (tUUIDHashId == 0) { char uid[64]; int32_t code = taosGetSystemUUID(uid, tListLen(uid)); if (code != TSDB_CODE_SUCCESS) { terrno = TAOS_SYSTEM_ERROR(errno); } else { - hashId = MurmurHash3_32(uid, strlen(uid)); + tUUIDHashId = MurmurHash3_32(uid, strlen(uid)); } } int64_t ts = taosGetTimestampMs(); uint64_t pid = taosGetPId(); - int32_t val = atomic_add_fetch_32(&SerialNo, 1); + int32_t val = atomic_add_fetch_32(&tUUIDSerialNo, 1); - int32_t id = ((hashId & 0x1F) << 26) | ((pid & 0x3F) << 20) | ((ts & 0xFFF) << 8) | (val & 0xFF); + int32_t id = ((tUUIDHashId & 0x1F) << 26) | ((pid & 0x3F) << 20) | ((ts & 0xFFF) << 8) | (val & 0xFF); return id; } int64_t tGenIdPI64(void) { - if (hashId == 0) { + if (tUUIDHashId == 0) { char uid[64]; int32_t code = taosGetSystemUUID(uid, tListLen(uid)); if (code != TSDB_CODE_SUCCESS) { terrno = TAOS_SYSTEM_ERROR(errno); } else { - hashId = MurmurHash3_32(uid, strlen(uid)); + tUUIDHashId = MurmurHash3_32(uid, strlen(uid)); } } int64_t ts = taosGetTimestampMs(); uint64_t pid = taosGetPId(); - int32_t val = atomic_add_fetch_32(&SerialNo, 1); + int32_t val = atomic_add_fetch_32(&tUUIDSerialNo, 1); - int64_t id = ((hashId & 0x07FF) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF); + int64_t id = ((tUUIDHashId & 0x07FF) << 52) | ((pid & 0x0FFF) << 40) | ((ts & 0xFFFFFF) << 16) | (val & 0xFFFF); return id; } diff --git a/tests/script/tsim/query/interval.sim b/tests/script/tsim/query/interval.sim new file mode 100644 index 0000000000000000000000000000000000000000..35e7c938d87834f0795b57124d81f245519aef26 --- /dev/null +++ b/tests/script/tsim/query/interval.sim @@ -0,0 +1,207 @@ +system sh/stop_dnodes.sh + +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c wal -v 1 +system sh/exec.sh -n dnode1 -s start +sleep 2000 +sql connect + +$dbPrefix = m_in_db +$tbPrefix = m_in_tb +$mtPrefix = m_in_mt +$tbNum = 10 +$rowNum = 20 +$totalNum = 200 + +print =============== step1 +$i = 0 +$db = $dbPrefix . $i +$mt = $mtPrefix . $i + +sql drop database $db -x step1 +step1: +sql create database $db +sql use $db +sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) + +print ====== start create child tables and insert data +$i = 0 +while $i < $tbNum + $tb = $tbPrefix . $i + sql create table $tb using $mt tags( $i ) + + $x = 0 + while $x < $rowNum + $cc = $x * 60000 + $ms = 1601481600000 + $cc + + sql insert into $tb values ($ms , $x ) + $x = $x + 1 + endw + + $i = $i + 1 +endw + +print =============== step2 +$i = 1 +$tb = $tbPrefix . $i + +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb interval(1m) +print ===> $rows +if $rows < $rowNum then + return -1 +endi +if $data01 != 1 then + return -1 +endi +if $data05 != 1 then + return -1 +endi + +print =============== step3 +$cc = 4 * 60000 +$ms = 1601481600000 + $cc +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts <= $ms interval(1m) +print ===> $rows +if $rows > 10 then + return -1 +endi +if $rows < 3 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +if $data05 != 1 then + return -1 +endi + +print =============== step4 +$cc = 40 * 60000 +$ms = 1601481600000 + $cc + +$cc = 1 * 60000 +$ms2 = 1601481600000 - $cc + +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts <= $ms and ts > $ms2 interval(1m) +print ===> $rows +if $rows < 18 then + return -1 +endi +if $rows > 22 then + return -1 +endi +if $data01 != 1 then + return -1 +endi +if $data05 != 1 then + return -1 +endi + +print =============== step5 +$cc = 40 * 60000 +$ms = 1601481600000 + $cc + +$cc = 1 * 60000 +$ms2 = 1601481600000 - $cc + +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts <= $ms and ts > $ms2 interval(1m) fill(value,0) +print ===> $rows +if $rows < 30 then + return -1 +endi +if $rows > 50 then + return -1 +endi +if $data21 != 1 then + return -1 +endi +if $data25 != 1 then + return -1 +endi + +print =============== step6 +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt interval(1m) +print ===> $rows +if $rows < 18 then + return -1 +endi +if $rows > 22 then + return -1 +endi +if $data11 > 15 then + return -1 +endi +if $data11 < 5 then + return -1 +endi + +print =============== step7 +$cc = 4 * 60000 +$ms = 1601481600000 + $cc +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts <= $ms interval(1m) +print ===> $rows +if $rows < 3 then + return -1 +endi +if $rows > 7 then + return -1 +endi +if $data11 > 15 then + return -1 +endi +if $data11 < 5 then + return -1 +endi + +print =============== step8 +$cc = 40 * 60000 +$ms1 = 1601481600000 + $cc + +$cc = 1 * 60000 +$ms2 = 1601481600000 - $cc + +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts <= $ms1 and ts > $ms2 interval(1m) +print ===> $rows +if $rows < 18 then + return -1 +endi +if $rows > 22 then + return -1 +endi +if $data11 > 15 then + return -1 +endi +if $data11 < 5 then + return -1 +endi + +print =============== step9 +$cc = 40 * 60000 +$ms1 = 1601481600000 + $cc + +$cc = 1 * 60000 +$ms2 = 1601481600000 - $cc + +sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts <= $ms1 and ts > $ms2 interval(1m) fill(value, 0) +if $rows < 30 then + return -1 +endi +if $rows > 50 then + return -1 +endi +if $data11 > 15 then + return -1 +endi +if $data11 < 5 then + return -1 +endi + +print =============== clear +sql drop database $db +sql show databases +if $rows != 0 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file