diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 167c72a778..e89df62b8e 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -33,129 +33,148 @@ #define TK_NK_SLASH 15 #define TK_NK_REM 16 #define TK_NK_CONCAT 17 -#define TK_CREATE 18 -#define TK_USER 19 -#define TK_PASS 20 -#define TK_NK_STRING 21 -#define TK_ALTER 22 -#define TK_PRIVILEGE 23 -#define TK_DROP 24 -#define TK_SHOW 25 -#define TK_USERS 26 -#define TK_DNODE 27 -#define TK_PORT 28 -#define TK_NK_INTEGER 29 -#define TK_DNODES 30 -#define TK_NK_ID 31 -#define TK_NK_IPTOKEN 32 -#define TK_QNODE 33 -#define TK_ON 34 -#define TK_QNODES 35 -#define TK_DATABASE 36 -#define TK_DATABASES 37 -#define TK_USE 38 -#define TK_IF 39 -#define TK_NOT 40 -#define TK_EXISTS 41 -#define TK_BLOCKS 42 -#define TK_CACHE 43 -#define TK_CACHELAST 44 -#define TK_COMP 45 -#define TK_DAYS 46 -#define TK_FSYNC 47 -#define TK_MAXROWS 48 -#define TK_MINROWS 49 -#define TK_KEEP 50 -#define TK_PRECISION 51 -#define TK_QUORUM 52 -#define TK_REPLICA 53 -#define TK_TTL 54 -#define TK_WAL 55 -#define TK_VGROUPS 56 -#define TK_SINGLE_STABLE 57 -#define TK_STREAM_MODE 58 -#define TK_TABLE 59 -#define TK_NK_LP 60 -#define TK_NK_RP 61 -#define TK_STABLE 62 -#define TK_TABLES 63 -#define TK_STABLES 64 -#define TK_USING 65 -#define TK_TAGS 66 -#define TK_NK_DOT 67 -#define TK_NK_COMMA 68 -#define TK_COMMENT 69 -#define TK_BOOL 70 -#define TK_TINYINT 71 -#define TK_SMALLINT 72 -#define TK_INT 73 -#define TK_INTEGER 74 -#define TK_BIGINT 75 -#define TK_FLOAT 76 -#define TK_DOUBLE 77 -#define TK_BINARY 78 -#define TK_TIMESTAMP 79 -#define TK_NCHAR 80 -#define TK_UNSIGNED 81 -#define TK_JSON 82 -#define TK_VARCHAR 83 -#define TK_MEDIUMBLOB 84 -#define TK_BLOB 85 -#define TK_VARBINARY 86 -#define TK_DECIMAL 87 -#define TK_SMA 88 -#define TK_INDEX 89 -#define TK_FULLTEXT 90 -#define TK_FUNCTION 91 -#define TK_INTERVAL 92 -#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_ALTER 18 +#define TK_ACCOUNT 19 +#define TK_NK_ID 20 +#define TK_PASS 21 +#define TK_PPS 22 +#define TK_TSERIES 23 +#define TK_STORAGE 24 +#define TK_STREAMS 25 +#define TK_QTIME 26 +#define TK_DBS 27 +#define TK_USERS 28 +#define TK_CONNS 29 +#define TK_STATE 30 +#define TK_CREATE 31 +#define TK_USER 32 +#define TK_NK_STRING 33 +#define TK_PRIVILEGE 34 +#define TK_DROP 35 +#define TK_SHOW 36 +#define TK_DNODE 37 +#define TK_PORT 38 +#define TK_NK_INTEGER 39 +#define TK_DNODES 40 +#define TK_NK_IPTOKEN 41 +#define TK_LOCAL 42 +#define TK_QNODE 43 +#define TK_ON 44 +#define TK_QNODES 45 +#define TK_DATABASE 46 +#define TK_DATABASES 47 +#define TK_USE 48 +#define TK_IF 49 +#define TK_NOT 50 +#define TK_EXISTS 51 +#define TK_BLOCKS 52 +#define TK_CACHE 53 +#define TK_CACHELAST 54 +#define TK_COMP 55 +#define TK_DAYS 56 +#define TK_FSYNC 57 +#define TK_MAXROWS 58 +#define TK_MINROWS 59 +#define TK_KEEP 60 +#define TK_PRECISION 61 +#define TK_QUORUM 62 +#define TK_REPLICA 63 +#define TK_TTL 64 +#define TK_WAL 65 +#define TK_VGROUPS 66 +#define TK_SINGLE_STABLE 67 +#define TK_STREAM_MODE 68 +#define TK_RETENTIONS 69 +#define TK_FILE_FACTOR 70 +#define TK_NK_FLOAT 71 +#define TK_TABLE 72 +#define TK_NK_LP 73 +#define TK_NK_RP 74 +#define TK_STABLE 75 +#define TK_TABLES 76 +#define TK_STABLES 77 +#define TK_ADD 78 +#define TK_COLUMN 79 +#define TK_MODIFY 80 +#define TK_RENAME 81 +#define TK_TAG 82 +#define TK_SET 83 +#define TK_NK_EQ 84 +#define TK_USING 85 +#define TK_TAGS 86 +#define TK_NK_DOT 87 +#define TK_NK_COMMA 88 +#define TK_COMMENT 89 +#define TK_BOOL 90 +#define TK_TINYINT 91 +#define TK_SMALLINT 92 +#define TK_INT 93 +#define TK_INTEGER 94 +#define TK_BIGINT 95 +#define TK_FLOAT 96 +#define TK_DOUBLE 97 +#define TK_BINARY 98 +#define TK_TIMESTAMP 99 +#define TK_NCHAR 100 +#define TK_UNSIGNED 101 +#define TK_JSON 102 +#define TK_VARCHAR 103 +#define TK_MEDIUMBLOB 104 +#define TK_BLOB 105 +#define TK_VARBINARY 106 +#define TK_DECIMAL 107 +#define TK_SMA 108 +#define TK_ROLLUP 109 +#define TK_INDEX 110 +#define TK_FULLTEXT 111 +#define TK_FUNCTION 112 +#define TK_INTERVAL 113 +#define TK_TOPIC 114 +#define TK_AS 115 +#define TK_MNODES 116 +#define TK_NK_BOOL 117 +#define TK_NK_VARIABLE 118 +#define TK_BETWEEN 119 +#define TK_IS 120 +#define TK_NULL 121 +#define TK_NK_LT 122 +#define TK_NK_GT 123 +#define TK_NK_LE 124 +#define TK_NK_GE 125 +#define TK_NK_NE 126 +#define TK_LIKE 127 +#define TK_MATCH 128 +#define TK_NMATCH 129 +#define TK_IN 130 +#define TK_FROM 131 +#define TK_JOIN 132 +#define TK_INNER 133 +#define TK_SELECT 134 +#define TK_DISTINCT 135 +#define TK_WHERE 136 +#define TK_PARTITION 137 +#define TK_BY 138 +#define TK_SESSION 139 +#define TK_STATE_WINDOW 140 +#define TK_SLIDING 141 +#define TK_FILL 142 +#define TK_VALUE 143 +#define TK_NONE 144 +#define TK_PREV 145 +#define TK_LINEAR 146 +#define TK_NEXT 147 +#define TK_GROUP 148 +#define TK_HAVING 149 +#define TK_ORDER 150 +#define TK_SLIMIT 151 +#define TK_SOFFSET 152 +#define TK_LIMIT 153 +#define TK_OFFSET 154 +#define TK_ASC 155 +#define TK_DESC 156 +#define TK_NULLS 157 +#define TK_FIRST 158 +#define TK_LAST 159 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 5d7174fc08..7508b71785 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -127,6 +127,13 @@ typedef struct SDropSuperTableStmt { bool ignoreNotExists; } SDropSuperTableStmt; +typedef struct SAlterTableStmt { + ENodeType type; + char dbName[TSDB_DB_NAME_LEN]; + char tableName[TSDB_TABLE_NAME_LEN]; + // todo +} SAlterTableStmt; + typedef struct SCreateUserStmt { ENodeType type; char useName[TSDB_USER_LEN]; @@ -158,6 +165,13 @@ typedef struct SDropDnodeStmt { int32_t port; } SDropDnodeStmt; +typedef struct SAlterDnodeStmt { + ENodeType type; + int32_t dnodeId; + char config[TSDB_DNODE_CONFIG_LEN]; + char value[TSDB_DNODE_VALUE_LEN]; +} SAlterDnodeStmt; + typedef struct SShowStmt { ENodeType type; char dbName[TSDB_DB_NAME_LEN]; @@ -215,6 +229,12 @@ typedef struct SDropTopicStmt { bool ignoreNotExists; } SDropTopicStmt; +typedef struct SAlterLocalStmt { + ENodeType type; + char config[TSDB_DNODE_CONFIG_LEN]; + char value[TSDB_DNODE_VALUE_LEN]; +} SAlterLocalStmt; + #ifdef __cplusplus } #endif diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 4ef70fc7ab..6825fe470a 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -85,6 +85,7 @@ typedef enum ENodeType { QUERY_NODE_DROP_TABLE_CLAUSE, QUERY_NODE_DROP_TABLE_STMT, QUERY_NODE_DROP_SUPER_TABLE_STMT, + QUERY_NODE_ALTER_TABLE_STMT, QUERY_NODE_SHOW_TABLES_STMT, // temp QUERY_NODE_SHOW_STABLES_STMT, QUERY_NODE_CREATE_USER_STMT, @@ -94,6 +95,7 @@ typedef enum ENodeType { QUERY_NODE_USE_DATABASE_STMT, QUERY_NODE_CREATE_DNODE_STMT, QUERY_NODE_DROP_DNODE_STMT, + QUERY_NODE_ALTER_DNODE_STMT, QUERY_NODE_SHOW_DNODES_STMT, QUERY_NODE_SHOW_VGROUPS_STMT, QUERY_NODE_SHOW_MNODES_STMT, @@ -104,6 +106,7 @@ typedef enum ENodeType { QUERY_NODE_DROP_QNODE_STMT, QUERY_NODE_CREATE_TOPIC_STMT, QUERY_NODE_DROP_TOPIC_STMT, + QUERY_NODE_ALTER_LOCAL_STMT, // logic plan node QUERY_NODE_LOGIC_PLAN_SCAN, diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 1c61d738b5..b5cab30088 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -481,6 +481,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_PAR_PASSWD_EMPTY TAOS_DEF_ERROR_CODE(0, 0x2611) #define TSDB_CODE_PAR_INVALID_PORT TAOS_DEF_ERROR_CODE(0, 0x2612) #define TSDB_CODE_PAR_INVALID_ENDPOINT TAOS_DEF_ERROR_CODE(0, 0x2613) +#define TSDB_CODE_PAR_EXPRIE_STATEMENT TAOS_DEF_ERROR_CODE(0, 0x2614) #ifdef __cplusplus } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 75568019cb..0fabb00040 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -125,6 +125,8 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SCreateDnodeStmt)); case QUERY_NODE_DROP_DNODE_STMT: return makeNode(type, sizeof(SDropDnodeStmt)); + case QUERY_NODE_ALTER_DNODE_STMT: + return makeNode(type, sizeof(SAlterDnodeStmt)); case QUERY_NODE_SHOW_DNODES_STMT: return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_SHOW_VGROUPS_STMT: diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 31d7331d0e..46bed1d61e 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -50,8 +50,10 @@ typedef enum EDatabaseOptionType { DB_OPTION_TTL, DB_OPTION_WAL, DB_OPTION_VGROUPS, - DB_OPTION_SINGLESTABLE, - DB_OPTION_STREAMMODE, + DB_OPTION_SINGLE_STABLE, + DB_OPTION_STREAM_MODE, + DB_OPTION_RETENTIONS, + DB_OPTION_FILE_FACTOR, DB_OPTION_MAX } EDatabaseOptionType; @@ -65,6 +67,11 @@ typedef enum ETableOptionType { TABLE_OPTION_MAX } ETableOptionType; +typedef struct SAlterOption { + int32_t type; + SToken val; +} SAlterOption; + extern SToken nil_token; void initAstCreateContext(SParseContext* pParseCxt, SAstCreateContext* pCxt); @@ -110,13 +117,16 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode* pLeft, SNode* pRight); SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt); +SNode* createDefaultAlterDatabaseOptions(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* createDefaultAlterTableOptions(SAstCreateContext* pCxt); SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, const SToken* pVal); SNode* setTableSmaOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pSma); +SNode* setTableRollupOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pFuncs); SNode* createColumnDefNode(SAstCreateContext* pCxt, const SToken* pColName, SDataType dataType, const SToken* pComment); SDataType createDataType(uint8_t type); SDataType createVarLenDataType(uint8_t type, const SToken* pLen); @@ -126,6 +136,11 @@ SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable); SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables); SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable); +SNode* createAlterTableOption(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions); +SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName, SDataType dataType); +SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName); +SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pOldColName, const SToken* pNewColName); +SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, const SToken* pTagName, SNode* pVal); SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName); SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDbName); SNode* createCreateUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, const SToken* pPassword); @@ -133,6 +148,7 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, int SNode* createDropUserStmt(SAstCreateContext* pCxt, const SToken* pUserName); SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort); SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode); +SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue); 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); @@ -140,6 +156,7 @@ 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); +SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue); #ifdef __cplusplus } diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 31c26e1e40..46775b7927 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -21,13 +21,15 @@ #include "parAst.h" } -%syntax_error { - if(TOKEN.z) { - generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); - } else { - generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL); +%syntax_error { + if (pCxt->valid) { + if(TOKEN.z) { + generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); + } else { + generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL); + } + pCxt->valid = false; } - pCxt->valid = false; } %left OR. @@ -41,6 +43,27 @@ %left NK_CONCAT. //%right NK_BITNOT. +/************************************************ create/alter account *****************************************/ +cmd ::= ALTER ACCOUNT NK_ID account_options. { pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } + +%type account_options { int32_t } +%destructor account_options { } +account_options ::= account_option. { } +account_options ::= account_options account_option. { } + +%type account_option { int32_t } +%destructor account_option { } +account_option ::= PASS literal. { } +account_option ::= PPS literal. { } +account_option ::= TSERIES literal. { } +account_option ::= STORAGE literal. { } +account_option ::= STREAMS literal. { } +account_option ::= QTIME literal. { } +account_option ::= DBS literal. { } +account_option ::= USERS literal. { } +account_option ::= CONNS literal. { } +account_option ::= STATE literal. { } + /************************************************ 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); } @@ -48,12 +71,16 @@ cmd ::= ALTER USER user_name(A) PRIVILEGE NK_STRING(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 **********************************************/ +/************************************************ create/drop/alter/show dnode ****************************************/ cmd ::= CREATE DNODE dnode_endpoint(A). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, NULL); } cmd ::= CREATE DNODE dnode_host_name(A) PORT NK_INTEGER(B). { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &A, &B); } cmd ::= DROP DNODE NK_INTEGER(A). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A); } cmd ::= DROP DNODE dnode_endpoint(A). { pCxt->pRootNode = createDropDnodeStmt(pCxt, &A); } cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } +cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, NULL); } +cmd ::= ALTER DNODE NK_INTEGER(A) NK_STRING(B) NK_STRING(C). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &A, &B, &C); } +cmd ::= ALTER ALL DNODES NK_STRING(A). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, NULL); } +cmd ::= ALTER ALL DNODES NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &A, &B); } %type dnode_endpoint { SToken } %destructor dnode_endpoint { } @@ -64,9 +91,13 @@ dnode_endpoint(A) ::= NK_STRING(B). dnode_host_name(A) ::= NK_ID(B). { A = B; } dnode_host_name(A) ::= NK_IPTOKEN(B). { A = B; } +/************************************************ alter local *********************************************************/ +cmd ::= ALTER LOCAL NK_STRING(A). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, NULL); } +cmd ::= ALTER LOCAL NK_STRING(A) NK_STRING(B). { pCxt->pRootNode = createAlterLocalStmt(pCxt, &A, &B); } + /************************************************ 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 ::= 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 ***************************************/ @@ -74,7 +105,7 @@ cmd ::= CREATE DATABASE not_exists_opt(A) db_name(B) db_options(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 ::= ALTER DATABASE db_name(A) db_options(B). { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &A, B); } +cmd ::= ALTER DATABASE db_name(A) alter_db_options(B). { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &A, B); } %type not_exists_opt { bool } %destructor not_exists_opt { } @@ -102,20 +133,55 @@ db_options(A) ::= db_options(B) REPLICA NK_INTEGER(C). db_options(A) ::= db_options(B) TTL NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_TTL, &C); } db_options(A) ::= db_options(B) WAL NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_WAL, &C); } db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_VGROUPS, &C); } -db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLESTABLE, &C); } -db_options(A) ::= db_options(B) STREAM_MODE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STREAMMODE, &C); } +db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLE_STABLE, &C); } +db_options(A) ::= db_options(B) STREAM_MODE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STREAM_MODE, &C); } +db_options(A) ::= db_options(B) RETENTIONS NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_RETENTIONS, &C); } +db_options(A) ::= db_options(B) FILE_FACTOR NK_FLOAT(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_FILE_FACTOR, &C); } + +alter_db_options(A) ::= alter_db_option(B). { A = createDefaultAlterDatabaseOptions(pCxt); A = setDatabaseOption(pCxt, A, B.type, &B.val); } +alter_db_options(A) ::= alter_db_options(B) alter_db_option(C). { A = setDatabaseOption(pCxt, B, C.type, &C.val); } + +%type alter_db_option { SAlterOption } +%destructor alter_db_option { } +alter_db_option(A) ::= BLOCKS NK_INTEGER(B). { A.type = DB_OPTION_BLOCKS; A.val = B; } +alter_db_option(A) ::= FSYNC NK_INTEGER(B). { A.type = DB_OPTION_FSYNC; A.val = B; } +alter_db_option(A) ::= KEEP NK_INTEGER(B). { A.type = DB_OPTION_KEEP; A.val = B; } +alter_db_option(A) ::= WAL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; } +alter_db_option(A) ::= QUORUM NK_INTEGER(B). { A.type = DB_OPTION_QUORUM; A.val = B; } +alter_db_option(A) ::= CACHELAST NK_INTEGER(B). { A.type = DB_OPTION_CACHELAST; A.val = B; } /************************************************ create/drop/show table/stable ***************************************/ cmd ::= CREATE TABLE not_exists_opt(A) full_table_name(B) - NK_LP column_def_list(C) NK_RP tags_def_opt(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E);} -cmd ::= CREATE TABLE multi_create_clause(A). { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, A);} + NK_LP column_def_list(C) NK_RP tags_def_opt(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); } +cmd ::= CREATE TABLE multi_create_clause(A). { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, A); } cmd ::= CREATE STABLE not_exists_opt(A) full_table_name(B) - NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E);} + NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E); } cmd ::= DROP TABLE multi_drop_clause(A). { pCxt->pRootNode = createDropTableStmt(pCxt, A); } cmd ::= DROP STABLE exists_opt(A) full_table_name(B). { pCxt->pRootNode = createDropSuperTableStmt(pCxt, A, B); } cmd ::= SHOW TABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } cmd ::= SHOW STABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } +cmd ::= ALTER TABLE alter_table_clause(A). { pCxt->pRootNode = A; } +cmd ::= ALTER STABLE alter_table_clause(A). { pCxt->pRootNode = A; } + +alter_table_clause(A) ::= full_table_name(B) alter_table_options(C). { A = createAlterTableOption(pCxt, B, C); } +alter_table_clause(A) ::= + full_table_name(B) ADD COLUMN column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, D); } +alter_table_clause(A) ::= full_table_name(B) DROP COLUMN column_name(C). { A = createAlterTableDropCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C); } +alter_table_clause(A) ::= + full_table_name(B) MODIFY COLUMN column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, D); } +alter_table_clause(A) ::= + full_table_name(B) RENAME COLUMN column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, &D); } +alter_table_clause(A) ::= + full_table_name(B) ADD TAG column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, D); } +alter_table_clause(A) ::= full_table_name(B) DROP TAG column_name(C). { A = createAlterTableDropCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C); } +alter_table_clause(A) ::= + full_table_name(B) MODIFY TAG column_name(C) type_name(D). { A = createAlterTableAddModifyCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, D); } +alter_table_clause(A) ::= + full_table_name(B) RENAME TAG column_name(C) column_name(D). { A = createAlterTableRenameCol(pCxt, B, TSDB_ALTER_TABLE_ADD_COLUMN, &C, &D); } +alter_table_clause(A) ::= + full_table_name(B) SET TAG column_name(C) NK_EQ literal(D). { A = createAlterTableSetTag(pCxt, B, &C, D); } + %type multi_create_clause { SNodeList* } %destructor multi_create_clause { nodesDestroyList($$); } multi_create_clause(A) ::= create_subtable_clause(B). { A = createNodeList(pCxt, B); } @@ -183,11 +249,21 @@ tags_def_opt(A) ::= tags_def(B). %destructor tags_def { nodesDestroyList($$); } tags_def(A) ::= TAGS NK_LP column_def_list(B) NK_RP. { A = B; } -table_options(A) ::= . { A = createDefaultTableOptions(pCxt);} +table_options(A) ::= . { A = createDefaultTableOptions(pCxt); } table_options(A) ::= table_options(B) COMMENT NK_STRING(C). { A = setTableOption(pCxt, B, TABLE_OPTION_COMMENT, &C); } table_options(A) ::= table_options(B) KEEP NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_KEEP, &C); } table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); } table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableSmaOption(pCxt, B, C); } +table_options(A) ::= table_options(B) ROLLUP NK_LP func_name_list(C) NK_RP. { A = setTableRollupOption(pCxt, B, C); } + +alter_table_options(A) ::= alter_table_option(B). { A = createDefaultAlterTableOptions(pCxt); A = setTableOption(pCxt, A, B.type, &B.val); } +alter_table_options(A) ::= alter_table_options(B) alter_table_option(C). { A = setTableOption(pCxt, B, C.type, &C.val); } + +%type alter_table_option { SAlterOption } +%destructor alter_table_option { } +alter_table_option(A) ::= COMMENT NK_STRING(B). { A.type = TABLE_OPTION_COMMENT; A.val = B; } +alter_table_option(A) ::= KEEP NK_INTEGER(B). { A.type = TABLE_OPTION_KEEP; A.val = B; } +alter_table_option(A) ::= TTL NK_INTEGER(B). { A.type = TABLE_OPTION_TTL; A.val = B; } %type col_name_list { SNodeList* } %destructor col_name_list { nodesDestroyList($$); } @@ -196,6 +272,13 @@ col_name_list(A) ::= col_name_list(B) NK_COMMA col_name(C). col_name(A) ::= column_name(B). { A = createColumnNode(pCxt, NULL, &B); } +%type func_name_list { SNodeList* } +%destructor func_name_list { nodesDestroyList($$); } +func_name_list(A) ::= func_name(B). { A = createNodeList(pCxt, B); } +func_name_list(A) ::= func_name_list(B) NK_COMMA col_name(C). { A = addNodeToList(pCxt, B, C); } + +func_name(A) ::= function_name(B). { A = createFunctionNode(pCxt, &B, NULL); } + /************************************************ create index ********************************************************/ 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 @@ -546,7 +629,7 @@ query_expression_body(A) ::= query_primary(A) ::= query_specification(B). { A = B; } //query_primary(A) ::= // NK_LP query_expression_body(B) -// order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP. { A = B;} +// order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP. { A = B; } %type order_by_clause_opt { SNodeList* } %destructor order_by_clause_opt { nodesDestroyList($$); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 034346362c..764f545ce3 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -246,6 +246,16 @@ static SDatabaseOptions* setDbStreamMode(SAstCreateContext* pCxt, SDatabaseOptio return pOptions; } +static SDatabaseOptions* setDbRetentions(SAstCreateContext* pCxt, SDatabaseOptions* pOptions, const SToken* pVal) { + // todo + return pOptions; +} + +static SDatabaseOptions* setDbFileFactor(SAstCreateContext* pCxt, SDatabaseOptions* pOptions, const SToken* pVal) { + // todo + return pOptions; +} + static void initSetDatabaseOptionFp() { setDbOptionFuncs[DB_OPTION_BLOCKS] = setDbBlocks; setDbOptionFuncs[DB_OPTION_CACHE] = setDbCache; @@ -262,8 +272,10 @@ static void initSetDatabaseOptionFp() { setDbOptionFuncs[DB_OPTION_TTL] = setDbTtl; setDbOptionFuncs[DB_OPTION_WAL] = setDbWal; setDbOptionFuncs[DB_OPTION_VGROUPS] = setDbVgroups; - setDbOptionFuncs[DB_OPTION_SINGLESTABLE] = setDbSingleStable; - setDbOptionFuncs[DB_OPTION_STREAMMODE] = setDbStreamMode; + setDbOptionFuncs[DB_OPTION_SINGLE_STABLE] = setDbSingleStable; + setDbOptionFuncs[DB_OPTION_STREAM_MODE] = setDbStreamMode; + setDbOptionFuncs[DB_OPTION_RETENTIONS] = setDbRetentions; + setDbOptionFuncs[DB_OPTION_FILE_FACTOR] = setDbFileFactor; } static STableOptions* setTableKeep(SAstCreateContext* pCxt, STableOptions* pOptions, const SToken* pVal) { @@ -772,6 +784,29 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { return (SNode*)pOptions; } +SNode* createDefaultAlterDatabaseOptions(SAstCreateContext* pCxt) { + SDatabaseOptions* pOptions = nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS); + CHECK_OUT_OF_MEM(pOptions); + pOptions->numOfBlocks = -1; + pOptions->cacheBlockSize = -1; + pOptions->cachelast = -1; + pOptions->compressionLevel = -1; + pOptions->daysPerFile = -1; + pOptions->fsyncPeriod = -1; + pOptions->maxRowsPerBlock = -1; + pOptions->minRowsPerBlock = -1; + pOptions->keep = -1; + pOptions->precision = -1; + pOptions->quorum = -1; + pOptions->replica = -1; + pOptions->ttl = -1; + pOptions->walLevel = -1; + pOptions->numOfVgroups = -1; + pOptions->singleStable = -1; + pOptions->streamMode = -1; + return (SNode*)pOptions; +} + SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, const SToken* pVal) { return (SNode*)setDbOptionFuncs[type](pCxt, (SDatabaseOptions*)pOptions, pVal); } @@ -818,6 +853,14 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) { return (SNode*)pOptions; } +SNode* createDefaultAlterTableOptions(SAstCreateContext* pCxt) { + STableOptions* pOptions = nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); + CHECK_OUT_OF_MEM(pOptions); + pOptions->keep = -1; + pOptions->ttl = -1; + return (SNode*)pOptions; +} + SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, const SToken* pVal) { return (SNode*)setTableOptionFuncs[type](pCxt, (STableOptions*)pOptions, pVal); } @@ -827,6 +870,11 @@ SNode* setTableSmaOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pS return pOptions; } +SNode* setTableRollupOption(SAstCreateContext* pCxt, SNode* pOptions, SNodeList* pFuncs) { + // todo + return pOptions; +} + SNode* createColumnDefNode(SAstCreateContext* pCxt, const SToken* pColName, SDataType dataType, const SToken* pComment) { SColumnDefNode* pCol = (SColumnDefNode*)nodesMakeNode(QUERY_NODE_COLUMN_DEF); CHECK_OUT_OF_MEM(pCol); @@ -912,6 +960,26 @@ SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, S return (SNode*)pStmt; } +SNode* createAlterTableOption(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions) { + +} + +SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName, SDataType dataType) { + +} + +SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pColName) { + +} + +SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_t alterType, const SToken* pOldColName, const SToken* pNewColName) { + +} + +SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, const SToken* pTagName, SNode* pVal) { + +} + SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName) { SUseDatabaseStmt* pStmt = (SUseDatabaseStmt*)nodesMakeNode(QUERY_NODE_USE_DATABASE_STMT); CHECK_OUT_OF_MEM(pStmt); @@ -1009,6 +1077,17 @@ SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode) { return (SNode*)pStmt; } +SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue) { + SAlterDnodeStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_DNODE_STMT); + CHECK_OUT_OF_MEM(pStmt); + pStmt->dnodeId = strtol(pDnode->z, NULL, 10); + trimString(pConfig->z, pConfig->n, pStmt->config, sizeof(pStmt->config)); + if (NULL != pValue) { + trimString(pValue->z, pValue->n, pStmt->value, sizeof(pStmt->value)); + } + return (SNode*)pStmt; +} + SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, const SToken* pIndexName, const SToken* pTableName, SNodeList* pCols, SNode* pOptions) { if (!checkIndexName(pCxt, pIndexName) || !checkTableName(pCxt, pTableName)) { return NULL; @@ -1077,3 +1156,13 @@ SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const pStmt->ignoreNotExists = ignoreNotExists; return (SNode*)pStmt; } + +SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue) { + SAlterLocalStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_LOCAL_STMT); + CHECK_OUT_OF_MEM(pStmt); + trimString(pConfig->z, pConfig->n, pStmt->config, sizeof(pStmt->config)); + if (NULL != pValue) { + trimString(pValue->z, pValue->n, pStmt->value, sizeof(pStmt->value)); + } + return (SNode*)pStmt; +} diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 2d58d4e1e3..4549660c76 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -28,6 +28,7 @@ typedef struct SKeyword { // keywords in sql string static SKeyword keywordTable[] = { + {"ACCOUNT", TK_ACCOUNT}, {"ALL", TK_ALL}, {"ALTER", TK_ALTER}, {"AND", TK_AND}, @@ -168,7 +169,6 @@ static SKeyword keywordTable[] = { // {"SCORES", TK_SCORES}, // {"GRANTS", TK_GRANTS}, // {"DOT", TK_DOT}, - // {"ACCOUNT", TK_ACCOUNT}, // {"DESCRIBE", TK_DESCRIBE}, // {"SYNCDB", TK_SYNCDB}, // {"LOCAL", TK_LOCAL}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index af7a38b702..e852a21c4e 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -962,6 +962,25 @@ static int32_t translateDropSuperTable(STranslateContext* pCxt, SDropSuperTableS return doTranslateDropSuperTable(pCxt, &tableName, pStmt->ignoreNotExists); } +static int32_t translateAlterTable(STranslateContext* pCxt, SAlterTableStmt* pStmt) { + SMAltertbReq alterReq = {0}; + + 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_STB; + pCxt->pCmdMsg->msgLen = tSerializeSMAlterStbReq(NULL, 0, &alterReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSMAlterStbReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &alterReq); + + return TSDB_CODE_SUCCESS; +} + static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* pStmt) { SName name = {0}; tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName)); @@ -1099,6 +1118,28 @@ static int32_t translateDropDnode(STranslateContext* pCxt, SDropDnodeStmt* pStmt return TSDB_CODE_SUCCESS; } +static int32_t translateAlterDnode(STranslateContext* pCxt, SAlterDnodeStmt* pStmt) { + SMCfgDnodeReq cfgReq = {0}; + cfgReq.dnodeId = pStmt->dnodeId; + strcpy(cfgReq.config, pStmt->config); + strcpy(cfgReq.value, pStmt->value); + + 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_CONFIG_DNODE; + pCxt->pCmdMsg->msgLen = tSerializeSMCfgDnodeReq(NULL, 0, &cfgReq); + pCxt->pCmdMsg->pMsg = malloc(pCxt->pCmdMsg->msgLen); + if (NULL == pCxt->pCmdMsg->pMsg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + tSerializeSMCfgDnodeReq(pCxt->pCmdMsg->pMsg, pCxt->pCmdMsg->msgLen, &cfgReq); + + return TSDB_CODE_SUCCESS; +} + static int32_t nodeTypeToShowType(ENodeType nt) { switch (nt) { case QUERY_NODE_SHOW_DATABASES_STMT: @@ -1364,6 +1405,11 @@ static int32_t translateDropTopic(STranslateContext* pCxt, SDropTopicStmt* pStmt return TSDB_CODE_SUCCESS; } +static int32_t translateAlterLocal(STranslateContext* pCxt, SAlterLocalStmt* pStmt) { + // todo + return TSDB_CODE_SUCCESS; +} + static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pNode)) { @@ -1388,6 +1434,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_DROP_SUPER_TABLE_STMT: code = translateDropSuperTable(pCxt, (SDropSuperTableStmt*)pNode); break; + case QUERY_NODE_ALTER_TABLE_STMT: + code = translateAlterTable(pCxt, (SAlterTableStmt*)pNode); + break; case QUERY_NODE_CREATE_USER_STMT: code = translateCreateUser(pCxt, (SCreateUserStmt*)pNode); break; @@ -1406,6 +1455,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_DROP_DNODE_STMT: code = translateDropDnode(pCxt, (SDropDnodeStmt*)pNode); break; + case QUERY_NODE_ALTER_DNODE_STMT: + code = translateAlterDnode(pCxt, (SAlterDnodeStmt*)pNode); + break; case QUERY_NODE_SHOW_DATABASES_STMT: case QUERY_NODE_SHOW_STABLES_STMT: case QUERY_NODE_SHOW_USERS_STMT: @@ -1436,6 +1488,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_DROP_TOPIC_STMT: code = translateDropTopic(pCxt, (SDropTopicStmt*)pNode); break; + case QUERY_NODE_ALTER_LOCAL_STMT: + code = translateAlterLocal(pCxt, (SAlterLocalStmt*)pNode); + break; default: break; } diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index aa2516e2b9..69c2380b45 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -46,17 +46,19 @@ static char* getSyntaxErrFormat(int32_t errCode) { case TSDB_CODE_PAR_NOT_SINGLE_GROUP: return "Not a single-group group function"; case TSDB_CODE_PAR_TAGS_NOT_MATCHED: - return "tags number not matched"; + return "Tags number not matched"; case TSDB_CODE_PAR_INVALID_TAG_NAME: - return "invalid tag name : %s"; + return "Invalid tag name : %s"; case TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG: - return "name or password too long"; + return "Name or password too long"; case TSDB_CODE_PAR_PASSWD_EMPTY: - return "password can not be empty"; + return "Password can not be empty"; case TSDB_CODE_PAR_INVALID_PORT: - return "port should be an integer that is less than 65535 and greater than 0"; + return "Port should be an integer that is less than 65535 and greater than 0"; case TSDB_CODE_PAR_INVALID_ENDPOINT: - return "endpoint should be in the format of 'fqdn:port'"; + return "Endpoint should be in the format of 'fqdn:port'"; + case TSDB_CODE_PAR_EXPRIE_STATEMENT: + return "This statement is no longer supported"; case TSDB_CODE_OUT_OF_MEMORY: return "Out of memory"; default: diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 18b507c1b0..4f2149ac88 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -99,22 +99,24 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char -#define YYNOCODE 220 +#define YYNOCODE 248 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SNodeList* yy24; - bool yy97; - SToken yy129; - SDataType yy224; - ENullOrder yy257; - EOperatorType yy260; - EFillMode yy294; - EJoinType yy332; - EOrder yy378; - SNode* yy432; + SNode* yy168; + SDataType yy208; + EJoinType yy228; + SToken yy241; + EOrder yy258; + EFillMode yy262; + int32_t yy324; + SAlterOption yy349; + ENullOrder yy425; + SNodeList* yy440; + bool yy457; + EOperatorType yy476; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -129,17 +131,17 @@ typedef union { #define ParseCTX_PARAM #define ParseCTX_FETCH #define ParseCTX_STORE -#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 +#define YYNSTATE 400 +#define YYNRULE 305 +#define YYNTOKEN 160 +#define YY_MAX_SHIFT 399 +#define YY_MIN_SHIFTREDUCE 608 +#define YY_MAX_SHIFTREDUCE 912 +#define YY_ERROR_ACTION 913 +#define YY_ACCEPT_ACTION 914 +#define YY_NO_ACTION 915 +#define YY_MIN_REDUCE 916 +#define YY_MAX_REDUCE 1220 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -206,322 +208,366 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (1012) +#define YY_ACTTAB_COUNT (1150) static const YYACTIONTYPE yy_action[] = { - /* 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, + /* 0 */ 951, 1087, 1087, 42, 297, 914, 1199, 208, 24, 140, + /* 10 */ 1070, 312, 79, 31, 29, 27, 26, 25, 916, 1198, + /* 20 */ 1010, 94, 917, 1197, 196, 211, 89, 31, 29, 27, + /* 30 */ 26, 25, 213, 352, 1018, 1061, 1063, 1085, 1085, 77, + /* 40 */ 76, 75, 74, 73, 72, 71, 70, 69, 68, 226, + /* 50 */ 991, 190, 339, 338, 337, 336, 335, 334, 333, 332, + /* 60 */ 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, + /* 70 */ 321, 1199, 100, 30, 28, 795, 31, 29, 27, 26, + /* 80 */ 25, 205, 352, 1053, 107, 818, 10, 1060, 1197, 297, + /* 90 */ 781, 353, 278, 195, 774, 1071, 242, 989, 1058, 243, + /* 100 */ 772, 77, 76, 75, 74, 73, 72, 71, 70, 69, + /* 110 */ 68, 12, 1015, 82, 190, 31, 29, 27, 26, 25, + /* 120 */ 23, 203, 243, 813, 814, 815, 816, 817, 819, 821, + /* 130 */ 822, 823, 773, 80, 1, 774, 31, 29, 27, 26, + /* 140 */ 25, 772, 280, 103, 1145, 1146, 320, 1150, 818, 713, + /* 150 */ 375, 374, 373, 717, 372, 719, 720, 371, 722, 368, + /* 160 */ 398, 728, 365, 730, 731, 362, 359, 97, 980, 1060, + /* 170 */ 908, 909, 854, 773, 352, 210, 783, 1098, 775, 778, + /* 180 */ 1058, 9, 8, 23, 203, 272, 813, 814, 815, 816, + /* 190 */ 817, 819, 821, 822, 823, 108, 1113, 385, 795, 380, + /* 200 */ 209, 398, 384, 294, 108, 383, 1060, 381, 89, 296, + /* 210 */ 382, 785, 214, 1085, 252, 1098, 1017, 1058, 282, 775, + /* 220 */ 778, 60, 1099, 1102, 1138, 353, 6, 10, 189, 1134, + /* 230 */ 64, 30, 28, 855, 1113, 1088, 635, 351, 1060, 205, + /* 240 */ 1199, 281, 250, 353, 347, 346, 1015, 296, 64, 1062, + /* 250 */ 253, 1085, 774, 107, 831, 379, 42, 1197, 772, 61, + /* 260 */ 1099, 1102, 1138, 286, 1015, 155, 198, 1134, 102, 12, + /* 270 */ 78, 1085, 1199, 1011, 1113, 1098, 343, 353, 1098, 154, + /* 280 */ 136, 294, 1012, 1157, 850, 107, 259, 1165, 108, 1197, + /* 290 */ 773, 21, 1, 171, 1113, 786, 1045, 1113, 1015, 820, + /* 300 */ 267, 294, 824, 853, 281, 59, 135, 296, 151, 990, + /* 310 */ 296, 1085, 353, 1098, 1085, 850, 282, 307, 398, 179, + /* 320 */ 1099, 1102, 61, 1099, 1102, 1138, 212, 287, 1113, 198, + /* 330 */ 1134, 102, 1113, 1015, 89, 294, 775, 778, 1199, 294, + /* 340 */ 636, 306, 1017, 219, 258, 296, 58, 119, 1098, 1085, + /* 350 */ 1166, 107, 988, 635, 271, 1197, 83, 61, 1099, 1102, + /* 360 */ 1138, 637, 215, 1007, 198, 1134, 1211, 1113, 377, 317, + /* 370 */ 89, 1060, 376, 316, 294, 1172, 108, 1098, 1017, 377, + /* 380 */ 296, 862, 1059, 376, 1085, 285, 221, 783, 218, 217, + /* 390 */ 122, 355, 61, 1099, 1102, 1138, 1113, 378, 318, 198, + /* 400 */ 1134, 1211, 1152, 294, 1006, 946, 30, 28, 378, 296, + /* 410 */ 1195, 784, 317, 1085, 205, 289, 316, 315, 314, 1149, + /* 420 */ 1152, 61, 1099, 1102, 1138, 1152, 353, 774, 198, 1134, + /* 430 */ 1211, 308, 1098, 772, 928, 30, 28, 1148, 386, 1156, + /* 440 */ 1085, 318, 1147, 205, 12, 255, 927, 1015, 353, 926, + /* 450 */ 353, 1113, 925, 152, 1098, 216, 774, 320, 294, 87, + /* 460 */ 315, 314, 772, 57, 296, 773, 278, 1, 1085, 1015, + /* 470 */ 1085, 1015, 51, 1113, 278, 53, 62, 1099, 1102, 1138, + /* 480 */ 294, 290, 1085, 1137, 1134, 1085, 296, 82, 1085, 1008, + /* 490 */ 1085, 918, 278, 398, 773, 82, 7, 313, 62, 1099, + /* 500 */ 1102, 1138, 27, 26, 25, 292, 1134, 80, 1004, 117, + /* 510 */ 293, 775, 778, 82, 101, 80, 876, 104, 1145, 1146, + /* 520 */ 248, 1150, 398, 116, 20, 105, 1145, 1146, 282, 1150, + /* 530 */ 65, 1000, 284, 80, 31, 29, 27, 26, 25, 1002, + /* 540 */ 775, 778, 924, 133, 1145, 277, 266, 276, 923, 43, + /* 550 */ 1199, 998, 114, 30, 28, 295, 1098, 108, 30, 28, + /* 560 */ 231, 205, 922, 107, 9, 8, 205, 1197, 30, 28, + /* 570 */ 981, 264, 273, 268, 774, 1113, 205, 1098, 1085, 774, + /* 580 */ 772, 810, 294, 161, 1085, 772, 159, 113, 296, 774, + /* 590 */ 921, 111, 1085, 137, 22, 772, 1113, 920, 1085, 919, + /* 600 */ 96, 1099, 1102, 294, 31, 29, 27, 26, 25, 296, + /* 610 */ 1054, 127, 773, 1085, 7, 163, 204, 773, 162, 7, + /* 620 */ 1092, 185, 1099, 1102, 781, 125, 1085, 773, 825, 1, + /* 630 */ 911, 912, 238, 1085, 1090, 1085, 792, 283, 1212, 764, + /* 640 */ 398, 130, 32, 1098, 237, 398, 249, 145, 279, 236, + /* 650 */ 32, 235, 302, 32, 150, 398, 1168, 706, 775, 778, + /* 660 */ 941, 143, 1113, 775, 778, 1098, 84, 1114, 85, 294, + /* 670 */ 232, 87, 397, 775, 778, 296, 2, 139, 781, 1085, + /* 680 */ 234, 233, 701, 227, 1113, 395, 1098, 62, 1099, 1102, + /* 690 */ 1138, 294, 939, 388, 738, 1135, 65, 296, 789, 744, + /* 700 */ 743, 1085, 88, 165, 260, 1113, 164, 1098, 85, 185, + /* 710 */ 1099, 1102, 294, 86, 87, 734, 85, 239, 296, 110, + /* 720 */ 228, 782, 1085, 1098, 167, 391, 1113, 166, 176, 357, + /* 730 */ 184, 1099, 1102, 294, 240, 788, 241, 41, 1098, 296, + /* 740 */ 244, 174, 1113, 1085, 115, 175, 95, 787, 251, 294, + /* 750 */ 256, 96, 1099, 1102, 254, 296, 118, 1113, 109, 1085, + /* 760 */ 1098, 274, 202, 786, 294, 257, 1179, 185, 1099, 1102, + /* 770 */ 296, 265, 1169, 300, 1085, 778, 1098, 206, 262, 1113, + /* 780 */ 197, 1098, 185, 1099, 1102, 123, 294, 126, 1178, 1213, + /* 790 */ 1159, 5, 296, 261, 99, 1113, 1085, 275, 4, 131, + /* 800 */ 1113, 850, 294, 129, 183, 1099, 1102, 294, 296, 1098, + /* 810 */ 81, 785, 1085, 296, 1153, 33, 132, 1085, 199, 291, + /* 820 */ 186, 1099, 1102, 1214, 1196, 177, 1099, 1102, 1113, 138, + /* 830 */ 288, 17, 1120, 1098, 1069, 294, 298, 299, 1098, 1068, + /* 840 */ 303, 296, 207, 147, 108, 1085, 52, 304, 305, 170, + /* 850 */ 50, 350, 1113, 187, 1099, 1102, 172, 1113, 390, 294, + /* 860 */ 153, 1098, 310, 1016, 294, 296, 225, 354, 1005, 1085, + /* 870 */ 296, 955, 158, 399, 1085, 1079, 1098, 178, 1099, 1102, + /* 880 */ 1113, 1001, 188, 1099, 1102, 160, 169, 294, 90, 91, + /* 890 */ 1003, 393, 67, 296, 999, 1113, 387, 1085, 92, 93, + /* 900 */ 168, 180, 294, 173, 954, 1110, 1099, 1102, 296, 181, + /* 910 */ 1078, 1077, 1085, 1098, 229, 230, 1098, 1076, 994, 993, + /* 920 */ 1109, 1099, 1102, 385, 953, 380, 38, 950, 384, 37, + /* 930 */ 938, 383, 1113, 381, 933, 1113, 382, 1075, 1066, 294, + /* 940 */ 992, 112, 294, 650, 952, 296, 1098, 949, 296, 1085, + /* 950 */ 246, 245, 1085, 247, 937, 936, 932, 1108, 1099, 1102, + /* 960 */ 193, 1099, 1102, 1074, 1073, 1113, 36, 1065, 1098, 120, + /* 970 */ 121, 44, 294, 3, 32, 14, 124, 39, 296, 875, + /* 980 */ 98, 128, 1085, 270, 1098, 269, 1090, 1113, 869, 1098, + /* 990 */ 192, 1099, 1102, 45, 294, 868, 46, 15, 34, 11, + /* 1000 */ 296, 47, 847, 1113, 1085, 897, 846, 902, 1113, 134, + /* 1010 */ 294, 896, 194, 1099, 1102, 294, 296, 879, 200, 19, + /* 1020 */ 1085, 296, 901, 35, 16, 1085, 106, 900, 191, 1099, + /* 1030 */ 1102, 201, 8, 182, 1099, 1102, 811, 141, 13, 263, + /* 1040 */ 877, 878, 880, 881, 793, 142, 18, 1064, 873, 144, + /* 1050 */ 146, 48, 148, 149, 301, 49, 712, 40, 311, 54, + /* 1060 */ 53, 742, 55, 56, 741, 740, 309, 648, 319, 671, + /* 1070 */ 670, 948, 669, 668, 667, 666, 662, 665, 664, 663, + /* 1080 */ 661, 660, 935, 659, 658, 657, 934, 656, 655, 654, + /* 1090 */ 653, 340, 341, 344, 345, 929, 348, 342, 349, 996, + /* 1100 */ 1089, 156, 157, 66, 356, 735, 220, 360, 363, 366, + /* 1110 */ 727, 726, 369, 725, 749, 748, 724, 747, 995, 679, + /* 1120 */ 678, 947, 677, 222, 676, 942, 675, 674, 940, 223, + /* 1130 */ 358, 389, 732, 361, 224, 729, 723, 364, 931, 367, + /* 1140 */ 394, 392, 930, 396, 776, 915, 721, 370, 915, 63, }; static const YYCODETYPE yy_lookahead[] = { - /* 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, + /* 0 */ 0, 163, 163, 170, 195, 160, 226, 198, 211, 212, + /* 10 */ 201, 183, 179, 12, 13, 14, 15, 16, 0, 239, + /* 20 */ 187, 161, 162, 243, 186, 186, 182, 12, 13, 14, + /* 30 */ 15, 16, 191, 20, 190, 194, 195, 199, 199, 21, + /* 40 */ 22, 23, 24, 25, 26, 27, 28, 29, 30, 204, + /* 50 */ 0, 50, 52, 53, 54, 55, 56, 57, 58, 59, + /* 60 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + /* 70 */ 70, 226, 181, 12, 13, 74, 12, 13, 14, 15, + /* 80 */ 16, 20, 20, 192, 239, 84, 73, 182, 243, 195, + /* 90 */ 20, 168, 168, 188, 33, 201, 173, 0, 193, 49, + /* 100 */ 39, 21, 22, 23, 24, 25, 26, 27, 28, 29, + /* 110 */ 30, 50, 189, 189, 50, 12, 13, 14, 15, 16, + /* 120 */ 119, 120, 49, 122, 123, 124, 125, 126, 127, 128, + /* 130 */ 129, 130, 71, 209, 73, 33, 12, 13, 14, 15, + /* 140 */ 16, 39, 218, 219, 220, 221, 49, 223, 84, 90, + /* 150 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + /* 160 */ 99, 102, 103, 104, 105, 106, 107, 171, 172, 182, + /* 170 */ 155, 156, 4, 71, 20, 188, 20, 163, 117, 118, + /* 180 */ 193, 1, 2, 119, 120, 20, 122, 123, 124, 125, + /* 190 */ 126, 127, 128, 129, 130, 134, 182, 52, 74, 54, + /* 200 */ 174, 99, 57, 189, 134, 60, 182, 62, 182, 195, + /* 210 */ 65, 20, 188, 199, 168, 163, 190, 193, 204, 117, + /* 220 */ 118, 207, 208, 209, 210, 168, 44, 73, 214, 215, + /* 230 */ 173, 12, 13, 14, 182, 163, 33, 180, 182, 20, + /* 240 */ 226, 189, 39, 168, 165, 166, 189, 195, 173, 193, + /* 250 */ 204, 199, 33, 239, 74, 180, 170, 243, 39, 207, + /* 260 */ 208, 209, 210, 88, 189, 32, 214, 215, 216, 50, + /* 270 */ 37, 199, 226, 187, 182, 163, 43, 168, 163, 46, + /* 280 */ 228, 189, 173, 132, 133, 239, 234, 235, 134, 243, + /* 290 */ 71, 119, 73, 175, 182, 20, 178, 182, 189, 127, + /* 300 */ 208, 189, 130, 135, 189, 72, 115, 195, 75, 0, + /* 310 */ 195, 199, 168, 163, 199, 133, 204, 173, 99, 207, + /* 320 */ 208, 209, 207, 208, 209, 210, 174, 152, 182, 214, + /* 330 */ 215, 216, 182, 189, 182, 189, 117, 118, 226, 189, + /* 340 */ 20, 108, 190, 35, 111, 195, 167, 114, 163, 199, + /* 350 */ 235, 239, 0, 33, 208, 243, 177, 207, 208, 209, + /* 360 */ 210, 41, 174, 184, 214, 215, 216, 182, 60, 60, + /* 370 */ 182, 182, 64, 64, 189, 225, 134, 163, 190, 60, + /* 380 */ 195, 14, 193, 64, 199, 3, 78, 20, 80, 81, + /* 390 */ 115, 83, 207, 208, 209, 210, 182, 89, 89, 214, + /* 400 */ 215, 216, 205, 189, 163, 0, 12, 13, 89, 195, + /* 410 */ 225, 20, 60, 199, 20, 88, 64, 108, 109, 222, + /* 420 */ 205, 207, 208, 209, 210, 205, 168, 33, 214, 215, + /* 430 */ 216, 173, 163, 39, 163, 12, 13, 222, 33, 225, + /* 440 */ 199, 89, 222, 20, 50, 74, 163, 189, 168, 163, + /* 450 */ 168, 182, 163, 173, 163, 173, 33, 49, 189, 88, + /* 460 */ 108, 109, 39, 73, 195, 71, 168, 73, 199, 189, + /* 470 */ 199, 189, 167, 182, 168, 85, 207, 208, 209, 210, + /* 480 */ 189, 154, 199, 214, 215, 199, 195, 189, 199, 184, + /* 490 */ 199, 162, 168, 99, 71, 189, 73, 86, 207, 208, + /* 500 */ 209, 210, 14, 15, 16, 214, 215, 209, 183, 32, + /* 510 */ 50, 117, 118, 189, 37, 209, 74, 219, 220, 221, + /* 520 */ 43, 223, 99, 46, 2, 219, 220, 221, 204, 223, + /* 530 */ 88, 183, 150, 209, 12, 13, 14, 15, 16, 183, + /* 540 */ 117, 118, 163, 219, 220, 221, 113, 223, 163, 72, + /* 550 */ 226, 183, 75, 12, 13, 14, 163, 134, 12, 13, + /* 560 */ 168, 20, 163, 239, 1, 2, 20, 243, 12, 13, + /* 570 */ 172, 237, 139, 140, 33, 182, 20, 163, 199, 33, + /* 580 */ 39, 121, 189, 79, 199, 39, 82, 110, 195, 33, + /* 590 */ 163, 114, 199, 246, 2, 39, 182, 163, 199, 163, + /* 600 */ 207, 208, 209, 189, 12, 13, 14, 15, 16, 195, + /* 610 */ 192, 74, 71, 199, 73, 79, 202, 71, 82, 73, + /* 620 */ 73, 207, 208, 209, 20, 88, 199, 71, 74, 73, + /* 630 */ 158, 159, 28, 199, 87, 199, 74, 244, 245, 74, + /* 640 */ 99, 231, 88, 163, 40, 99, 165, 74, 224, 45, + /* 650 */ 88, 47, 74, 88, 74, 99, 206, 74, 117, 118, + /* 660 */ 0, 88, 182, 117, 118, 163, 88, 182, 88, 189, + /* 670 */ 66, 88, 21, 117, 118, 195, 227, 240, 20, 199, + /* 680 */ 76, 77, 74, 168, 182, 34, 163, 207, 208, 209, + /* 690 */ 210, 189, 0, 33, 74, 215, 88, 195, 20, 74, + /* 700 */ 74, 199, 74, 79, 202, 182, 82, 163, 88, 207, + /* 710 */ 208, 209, 189, 88, 88, 74, 88, 203, 195, 170, + /* 720 */ 116, 20, 199, 163, 79, 33, 182, 82, 18, 88, + /* 730 */ 207, 208, 209, 189, 189, 20, 196, 170, 163, 195, + /* 740 */ 168, 31, 182, 199, 170, 35, 36, 20, 164, 189, + /* 750 */ 189, 207, 208, 209, 203, 195, 167, 182, 48, 199, + /* 760 */ 163, 238, 202, 20, 189, 196, 236, 207, 208, 209, + /* 770 */ 195, 142, 206, 141, 199, 118, 163, 202, 199, 182, + /* 780 */ 199, 163, 207, 208, 209, 200, 189, 200, 236, 245, + /* 790 */ 233, 149, 195, 137, 230, 182, 199, 148, 136, 229, + /* 800 */ 182, 133, 189, 232, 207, 208, 209, 189, 195, 163, + /* 810 */ 189, 20, 199, 195, 205, 131, 217, 199, 157, 153, + /* 820 */ 207, 208, 209, 247, 242, 207, 208, 209, 182, 241, + /* 830 */ 151, 73, 213, 163, 200, 189, 199, 199, 163, 200, + /* 840 */ 112, 195, 199, 189, 134, 199, 73, 197, 196, 178, + /* 850 */ 167, 164, 182, 207, 208, 209, 168, 182, 4, 189, + /* 860 */ 167, 163, 185, 189, 189, 195, 164, 182, 182, 199, + /* 870 */ 195, 0, 182, 19, 199, 0, 163, 207, 208, 209, + /* 880 */ 182, 182, 207, 208, 209, 182, 32, 189, 182, 182, + /* 890 */ 182, 37, 168, 195, 182, 182, 42, 199, 182, 182, + /* 900 */ 46, 176, 189, 169, 0, 207, 208, 209, 195, 176, + /* 910 */ 0, 0, 199, 163, 66, 87, 163, 0, 0, 0, + /* 920 */ 207, 208, 209, 52, 0, 54, 72, 0, 57, 75, + /* 930 */ 0, 60, 182, 62, 0, 182, 65, 0, 0, 189, + /* 940 */ 0, 44, 189, 51, 0, 195, 163, 0, 195, 199, + /* 950 */ 37, 39, 199, 44, 0, 0, 0, 207, 208, 209, + /* 960 */ 207, 208, 209, 0, 0, 182, 115, 0, 163, 44, + /* 970 */ 110, 73, 189, 88, 88, 138, 74, 88, 195, 74, + /* 980 */ 73, 73, 199, 88, 163, 39, 87, 182, 74, 163, + /* 990 */ 207, 208, 209, 73, 189, 74, 73, 138, 132, 138, + /* 1000 */ 195, 4, 74, 182, 199, 39, 74, 74, 182, 87, + /* 1010 */ 189, 39, 207, 208, 209, 189, 195, 121, 39, 88, + /* 1020 */ 199, 195, 39, 88, 88, 199, 87, 39, 207, 208, + /* 1030 */ 209, 39, 2, 207, 208, 209, 121, 87, 73, 143, + /* 1040 */ 144, 145, 146, 147, 74, 74, 73, 0, 74, 73, + /* 1050 */ 73, 73, 44, 110, 113, 73, 33, 73, 89, 73, + /* 1060 */ 85, 39, 73, 73, 39, 33, 86, 51, 50, 71, + /* 1070 */ 33, 0, 39, 39, 39, 39, 33, 39, 39, 39, + /* 1080 */ 39, 39, 0, 39, 39, 39, 0, 39, 39, 39, + /* 1090 */ 39, 39, 37, 39, 38, 0, 33, 44, 21, 0, + /* 1100 */ 87, 87, 82, 84, 39, 74, 39, 39, 39, 39, + /* 1110 */ 101, 101, 39, 101, 39, 39, 101, 33, 0, 39, + /* 1120 */ 39, 0, 39, 33, 39, 0, 39, 39, 0, 33, + /* 1130 */ 73, 40, 74, 73, 33, 74, 74, 73, 0, 73, + /* 1140 */ 33, 39, 0, 33, 33, 248, 74, 73, 248, 20, + /* 1150 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1160 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1170 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1180 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1190 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1200 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1210 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1220 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1230 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1240 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1250 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1260 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1270 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1280 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1290 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, + /* 1300 */ 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, }; -#define YY_SHIFT_COUNT (332) +#define YY_SHIFT_COUNT (399) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1009) +#define YY_SHIFT_MAX (1142) static const unsigned short int yy_shift_ofst[] = { - /* 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, 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, + /* 0 */ 710, 61, 219, 394, 394, 394, 394, 423, 394, 394, + /* 10 */ 154, 546, 556, 541, 546, 546, 546, 546, 546, 546, + /* 20 */ 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, + /* 30 */ 546, 546, 546, 13, 13, 13, 70, 62, 62, 102, + /* 40 */ 102, 62, 62, 73, 156, 165, 165, 242, 391, 156, + /* 50 */ 62, 62, 156, 62, 156, 391, 156, 156, 62, 408, + /* 60 */ 1, 64, 64, 80, 308, 102, 102, 145, 102, 102, + /* 70 */ 102, 102, 102, 102, 102, 102, 102, 102, 320, 50, + /* 80 */ 191, 191, 191, 97, 391, 156, 156, 156, 411, 59, + /* 90 */ 59, 59, 59, 59, 18, 604, 15, 871, 896, 433, + /* 100 */ 319, 203, 275, 151, 182, 151, 367, 382, 168, 658, + /* 110 */ 678, 73, 701, 715, 73, 658, 73, 727, 678, 408, + /* 120 */ 701, 715, 743, 629, 632, 657, 629, 632, 657, 642, + /* 130 */ 649, 656, 662, 668, 701, 791, 684, 661, 666, 679, + /* 140 */ 758, 156, 632, 657, 657, 632, 657, 728, 701, 715, + /* 150 */ 411, 408, 773, 658, 408, 727, 701, 156, 156, 156, + /* 160 */ 156, 156, 156, 156, 156, 156, 156, 156, 658, 727, + /* 170 */ 1150, 1150, 1150, 0, 233, 477, 854, 522, 592, 124, + /* 180 */ 309, 352, 103, 103, 103, 103, 103, 103, 103, 180, + /* 190 */ 172, 488, 488, 488, 488, 371, 442, 537, 563, 472, + /* 200 */ 175, 327, 554, 460, 562, 547, 565, 573, 578, 580, + /* 210 */ 583, 608, 620, 625, 626, 628, 390, 504, 536, 624, + /* 220 */ 641, 645, 405, 660, 692, 651, 875, 904, 910, 911, + /* 230 */ 848, 828, 917, 918, 919, 924, 927, 930, 934, 937, + /* 240 */ 938, 897, 940, 892, 944, 947, 912, 913, 909, 954, + /* 250 */ 955, 956, 963, 964, 851, 967, 898, 925, 860, 885, + /* 260 */ 886, 837, 902, 889, 905, 907, 908, 914, 920, 921, + /* 270 */ 946, 895, 899, 923, 931, 859, 928, 932, 922, 866, + /* 280 */ 935, 939, 933, 936, 861, 997, 966, 972, 979, 983, + /* 290 */ 988, 992, 1030, 915, 950, 970, 965, 973, 971, 974, + /* 300 */ 976, 977, 941, 978, 1047, 1008, 943, 982, 975, 984, + /* 310 */ 980, 1023, 969, 986, 989, 990, 1022, 1025, 1032, 1016, + /* 320 */ 1018, 998, 1037, 1033, 1034, 1035, 1036, 1038, 1039, 1040, + /* 330 */ 1043, 1041, 1042, 1044, 1045, 1046, 1048, 1049, 1050, 1051, + /* 340 */ 1071, 1052, 1055, 1053, 1082, 1054, 1056, 1086, 1095, 1063, + /* 350 */ 1077, 1099, 1013, 1014, 1019, 1020, 1031, 1065, 1067, 1057, + /* 360 */ 1058, 1068, 1060, 1061, 1069, 1064, 1062, 1070, 1066, 1072, + /* 370 */ 1073, 1074, 1009, 1010, 1012, 1015, 1075, 1076, 1084, 1118, + /* 380 */ 1080, 1081, 1083, 1085, 1087, 1088, 1121, 1090, 1125, 1096, + /* 390 */ 1091, 1128, 1101, 1102, 1138, 1107, 1142, 1110, 1111, 1129, }; -#define YY_REDUCE_COUNT (137) -#define YY_REDUCE_MIN (-162) -#define YY_REDUCE_MAX (708) +#define YY_REDUCE_COUNT (172) +#define YY_REDUCE_MIN (-220) +#define YY_REDUCE_MAX (826) static const short yy_reduce_ofst[] = { - /* 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, + /* 0 */ -155, 14, 52, 115, 150, 185, 214, 112, 269, 291, + /* 10 */ 324, 393, 480, 414, 502, 523, 544, 560, 575, 597, + /* 20 */ 613, 618, 646, 670, 675, 698, 713, 750, 753, 783, + /* 30 */ 805, 821, 826, -76, 298, 306, 46, 57, 75, -162, + /* 40 */ -161, -77, 109, -167, -95, 92, 146, -220, -191, 26, + /* 50 */ 144, 258, -13, 280, 152, -159, 24, 188, 282, 179, + /* 60 */ -203, -203, -203, -140, -109, 72, 241, -4, 271, 283, + /* 70 */ 286, 289, 379, 385, 399, 427, 434, 436, 79, 86, + /* 80 */ 197, 215, 220, 305, -106, -156, 56, 189, 118, -172, + /* 90 */ 325, 348, 356, 368, 329, 392, 347, 398, 334, 410, + /* 100 */ 418, 481, 450, 424, 424, 424, 485, 437, 449, 515, + /* 110 */ 514, 549, 545, 540, 567, 572, 574, 584, 551, 589, + /* 120 */ 561, 569, 566, 530, 585, 579, 552, 587, 581, 557, + /* 130 */ 571, 564, 570, 424, 621, 609, 599, 576, 582, 588, + /* 140 */ 619, 485, 634, 637, 638, 639, 643, 650, 654, 652, + /* 150 */ 671, 683, 677, 688, 693, 687, 674, 685, 686, 690, + /* 160 */ 699, 703, 706, 707, 708, 712, 716, 717, 724, 702, + /* 170 */ 725, 733, 734, }; static const YYACTIONTYPE yy_default[] = { - /* 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, + /* 0 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 10 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 20 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 30 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 40 */ 913, 913, 913, 959, 913, 913, 913, 913, 913, 913, + /* 50 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 957, + /* 60 */ 913, 1140, 913, 913, 913, 913, 913, 913, 913, 913, + /* 70 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 959, + /* 80 */ 1151, 1151, 1151, 957, 913, 913, 913, 913, 1044, 913, + /* 90 */ 913, 913, 913, 913, 913, 913, 1215, 913, 913, 1175, + /* 100 */ 997, 913, 1167, 1143, 1157, 1144, 913, 1200, 1160, 913, + /* 110 */ 913, 959, 913, 913, 959, 913, 959, 913, 913, 957, + /* 120 */ 913, 913, 913, 1182, 1180, 913, 1182, 1180, 913, 1194, + /* 130 */ 1190, 1173, 1171, 1157, 913, 913, 913, 1218, 1206, 1202, + /* 140 */ 913, 913, 1180, 913, 913, 1180, 913, 1067, 913, 913, + /* 150 */ 913, 957, 1013, 913, 957, 913, 913, 913, 913, 913, + /* 160 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 170 */ 1047, 1047, 960, 913, 913, 913, 913, 913, 913, 913, + /* 180 */ 913, 913, 1112, 1193, 1192, 1111, 1117, 1116, 1115, 913, + /* 190 */ 913, 1106, 1107, 1105, 1104, 913, 913, 913, 1141, 913, + /* 200 */ 1203, 1207, 913, 913, 913, 1091, 913, 913, 913, 913, + /* 210 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 220 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 230 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 240 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 250 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 1164, + /* 260 */ 1174, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 270 */ 913, 913, 1091, 913, 1191, 913, 1150, 1146, 913, 913, + /* 280 */ 1142, 913, 913, 1201, 913, 913, 913, 913, 913, 913, + /* 290 */ 913, 913, 1136, 913, 913, 913, 913, 913, 913, 913, + /* 300 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 310 */ 913, 913, 1019, 913, 913, 913, 913, 913, 913, 913, + /* 320 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 330 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 340 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 350 */ 913, 913, 1090, 913, 913, 913, 913, 913, 913, 1041, + /* 360 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 370 */ 913, 913, 1026, 1024, 1023, 1022, 913, 913, 913, 913, + /* 380 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, + /* 390 */ 913, 913, 913, 913, 913, 913, 913, 913, 913, 913, }; /********** End of lemon-generated parsing tables *****************************/ @@ -646,208 +692,236 @@ static const char *const yyTokenName[] = { /* 15 */ "NK_SLASH", /* 16 */ "NK_REM", /* 17 */ "NK_CONCAT", - /* 18 */ "CREATE", - /* 19 */ "USER", - /* 20 */ "PASS", - /* 21 */ "NK_STRING", - /* 22 */ "ALTER", - /* 23 */ "PRIVILEGE", - /* 24 */ "DROP", - /* 25 */ "SHOW", - /* 26 */ "USERS", - /* 27 */ "DNODE", - /* 28 */ "PORT", - /* 29 */ "NK_INTEGER", - /* 30 */ "DNODES", - /* 31 */ "NK_ID", - /* 32 */ "NK_IPTOKEN", - /* 33 */ "QNODE", - /* 34 */ "ON", - /* 35 */ "QNODES", - /* 36 */ "DATABASE", - /* 37 */ "DATABASES", - /* 38 */ "USE", - /* 39 */ "IF", - /* 40 */ "NOT", - /* 41 */ "EXISTS", - /* 42 */ "BLOCKS", - /* 43 */ "CACHE", - /* 44 */ "CACHELAST", - /* 45 */ "COMP", - /* 46 */ "DAYS", - /* 47 */ "FSYNC", - /* 48 */ "MAXROWS", - /* 49 */ "MINROWS", - /* 50 */ "KEEP", - /* 51 */ "PRECISION", - /* 52 */ "QUORUM", - /* 53 */ "REPLICA", - /* 54 */ "TTL", - /* 55 */ "WAL", - /* 56 */ "VGROUPS", - /* 57 */ "SINGLE_STABLE", - /* 58 */ "STREAM_MODE", - /* 59 */ "TABLE", - /* 60 */ "NK_LP", - /* 61 */ "NK_RP", - /* 62 */ "STABLE", - /* 63 */ "TABLES", - /* 64 */ "STABLES", - /* 65 */ "USING", - /* 66 */ "TAGS", - /* 67 */ "NK_DOT", - /* 68 */ "NK_COMMA", - /* 69 */ "COMMENT", - /* 70 */ "BOOL", - /* 71 */ "TINYINT", - /* 72 */ "SMALLINT", - /* 73 */ "INT", - /* 74 */ "INTEGER", - /* 75 */ "BIGINT", - /* 76 */ "FLOAT", - /* 77 */ "DOUBLE", - /* 78 */ "BINARY", - /* 79 */ "TIMESTAMP", - /* 80 */ "NCHAR", - /* 81 */ "UNSIGNED", - /* 82 */ "JSON", - /* 83 */ "VARCHAR", - /* 84 */ "MEDIUMBLOB", - /* 85 */ "BLOB", - /* 86 */ "VARBINARY", - /* 87 */ "DECIMAL", - /* 88 */ "SMA", - /* 89 */ "INDEX", - /* 90 */ "FULLTEXT", - /* 91 */ "FUNCTION", - /* 92 */ "INTERVAL", - /* 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", + /* 18 */ "ALTER", + /* 19 */ "ACCOUNT", + /* 20 */ "NK_ID", + /* 21 */ "PASS", + /* 22 */ "PPS", + /* 23 */ "TSERIES", + /* 24 */ "STORAGE", + /* 25 */ "STREAMS", + /* 26 */ "QTIME", + /* 27 */ "DBS", + /* 28 */ "USERS", + /* 29 */ "CONNS", + /* 30 */ "STATE", + /* 31 */ "CREATE", + /* 32 */ "USER", + /* 33 */ "NK_STRING", + /* 34 */ "PRIVILEGE", + /* 35 */ "DROP", + /* 36 */ "SHOW", + /* 37 */ "DNODE", + /* 38 */ "PORT", + /* 39 */ "NK_INTEGER", + /* 40 */ "DNODES", + /* 41 */ "NK_IPTOKEN", + /* 42 */ "LOCAL", + /* 43 */ "QNODE", + /* 44 */ "ON", + /* 45 */ "QNODES", + /* 46 */ "DATABASE", + /* 47 */ "DATABASES", + /* 48 */ "USE", + /* 49 */ "IF", + /* 50 */ "NOT", + /* 51 */ "EXISTS", + /* 52 */ "BLOCKS", + /* 53 */ "CACHE", + /* 54 */ "CACHELAST", + /* 55 */ "COMP", + /* 56 */ "DAYS", + /* 57 */ "FSYNC", + /* 58 */ "MAXROWS", + /* 59 */ "MINROWS", + /* 60 */ "KEEP", + /* 61 */ "PRECISION", + /* 62 */ "QUORUM", + /* 63 */ "REPLICA", + /* 64 */ "TTL", + /* 65 */ "WAL", + /* 66 */ "VGROUPS", + /* 67 */ "SINGLE_STABLE", + /* 68 */ "STREAM_MODE", + /* 69 */ "RETENTIONS", + /* 70 */ "FILE_FACTOR", + /* 71 */ "NK_FLOAT", + /* 72 */ "TABLE", + /* 73 */ "NK_LP", + /* 74 */ "NK_RP", + /* 75 */ "STABLE", + /* 76 */ "TABLES", + /* 77 */ "STABLES", + /* 78 */ "ADD", + /* 79 */ "COLUMN", + /* 80 */ "MODIFY", + /* 81 */ "RENAME", + /* 82 */ "TAG", + /* 83 */ "SET", + /* 84 */ "NK_EQ", + /* 85 */ "USING", + /* 86 */ "TAGS", + /* 87 */ "NK_DOT", + /* 88 */ "NK_COMMA", + /* 89 */ "COMMENT", + /* 90 */ "BOOL", + /* 91 */ "TINYINT", + /* 92 */ "SMALLINT", + /* 93 */ "INT", + /* 94 */ "INTEGER", + /* 95 */ "BIGINT", + /* 96 */ "FLOAT", + /* 97 */ "DOUBLE", + /* 98 */ "BINARY", + /* 99 */ "TIMESTAMP", + /* 100 */ "NCHAR", + /* 101 */ "UNSIGNED", + /* 102 */ "JSON", + /* 103 */ "VARCHAR", + /* 104 */ "MEDIUMBLOB", + /* 105 */ "BLOB", + /* 106 */ "VARBINARY", + /* 107 */ "DECIMAL", + /* 108 */ "SMA", + /* 109 */ "ROLLUP", + /* 110 */ "INDEX", + /* 111 */ "FULLTEXT", + /* 112 */ "FUNCTION", + /* 113 */ "INTERVAL", + /* 114 */ "TOPIC", + /* 115 */ "AS", + /* 116 */ "MNODES", + /* 117 */ "NK_BOOL", + /* 118 */ "NK_VARIABLE", + /* 119 */ "BETWEEN", + /* 120 */ "IS", + /* 121 */ "NULL", + /* 122 */ "NK_LT", + /* 123 */ "NK_GT", + /* 124 */ "NK_LE", + /* 125 */ "NK_GE", + /* 126 */ "NK_NE", + /* 127 */ "LIKE", + /* 128 */ "MATCH", + /* 129 */ "NMATCH", + /* 130 */ "IN", + /* 131 */ "FROM", + /* 132 */ "JOIN", + /* 133 */ "INNER", + /* 134 */ "SELECT", + /* 135 */ "DISTINCT", + /* 136 */ "WHERE", + /* 137 */ "PARTITION", + /* 138 */ "BY", + /* 139 */ "SESSION", + /* 140 */ "STATE_WINDOW", + /* 141 */ "SLIDING", + /* 142 */ "FILL", + /* 143 */ "VALUE", + /* 144 */ "NONE", + /* 145 */ "PREV", + /* 146 */ "LINEAR", + /* 147 */ "NEXT", + /* 148 */ "GROUP", + /* 149 */ "HAVING", + /* 150 */ "ORDER", + /* 151 */ "SLIMIT", + /* 152 */ "SOFFSET", + /* 153 */ "LIMIT", + /* 154 */ "OFFSET", + /* 155 */ "ASC", + /* 156 */ "DESC", + /* 157 */ "NULLS", + /* 158 */ "FIRST", + /* 159 */ "LAST", + /* 160 */ "cmd", + /* 161 */ "account_options", + /* 162 */ "account_option", + /* 163 */ "literal", + /* 164 */ "user_name", + /* 165 */ "dnode_endpoint", + /* 166 */ "dnode_host_name", + /* 167 */ "not_exists_opt", + /* 168 */ "db_name", + /* 169 */ "db_options", + /* 170 */ "exists_opt", + /* 171 */ "alter_db_options", + /* 172 */ "alter_db_option", + /* 173 */ "full_table_name", + /* 174 */ "column_def_list", + /* 175 */ "tags_def_opt", + /* 176 */ "table_options", + /* 177 */ "multi_create_clause", + /* 178 */ "tags_def", + /* 179 */ "multi_drop_clause", + /* 180 */ "alter_table_clause", + /* 181 */ "alter_table_options", + /* 182 */ "column_name", + /* 183 */ "type_name", + /* 184 */ "create_subtable_clause", + /* 185 */ "specific_tags_opt", + /* 186 */ "literal_list", + /* 187 */ "drop_table_clause", + /* 188 */ "col_name_list", + /* 189 */ "table_name", + /* 190 */ "column_def", + /* 191 */ "func_name_list", + /* 192 */ "alter_table_option", + /* 193 */ "col_name", + /* 194 */ "func_name", + /* 195 */ "function_name", + /* 196 */ "index_name", + /* 197 */ "index_options", + /* 198 */ "func_list", + /* 199 */ "duration_literal", + /* 200 */ "sliding_opt", + /* 201 */ "func", + /* 202 */ "expression_list", + /* 203 */ "topic_name", + /* 204 */ "query_expression", + /* 205 */ "table_alias", + /* 206 */ "column_alias", + /* 207 */ "expression", + /* 208 */ "column_reference", + /* 209 */ "subquery", + /* 210 */ "predicate", + /* 211 */ "compare_op", + /* 212 */ "in_op", + /* 213 */ "in_predicate_value", + /* 214 */ "boolean_value_expression", + /* 215 */ "boolean_primary", + /* 216 */ "common_expression", + /* 217 */ "from_clause", + /* 218 */ "table_reference_list", + /* 219 */ "table_reference", + /* 220 */ "table_primary", + /* 221 */ "joined_table", + /* 222 */ "alias_opt", + /* 223 */ "parenthesized_joined_table", + /* 224 */ "join_type", + /* 225 */ "search_condition", + /* 226 */ "query_specification", + /* 227 */ "set_quantifier_opt", + /* 228 */ "select_list", + /* 229 */ "where_clause_opt", + /* 230 */ "partition_by_clause_opt", + /* 231 */ "twindow_clause_opt", + /* 232 */ "group_by_clause_opt", + /* 233 */ "having_clause_opt", + /* 234 */ "select_sublist", + /* 235 */ "select_item", + /* 236 */ "fill_opt", + /* 237 */ "fill_mode", + /* 238 */ "group_by_list", + /* 239 */ "query_expression_body", + /* 240 */ "order_by_clause_opt", + /* 241 */ "slimit_clause_opt", + /* 242 */ "limit_clause_opt", + /* 243 */ "query_primary", + /* 244 */ "sort_specification_list", + /* 245 */ "sort_specification", + /* 246 */ "ordering_specification_opt", + /* 247 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -855,261 +929,311 @@ static const char *const yyTokenName[] = { /* For tracing reduce actions, the names of all rules are required. */ static const char *const yyRuleName[] = { - /* 0 */ "cmd ::= CREATE USER user_name PASS NK_STRING", - /* 1 */ "cmd ::= ALTER USER user_name PASS NK_STRING", - /* 2 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING", - /* 3 */ "cmd ::= DROP USER user_name", - /* 4 */ "cmd ::= SHOW USERS", - /* 5 */ "cmd ::= CREATE DNODE dnode_endpoint", - /* 6 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER", - /* 7 */ "cmd ::= DROP DNODE NK_INTEGER", - /* 8 */ "cmd ::= DROP DNODE dnode_endpoint", - /* 9 */ "cmd ::= SHOW DNODES", - /* 10 */ "dnode_endpoint ::= NK_STRING", - /* 11 */ "dnode_host_name ::= NK_ID", - /* 12 */ "dnode_host_name ::= NK_IPTOKEN", - /* 13 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 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", + /* 0 */ "cmd ::= ALTER ACCOUNT NK_ID account_options", + /* 1 */ "account_options ::= account_option", + /* 2 */ "account_options ::= account_options account_option", + /* 3 */ "account_option ::= PASS literal", + /* 4 */ "account_option ::= PPS literal", + /* 5 */ "account_option ::= TSERIES literal", + /* 6 */ "account_option ::= STORAGE literal", + /* 7 */ "account_option ::= STREAMS literal", + /* 8 */ "account_option ::= QTIME literal", + /* 9 */ "account_option ::= DBS literal", + /* 10 */ "account_option ::= USERS literal", + /* 11 */ "account_option ::= CONNS literal", + /* 12 */ "account_option ::= STATE literal", + /* 13 */ "cmd ::= CREATE USER user_name PASS NK_STRING", + /* 14 */ "cmd ::= ALTER USER user_name PASS NK_STRING", + /* 15 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING", + /* 16 */ "cmd ::= DROP USER user_name", + /* 17 */ "cmd ::= SHOW USERS", + /* 18 */ "cmd ::= CREATE DNODE dnode_endpoint", + /* 19 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER", + /* 20 */ "cmd ::= DROP DNODE NK_INTEGER", + /* 21 */ "cmd ::= DROP DNODE dnode_endpoint", + /* 22 */ "cmd ::= SHOW DNODES", + /* 23 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", + /* 24 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", + /* 25 */ "cmd ::= ALTER ALL DNODES NK_STRING", + /* 26 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", + /* 27 */ "dnode_endpoint ::= NK_STRING", + /* 28 */ "dnode_host_name ::= NK_ID", + /* 29 */ "dnode_host_name ::= NK_IPTOKEN", + /* 30 */ "cmd ::= ALTER LOCAL NK_STRING", + /* 31 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", + /* 32 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", + /* 33 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", + /* 34 */ "cmd ::= SHOW QNODES", + /* 35 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 36 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 37 */ "cmd ::= SHOW DATABASES", + /* 38 */ "cmd ::= USE db_name", + /* 39 */ "cmd ::= ALTER DATABASE db_name alter_db_options", + /* 40 */ "not_exists_opt ::= IF NOT EXISTS", + /* 41 */ "not_exists_opt ::=", + /* 42 */ "exists_opt ::= IF EXISTS", + /* 43 */ "exists_opt ::=", + /* 44 */ "db_options ::=", + /* 45 */ "db_options ::= db_options BLOCKS NK_INTEGER", + /* 46 */ "db_options ::= db_options CACHE NK_INTEGER", + /* 47 */ "db_options ::= db_options CACHELAST NK_INTEGER", + /* 48 */ "db_options ::= db_options COMP NK_INTEGER", + /* 49 */ "db_options ::= db_options DAYS NK_INTEGER", + /* 50 */ "db_options ::= db_options FSYNC NK_INTEGER", + /* 51 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 52 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 53 */ "db_options ::= db_options KEEP NK_INTEGER", + /* 54 */ "db_options ::= db_options PRECISION NK_STRING", + /* 55 */ "db_options ::= db_options QUORUM NK_INTEGER", + /* 56 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 57 */ "db_options ::= db_options TTL NK_INTEGER", + /* 58 */ "db_options ::= db_options WAL NK_INTEGER", + /* 59 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 60 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 61 */ "db_options ::= db_options STREAM_MODE NK_INTEGER", + /* 62 */ "db_options ::= db_options RETENTIONS NK_STRING", + /* 63 */ "db_options ::= db_options FILE_FACTOR NK_FLOAT", + /* 64 */ "alter_db_options ::= alter_db_option", + /* 65 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 66 */ "alter_db_option ::= BLOCKS NK_INTEGER", + /* 67 */ "alter_db_option ::= FSYNC NK_INTEGER", + /* 68 */ "alter_db_option ::= KEEP NK_INTEGER", + /* 69 */ "alter_db_option ::= WAL NK_INTEGER", + /* 70 */ "alter_db_option ::= QUORUM NK_INTEGER", + /* 71 */ "alter_db_option ::= CACHELAST NK_INTEGER", + /* 72 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 73 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 74 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 75 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 76 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 77 */ "cmd ::= SHOW TABLES", + /* 78 */ "cmd ::= SHOW STABLES", + /* 79 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 80 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 81 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 82 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 83 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 84 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 85 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 86 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 87 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 88 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 89 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 90 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal", + /* 91 */ "multi_create_clause ::= create_subtable_clause", + /* 92 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 93 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", + /* 94 */ "multi_drop_clause ::= drop_table_clause", + /* 95 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 96 */ "drop_table_clause ::= exists_opt full_table_name", + /* 97 */ "specific_tags_opt ::=", + /* 98 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", + /* 99 */ "full_table_name ::= table_name", + /* 100 */ "full_table_name ::= db_name NK_DOT table_name", + /* 101 */ "column_def_list ::= column_def", + /* 102 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 103 */ "column_def ::= column_name type_name", + /* 104 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 105 */ "type_name ::= BOOL", + /* 106 */ "type_name ::= TINYINT", + /* 107 */ "type_name ::= SMALLINT", + /* 108 */ "type_name ::= INT", + /* 109 */ "type_name ::= INTEGER", + /* 110 */ "type_name ::= BIGINT", + /* 111 */ "type_name ::= FLOAT", + /* 112 */ "type_name ::= DOUBLE", + /* 113 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 114 */ "type_name ::= TIMESTAMP", + /* 115 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 116 */ "type_name ::= TINYINT UNSIGNED", + /* 117 */ "type_name ::= SMALLINT UNSIGNED", + /* 118 */ "type_name ::= INT UNSIGNED", + /* 119 */ "type_name ::= BIGINT UNSIGNED", + /* 120 */ "type_name ::= JSON", + /* 121 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 122 */ "type_name ::= MEDIUMBLOB", + /* 123 */ "type_name ::= BLOB", + /* 124 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 125 */ "type_name ::= DECIMAL", + /* 126 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 127 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 128 */ "tags_def_opt ::=", + /* 129 */ "tags_def_opt ::= tags_def", + /* 130 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 131 */ "table_options ::=", + /* 132 */ "table_options ::= table_options COMMENT NK_STRING", + /* 133 */ "table_options ::= table_options KEEP NK_INTEGER", + /* 134 */ "table_options ::= table_options TTL NK_INTEGER", + /* 135 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 136 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP", + /* 137 */ "alter_table_options ::= alter_table_option", + /* 138 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 139 */ "alter_table_option ::= COMMENT NK_STRING", + /* 140 */ "alter_table_option ::= KEEP NK_INTEGER", + /* 141 */ "alter_table_option ::= TTL NK_INTEGER", + /* 142 */ "col_name_list ::= col_name", + /* 143 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 144 */ "col_name ::= column_name", + /* 145 */ "func_name_list ::= func_name", + /* 146 */ "func_name_list ::= func_name_list NK_COMMA col_name", + /* 147 */ "func_name ::= function_name", + /* 148 */ "cmd ::= CREATE SMA INDEX index_name ON table_name index_options", + /* 149 */ "cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP", + /* 150 */ "cmd ::= DROP INDEX index_name ON table_name", + /* 151 */ "index_options ::=", + /* 152 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt", + /* 153 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt", + /* 154 */ "func_list ::= func", + /* 155 */ "func_list ::= func_list NK_COMMA func", + /* 156 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 157 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression", + /* 158 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name", + /* 159 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 160 */ "cmd ::= SHOW VGROUPS", + /* 161 */ "cmd ::= SHOW db_name NK_DOT VGROUPS", + /* 162 */ "cmd ::= SHOW MNODES", + /* 163 */ "cmd ::= query_expression", + /* 164 */ "literal ::= NK_INTEGER", + /* 165 */ "literal ::= NK_FLOAT", + /* 166 */ "literal ::= NK_STRING", + /* 167 */ "literal ::= NK_BOOL", + /* 168 */ "literal ::= TIMESTAMP NK_STRING", + /* 169 */ "literal ::= duration_literal", + /* 170 */ "duration_literal ::= NK_VARIABLE", + /* 171 */ "literal_list ::= literal", + /* 172 */ "literal_list ::= literal_list NK_COMMA literal", + /* 173 */ "db_name ::= NK_ID", + /* 174 */ "table_name ::= NK_ID", + /* 175 */ "column_name ::= NK_ID", + /* 176 */ "function_name ::= NK_ID", + /* 177 */ "table_alias ::= NK_ID", + /* 178 */ "column_alias ::= NK_ID", + /* 179 */ "user_name ::= NK_ID", + /* 180 */ "index_name ::= NK_ID", + /* 181 */ "topic_name ::= NK_ID", + /* 182 */ "expression ::= literal", + /* 183 */ "expression ::= column_reference", + /* 184 */ "expression ::= function_name NK_LP expression_list NK_RP", + /* 185 */ "expression ::= function_name NK_LP NK_STAR NK_RP", + /* 186 */ "expression ::= subquery", + /* 187 */ "expression ::= NK_LP expression NK_RP", + /* 188 */ "expression ::= NK_PLUS expression", + /* 189 */ "expression ::= NK_MINUS expression", + /* 190 */ "expression ::= expression NK_PLUS expression", + /* 191 */ "expression ::= expression NK_MINUS expression", + /* 192 */ "expression ::= expression NK_STAR expression", + /* 193 */ "expression ::= expression NK_SLASH expression", + /* 194 */ "expression ::= expression NK_REM expression", + /* 195 */ "expression_list ::= expression", + /* 196 */ "expression_list ::= expression_list NK_COMMA expression", + /* 197 */ "column_reference ::= column_name", + /* 198 */ "column_reference ::= table_name NK_DOT column_name", + /* 199 */ "predicate ::= expression compare_op expression", + /* 200 */ "predicate ::= expression BETWEEN expression AND expression", + /* 201 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 202 */ "predicate ::= expression IS NULL", + /* 203 */ "predicate ::= expression IS NOT NULL", + /* 204 */ "predicate ::= expression in_op in_predicate_value", + /* 205 */ "compare_op ::= NK_LT", + /* 206 */ "compare_op ::= NK_GT", + /* 207 */ "compare_op ::= NK_LE", + /* 208 */ "compare_op ::= NK_GE", + /* 209 */ "compare_op ::= NK_NE", + /* 210 */ "compare_op ::= NK_EQ", + /* 211 */ "compare_op ::= LIKE", + /* 212 */ "compare_op ::= NOT LIKE", + /* 213 */ "compare_op ::= MATCH", + /* 214 */ "compare_op ::= NMATCH", + /* 215 */ "in_op ::= IN", + /* 216 */ "in_op ::= NOT IN", + /* 217 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 218 */ "boolean_value_expression ::= boolean_primary", + /* 219 */ "boolean_value_expression ::= NOT boolean_primary", + /* 220 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 221 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 222 */ "boolean_primary ::= predicate", + /* 223 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 224 */ "common_expression ::= expression", + /* 225 */ "common_expression ::= boolean_value_expression", + /* 226 */ "from_clause ::= FROM table_reference_list", + /* 227 */ "table_reference_list ::= table_reference", + /* 228 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 229 */ "table_reference ::= table_primary", + /* 230 */ "table_reference ::= joined_table", + /* 231 */ "table_primary ::= table_name alias_opt", + /* 232 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 233 */ "table_primary ::= subquery alias_opt", + /* 234 */ "table_primary ::= parenthesized_joined_table", + /* 235 */ "alias_opt ::=", + /* 236 */ "alias_opt ::= table_alias", + /* 237 */ "alias_opt ::= AS table_alias", + /* 238 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 239 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 240 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 241 */ "join_type ::=", + /* 242 */ "join_type ::= INNER", + /* 243 */ "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", + /* 244 */ "set_quantifier_opt ::=", + /* 245 */ "set_quantifier_opt ::= DISTINCT", + /* 246 */ "set_quantifier_opt ::= ALL", + /* 247 */ "select_list ::= NK_STAR", + /* 248 */ "select_list ::= select_sublist", + /* 249 */ "select_sublist ::= select_item", + /* 250 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 251 */ "select_item ::= common_expression", + /* 252 */ "select_item ::= common_expression column_alias", + /* 253 */ "select_item ::= common_expression AS column_alias", + /* 254 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 255 */ "where_clause_opt ::=", + /* 256 */ "where_clause_opt ::= WHERE search_condition", + /* 257 */ "partition_by_clause_opt ::=", + /* 258 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 259 */ "twindow_clause_opt ::=", + /* 260 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", + /* 261 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", + /* 262 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 263 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 264 */ "sliding_opt ::=", + /* 265 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 266 */ "fill_opt ::=", + /* 267 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 268 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 269 */ "fill_mode ::= NONE", + /* 270 */ "fill_mode ::= PREV", + /* 271 */ "fill_mode ::= NULL", + /* 272 */ "fill_mode ::= LINEAR", + /* 273 */ "fill_mode ::= NEXT", + /* 274 */ "group_by_clause_opt ::=", + /* 275 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 276 */ "group_by_list ::= expression", + /* 277 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 278 */ "having_clause_opt ::=", + /* 279 */ "having_clause_opt ::= HAVING search_condition", + /* 280 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 281 */ "query_expression_body ::= query_primary", + /* 282 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 283 */ "query_primary ::= query_specification", + /* 284 */ "order_by_clause_opt ::=", + /* 285 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 286 */ "slimit_clause_opt ::=", + /* 287 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 288 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 289 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 290 */ "limit_clause_opt ::=", + /* 291 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 292 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 293 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 294 */ "subquery ::= NK_LP query_expression NK_RP", + /* 295 */ "search_condition ::= common_expression", + /* 296 */ "sort_specification_list ::= sort_specification", + /* 297 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 298 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 299 */ "ordering_specification_opt ::=", + /* 300 */ "ordering_specification_opt ::= ASC", + /* 301 */ "ordering_specification_opt ::= DESC", + /* 302 */ "null_ordering_opt ::=", + /* 303 */ "null_ordering_opt ::= NULLS FIRST", + /* 304 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -1236,121 +1360,138 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - 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 */ + case 160: /* cmd */ + case 163: /* literal */ + case 169: /* db_options */ + case 171: /* alter_db_options */ + case 173: /* full_table_name */ + case 176: /* table_options */ + case 180: /* alter_table_clause */ + case 181: /* alter_table_options */ + case 184: /* create_subtable_clause */ + case 187: /* drop_table_clause */ + case 190: /* column_def */ + case 193: /* col_name */ + case 194: /* func_name */ + case 197: /* index_options */ + case 199: /* duration_literal */ + case 200: /* sliding_opt */ + case 201: /* func */ + case 204: /* query_expression */ + case 207: /* expression */ + case 208: /* column_reference */ + case 209: /* subquery */ + case 210: /* predicate */ + case 213: /* in_predicate_value */ + case 214: /* boolean_value_expression */ + case 215: /* boolean_primary */ + case 216: /* common_expression */ + case 217: /* from_clause */ + case 218: /* table_reference_list */ + case 219: /* table_reference */ + case 220: /* table_primary */ + case 221: /* joined_table */ + case 223: /* parenthesized_joined_table */ + case 225: /* search_condition */ + case 226: /* query_specification */ + case 229: /* where_clause_opt */ + case 231: /* twindow_clause_opt */ + case 233: /* having_clause_opt */ + case 235: /* select_item */ + case 236: /* fill_opt */ + case 239: /* query_expression_body */ + case 241: /* slimit_clause_opt */ + case 242: /* limit_clause_opt */ + case 243: /* query_primary */ + case 245: /* sort_specification */ { - nodesDestroyNode((yypminor->yy432)); + nodesDestroyNode((yypminor->yy168)); } break; - 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 */ + case 161: /* account_options */ + case 162: /* account_option */ { } break; - case 145: /* not_exists_opt */ - case 148: /* exists_opt */ - case 199: /* set_quantifier_opt */ + case 164: /* user_name */ + case 165: /* dnode_endpoint */ + case 166: /* dnode_host_name */ + case 168: /* db_name */ + case 182: /* column_name */ + case 189: /* table_name */ + case 195: /* function_name */ + case 196: /* index_name */ + case 203: /* topic_name */ + case 205: /* table_alias */ + case 206: /* column_alias */ + case 222: /* alias_opt */ { } break; - 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->yy24)); -} - break; - case 164: /* type_name */ + case 167: /* not_exists_opt */ + case 170: /* exists_opt */ + case 227: /* set_quantifier_opt */ { } break; - case 183: /* compare_op */ - case 184: /* in_op */ + case 172: /* alter_db_option */ + case 192: /* alter_table_option */ { } break; - case 196: /* join_type */ + case 174: /* column_def_list */ + case 175: /* tags_def_opt */ + case 177: /* multi_create_clause */ + case 178: /* tags_def */ + case 179: /* multi_drop_clause */ + case 185: /* specific_tags_opt */ + case 186: /* literal_list */ + case 188: /* col_name_list */ + case 191: /* func_name_list */ + case 198: /* func_list */ + case 202: /* expression_list */ + case 228: /* select_list */ + case 230: /* partition_by_clause_opt */ + case 232: /* group_by_clause_opt */ + case 234: /* select_sublist */ + case 238: /* group_by_list */ + case 240: /* order_by_clause_opt */ + case 244: /* sort_specification_list */ +{ + nodesDestroyList((yypminor->yy440)); +} + break; + case 183: /* type_name */ { } break; - case 209: /* fill_mode */ + case 211: /* compare_op */ + case 212: /* in_op */ { } break; - case 218: /* ordering_specification_opt */ + case 224: /* join_type */ { } break; - case 219: /* null_ordering_opt */ + case 237: /* fill_mode */ +{ + +} + break; + case 246: /* ordering_specification_opt */ +{ + +} + break; + case 247: /* null_ordering_opt */ { } @@ -1649,261 +1790,311 @@ 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[] = { - { 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 */ + { 160, -4 }, /* (0) cmd ::= ALTER ACCOUNT NK_ID account_options */ + { 161, -1 }, /* (1) account_options ::= account_option */ + { 161, -2 }, /* (2) account_options ::= account_options account_option */ + { 162, -2 }, /* (3) account_option ::= PASS literal */ + { 162, -2 }, /* (4) account_option ::= PPS literal */ + { 162, -2 }, /* (5) account_option ::= TSERIES literal */ + { 162, -2 }, /* (6) account_option ::= STORAGE literal */ + { 162, -2 }, /* (7) account_option ::= STREAMS literal */ + { 162, -2 }, /* (8) account_option ::= QTIME literal */ + { 162, -2 }, /* (9) account_option ::= DBS literal */ + { 162, -2 }, /* (10) account_option ::= USERS literal */ + { 162, -2 }, /* (11) account_option ::= CONNS literal */ + { 162, -2 }, /* (12) account_option ::= STATE literal */ + { 160, -5 }, /* (13) cmd ::= CREATE USER user_name PASS NK_STRING */ + { 160, -5 }, /* (14) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 160, -5 }, /* (15) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ + { 160, -3 }, /* (16) cmd ::= DROP USER user_name */ + { 160, -2 }, /* (17) cmd ::= SHOW USERS */ + { 160, -3 }, /* (18) cmd ::= CREATE DNODE dnode_endpoint */ + { 160, -5 }, /* (19) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ + { 160, -3 }, /* (20) cmd ::= DROP DNODE NK_INTEGER */ + { 160, -3 }, /* (21) cmd ::= DROP DNODE dnode_endpoint */ + { 160, -2 }, /* (22) cmd ::= SHOW DNODES */ + { 160, -4 }, /* (23) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 160, -5 }, /* (24) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 160, -4 }, /* (25) cmd ::= ALTER ALL DNODES NK_STRING */ + { 160, -5 }, /* (26) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 165, -1 }, /* (27) dnode_endpoint ::= NK_STRING */ + { 166, -1 }, /* (28) dnode_host_name ::= NK_ID */ + { 166, -1 }, /* (29) dnode_host_name ::= NK_IPTOKEN */ + { 160, -3 }, /* (30) cmd ::= ALTER LOCAL NK_STRING */ + { 160, -4 }, /* (31) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 160, -5 }, /* (32) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 160, -5 }, /* (33) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 160, -2 }, /* (34) cmd ::= SHOW QNODES */ + { 160, -5 }, /* (35) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 160, -4 }, /* (36) cmd ::= DROP DATABASE exists_opt db_name */ + { 160, -2 }, /* (37) cmd ::= SHOW DATABASES */ + { 160, -2 }, /* (38) cmd ::= USE db_name */ + { 160, -4 }, /* (39) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 167, -3 }, /* (40) not_exists_opt ::= IF NOT EXISTS */ + { 167, 0 }, /* (41) not_exists_opt ::= */ + { 170, -2 }, /* (42) exists_opt ::= IF EXISTS */ + { 170, 0 }, /* (43) exists_opt ::= */ + { 169, 0 }, /* (44) db_options ::= */ + { 169, -3 }, /* (45) db_options ::= db_options BLOCKS NK_INTEGER */ + { 169, -3 }, /* (46) db_options ::= db_options CACHE NK_INTEGER */ + { 169, -3 }, /* (47) db_options ::= db_options CACHELAST NK_INTEGER */ + { 169, -3 }, /* (48) db_options ::= db_options COMP NK_INTEGER */ + { 169, -3 }, /* (49) db_options ::= db_options DAYS NK_INTEGER */ + { 169, -3 }, /* (50) db_options ::= db_options FSYNC NK_INTEGER */ + { 169, -3 }, /* (51) db_options ::= db_options MAXROWS NK_INTEGER */ + { 169, -3 }, /* (52) db_options ::= db_options MINROWS NK_INTEGER */ + { 169, -3 }, /* (53) db_options ::= db_options KEEP NK_INTEGER */ + { 169, -3 }, /* (54) db_options ::= db_options PRECISION NK_STRING */ + { 169, -3 }, /* (55) db_options ::= db_options QUORUM NK_INTEGER */ + { 169, -3 }, /* (56) db_options ::= db_options REPLICA NK_INTEGER */ + { 169, -3 }, /* (57) db_options ::= db_options TTL NK_INTEGER */ + { 169, -3 }, /* (58) db_options ::= db_options WAL NK_INTEGER */ + { 169, -3 }, /* (59) db_options ::= db_options VGROUPS NK_INTEGER */ + { 169, -3 }, /* (60) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 169, -3 }, /* (61) db_options ::= db_options STREAM_MODE NK_INTEGER */ + { 169, -3 }, /* (62) db_options ::= db_options RETENTIONS NK_STRING */ + { 169, -3 }, /* (63) db_options ::= db_options FILE_FACTOR NK_FLOAT */ + { 171, -1 }, /* (64) alter_db_options ::= alter_db_option */ + { 171, -2 }, /* (65) alter_db_options ::= alter_db_options alter_db_option */ + { 172, -2 }, /* (66) alter_db_option ::= BLOCKS NK_INTEGER */ + { 172, -2 }, /* (67) alter_db_option ::= FSYNC NK_INTEGER */ + { 172, -2 }, /* (68) alter_db_option ::= KEEP NK_INTEGER */ + { 172, -2 }, /* (69) alter_db_option ::= WAL NK_INTEGER */ + { 172, -2 }, /* (70) alter_db_option ::= QUORUM NK_INTEGER */ + { 172, -2 }, /* (71) alter_db_option ::= CACHELAST NK_INTEGER */ + { 160, -9 }, /* (72) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 160, -3 }, /* (73) cmd ::= CREATE TABLE multi_create_clause */ + { 160, -9 }, /* (74) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 160, -3 }, /* (75) cmd ::= DROP TABLE multi_drop_clause */ + { 160, -4 }, /* (76) cmd ::= DROP STABLE exists_opt full_table_name */ + { 160, -2 }, /* (77) cmd ::= SHOW TABLES */ + { 160, -2 }, /* (78) cmd ::= SHOW STABLES */ + { 160, -3 }, /* (79) cmd ::= ALTER TABLE alter_table_clause */ + { 160, -3 }, /* (80) cmd ::= ALTER STABLE alter_table_clause */ + { 180, -2 }, /* (81) alter_table_clause ::= full_table_name alter_table_options */ + { 180, -5 }, /* (82) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 180, -4 }, /* (83) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 180, -5 }, /* (84) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 180, -5 }, /* (85) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 180, -5 }, /* (86) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 180, -4 }, /* (87) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 180, -5 }, /* (88) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 180, -5 }, /* (89) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 180, -6 }, /* (90) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */ + { 177, -1 }, /* (91) multi_create_clause ::= create_subtable_clause */ + { 177, -2 }, /* (92) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 184, -9 }, /* (93) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ + { 179, -1 }, /* (94) multi_drop_clause ::= drop_table_clause */ + { 179, -2 }, /* (95) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 187, -2 }, /* (96) drop_table_clause ::= exists_opt full_table_name */ + { 185, 0 }, /* (97) specific_tags_opt ::= */ + { 185, -3 }, /* (98) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 173, -1 }, /* (99) full_table_name ::= table_name */ + { 173, -3 }, /* (100) full_table_name ::= db_name NK_DOT table_name */ + { 174, -1 }, /* (101) column_def_list ::= column_def */ + { 174, -3 }, /* (102) column_def_list ::= column_def_list NK_COMMA column_def */ + { 190, -2 }, /* (103) column_def ::= column_name type_name */ + { 190, -4 }, /* (104) column_def ::= column_name type_name COMMENT NK_STRING */ + { 183, -1 }, /* (105) type_name ::= BOOL */ + { 183, -1 }, /* (106) type_name ::= TINYINT */ + { 183, -1 }, /* (107) type_name ::= SMALLINT */ + { 183, -1 }, /* (108) type_name ::= INT */ + { 183, -1 }, /* (109) type_name ::= INTEGER */ + { 183, -1 }, /* (110) type_name ::= BIGINT */ + { 183, -1 }, /* (111) type_name ::= FLOAT */ + { 183, -1 }, /* (112) type_name ::= DOUBLE */ + { 183, -4 }, /* (113) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 183, -1 }, /* (114) type_name ::= TIMESTAMP */ + { 183, -4 }, /* (115) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 183, -2 }, /* (116) type_name ::= TINYINT UNSIGNED */ + { 183, -2 }, /* (117) type_name ::= SMALLINT UNSIGNED */ + { 183, -2 }, /* (118) type_name ::= INT UNSIGNED */ + { 183, -2 }, /* (119) type_name ::= BIGINT UNSIGNED */ + { 183, -1 }, /* (120) type_name ::= JSON */ + { 183, -4 }, /* (121) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 183, -1 }, /* (122) type_name ::= MEDIUMBLOB */ + { 183, -1 }, /* (123) type_name ::= BLOB */ + { 183, -4 }, /* (124) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 183, -1 }, /* (125) type_name ::= DECIMAL */ + { 183, -4 }, /* (126) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 183, -6 }, /* (127) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 175, 0 }, /* (128) tags_def_opt ::= */ + { 175, -1 }, /* (129) tags_def_opt ::= tags_def */ + { 178, -4 }, /* (130) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 176, 0 }, /* (131) table_options ::= */ + { 176, -3 }, /* (132) table_options ::= table_options COMMENT NK_STRING */ + { 176, -3 }, /* (133) table_options ::= table_options KEEP NK_INTEGER */ + { 176, -3 }, /* (134) table_options ::= table_options TTL NK_INTEGER */ + { 176, -5 }, /* (135) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 176, -5 }, /* (136) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ + { 181, -1 }, /* (137) alter_table_options ::= alter_table_option */ + { 181, -2 }, /* (138) alter_table_options ::= alter_table_options alter_table_option */ + { 192, -2 }, /* (139) alter_table_option ::= COMMENT NK_STRING */ + { 192, -2 }, /* (140) alter_table_option ::= KEEP NK_INTEGER */ + { 192, -2 }, /* (141) alter_table_option ::= TTL NK_INTEGER */ + { 188, -1 }, /* (142) col_name_list ::= col_name */ + { 188, -3 }, /* (143) col_name_list ::= col_name_list NK_COMMA col_name */ + { 193, -1 }, /* (144) col_name ::= column_name */ + { 191, -1 }, /* (145) func_name_list ::= func_name */ + { 191, -3 }, /* (146) func_name_list ::= func_name_list NK_COMMA col_name */ + { 194, -1 }, /* (147) func_name ::= function_name */ + { 160, -7 }, /* (148) cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ + { 160, -9 }, /* (149) cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */ + { 160, -5 }, /* (150) cmd ::= DROP INDEX index_name ON table_name */ + { 197, 0 }, /* (151) index_options ::= */ + { 197, -9 }, /* (152) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ + { 197, -11 }, /* (153) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ + { 198, -1 }, /* (154) func_list ::= func */ + { 198, -3 }, /* (155) func_list ::= func_list NK_COMMA func */ + { 201, -4 }, /* (156) func ::= function_name NK_LP expression_list NK_RP */ + { 160, -6 }, /* (157) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ + { 160, -6 }, /* (158) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */ + { 160, -4 }, /* (159) cmd ::= DROP TOPIC exists_opt topic_name */ + { 160, -2 }, /* (160) cmd ::= SHOW VGROUPS */ + { 160, -4 }, /* (161) cmd ::= SHOW db_name NK_DOT VGROUPS */ + { 160, -2 }, /* (162) cmd ::= SHOW MNODES */ + { 160, -1 }, /* (163) cmd ::= query_expression */ + { 163, -1 }, /* (164) literal ::= NK_INTEGER */ + { 163, -1 }, /* (165) literal ::= NK_FLOAT */ + { 163, -1 }, /* (166) literal ::= NK_STRING */ + { 163, -1 }, /* (167) literal ::= NK_BOOL */ + { 163, -2 }, /* (168) literal ::= TIMESTAMP NK_STRING */ + { 163, -1 }, /* (169) literal ::= duration_literal */ + { 199, -1 }, /* (170) duration_literal ::= NK_VARIABLE */ + { 186, -1 }, /* (171) literal_list ::= literal */ + { 186, -3 }, /* (172) literal_list ::= literal_list NK_COMMA literal */ + { 168, -1 }, /* (173) db_name ::= NK_ID */ + { 189, -1 }, /* (174) table_name ::= NK_ID */ + { 182, -1 }, /* (175) column_name ::= NK_ID */ + { 195, -1 }, /* (176) function_name ::= NK_ID */ + { 205, -1 }, /* (177) table_alias ::= NK_ID */ + { 206, -1 }, /* (178) column_alias ::= NK_ID */ + { 164, -1 }, /* (179) user_name ::= NK_ID */ + { 196, -1 }, /* (180) index_name ::= NK_ID */ + { 203, -1 }, /* (181) topic_name ::= NK_ID */ + { 207, -1 }, /* (182) expression ::= literal */ + { 207, -1 }, /* (183) expression ::= column_reference */ + { 207, -4 }, /* (184) expression ::= function_name NK_LP expression_list NK_RP */ + { 207, -4 }, /* (185) expression ::= function_name NK_LP NK_STAR NK_RP */ + { 207, -1 }, /* (186) expression ::= subquery */ + { 207, -3 }, /* (187) expression ::= NK_LP expression NK_RP */ + { 207, -2 }, /* (188) expression ::= NK_PLUS expression */ + { 207, -2 }, /* (189) expression ::= NK_MINUS expression */ + { 207, -3 }, /* (190) expression ::= expression NK_PLUS expression */ + { 207, -3 }, /* (191) expression ::= expression NK_MINUS expression */ + { 207, -3 }, /* (192) expression ::= expression NK_STAR expression */ + { 207, -3 }, /* (193) expression ::= expression NK_SLASH expression */ + { 207, -3 }, /* (194) expression ::= expression NK_REM expression */ + { 202, -1 }, /* (195) expression_list ::= expression */ + { 202, -3 }, /* (196) expression_list ::= expression_list NK_COMMA expression */ + { 208, -1 }, /* (197) column_reference ::= column_name */ + { 208, -3 }, /* (198) column_reference ::= table_name NK_DOT column_name */ + { 210, -3 }, /* (199) predicate ::= expression compare_op expression */ + { 210, -5 }, /* (200) predicate ::= expression BETWEEN expression AND expression */ + { 210, -6 }, /* (201) predicate ::= expression NOT BETWEEN expression AND expression */ + { 210, -3 }, /* (202) predicate ::= expression IS NULL */ + { 210, -4 }, /* (203) predicate ::= expression IS NOT NULL */ + { 210, -3 }, /* (204) predicate ::= expression in_op in_predicate_value */ + { 211, -1 }, /* (205) compare_op ::= NK_LT */ + { 211, -1 }, /* (206) compare_op ::= NK_GT */ + { 211, -1 }, /* (207) compare_op ::= NK_LE */ + { 211, -1 }, /* (208) compare_op ::= NK_GE */ + { 211, -1 }, /* (209) compare_op ::= NK_NE */ + { 211, -1 }, /* (210) compare_op ::= NK_EQ */ + { 211, -1 }, /* (211) compare_op ::= LIKE */ + { 211, -2 }, /* (212) compare_op ::= NOT LIKE */ + { 211, -1 }, /* (213) compare_op ::= MATCH */ + { 211, -1 }, /* (214) compare_op ::= NMATCH */ + { 212, -1 }, /* (215) in_op ::= IN */ + { 212, -2 }, /* (216) in_op ::= NOT IN */ + { 213, -3 }, /* (217) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 214, -1 }, /* (218) boolean_value_expression ::= boolean_primary */ + { 214, -2 }, /* (219) boolean_value_expression ::= NOT boolean_primary */ + { 214, -3 }, /* (220) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 214, -3 }, /* (221) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 215, -1 }, /* (222) boolean_primary ::= predicate */ + { 215, -3 }, /* (223) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 216, -1 }, /* (224) common_expression ::= expression */ + { 216, -1 }, /* (225) common_expression ::= boolean_value_expression */ + { 217, -2 }, /* (226) from_clause ::= FROM table_reference_list */ + { 218, -1 }, /* (227) table_reference_list ::= table_reference */ + { 218, -3 }, /* (228) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 219, -1 }, /* (229) table_reference ::= table_primary */ + { 219, -1 }, /* (230) table_reference ::= joined_table */ + { 220, -2 }, /* (231) table_primary ::= table_name alias_opt */ + { 220, -4 }, /* (232) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 220, -2 }, /* (233) table_primary ::= subquery alias_opt */ + { 220, -1 }, /* (234) table_primary ::= parenthesized_joined_table */ + { 222, 0 }, /* (235) alias_opt ::= */ + { 222, -1 }, /* (236) alias_opt ::= table_alias */ + { 222, -2 }, /* (237) alias_opt ::= AS table_alias */ + { 223, -3 }, /* (238) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 223, -3 }, /* (239) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 221, -6 }, /* (240) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 224, 0 }, /* (241) join_type ::= */ + { 224, -1 }, /* (242) join_type ::= INNER */ + { 226, -9 }, /* (243) 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 */ + { 227, 0 }, /* (244) set_quantifier_opt ::= */ + { 227, -1 }, /* (245) set_quantifier_opt ::= DISTINCT */ + { 227, -1 }, /* (246) set_quantifier_opt ::= ALL */ + { 228, -1 }, /* (247) select_list ::= NK_STAR */ + { 228, -1 }, /* (248) select_list ::= select_sublist */ + { 234, -1 }, /* (249) select_sublist ::= select_item */ + { 234, -3 }, /* (250) select_sublist ::= select_sublist NK_COMMA select_item */ + { 235, -1 }, /* (251) select_item ::= common_expression */ + { 235, -2 }, /* (252) select_item ::= common_expression column_alias */ + { 235, -3 }, /* (253) select_item ::= common_expression AS column_alias */ + { 235, -3 }, /* (254) select_item ::= table_name NK_DOT NK_STAR */ + { 229, 0 }, /* (255) where_clause_opt ::= */ + { 229, -2 }, /* (256) where_clause_opt ::= WHERE search_condition */ + { 230, 0 }, /* (257) partition_by_clause_opt ::= */ + { 230, -3 }, /* (258) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 231, 0 }, /* (259) twindow_clause_opt ::= */ + { 231, -6 }, /* (260) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ + { 231, -4 }, /* (261) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + { 231, -6 }, /* (262) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 231, -8 }, /* (263) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 200, 0 }, /* (264) sliding_opt ::= */ + { 200, -4 }, /* (265) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 236, 0 }, /* (266) fill_opt ::= */ + { 236, -4 }, /* (267) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 236, -6 }, /* (268) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 237, -1 }, /* (269) fill_mode ::= NONE */ + { 237, -1 }, /* (270) fill_mode ::= PREV */ + { 237, -1 }, /* (271) fill_mode ::= NULL */ + { 237, -1 }, /* (272) fill_mode ::= LINEAR */ + { 237, -1 }, /* (273) fill_mode ::= NEXT */ + { 232, 0 }, /* (274) group_by_clause_opt ::= */ + { 232, -3 }, /* (275) group_by_clause_opt ::= GROUP BY group_by_list */ + { 238, -1 }, /* (276) group_by_list ::= expression */ + { 238, -3 }, /* (277) group_by_list ::= group_by_list NK_COMMA expression */ + { 233, 0 }, /* (278) having_clause_opt ::= */ + { 233, -2 }, /* (279) having_clause_opt ::= HAVING search_condition */ + { 204, -4 }, /* (280) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 239, -1 }, /* (281) query_expression_body ::= query_primary */ + { 239, -4 }, /* (282) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 243, -1 }, /* (283) query_primary ::= query_specification */ + { 240, 0 }, /* (284) order_by_clause_opt ::= */ + { 240, -3 }, /* (285) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 241, 0 }, /* (286) slimit_clause_opt ::= */ + { 241, -2 }, /* (287) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 241, -4 }, /* (288) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 241, -4 }, /* (289) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 242, 0 }, /* (290) limit_clause_opt ::= */ + { 242, -2 }, /* (291) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 242, -4 }, /* (292) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 242, -4 }, /* (293) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 209, -3 }, /* (294) subquery ::= NK_LP query_expression NK_RP */ + { 225, -1 }, /* (295) search_condition ::= common_expression */ + { 244, -1 }, /* (296) sort_specification_list ::= sort_specification */ + { 244, -3 }, /* (297) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 245, -3 }, /* (298) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 246, 0 }, /* (299) ordering_specification_opt ::= */ + { 246, -1 }, /* (300) ordering_specification_opt ::= ASC */ + { 246, -1 }, /* (301) ordering_specification_opt ::= DESC */ + { 247, 0 }, /* (302) null_ordering_opt ::= */ + { 247, -2 }, /* (303) null_ordering_opt ::= NULLS FIRST */ + { 247, -2 }, /* (304) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1990,794 +2181,928 @@ 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.yy129, &yymsp[0].minor.yy0); } + case 0: /* cmd ::= ALTER ACCOUNT NK_ID account_options */ +{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } + yy_destructor(yypParser,161,&yymsp[0].minor); break; - case 1: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } + case 1: /* account_options ::= account_option */ +{ yy_destructor(yypParser,162,&yymsp[0].minor); +{ } +} break; - case 2: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } + case 2: /* account_options ::= account_options account_option */ +{ yy_destructor(yypParser,161,&yymsp[-1].minor); +{ } + yy_destructor(yypParser,162,&yymsp[0].minor); +} break; - case 3: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); } + case 3: /* account_option ::= PASS literal */ + case 4: /* account_option ::= PPS literal */ yytestcase(yyruleno==4); + case 5: /* account_option ::= TSERIES literal */ yytestcase(yyruleno==5); + case 6: /* account_option ::= STORAGE literal */ yytestcase(yyruleno==6); + case 7: /* account_option ::= STREAMS literal */ yytestcase(yyruleno==7); + case 8: /* account_option ::= QTIME literal */ yytestcase(yyruleno==8); + case 9: /* account_option ::= DBS literal */ yytestcase(yyruleno==9); + case 10: /* account_option ::= USERS literal */ yytestcase(yyruleno==10); + case 11: /* account_option ::= CONNS literal */ yytestcase(yyruleno==11); + case 12: /* account_option ::= STATE literal */ yytestcase(yyruleno==12); +{ } + yy_destructor(yypParser,163,&yymsp[0].minor); break; - case 4: /* cmd ::= SHOW USERS */ + case 13: /* cmd ::= CREATE USER user_name PASS NK_STRING */ +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy0); } + break; + case 14: /* cmd ::= ALTER USER user_name PASS NK_STRING */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy241, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } + break; + case 15: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy241, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } + break; + case 16: /* cmd ::= DROP USER user_name */ +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy241); } + break; + case 17: /* 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.yy129, NULL); } + case 18: /* cmd ::= CREATE DNODE dnode_endpoint */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy241, NULL); } break; - case 6: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } + case 19: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy0); } break; - case 7: /* cmd ::= DROP DNODE NK_INTEGER */ + case 20: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 8: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy129); } + case 21: /* cmd ::= DROP DNODE dnode_endpoint */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy241); } break; - case 9: /* cmd ::= SHOW DNODES */ + case 22: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } break; - case 10: /* dnode_endpoint ::= NK_STRING */ - case 11: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==11); - case 12: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==12); - case 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; + case 23: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ +{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } break; - case 13: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + case 24: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ +{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 25: /* cmd ::= ALTER ALL DNODES NK_STRING */ +{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } + break; + case 26: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ +{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 27: /* dnode_endpoint ::= NK_STRING */ + case 28: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==28); + case 29: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==29); + case 173: /* db_name ::= NK_ID */ yytestcase(yyruleno==173); + case 174: /* table_name ::= NK_ID */ yytestcase(yyruleno==174); + case 175: /* column_name ::= NK_ID */ yytestcase(yyruleno==175); + case 176: /* function_name ::= NK_ID */ yytestcase(yyruleno==176); + case 177: /* table_alias ::= NK_ID */ yytestcase(yyruleno==177); + case 178: /* column_alias ::= NK_ID */ yytestcase(yyruleno==178); + case 179: /* user_name ::= NK_ID */ yytestcase(yyruleno==179); + case 180: /* index_name ::= NK_ID */ yytestcase(yyruleno==180); + case 181: /* topic_name ::= NK_ID */ yytestcase(yyruleno==181); +{ yylhsminor.yy241 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy241 = yylhsminor.yy241; + break; + case 30: /* cmd ::= ALTER LOCAL NK_STRING */ +{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } + break; + case 31: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ +{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 32: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateQnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 14: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + case 33: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropQnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 15: /* cmd ::= SHOW QNODES */ + case 34: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL); } break; - 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); } + case 35: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy457, &yymsp[-1].minor.yy241, yymsp[0].minor.yy168); } break; - case 17: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy129); } + case 36: /* cmd ::= DROP DATABASE exists_opt db_name */ +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy457, &yymsp[0].minor.yy241); } break; - case 18: /* cmd ::= SHOW DATABASES */ + case 37: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } break; - case 19: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129); } + case 38: /* cmd ::= USE db_name */ +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy241); } break; - case 20: /* cmd ::= ALTER DATABASE db_name db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy432); } + case 39: /* cmd ::= ALTER DATABASE db_name alter_db_options */ +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy241, yymsp[0].minor.yy168); } break; - case 21: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy97 = true; } + case 40: /* not_exists_opt ::= IF NOT EXISTS */ +{ yymsp[-2].minor.yy457 = true; } break; - 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; } + case 41: /* not_exists_opt ::= */ + case 43: /* exists_opt ::= */ yytestcase(yyruleno==43); + case 244: /* set_quantifier_opt ::= */ yytestcase(yyruleno==244); +{ yymsp[1].minor.yy457 = false; } break; - case 23: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy97 = true; } + case 42: /* exists_opt ::= IF EXISTS */ +{ yymsp[-1].minor.yy457 = true; } break; - case 25: /* db_options ::= */ -{ yymsp[1].minor.yy432 = createDefaultDatabaseOptions(pCxt); } + case 44: /* db_options ::= */ +{ yymsp[1].minor.yy168 = createDefaultDatabaseOptions(pCxt); } break; - 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; + case 45: /* db_options ::= db_options BLOCKS NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 46: /* db_options ::= db_options CACHE NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 47: /* db_options ::= db_options CACHELAST NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 48: /* db_options ::= db_options COMP NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 49: /* db_options ::= db_options DAYS NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 50: /* db_options ::= db_options FSYNC NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 51: /* db_options ::= db_options MAXROWS NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 52: /* db_options ::= db_options MINROWS NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 53: /* db_options ::= db_options KEEP NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 54: /* db_options ::= db_options PRECISION NK_STRING */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 55: /* db_options ::= db_options QUORUM NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 56: /* db_options ::= db_options REPLICA NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 57: /* db_options ::= db_options TTL NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 58: /* db_options ::= db_options WAL NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 59: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 60: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 61: /* db_options ::= db_options STREAM_MODE NK_INTEGER */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_STREAM_MODE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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);} + case 62: /* db_options ::= db_options RETENTIONS NK_STRING */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_RETENTIONS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 44: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy24);} + case 63: /* db_options ::= db_options FILE_FACTOR NK_FLOAT */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-2].minor.yy168, DB_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 46: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy24); } + case 64: /* alter_db_options ::= alter_db_option */ +{ yylhsminor.yy168 = createDefaultAlterDatabaseOptions(pCxt); yylhsminor.yy168 = setDatabaseOption(pCxt, yylhsminor.yy168, yymsp[0].minor.yy349.type, &yymsp[0].minor.yy349.val); } + yymsp[0].minor.yy168 = yylhsminor.yy168; break; - case 47: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy97, yymsp[0].minor.yy432); } + case 65: /* alter_db_options ::= alter_db_options alter_db_option */ +{ yylhsminor.yy168 = setDatabaseOption(pCxt, yymsp[-1].minor.yy168, yymsp[0].minor.yy349.type, &yymsp[0].minor.yy349.val); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - case 48: /* cmd ::= SHOW TABLES */ + case 66: /* alter_db_option ::= BLOCKS NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 67: /* alter_db_option ::= FSYNC NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 68: /* alter_db_option ::= KEEP NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = DB_OPTION_KEEP; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 69: /* alter_db_option ::= WAL NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = DB_OPTION_WAL; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 70: /* alter_db_option ::= QUORUM NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 71: /* alter_db_option ::= CACHELAST NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 72: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 74: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==74); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy457, yymsp[-5].minor.yy168, yymsp[-3].minor.yy440, yymsp[-1].minor.yy440, yymsp[0].minor.yy168); } + break; + case 73: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy440); } + break; + case 75: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy440); } + break; + case 76: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy457, yymsp[0].minor.yy168); } + break; + case 77: /* cmd ::= SHOW TABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } break; - case 49: /* cmd ::= SHOW STABLES */ + case 78: /* cmd ::= SHOW STABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } break; - 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; + case 79: /* cmd ::= ALTER TABLE alter_table_clause */ + case 80: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==80); + case 163: /* cmd ::= query_expression */ yytestcase(yyruleno==163); +{ pCxt->pRootNode = yymsp[0].minor.yy168; } 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; + case 81: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy168 = createAlterTableOption(pCxt, yymsp[-1].minor.yy168, yymsp[0].minor.yy168); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; 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; + case 82: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + case 84: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ yytestcase(yyruleno==84); + case 86: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ yytestcase(yyruleno==86); + case 88: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ yytestcase(yyruleno==88); +{ yylhsminor.yy168 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy168, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy241, yymsp[0].minor.yy208); } + yymsp[-4].minor.yy168 = yylhsminor.yy168; 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; + case 83: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ + case 87: /* alter_table_clause ::= full_table_name DROP TAG column_name */ yytestcase(yyruleno==87); +{ yylhsminor.yy168 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy168, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[0].minor.yy241); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; 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; } + case 85: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + case 89: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ yytestcase(yyruleno==89); +{ yylhsminor.yy168 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy168, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy241, &yymsp[0].minor.yy241); } + yymsp[-4].minor.yy168 = yylhsminor.yy168; break; - case 57: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy24 = yymsp[-1].minor.yy24; } + case 90: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */ +{ yylhsminor.yy168 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy168, &yymsp[-2].minor.yy241, yymsp[0].minor.yy168); } + yymsp[-5].minor.yy168 = yylhsminor.yy168; break; - case 58: /* full_table_name ::= table_name */ -{ yylhsminor.yy432 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 91: /* multi_create_clause ::= create_subtable_clause */ + case 94: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==94); + case 101: /* column_def_list ::= column_def */ yytestcase(yyruleno==101); + case 142: /* col_name_list ::= col_name */ yytestcase(yyruleno==142); + case 145: /* func_name_list ::= func_name */ yytestcase(yyruleno==145); + case 154: /* func_list ::= func */ yytestcase(yyruleno==154); + case 249: /* select_sublist ::= select_item */ yytestcase(yyruleno==249); + case 296: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==296); +{ yylhsminor.yy440 = createNodeList(pCxt, yymsp[0].minor.yy168); } + yymsp[0].minor.yy440 = yylhsminor.yy440; break; - 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; + case 92: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 95: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==95); +{ yylhsminor.yy440 = addNodeToList(pCxt, yymsp[-1].minor.yy440, yymsp[0].minor.yy168); } + yymsp[-1].minor.yy440 = yylhsminor.yy440; break; - 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; + case 93: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ +{ yylhsminor.yy168 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy457, yymsp[-7].minor.yy168, yymsp[-5].minor.yy168, yymsp[-4].minor.yy440, yymsp[-1].minor.yy440); } + yymsp[-8].minor.yy168 = yylhsminor.yy168; break; - 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; + case 96: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy168 = createDropTableClause(pCxt, yymsp[-1].minor.yy457, yymsp[0].minor.yy168); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - 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; + case 97: /* specific_tags_opt ::= */ + case 128: /* tags_def_opt ::= */ yytestcase(yyruleno==128); + case 257: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==257); + case 274: /* group_by_clause_opt ::= */ yytestcase(yyruleno==274); + case 284: /* order_by_clause_opt ::= */ yytestcase(yyruleno==284); +{ yymsp[1].minor.yy440 = NULL; } break; - case 64: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 98: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ +{ yymsp[-2].minor.yy440 = yymsp[-1].minor.yy440; } break; - case 65: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 99: /* full_table_name ::= table_name */ +{ yylhsminor.yy168 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy241, NULL); } + yymsp[0].minor.yy168 = yylhsminor.yy168; break; - case 66: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 100: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy168 = createRealTableNode(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy241, NULL); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 67: /* type_name ::= INT */ - case 68: /* type_name ::= INTEGER */ yytestcase(yyruleno==68); -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_INT); } + case 102: /* column_def_list ::= column_def_list NK_COMMA column_def */ + case 143: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==143); + case 146: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==146); + case 155: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==155); + case 250: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==250); + case 297: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==297); +{ yylhsminor.yy440 = addNodeToList(pCxt, yymsp[-2].minor.yy440, yymsp[0].minor.yy168); } + yymsp[-2].minor.yy440 = yylhsminor.yy440; break; - case 69: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 103: /* column_def ::= column_name type_name */ +{ yylhsminor.yy168 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy241, yymsp[0].minor.yy208, NULL); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - case 70: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 104: /* column_def ::= column_name type_name COMMENT NK_STRING */ +{ yylhsminor.yy168 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy241, yymsp[-2].minor.yy208, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; break; - case 71: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 105: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 72: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 106: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 73: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 107: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 74: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 108: /* type_name ::= INT */ + case 109: /* type_name ::= INTEGER */ yytestcase(yyruleno==109); +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 75: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 110: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 76: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 111: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 77: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UINT); } + case 112: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 78: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy224 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 113: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy208 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 79: /* type_name ::= JSON */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_JSON); } + case 114: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 80: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 115: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy208 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 81: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 116: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy208 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 82: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 117: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy208 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 83: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 118: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy208 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 84: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 119: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy208 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 85: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 120: /* type_name ::= JSON */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 86: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy224 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 121: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy208 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - 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; + case 122: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 89: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy24 = yymsp[-1].minor.yy24; } + case 123: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 90: /* table_options ::= */ -{ yymsp[1].minor.yy432 = createDefaultTableOptions(pCxt);} + case 124: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy208 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - 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; + case 125: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy208 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - 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; + case 126: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy208 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - 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; + case 127: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy208 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - 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; + case 129: /* tags_def_opt ::= tags_def */ + case 248: /* select_list ::= select_sublist */ yytestcase(yyruleno==248); +{ yylhsminor.yy440 = yymsp[0].minor.yy440; } + yymsp[0].minor.yy440 = yylhsminor.yy440; break; - case 97: /* col_name ::= column_name */ -{ yylhsminor.yy432 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 130: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ +{ yymsp[-3].minor.yy440 = yymsp[-1].minor.yy440; } break; - 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); } + case 131: /* table_options ::= */ +{ yymsp[1].minor.yy168 = createDefaultTableOptions(pCxt); } break; - 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); } + case 132: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy168 = setTableOption(pCxt, yymsp[-2].minor.yy168, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 100: /* cmd ::= DROP INDEX index_name ON table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129); } + case 133: /* table_options ::= table_options KEEP NK_INTEGER */ +{ yylhsminor.yy168 = setTableOption(pCxt, yymsp[-2].minor.yy168, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; } + case 134: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy168 = setTableOption(pCxt, yymsp[-2].minor.yy168, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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); } + case 135: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy168 = setTableSmaOption(pCxt, yymsp[-4].minor.yy168, yymsp[-1].minor.yy440); } + yymsp[-4].minor.yy168 = yylhsminor.yy168; break; - 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); } + case 136: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ +{ yylhsminor.yy168 = setTableRollupOption(pCxt, yymsp[-4].minor.yy168, yymsp[-1].minor.yy440); } + yymsp[-4].minor.yy168 = yylhsminor.yy168; break; - 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; + case 137: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy168 = createDefaultAlterTableOptions(pCxt); yylhsminor.yy168 = setTableOption(pCxt, yylhsminor.yy168, yymsp[0].minor.yy349.type, &yymsp[0].minor.yy349.val); } + yymsp[0].minor.yy168 = yylhsminor.yy168; break; - 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); } + case 138: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy168 = setTableOption(pCxt, yymsp[-1].minor.yy168, yymsp[0].minor.yy349.type, &yymsp[0].minor.yy349.val); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - 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); } + case 139: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy349.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } break; - case 109: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy97, &yymsp[0].minor.yy129); } + case 140: /* alter_table_option ::= KEEP NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } break; - case 110: /* cmd ::= SHOW VGROUPS */ + case 141: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy349.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy349.val = yymsp[0].minor.yy0; } + break; + case 144: /* col_name ::= column_name */ +{ yylhsminor.yy168 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy241); } + yymsp[0].minor.yy168 = yylhsminor.yy168; + break; + case 147: /* func_name ::= function_name */ +{ yylhsminor.yy168 = createFunctionNode(pCxt, &yymsp[0].minor.yy241, NULL); } + yymsp[0].minor.yy168 = yylhsminor.yy168; + break; + case 148: /* cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy241, &yymsp[-1].minor.yy241, NULL, yymsp[0].minor.yy168); } + break; + case 149: /* 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.yy241, &yymsp[-3].minor.yy241, yymsp[-1].minor.yy440, NULL); } + break; + case 150: /* cmd ::= DROP INDEX index_name ON table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy241); } + break; + case 151: /* index_options ::= */ + case 255: /* where_clause_opt ::= */ yytestcase(yyruleno==255); + case 259: /* twindow_clause_opt ::= */ yytestcase(yyruleno==259); + case 264: /* sliding_opt ::= */ yytestcase(yyruleno==264); + case 266: /* fill_opt ::= */ yytestcase(yyruleno==266); + case 278: /* having_clause_opt ::= */ yytestcase(yyruleno==278); + case 286: /* slimit_clause_opt ::= */ yytestcase(yyruleno==286); + case 290: /* limit_clause_opt ::= */ yytestcase(yyruleno==290); +{ yymsp[1].minor.yy168 = NULL; } + break; + case 152: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ +{ yymsp[-8].minor.yy168 = createIndexOption(pCxt, yymsp[-6].minor.yy440, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), NULL, yymsp[0].minor.yy168); } + break; + case 153: /* 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.yy168 = createIndexOption(pCxt, yymsp[-8].minor.yy440, releaseRawExprNode(pCxt, yymsp[-4].minor.yy168), releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), yymsp[0].minor.yy168); } + break; + case 156: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy168 = createFunctionNode(pCxt, &yymsp[-3].minor.yy241, yymsp[-1].minor.yy440); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; + break; + case 157: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy457, &yymsp[-2].minor.yy241, yymsp[0].minor.yy168, NULL); } + break; + case 158: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */ +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy457, &yymsp[-2].minor.yy241, NULL, &yymsp[0].minor.yy241); } + break; + case 159: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy457, &yymsp[0].minor.yy241); } + break; + case 160: /* cmd ::= SHOW VGROUPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } break; - case 111: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy129); } + case 161: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy241); } break; - case 112: /* cmd ::= SHOW MNODES */ + case 162: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); } break; - case 113: /* cmd ::= query_expression */ -{ pCxt->pRootNode = yymsp[0].minor.yy432; } + case 164: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy168 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy168 = yylhsminor.yy168; 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; + case 165: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy168 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy168 = yylhsminor.yy168; 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; + case 166: /* literal ::= NK_STRING */ +{ yylhsminor.yy168 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy168 = yylhsminor.yy168; 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; + case 167: /* literal ::= NK_BOOL */ +{ yylhsminor.yy168 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy168 = yylhsminor.yy168; 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; + case 168: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; 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; + case 169: /* literal ::= duration_literal */ + case 182: /* expression ::= literal */ yytestcase(yyruleno==182); + case 183: /* expression ::= column_reference */ yytestcase(yyruleno==183); + case 186: /* expression ::= subquery */ yytestcase(yyruleno==186); + case 218: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==218); + case 222: /* boolean_primary ::= predicate */ yytestcase(yyruleno==222); + case 224: /* common_expression ::= expression */ yytestcase(yyruleno==224); + case 225: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==225); + case 227: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==227); + case 229: /* table_reference ::= table_primary */ yytestcase(yyruleno==229); + case 230: /* table_reference ::= joined_table */ yytestcase(yyruleno==230); + case 234: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==234); + case 281: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==281); + case 283: /* query_primary ::= query_specification */ yytestcase(yyruleno==283); +{ yylhsminor.yy168 = yymsp[0].minor.yy168; } + yymsp[0].minor.yy168 = yylhsminor.yy168; 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; + case 170: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy168 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy168 = yylhsminor.yy168; 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; + case 171: /* literal_list ::= literal */ + case 195: /* expression_list ::= expression */ yytestcase(yyruleno==195); +{ yylhsminor.yy440 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy168)); } + yymsp[0].minor.yy440 = yylhsminor.yy440; 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; + case 172: /* literal_list ::= literal_list NK_COMMA literal */ + case 196: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==196); +{ yylhsminor.yy440 = addNodeToList(pCxt, yymsp[-2].minor.yy440, releaseRawExprNode(pCxt, yymsp[0].minor.yy168)); } + yymsp[-2].minor.yy440 = yylhsminor.yy440; 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; + case 184: /* expression ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy241, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy241, yymsp[-1].minor.yy440)); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; 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; + case 185: /* expression ::= function_name NK_LP NK_STAR NK_RP */ +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy241, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy241, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; 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; + case 187: /* expression ::= NK_LP expression NK_RP */ + case 223: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==223); +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy168)); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; 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 */ + case 188: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); - yylhsminor.yy432 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy432)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy168)); } - yymsp[-1].minor.yy432 = yylhsminor.yy432; + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - case 139: /* expression ::= NK_MINUS expression */ + case 189: /* expression ::= NK_MINUS expression */ { - 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)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy168), NULL)); } - yymsp[-1].minor.yy432 = yylhsminor.yy432; + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - case 140: /* expression ::= expression NK_PLUS expression */ + case 190: /* expression ::= expression NK_PLUS expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 141: /* expression ::= expression NK_MINUS expression */ + case 191: /* expression ::= expression NK_MINUS expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 142: /* expression ::= expression NK_STAR expression */ + case 192: /* expression ::= expression NK_STAR expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 143: /* expression ::= expression NK_SLASH expression */ + case 193: /* expression ::= expression NK_SLASH expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 144: /* expression ::= expression NK_REM expression */ + case 194: /* expression ::= expression NK_REM expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 197: /* column_reference ::= column_name */ +{ yylhsminor.yy168 = createRawExprNode(pCxt, &yymsp[0].minor.yy241, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy241)); } + yymsp[0].minor.yy168 = yylhsminor.yy168; break; - 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; + case 198: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy241, createColumnNode(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy241)); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 149: /* predicate ::= expression compare_op expression */ - case 154: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==154); + case 199: /* predicate ::= expression compare_op expression */ + case 204: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==204); { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy476, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 150: /* predicate ::= expression BETWEEN expression AND expression */ + case 200: /* predicate ::= expression BETWEEN expression AND expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy168), releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-4].minor.yy432 = yylhsminor.yy432; + yymsp[-4].minor.yy168 = yylhsminor.yy168; break; - case 151: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 201: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[-5].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-5].minor.yy432 = yylhsminor.yy432; + yymsp[-5].minor.yy168 = yylhsminor.yy168; break; - case 152: /* predicate ::= expression IS NULL */ + case 202: /* predicate ::= expression IS 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)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), NULL)); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 153: /* predicate ::= expression IS NOT NULL */ + case 203: /* predicate ::= expression IS NOT 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)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy168), NULL)); } - yymsp[-3].minor.yy432 = yylhsminor.yy432; + yymsp[-3].minor.yy168 = yylhsminor.yy168; break; - case 155: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy260 = OP_TYPE_LOWER_THAN; } + case 205: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy476 = OP_TYPE_LOWER_THAN; } break; - case 156: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy260 = OP_TYPE_GREATER_THAN; } + case 206: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy476 = OP_TYPE_GREATER_THAN; } break; - case 157: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy260 = OP_TYPE_LOWER_EQUAL; } + case 207: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy476 = OP_TYPE_LOWER_EQUAL; } break; - case 158: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy260 = OP_TYPE_GREATER_EQUAL; } + case 208: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy476 = OP_TYPE_GREATER_EQUAL; } break; - case 159: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy260 = OP_TYPE_NOT_EQUAL; } + case 209: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy476 = OP_TYPE_NOT_EQUAL; } break; - case 160: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy260 = OP_TYPE_EQUAL; } + case 210: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy476 = OP_TYPE_EQUAL; } break; - case 161: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy260 = OP_TYPE_LIKE; } + case 211: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy476 = OP_TYPE_LIKE; } break; - case 162: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy260 = OP_TYPE_NOT_LIKE; } + case 212: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy476 = OP_TYPE_NOT_LIKE; } break; - case 163: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy260 = OP_TYPE_MATCH; } + case 213: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy476 = OP_TYPE_MATCH; } break; - case 164: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy260 = OP_TYPE_NMATCH; } + case 214: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy476 = OP_TYPE_NMATCH; } break; - case 165: /* in_op ::= IN */ -{ yymsp[0].minor.yy260 = OP_TYPE_IN; } + case 215: /* in_op ::= IN */ +{ yymsp[0].minor.yy476 = OP_TYPE_IN; } break; - case 166: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy260 = OP_TYPE_NOT_IN; } + case 216: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy476 = OP_TYPE_NOT_IN; } break; - 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; + case 217: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy440)); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 169: /* boolean_value_expression ::= NOT boolean_primary */ + case 219: /* boolean_value_expression ::= NOT boolean_primary */ { - 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)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy168), NULL)); } - yymsp[-1].minor.yy432 = yylhsminor.yy432; + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - case 170: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 220: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 171: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 221: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy168); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } - yymsp[-2].minor.yy432 = yylhsminor.yy432; + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; } + case 226: /* from_clause ::= FROM table_reference_list */ + case 256: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==256); + case 279: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==279); +{ yymsp[-1].minor.yy168 = yymsp[0].minor.yy168; } break; - 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; + case 228: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy168 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy168, yymsp[0].minor.yy168, NULL); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 231: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy168 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy241, &yymsp[0].minor.yy241); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - 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; + case 232: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy168 = createRealTableNode(pCxt, &yymsp[-3].minor.yy241, &yymsp[-1].minor.yy241, &yymsp[0].minor.yy241); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; break; - 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; + case 233: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy168 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy168), &yymsp[0].minor.yy241); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - case 185: /* alias_opt ::= */ -{ yymsp[1].minor.yy129 = nil_token; } + case 235: /* alias_opt ::= */ +{ yymsp[1].minor.yy241 = nil_token; } break; - case 186: /* alias_opt ::= table_alias */ -{ yylhsminor.yy129 = yymsp[0].minor.yy129; } - yymsp[0].minor.yy129 = yylhsminor.yy129; + case 236: /* alias_opt ::= table_alias */ +{ yylhsminor.yy241 = yymsp[0].minor.yy241; } + yymsp[0].minor.yy241 = yylhsminor.yy241; break; - case 187: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; } + case 237: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy241 = yymsp[0].minor.yy241; } break; - 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; } + case 238: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 239: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==239); +{ yymsp[-2].minor.yy168 = yymsp[-1].minor.yy168; } break; - 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; + case 240: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy168 = createJoinTableNode(pCxt, yymsp[-4].minor.yy228, yymsp[-5].minor.yy168, yymsp[-2].minor.yy168, yymsp[0].minor.yy168); } + yymsp[-5].minor.yy168 = yylhsminor.yy168; break; - case 191: /* join_type ::= */ -{ yymsp[1].minor.yy332 = JOIN_TYPE_INNER; } + case 241: /* join_type ::= */ +{ yymsp[1].minor.yy228 = JOIN_TYPE_INNER; } break; - case 192: /* join_type ::= INNER */ -{ yymsp[0].minor.yy332 = JOIN_TYPE_INNER; } + case 242: /* join_type ::= INNER */ +{ yymsp[0].minor.yy228 = JOIN_TYPE_INNER; } break; - 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 */ + case 243: /* 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.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); + yymsp[-8].minor.yy168 = createSelectStmt(pCxt, yymsp[-7].minor.yy457, yymsp[-6].minor.yy440, yymsp[-5].minor.yy168); + yymsp[-8].minor.yy168 = addWhereClause(pCxt, yymsp[-8].minor.yy168, yymsp[-4].minor.yy168); + yymsp[-8].minor.yy168 = addPartitionByClause(pCxt, yymsp[-8].minor.yy168, yymsp[-3].minor.yy440); + yymsp[-8].minor.yy168 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy168, yymsp[-2].minor.yy168); + yymsp[-8].minor.yy168 = addGroupByClause(pCxt, yymsp[-8].minor.yy168, yymsp[-1].minor.yy440); + yymsp[-8].minor.yy168 = addHavingClause(pCxt, yymsp[-8].minor.yy168, yymsp[0].minor.yy168); } break; - case 195: /* set_quantifier_opt ::= DISTINCT */ -{ yymsp[0].minor.yy97 = true; } + case 245: /* set_quantifier_opt ::= DISTINCT */ +{ yymsp[0].minor.yy457 = true; } break; - case 196: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy97 = false; } + case 246: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy457 = false; } break; - case 197: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy24 = NULL; } + case 247: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy440 = NULL; } break; - case 201: /* select_item ::= common_expression */ + case 251: /* select_item ::= common_expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy432); - yylhsminor.yy432 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432), &t); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy168); + yylhsminor.yy168 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy168), &t); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + yymsp[0].minor.yy168 = yylhsminor.yy168; break; - 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; + case 252: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy168 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy168), &yymsp[0].minor.yy241); } + yymsp[-1].minor.yy168 = yylhsminor.yy168; break; - 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; + case 253: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy168 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), &yymsp[0].minor.yy241); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; + case 254: /* select_item ::= table_name NK_DOT NK_STAR */ +{ yylhsminor.yy168 = createColumnNode(pCxt, &yymsp[-2].minor.yy241, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - 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; } + case 258: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 275: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==275); + case 285: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==285); +{ yymsp[-2].minor.yy440 = yymsp[0].minor.yy440; } break; - 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); } + case 260: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy168 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy168), &yymsp[-1].minor.yy0); } break; - 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)); } + case 261: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ +{ yymsp[-3].minor.yy168 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy168)); } break; - 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); } + case 262: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy168 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy168), NULL, yymsp[-1].minor.yy168, yymsp[0].minor.yy168); } break; - 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); } + case 263: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy168 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy168), releaseRawExprNode(pCxt, yymsp[-3].minor.yy168), yymsp[-1].minor.yy168, yymsp[0].minor.yy168); } break; - case 215: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy432 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy432); } + case 265: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ +{ yymsp[-3].minor.yy168 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy168); } break; - case 217: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy432 = createFillNode(pCxt, yymsp[-1].minor.yy294, NULL); } + case 267: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy168 = createFillNode(pCxt, yymsp[-1].minor.yy262, NULL); } break; - 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)); } + case 268: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy168 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy440)); } break; - case 219: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy294 = FILL_MODE_NONE; } + case 269: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy262 = FILL_MODE_NONE; } break; - case 220: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy294 = FILL_MODE_PREV; } + case 270: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy262 = FILL_MODE_PREV; } break; - case 221: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy294 = FILL_MODE_NULL; } + case 271: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy262 = FILL_MODE_NULL; } break; - case 222: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy294 = FILL_MODE_LINEAR; } + case 272: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy262 = FILL_MODE_LINEAR; } break; - case 223: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy294 = FILL_MODE_NEXT; } + case 273: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy262 = FILL_MODE_NEXT; } break; - case 226: /* group_by_list ::= expression */ -{ yylhsminor.yy24 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy432))); } - yymsp[0].minor.yy24 = yylhsminor.yy24; + case 276: /* group_by_list ::= expression */ +{ yylhsminor.yy440 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } + yymsp[0].minor.yy440 = yylhsminor.yy440; break; - 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; + case 277: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy440 = addNodeToList(pCxt, yymsp[-2].minor.yy440, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy168))); } + yymsp[-2].minor.yy440 = yylhsminor.yy440; break; - case 230: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 280: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - 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); + yylhsminor.yy168 = addOrderByClause(pCxt, yymsp[-3].minor.yy168, yymsp[-2].minor.yy440); + yylhsminor.yy168 = addSlimitClause(pCxt, yylhsminor.yy168, yymsp[-1].minor.yy168); + yylhsminor.yy168 = addLimitClause(pCxt, yylhsminor.yy168, yymsp[0].minor.yy168); } - yymsp[-3].minor.yy432 = yylhsminor.yy432; + yymsp[-3].minor.yy168 = yylhsminor.yy168; break; - 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; + case 282: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy168 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy168, yymsp[0].minor.yy168); } + yymsp[-3].minor.yy168 = yylhsminor.yy168; break; - 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); } + case 287: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 291: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==291); +{ yymsp[-1].minor.yy168 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - 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); } + case 288: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 292: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==292); +{ yymsp[-3].minor.yy168 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - 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); } + case 289: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 293: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==293); +{ yymsp[-3].minor.yy168 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - 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; + case 294: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy168 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy168); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 245: /* search_condition ::= common_expression */ -{ yylhsminor.yy432 = releaseRawExprNode(pCxt, yymsp[0].minor.yy432); } - yymsp[0].minor.yy432 = yylhsminor.yy432; + case 295: /* search_condition ::= common_expression */ +{ yylhsminor.yy168 = releaseRawExprNode(pCxt, yymsp[0].minor.yy168); } + yymsp[0].minor.yy168 = yylhsminor.yy168; break; - 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; + case 298: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy168 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy168), yymsp[-1].minor.yy258, yymsp[0].minor.yy425); } + yymsp[-2].minor.yy168 = yylhsminor.yy168; break; - case 249: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy378 = ORDER_ASC; } + case 299: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy258 = ORDER_ASC; } break; - case 250: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy378 = ORDER_ASC; } + case 300: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy258 = ORDER_ASC; } break; - case 251: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy378 = ORDER_DESC; } + case 301: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy258 = ORDER_DESC; } break; - case 252: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy257 = NULL_ORDER_DEFAULT; } + case 302: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy425 = NULL_ORDER_DEFAULT; } break; - case 253: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy257 = NULL_ORDER_FIRST; } + case 303: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy425 = NULL_ORDER_FIRST; } break; - case 254: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy257 = NULL_ORDER_LAST; } + case 304: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy425 = NULL_ORDER_LAST; } break; default: break; @@ -2839,13 +3164,15 @@ static void yy_syntax_error( ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ - - if(TOKEN.z) { - generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); - } else { - generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL); + + if (pCxt->valid) { + if(TOKEN.z) { + generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); + } else { + generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL); + } + pCxt->valid = false; } - pCxt->valid = false; /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseCTX_STORE diff --git a/source/libs/parser/test/parserAstTest.cpp b/source/libs/parser/test/parserAstTest.cpp index f4c1bde478..bb2f2539e9 100644 --- a/source/libs/parser/test/parserAstTest.cpp +++ b/source/libs/parser/test/parserAstTest.cpp @@ -302,6 +302,13 @@ TEST_F(ParserTest, createUser) { ASSERT_TRUE(run()); } +TEST_F(ParserTest, alterAccount) { + setDatabase("root", "test"); + + bind("alter account ac_wxy pass '123456'"); + ASSERT_TRUE(run(TSDB_CODE_PAR_EXPRIE_STATEMENT)); +} + TEST_F(ParserTest, createDnode) { setDatabase("root", "test"); @@ -312,6 +319,16 @@ TEST_F(ParserTest, createDnode) { ASSERT_TRUE(run()); } +TEST_F(ParserTest, alterDnode) { + setDatabase("root", "test"); + + bind("alter dnode 1 'resetLog'"); + ASSERT_TRUE(run()); + + bind("alter dnode 1 'debugFlag' '134'"); + ASSERT_TRUE(run()); +} + TEST_F(ParserTest, createDatabase) { setDatabase("root", "test");