diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 2121b3175a..4e3066790a 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -40,116 +40,121 @@ #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_DATABASE 33 -#define TK_DATABASES 34 -#define TK_USE 35 -#define TK_IF 36 -#define TK_NOT 37 -#define TK_EXISTS 38 -#define TK_BLOCKS 39 -#define TK_CACHE 40 -#define TK_CACHELAST 41 -#define TK_COMP 42 -#define TK_DAYS 43 -#define TK_FSYNC 44 -#define TK_MAXROWS 45 -#define TK_MINROWS 46 -#define TK_KEEP 47 -#define TK_PRECISION 48 -#define TK_QUORUM 49 -#define TK_REPLICA 50 -#define TK_TTL 51 -#define TK_WAL 52 -#define TK_VGROUPS 53 -#define TK_SINGLE_STABLE 54 -#define TK_STREAM_MODE 55 -#define TK_TABLE 56 -#define TK_NK_LP 57 -#define TK_NK_RP 58 -#define TK_STABLE 59 -#define TK_TABLES 60 -#define TK_STABLES 61 -#define TK_USING 62 -#define TK_TAGS 63 -#define TK_NK_DOT 64 -#define TK_NK_COMMA 65 -#define TK_COMMENT 66 -#define TK_BOOL 67 -#define TK_TINYINT 68 -#define TK_SMALLINT 69 -#define TK_INT 70 -#define TK_INTEGER 71 -#define TK_BIGINT 72 -#define TK_FLOAT 73 -#define TK_DOUBLE 74 -#define TK_BINARY 75 -#define TK_TIMESTAMP 76 -#define TK_NCHAR 77 -#define TK_UNSIGNED 78 -#define TK_JSON 79 -#define TK_VARCHAR 80 -#define TK_MEDIUMBLOB 81 -#define TK_BLOB 82 -#define TK_VARBINARY 83 -#define TK_DECIMAL 84 -#define TK_SMA 85 +#define TK_DNODE 25 +#define TK_PORT 26 +#define TK_NK_INTEGER 27 +#define TK_NK_ID 28 +#define TK_NK_IPTOKEN 29 +#define TK_DATABASE 30 +#define TK_USE 31 +#define TK_IF 32 +#define TK_NOT 33 +#define TK_EXISTS 34 +#define TK_BLOCKS 35 +#define TK_CACHE 36 +#define TK_CACHELAST 37 +#define TK_COMP 38 +#define TK_DAYS 39 +#define TK_FSYNC 40 +#define TK_MAXROWS 41 +#define TK_MINROWS 42 +#define TK_KEEP 43 +#define TK_PRECISION 44 +#define TK_QUORUM 45 +#define TK_REPLICA 46 +#define TK_TTL 47 +#define TK_WAL 48 +#define TK_VGROUPS 49 +#define TK_SINGLE_STABLE 50 +#define TK_STREAM_MODE 51 +#define TK_TABLE 52 +#define TK_NK_LP 53 +#define TK_NK_RP 54 +#define TK_STABLE 55 +#define TK_USING 56 +#define TK_TAGS 57 +#define TK_NK_DOT 58 +#define TK_NK_COMMA 59 +#define TK_COMMENT 60 +#define TK_BOOL 61 +#define TK_TINYINT 62 +#define TK_SMALLINT 63 +#define TK_INT 64 +#define TK_INTEGER 65 +#define TK_BIGINT 66 +#define TK_FLOAT 67 +#define TK_DOUBLE 68 +#define TK_BINARY 69 +#define TK_TIMESTAMP 70 +#define TK_NCHAR 71 +#define TK_UNSIGNED 72 +#define TK_JSON 73 +#define TK_VARCHAR 74 +#define TK_MEDIUMBLOB 75 +#define TK_BLOB 76 +#define TK_VARBINARY 77 +#define TK_DECIMAL 78 +#define TK_SMA 79 +#define TK_SHOW 80 +#define TK_DNODES 81 +#define TK_USERS 82 +#define TK_DATABASES 83 +#define TK_TABLES 84 +#define TK_STABLES 85 #define TK_MNODES 86 -#define TK_NK_FLOAT 87 -#define TK_NK_BOOL 88 -#define TK_NK_VARIABLE 89 -#define TK_BETWEEN 90 -#define TK_IS 91 -#define TK_NULL 92 -#define TK_NK_LT 93 -#define TK_NK_GT 94 -#define TK_NK_LE 95 -#define TK_NK_GE 96 -#define TK_NK_NE 97 -#define TK_NK_EQ 98 -#define TK_LIKE 99 -#define TK_MATCH 100 -#define TK_NMATCH 101 -#define TK_IN 102 -#define TK_FROM 103 -#define TK_AS 104 -#define TK_JOIN 105 -#define TK_ON 106 -#define TK_INNER 107 -#define TK_SELECT 108 -#define TK_DISTINCT 109 -#define TK_WHERE 110 -#define TK_PARTITION 111 -#define TK_BY 112 -#define TK_SESSION 113 -#define TK_STATE_WINDOW 114 -#define TK_INTERVAL 115 -#define TK_SLIDING 116 -#define TK_FILL 117 -#define TK_VALUE 118 -#define TK_NONE 119 -#define TK_PREV 120 -#define TK_LINEAR 121 -#define TK_NEXT 122 -#define TK_GROUP 123 -#define TK_HAVING 124 -#define TK_ORDER 125 -#define TK_SLIMIT 126 -#define TK_SOFFSET 127 -#define TK_LIMIT 128 -#define TK_OFFSET 129 -#define TK_ASC 130 -#define TK_DESC 131 -#define TK_NULLS 132 -#define TK_FIRST 133 -#define TK_LAST 134 +#define TK_MODULES 87 +#define TK_QNODES 88 +#define TK_FUNCTIONS 89 +#define TK_INDEXES 90 +#define TK_FROM 91 +#define TK_STREAMS 92 +#define TK_LIKE 93 +#define TK_NK_FLOAT 94 +#define TK_NK_BOOL 95 +#define TK_NK_VARIABLE 96 +#define TK_BETWEEN 97 +#define TK_IS 98 +#define TK_NULL 99 +#define TK_NK_LT 100 +#define TK_NK_GT 101 +#define TK_NK_LE 102 +#define TK_NK_GE 103 +#define TK_NK_NE 104 +#define TK_NK_EQ 105 +#define TK_MATCH 106 +#define TK_NMATCH 107 +#define TK_IN 108 +#define TK_AS 109 +#define TK_JOIN 110 +#define TK_ON 111 +#define TK_INNER 112 +#define TK_SELECT 113 +#define TK_DISTINCT 114 +#define TK_WHERE 115 +#define TK_PARTITION 116 +#define TK_BY 117 +#define TK_SESSION 118 +#define TK_STATE_WINDOW 119 +#define TK_INTERVAL 120 +#define TK_SLIDING 121 +#define TK_FILL 122 +#define TK_VALUE 123 +#define TK_NONE 124 +#define TK_PREV 125 +#define TK_LINEAR 126 +#define TK_NEXT 127 +#define TK_GROUP 128 +#define TK_HAVING 129 +#define TK_ORDER 130 +#define TK_SLIMIT 131 +#define TK_SOFFSET 132 +#define TK_LIMIT 133 +#define TK_OFFSET 134 +#define TK_ASC 135 +#define TK_DESC 136 +#define TK_NULLS 137 +#define TK_FIRST 138 +#define TK_LAST 139 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 084258e48f..2d1808789c 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -152,7 +152,8 @@ typedef struct SDropDnodeStmt { typedef struct SShowStmt { ENodeType type; - char dbName[TSDB_DB_NAME_LEN]; + SNode* pDbName; // SValueNode + SNode* pTbNamePattern; // SValueNode } SShowStmt; #ifdef __cplusplus diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 8fb52ceb85..124b712aab 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -74,25 +74,30 @@ typedef enum ENodeType { QUERY_NODE_VNODE_MODIF_STMT, QUERY_NODE_CREATE_DATABASE_STMT, QUERY_NODE_DROP_DATABASE_STMT, - QUERY_NODE_SHOW_DATABASES_STMT, // temp QUERY_NODE_CREATE_TABLE_STMT, QUERY_NODE_CREATE_SUBTABLE_CLAUSE, QUERY_NODE_CREATE_MULTI_TABLE_STMT, QUERY_NODE_DROP_TABLE_CLAUSE, QUERY_NODE_DROP_TABLE_STMT, QUERY_NODE_DROP_SUPER_TABLE_STMT, - QUERY_NODE_SHOW_TABLES_STMT, // temp - QUERY_NODE_SHOW_STABLES_STMT, QUERY_NODE_CREATE_USER_STMT, QUERY_NODE_ALTER_USER_STMT, QUERY_NODE_DROP_USER_STMT, - QUERY_NODE_SHOW_USERS_STMT, QUERY_NODE_USE_DATABASE_STMT, QUERY_NODE_CREATE_DNODE_STMT, QUERY_NODE_DROP_DNODE_STMT, + QUERY_NODE_SHOW_DATABASES_STMT, + QUERY_NODE_SHOW_TABLES_STMT, + QUERY_NODE_SHOW_STABLES_STMT, + QUERY_NODE_SHOW_USERS_STMT, QUERY_NODE_SHOW_DNODES_STMT, QUERY_NODE_SHOW_VGROUPS_STMT, QUERY_NODE_SHOW_MNODES_STMT, + QUERY_NODE_SHOW_MODULES_STMT, + QUERY_NODE_SHOW_QNODES_STMT, + QUERY_NODE_SHOW_FUNCTIONS_STMT, + QUERY_NODE_SHOW_INDEXES_STMT, + QUERY_NODE_SHOW_STREAMS_STMT, // logic plan node QUERY_NODE_LOGIC_PLAN_SCAN, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 75eedf58b4..dee9d3d391 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -217,7 +217,7 @@ typedef struct SSubplan { ESubplanType subplanType; int32_t msgType; // message type for subplan, used to denote the send message type to vnode. int32_t level; // the execution level of current subplan, starting from 0 in a top-down manner. - char dbFName[TSDB_DB_FNAME_LEN]; + char dbFName[TSDB_DB_FNAME_LEN]; SQueryNodeAddr execNode; // for the scan/modify subplan, the optional execution node SQueryNodeStat execNodeStat; // only for scan subplan SNodeList* pChildren; // the datasource subplan,from which to fetch the result diff --git a/source/dnode/mnode/impl/src/mndInfoSchema.c b/source/dnode/mnode/impl/src/mndInfoSchema.c index e60e2989be..06dd66074c 100644 --- a/source/dnode/mnode/impl/src/mndInfoSchema.c +++ b/source/dnode/mnode/impl/src/mndInfoSchema.c @@ -64,7 +64,7 @@ static const SInfosTableSchema userFuncSchema[] = {{.name = "name", .b {.name = "precision", .bytes = 2, .type = TSDB_DATA_TYPE_BINARY}, {.name = "status", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY}, }; -static const SInfosTableSchema userIdxSchema[] = {{.name = "table_database", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY}, +static const SInfosTableSchema userIdxSchema[] = {{.name = "db_name", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY}, {.name = "table_name", .bytes = 192, .type = TSDB_DATA_TYPE_BINARY}, {.name = "index_database", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY}, {.name = "index_name", .bytes = 192, .type = TSDB_DATA_TYPE_BINARY}, @@ -112,6 +112,7 @@ static const SInfosTableSchema userUsersSchema[] = {{.name = "user_name", . {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP}, }; static const SInfosTableSchema vgroupsSchema[] = {{.name = "vg_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, + {.name = "db_name", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY}, {.name = "tables", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "status", .bytes = 10, .type = TSDB_DATA_TYPE_BINARY}, {.name = "onlines", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index c675827253..402b12d00e 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -31,6 +31,9 @@ #define COPY_CHAR_POINT_FIELD(fldname) \ do { \ + if (NULL == (pSrc)->fldname) { \ + break; \ + } \ (pDst)->fldname = strdup((pSrc)->fldname); \ } while (0) diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index c1bd4b2279..43397ad424 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -85,9 +85,7 @@ SNodeptr nodesMakeNode(ENodeType type) { case QUERY_NODE_CREATE_DATABASE_STMT: return makeNode(type, sizeof(SCreateDatabaseStmt)); case QUERY_NODE_DROP_DATABASE_STMT: - return makeNode(type, sizeof(SDropDatabaseStmt)); - case QUERY_NODE_SHOW_DATABASES_STMT: - return makeNode(type, sizeof(SShowStmt)); + return makeNode(type, sizeof(SDropDatabaseStmt)); case QUERY_NODE_CREATE_TABLE_STMT: return makeNode(type, sizeof(SCreateTableStmt)); case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: @@ -100,27 +98,30 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SDropTableStmt)); case QUERY_NODE_DROP_SUPER_TABLE_STMT: return makeNode(type, sizeof(SDropSuperTableStmt)); - case QUERY_NODE_SHOW_TABLES_STMT: - case QUERY_NODE_SHOW_STABLES_STMT: - return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_CREATE_USER_STMT: return makeNode(type, sizeof(SCreateUserStmt)); case QUERY_NODE_ALTER_USER_STMT: return makeNode(type, sizeof(SAlterUserStmt)); case QUERY_NODE_DROP_USER_STMT: return makeNode(type, sizeof(SDropUserStmt)); - case QUERY_NODE_SHOW_USERS_STMT: - return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_USE_DATABASE_STMT: return makeNode(type, sizeof(SUseDatabaseStmt)); case QUERY_NODE_CREATE_DNODE_STMT: return makeNode(type, sizeof(SCreateDnodeStmt)); case QUERY_NODE_DROP_DNODE_STMT: return makeNode(type, sizeof(SDropDnodeStmt)); + case QUERY_NODE_SHOW_DATABASES_STMT: + case QUERY_NODE_SHOW_TABLES_STMT: + case QUERY_NODE_SHOW_STABLES_STMT: + case QUERY_NODE_SHOW_USERS_STMT: case QUERY_NODE_SHOW_DNODES_STMT: - return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_MNODES_STMT: + case QUERY_NODE_SHOW_MODULES_STMT: + case QUERY_NODE_SHOW_QNODES_STMT: + case QUERY_NODE_SHOW_FUNCTIONS_STMT: + case QUERY_NODE_SHOW_INDEXES_STMT: + case QUERY_NODE_SHOW_STREAMS_STMT: return makeNode(type, sizeof(SShowStmt)); case QUERY_NODE_LOGIC_PLAN_SCAN: return makeNode(type, sizeof(SScanLogicNode)); diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 11c56ddf3c..5470c67235 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -126,7 +126,7 @@ SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNod SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables); SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable); SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName); -SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDbName); +SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbNamePattern); SNode* createCreateUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, const SToken* pPassword); SNode* createAlterUserStmt(SAstCreateContext* pCxt, const SToken* pUserName, int8_t alterType, const SToken* pVal); SNode* createDropUserStmt(SAstCreateContext* pCxt, const SToken* pUserName); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 310da2e966..2074c18533 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -41,19 +41,17 @@ %left NK_CONCAT. //%right NK_BITNOT. -/************************************************ create/alter/drop/show user *****************************************/ +/************************************************ create/alter/drop user **********************************************/ cmd ::= CREATE USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &B);} cmd ::= ALTER USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PASSWD, &B);} cmd ::= ALTER USER user_name(A) PRIVILEGE NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PRIVILEGES, &B);} cmd ::= 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 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); } %type dnode_endpoint { SToken } %destructor dnode_endpoint { } @@ -64,10 +62,9 @@ dnode_endpoint(A) ::= NK_STRING(B). dnode_host_name(A) ::= NK_ID(B). { A = B; } dnode_host_name(A) ::= NK_IPTOKEN(B). { A = B; } -/************************************************ create/drop/show/use database ***************************************/ +/************************************************ create/drop/use database ********************************************/ cmd ::= CREATE DATABASE not_exists_opt(A) db_name(B) db_options(C). { pCxt->pRootNode = createCreateDatabaseStmt(pCxt, A, &B, C);} cmd ::= DROP DATABASE exists_opt(A) db_name(B). { pCxt->pRootNode = createDropDatabaseStmt(pCxt, A, &B); } -cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } cmd ::= USE db_name(A). { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &A);} %type not_exists_opt { bool } @@ -101,7 +98,7 @@ db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(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); } -/************************************************ create/drop/show table/stable ***************************************/ +/************************************************ create/drop 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);} @@ -109,8 +106,6 @@ cmd ::= CREATE STABLE not_exists_opt(A) full_table_name(B) NK_LP column_def_list(C) NK_RP tags_def(D) table_options(E). { pCxt->pRootNode = createCreateTableStmt(pCxt, A, B, C, D, E);} cmd ::= DROP TABLE multi_drop_clause(A). { pCxt->pRootNode = createDropTableStmt(pCxt, A); } cmd ::= DROP STABLE exists_opt(A) full_table_name(B). { pCxt->pRootNode = createDropSuperTableStmt(pCxt, A, B); } -cmd ::= SHOW TABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } -cmd ::= SHOW STABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } %type multi_create_clause { SNodeList* } %destructor multi_create_clause { nodesDestroyList($$); } @@ -194,12 +189,30 @@ col_name_list(A) ::= col_name_list(B) NK_COMMA col_name(C). col_name(A) ::= column_name(B). { A = createColumnNode(pCxt, NULL, &B); } -/************************************************ show vgroups ********************************************************/ -cmd ::= SHOW VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } -cmd ::= SHOW db_name(B) NK_DOT VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &B); } +/************************************************ show ****************************************************************/ +cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); } +cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); } +cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); } +cmd ::= SHOW db_name_cond_opt(A) TABLES like_pattern_opt(B). { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, A, B); } +cmd ::= SHOW db_name_cond_opt(A) STABLES like_pattern_opt(B). { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, A, B); } +cmd ::= SHOW db_name_cond_opt(A) VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, A, NULL); } +cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); } +cmd ::= SHOW MODULES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); } +cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); } +cmd ::= SHOW FUNCTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); } +cmd ::= SHOW INDEXES FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, A, B); } +cmd ::= SHOW STREAMS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); } -/************************************************ show vgroups ********************************************************/ -cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); } +db_name_cond_opt(A) ::= . { A = NULL; } +db_name_cond_opt(A) ::= db_name(B) NK_DOT. { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } + +like_pattern_opt(A) ::= . { A = NULL; } +like_pattern_opt(A) ::= LIKE NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } + +table_name_cond(A) ::= table_name(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } + +from_db_opt(A) ::= . { A = NULL; } +from_db_opt(A) ::= FROM db_name(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } /************************************************ select **************************************************************/ cmd ::= query_expression(A). { pCxt->pRootNode = A; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 9f6b697371..f8086e8a63 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -21,6 +21,7 @@ do { \ if (NULL == (p)) { \ pCxt->valid = false; \ + snprintf(pCxt->pQueryCxt->pMsg, pCxt->pQueryCxt->msgLen, "Out of memory"); \ return NULL; \ } \ } while (0) @@ -903,17 +904,11 @@ SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName) { return (SNode*)pStmt; } -SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDbName) { - if (!checkDbName(pCxt, pDbName, false)) { - return NULL; - } +SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbNamePattern) { SShowStmt* pStmt = nodesMakeNode(type);; CHECK_OUT_OF_MEM(pStmt); - if (NULL != pDbName) { - strncpy(pStmt->dbName, pDbName->z, pDbName->n); - } else if (NULL != pCxt->pQueryCxt->db) { - strcpy(pStmt->dbName, pCxt->pQueryCxt->db); - } + pStmt->pDbName = pDbName; + pStmt->pTbNamePattern = pTbNamePattern; return (SNode*)pStmt; } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index eefa99dae0..0617a399c4 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -59,11 +59,13 @@ static SKeyword keywordTable[] = { {"FLOAT", TK_FLOAT}, {"FROM", TK_FROM}, {"FSYNC", TK_FSYNC}, + {"FUNCTIONS", TK_FUNCTIONS}, {"GROUP", TK_GROUP}, {"HAVING", TK_HAVING}, {"IF", TK_IF}, {"IMPORT", TK_IMPORT}, {"IN", TK_IN}, + {"INDEXES", TK_INDEXES}, {"INNER", TK_INNER}, {"INT", TK_INT}, {"INSERT", TK_INSERT}, @@ -82,6 +84,7 @@ static SKeyword keywordTable[] = { {"MINROWS", TK_MINROWS}, {"MINUS", TK_MINUS}, {"MNODES", TK_MNODES}, + {"MODULES", TK_MODULES}, {"NCHAR", TK_NCHAR}, {"NMATCH", TK_NMATCH}, {"NONE", TK_NONE}, @@ -97,6 +100,7 @@ static SKeyword keywordTable[] = { {"PRECISION", TK_PRECISION}, {"PRIVILEGE", TK_PRIVILEGE}, {"PREV", TK_PREV}, + {"QNODES", TK_QNODES}, {"QUORUM", TK_QUORUM}, {"REPLICA", TK_REPLICA}, {"SELECT", TK_SELECT}, @@ -111,6 +115,7 @@ static SKeyword keywordTable[] = { {"STABLE", TK_STABLE}, {"STABLES", TK_STABLES}, {"STATE_WINDOW", TK_STATE_WINDOW}, + {"STREAMS", TK_STREAMS}, {"STREAM_MODE", TK_STREAM_MODE}, {"TABLE", TK_TABLE}, {"TABLES", TK_TABLES}, @@ -155,10 +160,8 @@ static SKeyword keywordTable[] = { // {"UPLUS", TK_UPLUS}, // {"BITNOT", TK_BITNOT}, // {"ACCOUNTS", TK_ACCOUNTS}, - // {"MODULES", TK_MODULES}, // {"QUERIES", TK_QUERIES}, // {"CONNECTIONS", TK_CONNECTIONS}, - // {"STREAMS", TK_STREAMS}, // {"VARIABLES", TK_VARIABLES}, // {"SCORES", TK_SCORES}, // {"GRANTS", TK_GRANTS}, @@ -231,7 +234,6 @@ static SKeyword keywordTable[] = { // {"COMPACT", TK_COMPACT}, // {"MODIFY", TK_MODIFY}, // {"FUNCTION", TK_FUNCTION}, - // {"FUNCTIONS", TK_FUNCTIONS}, // {"OUTPUTTYPE", TK_OUTPUTTYPE}, // {"AGGREGATE", TK_AGGREGATE}, // {"BUFSIZE", TK_BUFSIZE}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 8c44eafbd1..2891ff1f39 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1149,12 +1149,12 @@ static int32_t nodeTypeToShowType(ENodeType nt) { static int32_t translateShow(STranslateContext* pCxt, SShowStmt* pStmt) { SShowReq showReq = { .type = nodeTypeToShowType(nodeType(pStmt)) }; - if ('\0' != pStmt->dbName[0]) { - SName name = {0}; - tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName)); - char dbFname[TSDB_DB_FNAME_LEN] = {0}; - tNameGetFullDbName(&name, showReq.db); - } + // if ('\0' != pStmt->dbName[0]) { + // SName name = {0}; + // tNameSetDbName(&name, pCxt->pParseCxt->acctId, pStmt->dbName, strlen(pStmt->dbName)); + // char dbFname[TSDB_DB_FNAME_LEN] = {0}; + // tNameGetFullDbName(&name, showReq.db); + // } pCxt->pCmdMsg = malloc(sizeof(SCmdMsgInfo)); if (NULL== pCxt->pCmdMsg) { @@ -1302,25 +1302,142 @@ static void destroyTranslateContext(STranslateContext* pCxt) { } } -static int32_t rewriteShowDatabase(STranslateContext* pCxt, SQuery* pQuery) { - SSelectStmt* pStmt = nodesMakeNode(QUERY_NODE_SELECT_STMT); - if (NULL == pStmt) { +static const char* getSysTableName(ENodeType type) { + switch (type) { + case QUERY_NODE_SHOW_DATABASES_STMT: + return TSDB_INS_TABLE_USER_DATABASES; + case QUERY_NODE_SHOW_TABLES_STMT: + return TSDB_INS_TABLE_USER_TABLES; + case QUERY_NODE_SHOW_STABLES_STMT: + return TSDB_INS_TABLE_USER_STABLES; + case QUERY_NODE_SHOW_USERS_STMT: + return TSDB_INS_TABLE_USER_USERS; + case QUERY_NODE_SHOW_DNODES_STMT: + return TSDB_INS_TABLE_DNODES; + case QUERY_NODE_SHOW_VGROUPS_STMT: + return TSDB_INS_TABLE_VGROUPS; + case QUERY_NODE_SHOW_MNODES_STMT: + return TSDB_INS_TABLE_MNODES; + case QUERY_NODE_SHOW_MODULES_STMT: + return TSDB_INS_TABLE_MODULES; + case QUERY_NODE_SHOW_QNODES_STMT: + return TSDB_INS_TABLE_QNODES; + case QUERY_NODE_SHOW_FUNCTIONS_STMT: + return TSDB_INS_TABLE_USER_FUNCTIONS; + case QUERY_NODE_SHOW_INDEXES_STMT: + return TSDB_INS_TABLE_USER_INDEXES; + case QUERY_NODE_SHOW_STREAMS_STMT: + return TSDB_INS_TABLE_USER_STREAMS; + default: + break; + } + return NULL; +} + +static int32_t createSelectStmtForShow(ENodeType showType, SSelectStmt** pStmt) { + SSelectStmt* pSelect = nodesMakeNode(QUERY_NODE_SELECT_STMT); + if (NULL == pSelect) { return TSDB_CODE_OUT_OF_MEMORY; } + SRealTableNode* pTable = nodesMakeNode(QUERY_NODE_REAL_TABLE); if (NULL == pTable) { - nodesDestroyNode(pStmt); + nodesDestroyNode(pSelect); return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pTable->table.dbName, TSDB_INFORMATION_SCHEMA_DB); - strcpy(pTable->table.tableName, TSDB_INS_TABLE_USER_DATABASES); - pStmt->pFromTable = (SNode*)pTable; + strcpy(pTable->table.tableName, getSysTableName(showType)); + pSelect->pFromTable = (SNode*)pTable; + + *pStmt = pSelect; - nodesDestroyNode(pQuery->pRoot); - pQuery->pRoot = (SNode*)pStmt; return TSDB_CODE_SUCCESS; } +static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SNode* pRight, SNode** pOp) { + if (NULL == pRight) { + return TSDB_CODE_SUCCESS; + } + + SOperatorNode* pOper = nodesMakeNode(QUERY_NODE_OPERATOR); + if (NULL == pOper) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + pOper->opType = OP_TYPE_LIKE; + pOper->pLeft = nodesMakeNode(QUERY_NODE_COLUMN); + pOper->pRight = nodesCloneNode(pRight); + if (NULL == pOper->pLeft || NULL == pOper->pRight) { + nodesDestroyNode(pOper); + return TSDB_CODE_OUT_OF_MEMORY; + } + strcpy(((SColumnNode*)pOper->pLeft)->colName, pColName); + + *pOp = (SNode*)pOper; + return TSDB_CODE_SUCCESS; +} + +static const char* getTbNameColName(ENodeType type) { + return (QUERY_NODE_SHOW_STABLES_STMT == type ? "stable_name" : "table_name"); +} + +static int32_t createLogicCondNode(SNode* pCond1, SNode* pCond2, SNode** pCond) { + SLogicConditionNode* pCondition = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); + if (NULL == pCondition) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pCondition->condType = LOGIC_COND_TYPE_AND; + pCondition->pParameterList = nodesMakeList(); + if (NULL == pCondition->pParameterList) { + nodesDestroyNode(pCondition); + return TSDB_CODE_OUT_OF_MEMORY; + } + if (TSDB_CODE_SUCCESS != nodesListAppend(pCondition->pParameterList, pCond1) || + TSDB_CODE_SUCCESS != nodesListAppend(pCondition->pParameterList, pCond2)) { + nodesDestroyNode(pCondition); + return TSDB_CODE_OUT_OF_MEMORY; + } + + *pCond = (SNode*)pCondition; + return TSDB_CODE_SUCCESS; +} + +static int32_t createShowCondition(const SShowStmt* pShow, SSelectStmt* pSelect) { + SNode* pDbCond = NULL; + SNode* pTbCond = NULL; + if (TSDB_CODE_SUCCESS != createOperatorNode(OP_TYPE_EQUAL, "db_name", pShow->pDbName, &pDbCond) || + TSDB_CODE_SUCCESS != createOperatorNode(OP_TYPE_LIKE, getTbNameColName(nodeType(pShow)), pShow->pTbNamePattern, &pTbCond)) { + nodesDestroyNode(pDbCond); + nodesDestroyNode(pTbCond); + return TSDB_CODE_OUT_OF_MEMORY; + } + + if (NULL != pDbCond && NULL != pTbCond) { + if (TSDB_CODE_SUCCESS != createLogicCondNode(pDbCond, pTbCond, &pSelect->pWhere)) { + nodesDestroyNode(pDbCond); + nodesDestroyNode(pTbCond); + return TSDB_CODE_OUT_OF_MEMORY; + } + } else { + pSelect->pWhere = (NULL == pDbCond ? pTbCond : pDbCond); + } + + return TSDB_CODE_SUCCESS; +} + +static int32_t rewriteShow(STranslateContext* pCxt, SQuery* pQuery) { + SSelectStmt* pStmt = NULL; + int32_t code = createSelectStmtForShow(nodeType(pQuery->pRoot), &pStmt); + if (TSDB_CODE_SUCCESS == code) { + code = createShowCondition((SShowStmt*)pQuery->pRoot, pStmt); + } + if (TSDB_CODE_SUCCESS == code) { + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pStmt; + } + return code; +} + typedef struct SVgroupTablesBatch { SVCreateTbBatchReq req; SVgroupInfo info; @@ -1685,7 +1802,18 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pQuery->pRoot)) { case QUERY_NODE_SHOW_DATABASES_STMT: - code = rewriteShowDatabase(pCxt, pQuery); + case QUERY_NODE_SHOW_TABLES_STMT: + case QUERY_NODE_SHOW_STABLES_STMT: + case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_DNODES_STMT: + case QUERY_NODE_SHOW_VGROUPS_STMT: + case QUERY_NODE_SHOW_MNODES_STMT: + case QUERY_NODE_SHOW_MODULES_STMT: + case QUERY_NODE_SHOW_QNODES_STMT: + case QUERY_NODE_SHOW_FUNCTIONS_STMT: + case QUERY_NODE_SHOW_INDEXES_STMT: + case QUERY_NODE_SHOW_STREAMS_STMT: + code = rewriteShow(pCxt, pQuery); break; case QUERY_NODE_CREATE_TABLE_STMT: if (NULL == ((SCreateTableStmt*)pQuery->pRoot)->pTags) { diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index c54bbd41cc..9312537c49 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -99,24 +99,24 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char -#define YYNOCODE 209 +#define YYNOCODE 218 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SNodeList* yy46; - SDataType yy70; - SToken yy129; - ENullOrder yy147; - bool yy185; - EOrder yy202; - SNode* yy256; - EJoinType yy266; - EOperatorType yy326; - STableOptions* yy340; - EFillMode yy360; - SDatabaseOptions* yy391; + SToken yy5; + bool yy25; + SNodeList* yy40; + ENullOrder yy53; + EOrder yy54; + SNode* yy68; + EJoinType yy92; + EFillMode yy94; + SDatabaseOptions* yy339; + SDataType yy372; + EOperatorType yy416; + STableOptions* yy418; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -131,17 +131,17 @@ typedef union { #define ParseCTX_PARAM #define ParseCTX_FETCH #define ParseCTX_STORE -#define YYNSTATE 279 -#define YYNRULE 237 -#define YYNTOKEN 135 -#define YY_MAX_SHIFT 278 -#define YY_MIN_SHIFTREDUCE 439 -#define YY_MAX_SHIFTREDUCE 675 -#define YY_ERROR_ACTION 676 -#define YY_ACCEPT_ACTION 677 -#define YY_NO_ACTION 678 -#define YY_MIN_REDUCE 679 -#define YY_MAX_REDUCE 915 +#define YYNSTATE 290 +#define YYNRULE 248 +#define YYNTOKEN 140 +#define YY_MAX_SHIFT 289 +#define YY_MIN_SHIFTREDUCE 454 +#define YY_MAX_SHIFTREDUCE 701 +#define YY_ERROR_ACTION 702 +#define YY_ACCEPT_ACTION 703 +#define YY_NO_ACTION 704 +#define YY_MIN_REDUCE 705 +#define YY_MAX_REDUCE 952 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -208,285 +208,292 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (905) +#define YY_ACTTAB_COUNT (929) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 137, 149, 23, 95, 772, 721, 770, 247, 150, 784, - /* 10 */ 782, 148, 30, 28, 26, 25, 24, 784, 782, 194, - /* 20 */ 177, 808, 201, 735, 66, 30, 28, 26, 25, 24, - /* 30 */ 692, 166, 194, 222, 808, 60, 208, 132, 793, 782, - /* 40 */ 195, 209, 222, 54, 794, 730, 797, 833, 733, 58, - /* 50 */ 132, 139, 829, 906, 19, 785, 782, 733, 558, 73, - /* 60 */ 840, 841, 867, 845, 30, 28, 26, 25, 24, 271, - /* 70 */ 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, - /* 80 */ 260, 259, 258, 257, 256, 255, 26, 25, 24, 550, - /* 90 */ 22, 141, 171, 576, 577, 578, 579, 580, 581, 582, - /* 100 */ 584, 585, 586, 22, 141, 617, 576, 577, 578, 579, - /* 110 */ 580, 581, 582, 584, 585, 586, 275, 274, 499, 245, - /* 120 */ 244, 243, 503, 242, 505, 506, 241, 508, 238, 41, - /* 130 */ 514, 235, 516, 517, 232, 229, 194, 194, 808, 808, - /* 140 */ 729, 184, 793, 782, 195, 77, 45, 53, 794, 170, - /* 150 */ 797, 833, 194, 719, 808, 131, 829, 726, 793, 782, - /* 160 */ 195, 104, 93, 125, 794, 145, 797, 894, 153, 78, - /* 170 */ 221, 772, 180, 770, 808, 103, 736, 66, 793, 782, - /* 180 */ 195, 76, 209, 54, 794, 892, 797, 833, 194, 254, - /* 190 */ 808, 139, 829, 71, 793, 782, 195, 221, 42, 54, - /* 200 */ 794, 101, 797, 833, 772, 94, 771, 139, 829, 906, - /* 210 */ 616, 156, 860, 894, 180, 254, 808, 551, 890, 50, - /* 220 */ 793, 782, 195, 10, 47, 54, 794, 893, 797, 833, - /* 230 */ 194, 892, 808, 139, 829, 71, 793, 782, 195, 29, - /* 240 */ 27, 54, 794, 677, 797, 833, 41, 187, 539, 139, - /* 250 */ 829, 906, 114, 61, 861, 763, 537, 728, 146, 221, - /* 260 */ 851, 29, 27, 618, 11, 194, 182, 808, 196, 548, - /* 270 */ 539, 793, 782, 195, 77, 639, 121, 794, 537, 797, - /* 280 */ 146, 194, 56, 808, 1, 10, 11, 793, 782, 195, - /* 290 */ 79, 51, 55, 794, 894, 797, 833, 9, 8, 62, - /* 300 */ 832, 829, 725, 223, 222, 449, 1, 219, 76, 173, - /* 310 */ 248, 152, 892, 212, 538, 540, 543, 720, 191, 733, - /* 320 */ 194, 573, 808, 735, 66, 223, 793, 782, 195, 6, - /* 330 */ 613, 125, 794, 157, 797, 77, 538, 540, 543, 194, - /* 340 */ 222, 808, 96, 220, 184, 793, 782, 195, 29, 27, - /* 350 */ 119, 794, 163, 797, 594, 733, 847, 539, 172, 167, - /* 360 */ 165, 88, 29, 27, 251, 537, 188, 146, 250, 186, - /* 370 */ 894, 539, 222, 11, 844, 109, 847, 177, 852, 537, - /* 380 */ 613, 146, 192, 252, 76, 863, 154, 733, 892, 194, - /* 390 */ 177, 808, 60, 1, 843, 793, 782, 195, 735, 66, - /* 400 */ 55, 794, 249, 797, 833, 60, 58, 7, 181, 829, - /* 410 */ 184, 449, 223, 9, 8, 179, 72, 840, 841, 58, - /* 420 */ 845, 450, 451, 538, 540, 543, 223, 85, 189, 91, - /* 430 */ 840, 176, 625, 175, 82, 847, 894, 538, 540, 543, - /* 440 */ 178, 98, 29, 27, 183, 222, 29, 27, 155, 548, - /* 450 */ 76, 539, 809, 842, 892, 539, 674, 675, 77, 537, - /* 460 */ 733, 146, 194, 537, 808, 146, 20, 2, 793, 782, - /* 470 */ 195, 29, 27, 55, 794, 583, 797, 833, 587, 211, - /* 480 */ 539, 217, 830, 551, 215, 642, 539, 7, 537, 588, - /* 490 */ 146, 1, 864, 194, 537, 808, 31, 164, 161, 793, - /* 500 */ 782, 195, 555, 874, 68, 794, 223, 797, 80, 31, - /* 510 */ 223, 162, 640, 641, 643, 644, 7, 538, 540, 543, - /* 520 */ 789, 538, 540, 543, 106, 543, 194, 787, 808, 492, - /* 530 */ 159, 63, 793, 782, 195, 223, 64, 125, 794, 140, - /* 540 */ 797, 223, 873, 185, 907, 718, 538, 540, 543, 194, - /* 550 */ 160, 808, 538, 540, 543, 793, 782, 195, 487, 84, - /* 560 */ 68, 794, 138, 797, 194, 56, 808, 5, 854, 174, - /* 570 */ 793, 782, 195, 520, 70, 120, 794, 524, 797, 194, - /* 580 */ 227, 808, 4, 87, 63, 793, 782, 195, 158, 613, - /* 590 */ 122, 794, 251, 797, 89, 194, 250, 808, 529, 547, - /* 600 */ 908, 793, 782, 195, 59, 64, 117, 794, 65, 797, - /* 610 */ 194, 252, 808, 550, 848, 63, 793, 782, 195, 32, - /* 620 */ 16, 123, 794, 142, 797, 194, 815, 808, 90, 909, - /* 630 */ 249, 793, 782, 195, 193, 891, 118, 794, 194, 797, - /* 640 */ 808, 97, 546, 190, 793, 782, 195, 197, 210, 124, - /* 650 */ 794, 194, 797, 808, 40, 102, 552, 793, 782, 195, - /* 660 */ 734, 213, 805, 794, 147, 797, 194, 46, 808, 113, - /* 670 */ 44, 225, 793, 782, 195, 115, 110, 804, 794, 194, - /* 680 */ 797, 808, 278, 3, 128, 793, 782, 195, 129, 116, - /* 690 */ 803, 794, 31, 797, 194, 14, 808, 81, 636, 83, - /* 700 */ 793, 782, 195, 35, 638, 135, 794, 194, 797, 808, - /* 710 */ 69, 86, 37, 793, 782, 195, 632, 631, 134, 794, - /* 720 */ 194, 797, 808, 168, 38, 169, 793, 782, 195, 787, - /* 730 */ 610, 136, 794, 18, 797, 194, 15, 808, 609, 92, - /* 740 */ 207, 793, 782, 195, 206, 546, 133, 794, 205, 797, - /* 750 */ 33, 194, 34, 808, 75, 8, 574, 793, 782, 195, - /* 760 */ 556, 665, 126, 794, 17, 797, 177, 202, 12, 39, - /* 770 */ 660, 659, 143, 664, 204, 203, 30, 28, 26, 25, - /* 780 */ 24, 60, 99, 663, 130, 144, 13, 776, 218, 695, - /* 790 */ 127, 67, 775, 774, 112, 58, 200, 773, 199, 724, - /* 800 */ 198, 100, 57, 21, 723, 74, 840, 841, 111, 845, - /* 810 */ 694, 688, 683, 30, 28, 26, 25, 24, 30, 28, - /* 820 */ 26, 25, 24, 722, 458, 693, 30, 28, 26, 25, - /* 830 */ 24, 52, 687, 686, 107, 682, 681, 214, 680, 216, - /* 840 */ 105, 43, 47, 786, 226, 108, 224, 541, 36, 151, - /* 850 */ 513, 230, 521, 228, 512, 511, 518, 231, 233, 236, - /* 860 */ 515, 509, 234, 239, 558, 237, 510, 507, 498, 528, - /* 870 */ 240, 527, 526, 246, 77, 456, 48, 477, 253, 476, - /* 880 */ 470, 49, 475, 474, 473, 472, 471, 469, 685, 468, - /* 890 */ 467, 466, 465, 464, 671, 672, 463, 462, 461, 272, - /* 900 */ 273, 684, 679, 276, 277, + /* 0 */ 41, 155, 23, 96, 793, 200, 791, 845, 200, 884, + /* 10 */ 845, 750, 30, 28, 26, 25, 24, 190, 830, 819, + /* 20 */ 201, 172, 143, 124, 831, 156, 834, 881, 30, 28, + /* 30 */ 26, 25, 24, 137, 716, 821, 819, 177, 821, 819, + /* 40 */ 200, 232, 845, 931, 30, 28, 26, 25, 24, 137, + /* 50 */ 830, 819, 201, 232, 584, 55, 831, 77, 834, 870, + /* 60 */ 744, 929, 159, 869, 866, 793, 10, 791, 574, 282, + /* 70 */ 281, 280, 279, 278, 277, 276, 275, 274, 273, 272, + /* 80 */ 271, 270, 269, 268, 267, 266, 584, 30, 28, 26, + /* 90 */ 25, 24, 220, 608, 200, 220, 845, 22, 147, 573, + /* 100 */ 602, 603, 604, 605, 606, 607, 610, 611, 612, 608, + /* 110 */ 176, 265, 233, 22, 147, 219, 602, 603, 604, 605, + /* 120 */ 606, 607, 610, 611, 612, 232, 78, 754, 258, 668, + /* 130 */ 576, 509, 256, 255, 254, 513, 253, 515, 516, 252, + /* 140 */ 518, 249, 203, 524, 246, 526, 527, 243, 240, 200, + /* 150 */ 10, 845, 931, 168, 666, 667, 669, 670, 190, 830, + /* 160 */ 819, 201, 142, 572, 53, 831, 930, 834, 870, 41, + /* 170 */ 929, 233, 136, 866, 751, 889, 62, 639, 609, 135, + /* 180 */ 749, 565, 20, 229, 931, 132, 754, 563, 884, 186, + /* 190 */ 259, 845, 105, 613, 233, 183, 810, 230, 77, 830, + /* 200 */ 819, 201, 929, 102, 54, 831, 880, 834, 870, 754, + /* 210 */ 61, 94, 145, 866, 72, 193, 217, 216, 215, 286, + /* 220 */ 285, 210, 209, 208, 207, 206, 95, 204, 59, 793, + /* 230 */ 234, 792, 162, 897, 186, 154, 845, 185, 73, 877, + /* 240 */ 878, 56, 882, 78, 830, 819, 201, 756, 68, 54, + /* 250 */ 831, 97, 834, 870, 564, 566, 569, 145, 866, 72, + /* 260 */ 169, 200, 742, 845, 884, 30, 28, 26, 25, 24, + /* 270 */ 188, 830, 819, 201, 78, 577, 54, 831, 898, 834, + /* 280 */ 870, 200, 879, 845, 145, 866, 943, 233, 822, 819, + /* 290 */ 231, 830, 819, 201, 265, 904, 54, 831, 45, 834, + /* 300 */ 870, 200, 754, 845, 145, 866, 943, 233, 643, 747, + /* 310 */ 114, 830, 819, 201, 89, 927, 54, 831, 158, 834, + /* 320 */ 870, 462, 754, 900, 145, 866, 943, 223, 29, 27, + /* 330 */ 756, 68, 29, 27, 644, 888, 599, 565, 757, 68, + /* 340 */ 184, 565, 192, 563, 152, 160, 846, 563, 152, 11, + /* 350 */ 29, 27, 119, 11, 703, 784, 80, 756, 68, 565, + /* 360 */ 233, 29, 27, 161, 2, 563, 152, 665, 19, 1, + /* 370 */ 565, 11, 57, 1, 99, 754, 563, 152, 30, 28, + /* 380 */ 26, 25, 24, 202, 29, 27, 234, 51, 697, 698, + /* 390 */ 234, 1, 222, 565, 901, 63, 86, 462, 746, 563, + /* 400 */ 152, 83, 7, 651, 463, 464, 6, 639, 234, 931, + /* 410 */ 564, 566, 569, 577, 564, 566, 569, 574, 642, 234, + /* 420 */ 178, 173, 171, 77, 911, 1, 183, 929, 197, 78, + /* 430 */ 700, 701, 564, 566, 569, 9, 8, 200, 194, 845, + /* 440 */ 170, 61, 234, 564, 566, 569, 614, 830, 819, 201, + /* 450 */ 190, 31, 55, 831, 167, 834, 870, 9, 8, 59, + /* 460 */ 187, 866, 78, 29, 27, 189, 564, 566, 569, 92, + /* 470 */ 877, 182, 565, 181, 81, 581, 931, 826, 563, 152, + /* 480 */ 31, 200, 824, 845, 569, 165, 29, 27, 620, 910, + /* 490 */ 77, 830, 819, 201, 929, 565, 55, 831, 166, 834, + /* 500 */ 870, 563, 152, 198, 7, 867, 109, 144, 200, 5, + /* 510 */ 845, 195, 79, 85, 26, 25, 24, 108, 830, 819, + /* 520 */ 201, 234, 21, 69, 831, 111, 834, 7, 891, 211, + /* 530 */ 65, 180, 30, 28, 26, 25, 24, 743, 200, 42, + /* 540 */ 845, 88, 106, 164, 234, 564, 566, 569, 830, 819, + /* 550 */ 201, 71, 502, 130, 831, 151, 834, 66, 228, 4, + /* 560 */ 90, 226, 191, 944, 104, 103, 639, 497, 564, 566, + /* 570 */ 569, 200, 57, 845, 50, 60, 576, 47, 885, 91, + /* 580 */ 262, 830, 819, 201, 261, 32, 130, 831, 163, 834, + /* 590 */ 200, 852, 845, 530, 534, 16, 148, 263, 238, 65, + /* 600 */ 830, 819, 201, 946, 196, 126, 831, 539, 834, 200, + /* 610 */ 67, 845, 66, 928, 199, 65, 260, 98, 572, 830, + /* 620 */ 819, 201, 812, 101, 130, 831, 146, 834, 205, 200, + /* 630 */ 212, 845, 214, 40, 213, 218, 221, 578, 179, 830, + /* 640 */ 819, 201, 107, 224, 69, 831, 183, 834, 200, 153, + /* 650 */ 845, 741, 118, 44, 46, 120, 755, 289, 830, 819, + /* 660 */ 201, 61, 236, 125, 831, 200, 834, 845, 115, 133, + /* 670 */ 134, 3, 121, 31, 14, 830, 819, 201, 82, 59, + /* 680 */ 127, 831, 662, 834, 945, 200, 84, 845, 35, 74, + /* 690 */ 877, 878, 664, 882, 262, 830, 819, 201, 261, 70, + /* 700 */ 122, 831, 87, 834, 658, 200, 37, 845, 657, 174, + /* 710 */ 824, 263, 15, 38, 175, 830, 819, 201, 636, 635, + /* 720 */ 128, 831, 18, 834, 200, 93, 845, 117, 33, 34, + /* 730 */ 260, 76, 8, 58, 830, 819, 201, 582, 116, 123, + /* 740 */ 831, 600, 834, 200, 691, 845, 17, 12, 39, 686, + /* 750 */ 685, 149, 690, 830, 819, 201, 689, 100, 129, 831, + /* 760 */ 52, 834, 200, 112, 845, 150, 13, 813, 556, 805, + /* 770 */ 804, 64, 830, 819, 201, 803, 802, 842, 831, 801, + /* 780 */ 834, 200, 800, 845, 799, 798, 558, 797, 796, 795, + /* 790 */ 794, 830, 819, 201, 718, 745, 841, 831, 470, 834, + /* 800 */ 200, 717, 845, 712, 711, 708, 707, 225, 706, 43, + /* 810 */ 830, 819, 201, 227, 47, 840, 831, 110, 834, 200, + /* 820 */ 823, 845, 531, 567, 113, 36, 237, 157, 235, 830, + /* 830 */ 819, 201, 528, 239, 140, 831, 200, 834, 845, 241, + /* 840 */ 244, 247, 508, 250, 242, 523, 830, 819, 201, 522, + /* 850 */ 525, 139, 831, 521, 834, 520, 200, 257, 845, 538, + /* 860 */ 245, 537, 536, 519, 248, 468, 830, 819, 201, 517, + /* 870 */ 251, 141, 831, 48, 834, 49, 200, 264, 845, 489, + /* 880 */ 488, 183, 487, 486, 485, 484, 830, 819, 201, 483, + /* 890 */ 482, 138, 831, 481, 834, 200, 61, 845, 480, 479, + /* 900 */ 478, 477, 476, 475, 474, 830, 819, 201, 473, 710, + /* 910 */ 131, 831, 283, 834, 59, 284, 709, 705, 287, 288, + /* 920 */ 704, 704, 704, 704, 75, 877, 878, 704, 882, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 152, 154, 171, 172, 157, 0, 159, 158, 152, 161, - /* 10 */ 162, 144, 12, 13, 14, 15, 16, 161, 162, 155, - /* 20 */ 140, 157, 140, 156, 157, 12, 13, 14, 15, 16, - /* 30 */ 0, 167, 155, 140, 157, 155, 143, 37, 161, 162, - /* 40 */ 163, 36, 140, 166, 167, 143, 169, 170, 155, 169, - /* 50 */ 37, 174, 175, 176, 2, 161, 162, 155, 58, 179, - /* 60 */ 180, 181, 185, 183, 12, 13, 14, 15, 16, 39, - /* 70 */ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - /* 80 */ 50, 51, 52, 53, 54, 55, 14, 15, 16, 31, - /* 90 */ 90, 91, 31, 93, 94, 95, 96, 97, 98, 99, - /* 100 */ 100, 101, 102, 90, 91, 4, 93, 94, 95, 96, - /* 110 */ 97, 98, 99, 100, 101, 102, 137, 138, 67, 68, - /* 120 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 142, - /* 130 */ 79, 80, 81, 82, 83, 84, 155, 155, 157, 157, - /* 140 */ 153, 160, 161, 162, 163, 108, 139, 166, 167, 167, - /* 150 */ 169, 170, 155, 0, 157, 174, 175, 150, 161, 162, - /* 160 */ 163, 19, 104, 166, 167, 168, 169, 186, 154, 27, - /* 170 */ 31, 157, 155, 159, 157, 33, 156, 157, 161, 162, - /* 180 */ 163, 200, 36, 166, 167, 204, 169, 170, 155, 36, - /* 190 */ 157, 174, 175, 176, 161, 162, 163, 31, 56, 166, - /* 200 */ 167, 59, 169, 170, 157, 188, 159, 174, 175, 176, - /* 210 */ 109, 194, 195, 186, 155, 36, 157, 31, 185, 57, - /* 220 */ 161, 162, 163, 57, 62, 166, 167, 200, 169, 170, - /* 230 */ 155, 204, 157, 174, 175, 176, 161, 162, 163, 12, - /* 240 */ 13, 166, 167, 135, 169, 170, 142, 3, 21, 174, - /* 250 */ 175, 176, 145, 149, 195, 148, 29, 153, 31, 31, - /* 260 */ 185, 12, 13, 14, 37, 155, 37, 157, 160, 31, - /* 270 */ 21, 161, 162, 163, 108, 58, 166, 167, 29, 169, - /* 280 */ 31, 155, 65, 157, 57, 57, 37, 161, 162, 163, - /* 290 */ 104, 139, 166, 167, 186, 169, 170, 1, 2, 147, - /* 300 */ 174, 175, 150, 76, 140, 21, 57, 143, 200, 199, - /* 310 */ 63, 144, 204, 29, 87, 88, 89, 0, 65, 155, - /* 320 */ 155, 92, 157, 156, 157, 76, 161, 162, 163, 106, - /* 330 */ 107, 166, 167, 168, 169, 108, 87, 88, 89, 155, - /* 340 */ 140, 157, 207, 143, 160, 161, 162, 163, 12, 13, - /* 350 */ 166, 167, 198, 169, 58, 155, 164, 21, 113, 114, - /* 360 */ 115, 191, 12, 13, 47, 29, 65, 31, 51, 125, - /* 370 */ 186, 21, 140, 37, 182, 143, 164, 140, 105, 29, - /* 380 */ 107, 31, 129, 66, 200, 165, 144, 155, 204, 155, - /* 390 */ 140, 157, 155, 57, 182, 161, 162, 163, 156, 157, - /* 400 */ 166, 167, 85, 169, 170, 155, 169, 57, 174, 175, - /* 410 */ 160, 21, 76, 1, 2, 178, 179, 180, 181, 169, - /* 420 */ 183, 31, 32, 87, 88, 89, 76, 58, 127, 179, - /* 430 */ 180, 181, 14, 183, 65, 164, 186, 87, 88, 89, - /* 440 */ 184, 201, 12, 13, 14, 140, 12, 13, 143, 31, - /* 450 */ 200, 21, 157, 182, 204, 21, 133, 134, 108, 29, - /* 460 */ 155, 31, 155, 29, 157, 31, 90, 187, 161, 162, - /* 470 */ 163, 12, 13, 166, 167, 99, 169, 170, 102, 137, - /* 480 */ 21, 20, 175, 31, 23, 92, 21, 57, 29, 58, - /* 490 */ 31, 57, 165, 155, 29, 157, 65, 117, 116, 161, - /* 500 */ 162, 163, 58, 197, 166, 167, 76, 169, 196, 65, - /* 510 */ 76, 118, 119, 120, 121, 122, 57, 87, 88, 89, - /* 520 */ 57, 87, 88, 89, 58, 89, 155, 64, 157, 58, - /* 530 */ 162, 65, 161, 162, 163, 76, 65, 166, 167, 168, - /* 540 */ 169, 76, 197, 205, 206, 0, 87, 88, 89, 155, - /* 550 */ 162, 157, 87, 88, 89, 161, 162, 163, 58, 196, - /* 560 */ 166, 167, 162, 169, 155, 65, 157, 124, 193, 123, - /* 570 */ 161, 162, 163, 58, 190, 166, 167, 58, 169, 155, - /* 580 */ 65, 157, 110, 192, 65, 161, 162, 163, 111, 107, - /* 590 */ 166, 167, 47, 169, 189, 155, 51, 157, 58, 31, - /* 600 */ 206, 161, 162, 163, 155, 65, 166, 167, 58, 169, - /* 610 */ 155, 66, 157, 31, 164, 65, 161, 162, 163, 103, - /* 620 */ 57, 166, 167, 132, 169, 155, 173, 157, 177, 208, - /* 630 */ 85, 161, 162, 163, 128, 203, 166, 167, 155, 169, - /* 640 */ 157, 202, 31, 126, 161, 162, 163, 140, 140, 166, - /* 650 */ 167, 155, 169, 157, 142, 142, 31, 161, 162, 163, - /* 660 */ 155, 136, 166, 167, 136, 169, 155, 57, 157, 148, - /* 670 */ 139, 151, 161, 162, 163, 140, 139, 166, 167, 155, - /* 680 */ 169, 157, 136, 65, 146, 161, 162, 163, 146, 141, - /* 690 */ 166, 167, 65, 169, 155, 112, 157, 58, 58, 57, - /* 700 */ 161, 162, 163, 65, 58, 166, 167, 155, 169, 157, - /* 710 */ 57, 57, 57, 161, 162, 163, 58, 58, 166, 167, - /* 720 */ 155, 169, 157, 29, 57, 65, 161, 162, 163, 64, - /* 730 */ 58, 166, 167, 65, 169, 155, 112, 157, 58, 64, - /* 740 */ 26, 161, 162, 163, 30, 31, 166, 167, 34, 169, - /* 750 */ 105, 155, 65, 157, 64, 2, 92, 161, 162, 163, - /* 760 */ 58, 58, 166, 167, 65, 169, 140, 53, 112, 4, - /* 770 */ 29, 29, 29, 29, 60, 61, 12, 13, 14, 15, - /* 780 */ 16, 155, 64, 29, 18, 29, 57, 0, 22, 0, - /* 790 */ 24, 25, 0, 0, 19, 169, 64, 0, 53, 0, - /* 800 */ 86, 35, 27, 2, 0, 179, 180, 181, 33, 183, - /* 810 */ 0, 0, 0, 12, 13, 14, 15, 16, 12, 13, - /* 820 */ 14, 15, 16, 0, 38, 0, 12, 13, 14, 15, - /* 830 */ 16, 56, 0, 0, 59, 0, 0, 21, 0, 21, - /* 840 */ 19, 57, 62, 64, 29, 64, 63, 21, 57, 29, - /* 850 */ 78, 29, 58, 57, 78, 78, 58, 57, 29, 29, - /* 860 */ 58, 58, 57, 29, 58, 57, 78, 58, 21, 29, - /* 870 */ 57, 29, 21, 66, 108, 38, 57, 29, 37, 29, - /* 880 */ 21, 57, 29, 29, 29, 29, 29, 29, 0, 29, - /* 890 */ 29, 29, 29, 29, 130, 131, 29, 29, 29, 29, - /* 900 */ 28, 0, 0, 21, 20, 209, 209, 209, 209, 209, - /* 910 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 920 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 930 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 940 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 950 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 960 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 970 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 980 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 990 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 1000 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 1010 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 1020 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - /* 1030 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + /* 0 */ 147, 159, 180, 181, 162, 160, 164, 162, 160, 173, + /* 10 */ 162, 158, 12, 13, 14, 15, 16, 169, 170, 171, + /* 20 */ 172, 176, 157, 175, 176, 157, 178, 191, 12, 13, + /* 30 */ 14, 15, 16, 33, 0, 170, 171, 28, 170, 171, + /* 40 */ 160, 28, 162, 195, 12, 13, 14, 15, 16, 33, + /* 50 */ 170, 171, 172, 28, 54, 175, 176, 209, 178, 179, + /* 60 */ 0, 213, 159, 183, 184, 162, 53, 164, 28, 35, + /* 70 */ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + /* 80 */ 46, 47, 48, 49, 50, 51, 54, 12, 13, 14, + /* 90 */ 15, 16, 32, 93, 160, 32, 162, 97, 98, 28, + /* 100 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 93, + /* 110 */ 176, 32, 145, 97, 98, 148, 100, 101, 102, 103, + /* 120 */ 104, 105, 106, 107, 108, 28, 113, 160, 163, 99, + /* 130 */ 28, 61, 62, 63, 64, 65, 66, 67, 68, 69, + /* 140 */ 70, 71, 145, 73, 74, 75, 76, 77, 78, 160, + /* 150 */ 53, 162, 195, 123, 124, 125, 126, 127, 169, 170, + /* 160 */ 171, 172, 165, 28, 175, 176, 209, 178, 179, 147, + /* 170 */ 213, 145, 183, 184, 148, 110, 154, 112, 93, 18, + /* 180 */ 158, 21, 97, 22, 195, 24, 160, 27, 173, 160, + /* 190 */ 57, 162, 31, 108, 145, 145, 160, 148, 209, 170, + /* 200 */ 171, 172, 213, 167, 175, 176, 191, 178, 179, 160, + /* 210 */ 160, 109, 183, 184, 185, 3, 81, 82, 83, 142, + /* 220 */ 143, 86, 87, 88, 89, 90, 197, 92, 178, 162, + /* 230 */ 70, 164, 203, 204, 160, 149, 162, 187, 188, 189, + /* 240 */ 190, 80, 192, 113, 170, 171, 172, 161, 162, 175, + /* 250 */ 176, 216, 178, 179, 94, 95, 96, 183, 184, 185, + /* 260 */ 207, 160, 0, 162, 173, 12, 13, 14, 15, 16, + /* 270 */ 33, 170, 171, 172, 113, 28, 175, 176, 204, 178, + /* 280 */ 179, 160, 191, 162, 183, 184, 185, 145, 170, 171, + /* 290 */ 148, 170, 171, 172, 32, 194, 175, 176, 144, 178, + /* 300 */ 179, 160, 160, 162, 183, 184, 185, 145, 4, 155, + /* 310 */ 148, 170, 171, 172, 200, 194, 175, 176, 149, 178, + /* 320 */ 179, 21, 160, 174, 183, 184, 185, 27, 12, 13, + /* 330 */ 161, 162, 12, 13, 14, 194, 99, 21, 161, 162, + /* 340 */ 193, 21, 130, 27, 28, 149, 162, 27, 28, 33, + /* 350 */ 12, 13, 150, 33, 140, 153, 109, 161, 162, 21, + /* 360 */ 145, 12, 13, 148, 196, 27, 28, 54, 2, 53, + /* 370 */ 21, 33, 59, 53, 210, 160, 27, 28, 12, 13, + /* 380 */ 14, 15, 16, 169, 12, 13, 70, 144, 135, 136, + /* 390 */ 70, 53, 142, 21, 174, 152, 54, 21, 155, 27, + /* 400 */ 28, 59, 53, 14, 28, 29, 111, 112, 70, 195, + /* 410 */ 94, 95, 96, 28, 94, 95, 96, 28, 114, 70, + /* 420 */ 118, 119, 120, 209, 206, 53, 145, 213, 59, 113, + /* 430 */ 138, 139, 94, 95, 96, 1, 2, 160, 59, 162, + /* 440 */ 122, 160, 70, 94, 95, 96, 54, 170, 171, 172, + /* 450 */ 169, 59, 175, 176, 121, 178, 179, 1, 2, 178, + /* 460 */ 183, 184, 113, 12, 13, 14, 94, 95, 96, 188, + /* 470 */ 189, 190, 21, 192, 205, 54, 195, 53, 27, 28, + /* 480 */ 59, 160, 58, 162, 96, 171, 12, 13, 54, 206, + /* 490 */ 209, 170, 171, 172, 213, 21, 175, 176, 171, 178, + /* 500 */ 179, 27, 28, 134, 53, 184, 19, 171, 160, 129, + /* 510 */ 162, 132, 25, 205, 14, 15, 16, 30, 170, 171, + /* 520 */ 172, 70, 2, 175, 176, 54, 178, 53, 202, 49, + /* 530 */ 59, 128, 12, 13, 14, 15, 16, 0, 160, 52, + /* 540 */ 162, 201, 55, 116, 70, 94, 95, 96, 170, 171, + /* 550 */ 172, 199, 54, 175, 176, 177, 178, 59, 20, 115, + /* 560 */ 198, 23, 214, 215, 84, 85, 112, 54, 94, 95, + /* 570 */ 96, 160, 59, 162, 53, 160, 28, 56, 173, 186, + /* 580 */ 43, 170, 171, 172, 47, 91, 175, 176, 177, 178, + /* 590 */ 160, 182, 162, 54, 54, 53, 137, 60, 59, 59, + /* 600 */ 170, 171, 172, 217, 131, 175, 176, 54, 178, 160, + /* 610 */ 54, 162, 59, 212, 133, 59, 79, 211, 28, 170, + /* 620 */ 171, 172, 145, 91, 175, 176, 177, 178, 168, 160, + /* 630 */ 166, 162, 166, 147, 93, 145, 145, 28, 208, 170, + /* 640 */ 171, 172, 147, 141, 175, 176, 145, 178, 160, 141, + /* 650 */ 162, 0, 153, 144, 53, 145, 160, 141, 170, 171, + /* 660 */ 172, 160, 156, 175, 176, 160, 178, 162, 144, 151, + /* 670 */ 151, 59, 146, 59, 117, 170, 171, 172, 54, 178, + /* 680 */ 175, 176, 54, 178, 215, 160, 53, 162, 59, 188, + /* 690 */ 189, 190, 54, 192, 43, 170, 171, 172, 47, 53, + /* 700 */ 175, 176, 53, 178, 54, 160, 53, 162, 54, 27, + /* 710 */ 58, 60, 117, 53, 59, 170, 171, 172, 54, 54, + /* 720 */ 175, 176, 59, 178, 160, 58, 162, 19, 110, 59, + /* 730 */ 79, 58, 2, 25, 170, 171, 172, 54, 30, 175, + /* 740 */ 176, 99, 178, 160, 54, 162, 59, 117, 4, 27, + /* 750 */ 27, 27, 27, 170, 171, 172, 27, 58, 175, 176, + /* 760 */ 52, 178, 160, 55, 162, 27, 53, 0, 58, 0, + /* 770 */ 0, 91, 170, 171, 172, 0, 0, 175, 176, 0, + /* 780 */ 178, 160, 0, 162, 0, 0, 21, 0, 0, 0, + /* 790 */ 0, 170, 171, 172, 0, 0, 175, 176, 34, 178, + /* 800 */ 160, 0, 162, 0, 0, 0, 0, 21, 0, 53, + /* 810 */ 170, 171, 172, 21, 56, 175, 176, 19, 178, 160, + /* 820 */ 58, 162, 54, 21, 58, 53, 27, 27, 57, 170, + /* 830 */ 171, 172, 54, 53, 175, 176, 160, 178, 162, 27, + /* 840 */ 27, 27, 21, 27, 53, 72, 170, 171, 172, 72, + /* 850 */ 54, 175, 176, 72, 178, 72, 160, 60, 162, 27, + /* 860 */ 53, 27, 21, 54, 53, 34, 170, 171, 172, 54, + /* 870 */ 53, 175, 176, 53, 178, 53, 160, 33, 162, 27, + /* 880 */ 27, 145, 27, 27, 27, 27, 170, 171, 172, 27, + /* 890 */ 21, 175, 176, 27, 178, 160, 160, 162, 27, 27, + /* 900 */ 27, 27, 27, 27, 27, 170, 171, 172, 27, 0, + /* 910 */ 175, 176, 27, 178, 178, 26, 0, 0, 21, 20, + /* 920 */ 218, 218, 218, 218, 188, 189, 190, 218, 192, 218, + /* 930 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 940 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 950 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 960 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 970 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 980 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 990 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1000 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1010 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1020 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1030 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1040 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + /* 1050 */ 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, }; -#define YY_SHIFT_COUNT (278) +#define YY_SHIFT_COUNT (289) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (902) +#define YY_SHIFT_MAX (917) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 766, 227, 249, 336, 336, 336, 336, 350, 336, 336, - /* 10 */ 166, 434, 459, 430, 459, 459, 459, 459, 459, 459, - /* 20 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - /* 30 */ 459, 459, 228, 228, 228, 465, 465, 61, 61, 37, - /* 40 */ 139, 139, 146, 238, 139, 139, 238, 139, 238, 238, - /* 50 */ 238, 139, 179, 0, 13, 13, 465, 390, 58, 58, - /* 60 */ 58, 5, 153, 238, 238, 247, 51, 714, 764, 393, - /* 70 */ 245, 186, 273, 223, 273, 418, 244, 101, 284, 452, - /* 80 */ 380, 382, 436, 436, 380, 382, 436, 443, 446, 477, - /* 90 */ 472, 482, 568, 582, 516, 563, 491, 506, 517, 238, - /* 100 */ 611, 146, 611, 146, 625, 625, 247, 179, 568, 610, - /* 110 */ 611, 179, 625, 905, 905, 905, 30, 52, 801, 806, - /* 120 */ 814, 814, 814, 814, 814, 814, 814, 142, 317, 545, - /* 130 */ 775, 296, 376, 72, 72, 72, 72, 217, 369, 412, - /* 140 */ 431, 229, 323, 301, 253, 444, 463, 461, 466, 471, - /* 150 */ 500, 515, 519, 540, 550, 162, 618, 627, 583, 639, - /* 160 */ 640, 642, 638, 646, 653, 654, 658, 655, 659, 694, - /* 170 */ 660, 665, 667, 668, 624, 672, 680, 675, 645, 687, - /* 180 */ 690, 753, 664, 702, 703, 699, 656, 765, 741, 742, - /* 190 */ 743, 744, 754, 756, 718, 729, 787, 789, 792, 793, - /* 200 */ 745, 732, 797, 799, 804, 810, 811, 812, 823, 786, - /* 210 */ 825, 832, 833, 835, 836, 816, 838, 818, 821, 784, - /* 220 */ 780, 779, 781, 826, 791, 783, 794, 815, 820, 796, - /* 230 */ 798, 822, 800, 802, 829, 805, 803, 830, 808, 809, - /* 240 */ 834, 813, 772, 776, 777, 788, 847, 807, 819, 824, - /* 250 */ 840, 842, 851, 837, 841, 848, 850, 853, 854, 855, - /* 260 */ 856, 857, 859, 858, 860, 861, 862, 863, 864, 867, - /* 270 */ 868, 869, 888, 870, 872, 901, 902, 882, 884, + /* 0 */ 161, 316, 320, 338, 338, 338, 338, 349, 338, 338, + /* 10 */ 13, 372, 474, 451, 474, 474, 474, 474, 474, 474, + /* 20 */ 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, + /* 30 */ 474, 474, 97, 97, 97, 160, 160, 9, 9, 130, + /* 40 */ 25, 25, 63, 40, 25, 25, 40, 25, 40, 40, + /* 50 */ 40, 25, 79, 0, 16, 16, 135, 160, 376, 102, + /* 60 */ 102, 102, 60, 262, 71, 40, 40, 133, 70, 253, + /* 70 */ 30, 302, 247, 65, 295, 65, 389, 212, 304, 300, + /* 80 */ 385, 318, 333, 388, 388, 318, 333, 388, 380, 403, + /* 90 */ 427, 444, 454, 71, 548, 494, 542, 459, 481, 473, + /* 100 */ 40, 590, 532, 541, 541, 590, 63, 590, 63, 609, + /* 110 */ 609, 133, 79, 71, 601, 590, 79, 609, 929, 929, + /* 120 */ 929, 34, 366, 520, 32, 75, 75, 75, 75, 75, + /* 130 */ 75, 75, 487, 537, 651, 708, 434, 85, 500, 500, + /* 140 */ 500, 500, 480, 313, 342, 456, 392, 237, 292, 379, + /* 150 */ 369, 421, 424, 538, 471, 498, 513, 539, 540, 553, + /* 160 */ 556, 521, 612, 614, 557, 624, 628, 633, 629, 638, + /* 170 */ 646, 649, 650, 653, 654, 682, 655, 652, 660, 663, + /* 180 */ 595, 664, 665, 667, 618, 670, 673, 730, 642, 683, + /* 190 */ 690, 687, 630, 744, 722, 723, 724, 725, 729, 738, + /* 200 */ 699, 713, 767, 710, 769, 770, 680, 775, 776, 779, + /* 210 */ 782, 784, 785, 765, 787, 788, 789, 790, 794, 795, + /* 220 */ 764, 801, 803, 804, 805, 806, 786, 808, 792, 798, + /* 230 */ 756, 758, 762, 766, 802, 772, 771, 768, 799, 800, + /* 240 */ 780, 778, 812, 791, 796, 813, 807, 809, 814, 811, + /* 250 */ 815, 816, 817, 773, 777, 781, 783, 821, 797, 820, + /* 260 */ 822, 832, 834, 841, 831, 844, 852, 853, 855, 856, + /* 270 */ 857, 858, 862, 869, 866, 871, 872, 873, 874, 875, + /* 280 */ 876, 877, 881, 909, 885, 889, 916, 917, 897, 899, }; -#define YY_REDUCE_COUNT (115) -#define YY_REDUCE_MIN (-169) -#define YY_REDUCE_MAX (626) +#define YY_REDUCE_COUNT (120) +#define YY_REDUCE_MIN (-178) +#define YY_REDUCE_MAX (736) static const short yy_reduce_ofst[] = { - /* 0 */ 108, -19, 17, 59, -123, 33, 75, 184, 126, 234, - /* 10 */ 250, 307, 338, -3, 165, 110, 371, 394, 409, 424, - /* 20 */ 440, 455, 470, 483, 496, 511, 524, 539, 552, 565, - /* 30 */ 580, 596, 237, -120, 626, -152, -144, -136, -18, 27, - /* 40 */ -107, -98, 104, -133, 164, 200, -153, 232, 167, 14, - /* 50 */ 242, 305, 152, -169, -169, -169, -106, -21, 192, 212, - /* 60 */ 271, -13, 7, 20, 47, 107, -151, -118, 135, 154, - /* 70 */ 170, 220, 256, 256, 256, 295, 240, 280, 342, 327, - /* 80 */ 306, 312, 368, 388, 345, 363, 400, 375, 391, 384, - /* 90 */ 405, 256, 449, 450, 451, 453, 421, 432, 439, 295, - /* 100 */ 507, 512, 508, 513, 525, 528, 521, 531, 505, 520, - /* 110 */ 535, 537, 546, 538, 542, 548, + /* 0 */ 214, -11, 29, 74, 101, 121, 141, -152, -120, 277, + /* 10 */ 281, 321, 348, 378, 411, 430, 449, 469, 488, 505, + /* 20 */ 525, 545, 564, 583, 602, 621, 640, 659, 676, 696, + /* 30 */ 716, 735, 50, 501, 736, -135, -132, -155, -66, -43, + /* 40 */ -33, 26, 22, 86, 49, 142, -158, 162, 169, -97, + /* 50 */ 196, 215, 243, -178, -178, -178, -3, 118, 77, -164, + /* 60 */ 15, 91, -147, 154, 36, 177, 67, 202, -35, 35, + /* 70 */ 53, 114, 149, 147, 147, 147, 184, 164, 168, 250, + /* 80 */ 220, 218, 269, 314, 327, 283, 308, 336, 326, 340, + /* 90 */ 352, 362, 147, 415, 405, 393, 409, 386, 401, 406, + /* 100 */ 184, 477, 460, 464, 466, 490, 486, 491, 495, 502, + /* 110 */ 508, 499, 509, 496, 506, 510, 524, 516, 518, 519, + /* 120 */ 526, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 10 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 20 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 30 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 40 */ 676, 676, 699, 676, 676, 676, 676, 676, 676, 676, - /* 50 */ 676, 676, 697, 676, 835, 676, 676, 676, 846, 846, - /* 60 */ 846, 699, 697, 676, 676, 762, 676, 676, 910, 676, - /* 70 */ 870, 862, 838, 852, 839, 676, 895, 855, 676, 676, - /* 80 */ 877, 875, 676, 676, 877, 875, 676, 889, 885, 868, - /* 90 */ 866, 852, 676, 676, 676, 676, 913, 901, 897, 676, - /* 100 */ 676, 699, 676, 699, 676, 676, 676, 697, 676, 731, - /* 110 */ 676, 697, 676, 765, 765, 700, 676, 676, 676, 676, - /* 120 */ 888, 887, 812, 811, 810, 806, 807, 676, 676, 676, - /* 130 */ 676, 676, 676, 801, 802, 800, 799, 676, 676, 836, - /* 140 */ 676, 676, 676, 898, 902, 676, 788, 676, 676, 676, - /* 150 */ 676, 676, 676, 676, 676, 676, 859, 869, 676, 676, - /* 160 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 170 */ 676, 788, 676, 886, 676, 845, 841, 676, 676, 837, - /* 180 */ 676, 831, 676, 676, 676, 896, 676, 676, 676, 676, - /* 190 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 200 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 210 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 220 */ 676, 787, 676, 676, 676, 676, 676, 676, 676, 759, - /* 230 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 240 */ 676, 676, 744, 742, 741, 740, 676, 737, 676, 676, - /* 250 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 260 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - /* 270 */ 676, 676, 676, 676, 676, 676, 676, 676, 676, + /* 0 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 10 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 20 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 30 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 40 */ 702, 702, 722, 702, 702, 702, 702, 702, 702, 702, + /* 50 */ 702, 702, 720, 702, 872, 702, 806, 702, 702, 883, + /* 60 */ 883, 883, 722, 720, 702, 702, 702, 783, 702, 947, + /* 70 */ 702, 907, 899, 875, 889, 876, 702, 932, 892, 702, + /* 80 */ 702, 914, 912, 702, 702, 914, 912, 702, 926, 922, + /* 90 */ 905, 903, 889, 702, 702, 702, 702, 950, 938, 934, + /* 100 */ 702, 702, 811, 808, 808, 702, 722, 702, 722, 702, + /* 110 */ 702, 702, 720, 702, 752, 702, 720, 702, 786, 786, + /* 120 */ 723, 702, 702, 702, 702, 925, 924, 849, 848, 847, + /* 130 */ 843, 844, 702, 702, 702, 702, 702, 702, 838, 839, + /* 140 */ 837, 836, 702, 702, 702, 873, 702, 702, 702, 935, + /* 150 */ 939, 702, 825, 702, 702, 702, 702, 702, 702, 702, + /* 160 */ 702, 702, 896, 906, 702, 702, 702, 702, 702, 702, + /* 170 */ 702, 702, 702, 702, 702, 702, 702, 825, 702, 923, + /* 180 */ 702, 882, 878, 702, 702, 874, 702, 868, 702, 702, + /* 190 */ 702, 933, 702, 702, 702, 702, 702, 702, 702, 702, + /* 200 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 210 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 220 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 230 */ 702, 702, 824, 702, 702, 702, 702, 702, 702, 702, + /* 240 */ 780, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 250 */ 702, 702, 702, 765, 763, 762, 761, 702, 758, 702, + /* 260 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 270 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + /* 280 */ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, }; /********** End of lemon-generated parsing tables *****************************/ @@ -618,190 +625,199 @@ static const char *const yyTokenName[] = { /* 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 */ "DATABASE", - /* 34 */ "DATABASES", - /* 35 */ "USE", - /* 36 */ "IF", - /* 37 */ "NOT", - /* 38 */ "EXISTS", - /* 39 */ "BLOCKS", - /* 40 */ "CACHE", - /* 41 */ "CACHELAST", - /* 42 */ "COMP", - /* 43 */ "DAYS", - /* 44 */ "FSYNC", - /* 45 */ "MAXROWS", - /* 46 */ "MINROWS", - /* 47 */ "KEEP", - /* 48 */ "PRECISION", - /* 49 */ "QUORUM", - /* 50 */ "REPLICA", - /* 51 */ "TTL", - /* 52 */ "WAL", - /* 53 */ "VGROUPS", - /* 54 */ "SINGLE_STABLE", - /* 55 */ "STREAM_MODE", - /* 56 */ "TABLE", - /* 57 */ "NK_LP", - /* 58 */ "NK_RP", - /* 59 */ "STABLE", - /* 60 */ "TABLES", - /* 61 */ "STABLES", - /* 62 */ "USING", - /* 63 */ "TAGS", - /* 64 */ "NK_DOT", - /* 65 */ "NK_COMMA", - /* 66 */ "COMMENT", - /* 67 */ "BOOL", - /* 68 */ "TINYINT", - /* 69 */ "SMALLINT", - /* 70 */ "INT", - /* 71 */ "INTEGER", - /* 72 */ "BIGINT", - /* 73 */ "FLOAT", - /* 74 */ "DOUBLE", - /* 75 */ "BINARY", - /* 76 */ "TIMESTAMP", - /* 77 */ "NCHAR", - /* 78 */ "UNSIGNED", - /* 79 */ "JSON", - /* 80 */ "VARCHAR", - /* 81 */ "MEDIUMBLOB", - /* 82 */ "BLOB", - /* 83 */ "VARBINARY", - /* 84 */ "DECIMAL", - /* 85 */ "SMA", + /* 25 */ "DNODE", + /* 26 */ "PORT", + /* 27 */ "NK_INTEGER", + /* 28 */ "NK_ID", + /* 29 */ "NK_IPTOKEN", + /* 30 */ "DATABASE", + /* 31 */ "USE", + /* 32 */ "IF", + /* 33 */ "NOT", + /* 34 */ "EXISTS", + /* 35 */ "BLOCKS", + /* 36 */ "CACHE", + /* 37 */ "CACHELAST", + /* 38 */ "COMP", + /* 39 */ "DAYS", + /* 40 */ "FSYNC", + /* 41 */ "MAXROWS", + /* 42 */ "MINROWS", + /* 43 */ "KEEP", + /* 44 */ "PRECISION", + /* 45 */ "QUORUM", + /* 46 */ "REPLICA", + /* 47 */ "TTL", + /* 48 */ "WAL", + /* 49 */ "VGROUPS", + /* 50 */ "SINGLE_STABLE", + /* 51 */ "STREAM_MODE", + /* 52 */ "TABLE", + /* 53 */ "NK_LP", + /* 54 */ "NK_RP", + /* 55 */ "STABLE", + /* 56 */ "USING", + /* 57 */ "TAGS", + /* 58 */ "NK_DOT", + /* 59 */ "NK_COMMA", + /* 60 */ "COMMENT", + /* 61 */ "BOOL", + /* 62 */ "TINYINT", + /* 63 */ "SMALLINT", + /* 64 */ "INT", + /* 65 */ "INTEGER", + /* 66 */ "BIGINT", + /* 67 */ "FLOAT", + /* 68 */ "DOUBLE", + /* 69 */ "BINARY", + /* 70 */ "TIMESTAMP", + /* 71 */ "NCHAR", + /* 72 */ "UNSIGNED", + /* 73 */ "JSON", + /* 74 */ "VARCHAR", + /* 75 */ "MEDIUMBLOB", + /* 76 */ "BLOB", + /* 77 */ "VARBINARY", + /* 78 */ "DECIMAL", + /* 79 */ "SMA", + /* 80 */ "SHOW", + /* 81 */ "DNODES", + /* 82 */ "USERS", + /* 83 */ "DATABASES", + /* 84 */ "TABLES", + /* 85 */ "STABLES", /* 86 */ "MNODES", - /* 87 */ "NK_FLOAT", - /* 88 */ "NK_BOOL", - /* 89 */ "NK_VARIABLE", - /* 90 */ "BETWEEN", - /* 91 */ "IS", - /* 92 */ "NULL", - /* 93 */ "NK_LT", - /* 94 */ "NK_GT", - /* 95 */ "NK_LE", - /* 96 */ "NK_GE", - /* 97 */ "NK_NE", - /* 98 */ "NK_EQ", - /* 99 */ "LIKE", - /* 100 */ "MATCH", - /* 101 */ "NMATCH", - /* 102 */ "IN", - /* 103 */ "FROM", - /* 104 */ "AS", - /* 105 */ "JOIN", - /* 106 */ "ON", - /* 107 */ "INNER", - /* 108 */ "SELECT", - /* 109 */ "DISTINCT", - /* 110 */ "WHERE", - /* 111 */ "PARTITION", - /* 112 */ "BY", - /* 113 */ "SESSION", - /* 114 */ "STATE_WINDOW", - /* 115 */ "INTERVAL", - /* 116 */ "SLIDING", - /* 117 */ "FILL", - /* 118 */ "VALUE", - /* 119 */ "NONE", - /* 120 */ "PREV", - /* 121 */ "LINEAR", - /* 122 */ "NEXT", - /* 123 */ "GROUP", - /* 124 */ "HAVING", - /* 125 */ "ORDER", - /* 126 */ "SLIMIT", - /* 127 */ "SOFFSET", - /* 128 */ "LIMIT", - /* 129 */ "OFFSET", - /* 130 */ "ASC", - /* 131 */ "DESC", - /* 132 */ "NULLS", - /* 133 */ "FIRST", - /* 134 */ "LAST", - /* 135 */ "cmd", - /* 136 */ "user_name", - /* 137 */ "dnode_endpoint", - /* 138 */ "dnode_host_name", - /* 139 */ "not_exists_opt", - /* 140 */ "db_name", - /* 141 */ "db_options", - /* 142 */ "exists_opt", - /* 143 */ "full_table_name", - /* 144 */ "column_def_list", - /* 145 */ "tags_def_opt", - /* 146 */ "table_options", - /* 147 */ "multi_create_clause", - /* 148 */ "tags_def", - /* 149 */ "multi_drop_clause", - /* 150 */ "create_subtable_clause", - /* 151 */ "specific_tags_opt", - /* 152 */ "literal_list", - /* 153 */ "drop_table_clause", - /* 154 */ "col_name_list", - /* 155 */ "table_name", - /* 156 */ "column_def", - /* 157 */ "column_name", - /* 158 */ "type_name", - /* 159 */ "col_name", - /* 160 */ "query_expression", - /* 161 */ "literal", - /* 162 */ "duration_literal", - /* 163 */ "function_name", - /* 164 */ "table_alias", - /* 165 */ "column_alias", - /* 166 */ "expression", - /* 167 */ "column_reference", - /* 168 */ "expression_list", - /* 169 */ "subquery", - /* 170 */ "predicate", - /* 171 */ "compare_op", - /* 172 */ "in_op", - /* 173 */ "in_predicate_value", - /* 174 */ "boolean_value_expression", - /* 175 */ "boolean_primary", - /* 176 */ "common_expression", - /* 177 */ "from_clause", - /* 178 */ "table_reference_list", - /* 179 */ "table_reference", - /* 180 */ "table_primary", - /* 181 */ "joined_table", - /* 182 */ "alias_opt", - /* 183 */ "parenthesized_joined_table", - /* 184 */ "join_type", - /* 185 */ "search_condition", - /* 186 */ "query_specification", - /* 187 */ "set_quantifier_opt", - /* 188 */ "select_list", - /* 189 */ "where_clause_opt", - /* 190 */ "partition_by_clause_opt", - /* 191 */ "twindow_clause_opt", - /* 192 */ "group_by_clause_opt", - /* 193 */ "having_clause_opt", - /* 194 */ "select_sublist", - /* 195 */ "select_item", - /* 196 */ "sliding_opt", - /* 197 */ "fill_opt", - /* 198 */ "fill_mode", - /* 199 */ "group_by_list", - /* 200 */ "query_expression_body", - /* 201 */ "order_by_clause_opt", - /* 202 */ "slimit_clause_opt", - /* 203 */ "limit_clause_opt", - /* 204 */ "query_primary", - /* 205 */ "sort_specification_list", - /* 206 */ "sort_specification", - /* 207 */ "ordering_specification_opt", - /* 208 */ "null_ordering_opt", + /* 87 */ "MODULES", + /* 88 */ "QNODES", + /* 89 */ "FUNCTIONS", + /* 90 */ "INDEXES", + /* 91 */ "FROM", + /* 92 */ "STREAMS", + /* 93 */ "LIKE", + /* 94 */ "NK_FLOAT", + /* 95 */ "NK_BOOL", + /* 96 */ "NK_VARIABLE", + /* 97 */ "BETWEEN", + /* 98 */ "IS", + /* 99 */ "NULL", + /* 100 */ "NK_LT", + /* 101 */ "NK_GT", + /* 102 */ "NK_LE", + /* 103 */ "NK_GE", + /* 104 */ "NK_NE", + /* 105 */ "NK_EQ", + /* 106 */ "MATCH", + /* 107 */ "NMATCH", + /* 108 */ "IN", + /* 109 */ "AS", + /* 110 */ "JOIN", + /* 111 */ "ON", + /* 112 */ "INNER", + /* 113 */ "SELECT", + /* 114 */ "DISTINCT", + /* 115 */ "WHERE", + /* 116 */ "PARTITION", + /* 117 */ "BY", + /* 118 */ "SESSION", + /* 119 */ "STATE_WINDOW", + /* 120 */ "INTERVAL", + /* 121 */ "SLIDING", + /* 122 */ "FILL", + /* 123 */ "VALUE", + /* 124 */ "NONE", + /* 125 */ "PREV", + /* 126 */ "LINEAR", + /* 127 */ "NEXT", + /* 128 */ "GROUP", + /* 129 */ "HAVING", + /* 130 */ "ORDER", + /* 131 */ "SLIMIT", + /* 132 */ "SOFFSET", + /* 133 */ "LIMIT", + /* 134 */ "OFFSET", + /* 135 */ "ASC", + /* 136 */ "DESC", + /* 137 */ "NULLS", + /* 138 */ "FIRST", + /* 139 */ "LAST", + /* 140 */ "cmd", + /* 141 */ "user_name", + /* 142 */ "dnode_endpoint", + /* 143 */ "dnode_host_name", + /* 144 */ "not_exists_opt", + /* 145 */ "db_name", + /* 146 */ "db_options", + /* 147 */ "exists_opt", + /* 148 */ "full_table_name", + /* 149 */ "column_def_list", + /* 150 */ "tags_def_opt", + /* 151 */ "table_options", + /* 152 */ "multi_create_clause", + /* 153 */ "tags_def", + /* 154 */ "multi_drop_clause", + /* 155 */ "create_subtable_clause", + /* 156 */ "specific_tags_opt", + /* 157 */ "literal_list", + /* 158 */ "drop_table_clause", + /* 159 */ "col_name_list", + /* 160 */ "table_name", + /* 161 */ "column_def", + /* 162 */ "column_name", + /* 163 */ "type_name", + /* 164 */ "col_name", + /* 165 */ "db_name_cond_opt", + /* 166 */ "like_pattern_opt", + /* 167 */ "table_name_cond", + /* 168 */ "from_db_opt", + /* 169 */ "query_expression", + /* 170 */ "literal", + /* 171 */ "duration_literal", + /* 172 */ "function_name", + /* 173 */ "table_alias", + /* 174 */ "column_alias", + /* 175 */ "expression", + /* 176 */ "column_reference", + /* 177 */ "expression_list", + /* 178 */ "subquery", + /* 179 */ "predicate", + /* 180 */ "compare_op", + /* 181 */ "in_op", + /* 182 */ "in_predicate_value", + /* 183 */ "boolean_value_expression", + /* 184 */ "boolean_primary", + /* 185 */ "common_expression", + /* 186 */ "from_clause", + /* 187 */ "table_reference_list", + /* 188 */ "table_reference", + /* 189 */ "table_primary", + /* 190 */ "joined_table", + /* 191 */ "alias_opt", + /* 192 */ "parenthesized_joined_table", + /* 193 */ "join_type", + /* 194 */ "search_condition", + /* 195 */ "query_specification", + /* 196 */ "set_quantifier_opt", + /* 197 */ "select_list", + /* 198 */ "where_clause_opt", + /* 199 */ "partition_by_clause_opt", + /* 200 */ "twindow_clause_opt", + /* 201 */ "group_by_clause_opt", + /* 202 */ "having_clause_opt", + /* 203 */ "select_sublist", + /* 204 */ "select_item", + /* 205 */ "sliding_opt", + /* 206 */ "fill_opt", + /* 207 */ "fill_mode", + /* 208 */ "group_by_list", + /* 209 */ "query_expression_body", + /* 210 */ "order_by_clause_opt", + /* 211 */ "slimit_clause_opt", + /* 212 */ "limit_clause_opt", + /* 213 */ "query_primary", + /* 214 */ "sort_specification_list", + /* 215 */ "sort_specification", + /* 216 */ "ordering_specification_opt", + /* 217 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -813,239 +829,250 @@ static const char *const yyRuleName[] = { /* 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 DATABASE not_exists_opt db_name db_options", - /* 14 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 15 */ "cmd ::= SHOW DATABASES", - /* 16 */ "cmd ::= USE db_name", - /* 17 */ "not_exists_opt ::= IF NOT EXISTS", - /* 18 */ "not_exists_opt ::=", - /* 19 */ "exists_opt ::= IF EXISTS", - /* 20 */ "exists_opt ::=", - /* 21 */ "db_options ::=", - /* 22 */ "db_options ::= db_options BLOCKS NK_INTEGER", - /* 23 */ "db_options ::= db_options CACHE NK_INTEGER", - /* 24 */ "db_options ::= db_options CACHELAST NK_INTEGER", - /* 25 */ "db_options ::= db_options COMP NK_INTEGER", - /* 26 */ "db_options ::= db_options DAYS NK_INTEGER", - /* 27 */ "db_options ::= db_options FSYNC NK_INTEGER", - /* 28 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 29 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 30 */ "db_options ::= db_options KEEP NK_INTEGER", - /* 31 */ "db_options ::= db_options PRECISION NK_STRING", - /* 32 */ "db_options ::= db_options QUORUM NK_INTEGER", - /* 33 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 34 */ "db_options ::= db_options TTL NK_INTEGER", - /* 35 */ "db_options ::= db_options WAL NK_INTEGER", - /* 36 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 37 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 38 */ "db_options ::= db_options STREAM_MODE NK_INTEGER", - /* 39 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 40 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 41 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 42 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 43 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 44 */ "cmd ::= SHOW TABLES", - /* 45 */ "cmd ::= SHOW STABLES", - /* 46 */ "multi_create_clause ::= create_subtable_clause", - /* 47 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 48 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", - /* 49 */ "multi_drop_clause ::= drop_table_clause", - /* 50 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 51 */ "drop_table_clause ::= exists_opt full_table_name", - /* 52 */ "specific_tags_opt ::=", - /* 53 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", - /* 54 */ "full_table_name ::= table_name", - /* 55 */ "full_table_name ::= db_name NK_DOT table_name", - /* 56 */ "column_def_list ::= column_def", - /* 57 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 58 */ "column_def ::= column_name type_name", - /* 59 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 60 */ "type_name ::= BOOL", - /* 61 */ "type_name ::= TINYINT", - /* 62 */ "type_name ::= SMALLINT", - /* 63 */ "type_name ::= INT", - /* 64 */ "type_name ::= INTEGER", - /* 65 */ "type_name ::= BIGINT", - /* 66 */ "type_name ::= FLOAT", - /* 67 */ "type_name ::= DOUBLE", - /* 68 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 69 */ "type_name ::= TIMESTAMP", - /* 70 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 71 */ "type_name ::= TINYINT UNSIGNED", - /* 72 */ "type_name ::= SMALLINT UNSIGNED", - /* 73 */ "type_name ::= INT UNSIGNED", - /* 74 */ "type_name ::= BIGINT UNSIGNED", - /* 75 */ "type_name ::= JSON", - /* 76 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 77 */ "type_name ::= MEDIUMBLOB", - /* 78 */ "type_name ::= BLOB", - /* 79 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 80 */ "type_name ::= DECIMAL", - /* 81 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 82 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 83 */ "tags_def_opt ::=", - /* 84 */ "tags_def_opt ::= tags_def", - /* 85 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 86 */ "table_options ::=", - /* 87 */ "table_options ::= table_options COMMENT NK_STRING", - /* 88 */ "table_options ::= table_options KEEP NK_INTEGER", - /* 89 */ "table_options ::= table_options TTL NK_INTEGER", - /* 90 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 91 */ "col_name_list ::= col_name", - /* 92 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 93 */ "col_name ::= column_name", - /* 94 */ "cmd ::= SHOW VGROUPS", - /* 95 */ "cmd ::= SHOW db_name NK_DOT VGROUPS", - /* 96 */ "cmd ::= SHOW MNODES", - /* 97 */ "cmd ::= query_expression", - /* 98 */ "literal ::= NK_INTEGER", - /* 99 */ "literal ::= NK_FLOAT", - /* 100 */ "literal ::= NK_STRING", - /* 101 */ "literal ::= NK_BOOL", - /* 102 */ "literal ::= TIMESTAMP NK_STRING", - /* 103 */ "literal ::= duration_literal", - /* 104 */ "duration_literal ::= NK_VARIABLE", - /* 105 */ "literal_list ::= literal", - /* 106 */ "literal_list ::= literal_list NK_COMMA literal", - /* 107 */ "db_name ::= NK_ID", - /* 108 */ "table_name ::= NK_ID", - /* 109 */ "column_name ::= NK_ID", - /* 110 */ "function_name ::= NK_ID", - /* 111 */ "table_alias ::= NK_ID", - /* 112 */ "column_alias ::= NK_ID", - /* 113 */ "user_name ::= NK_ID", - /* 114 */ "expression ::= literal", - /* 115 */ "expression ::= column_reference", - /* 116 */ "expression ::= function_name NK_LP expression_list NK_RP", - /* 117 */ "expression ::= function_name NK_LP NK_STAR NK_RP", - /* 118 */ "expression ::= subquery", - /* 119 */ "expression ::= NK_LP expression NK_RP", - /* 120 */ "expression ::= NK_PLUS expression", - /* 121 */ "expression ::= NK_MINUS expression", - /* 122 */ "expression ::= expression NK_PLUS expression", - /* 123 */ "expression ::= expression NK_MINUS expression", - /* 124 */ "expression ::= expression NK_STAR expression", - /* 125 */ "expression ::= expression NK_SLASH expression", - /* 126 */ "expression ::= expression NK_REM expression", - /* 127 */ "expression_list ::= expression", - /* 128 */ "expression_list ::= expression_list NK_COMMA expression", - /* 129 */ "column_reference ::= column_name", - /* 130 */ "column_reference ::= table_name NK_DOT column_name", - /* 131 */ "predicate ::= expression compare_op expression", - /* 132 */ "predicate ::= expression BETWEEN expression AND expression", - /* 133 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 134 */ "predicate ::= expression IS NULL", - /* 135 */ "predicate ::= expression IS NOT NULL", - /* 136 */ "predicate ::= expression in_op in_predicate_value", - /* 137 */ "compare_op ::= NK_LT", - /* 138 */ "compare_op ::= NK_GT", - /* 139 */ "compare_op ::= NK_LE", - /* 140 */ "compare_op ::= NK_GE", - /* 141 */ "compare_op ::= NK_NE", - /* 142 */ "compare_op ::= NK_EQ", - /* 143 */ "compare_op ::= LIKE", - /* 144 */ "compare_op ::= NOT LIKE", - /* 145 */ "compare_op ::= MATCH", - /* 146 */ "compare_op ::= NMATCH", - /* 147 */ "in_op ::= IN", - /* 148 */ "in_op ::= NOT IN", - /* 149 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 150 */ "boolean_value_expression ::= boolean_primary", - /* 151 */ "boolean_value_expression ::= NOT boolean_primary", - /* 152 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 153 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 154 */ "boolean_primary ::= predicate", - /* 155 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 156 */ "common_expression ::= expression", - /* 157 */ "common_expression ::= boolean_value_expression", - /* 158 */ "from_clause ::= FROM table_reference_list", - /* 159 */ "table_reference_list ::= table_reference", - /* 160 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 161 */ "table_reference ::= table_primary", - /* 162 */ "table_reference ::= joined_table", - /* 163 */ "table_primary ::= table_name alias_opt", - /* 164 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 165 */ "table_primary ::= subquery alias_opt", - /* 166 */ "table_primary ::= parenthesized_joined_table", - /* 167 */ "alias_opt ::=", - /* 168 */ "alias_opt ::= table_alias", - /* 169 */ "alias_opt ::= AS table_alias", - /* 170 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 171 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 172 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 173 */ "join_type ::=", - /* 174 */ "join_type ::= INNER", - /* 175 */ "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", - /* 176 */ "set_quantifier_opt ::=", - /* 177 */ "set_quantifier_opt ::= DISTINCT", - /* 178 */ "set_quantifier_opt ::= ALL", - /* 179 */ "select_list ::= NK_STAR", - /* 180 */ "select_list ::= select_sublist", - /* 181 */ "select_sublist ::= select_item", - /* 182 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 183 */ "select_item ::= common_expression", - /* 184 */ "select_item ::= common_expression column_alias", - /* 185 */ "select_item ::= common_expression AS column_alias", - /* 186 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 187 */ "where_clause_opt ::=", - /* 188 */ "where_clause_opt ::= WHERE search_condition", - /* 189 */ "partition_by_clause_opt ::=", - /* 190 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 191 */ "twindow_clause_opt ::=", - /* 192 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", - /* 193 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", - /* 194 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 195 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 196 */ "sliding_opt ::=", - /* 197 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 198 */ "fill_opt ::=", - /* 199 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 200 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 201 */ "fill_mode ::= NONE", - /* 202 */ "fill_mode ::= PREV", - /* 203 */ "fill_mode ::= NULL", - /* 204 */ "fill_mode ::= LINEAR", - /* 205 */ "fill_mode ::= NEXT", - /* 206 */ "group_by_clause_opt ::=", - /* 207 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 208 */ "group_by_list ::= expression", - /* 209 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 210 */ "having_clause_opt ::=", - /* 211 */ "having_clause_opt ::= HAVING search_condition", - /* 212 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 213 */ "query_expression_body ::= query_primary", - /* 214 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 215 */ "query_primary ::= query_specification", - /* 216 */ "order_by_clause_opt ::=", - /* 217 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 218 */ "slimit_clause_opt ::=", - /* 219 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 220 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 221 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 222 */ "limit_clause_opt ::=", - /* 223 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 224 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 225 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 226 */ "subquery ::= NK_LP query_expression NK_RP", - /* 227 */ "search_condition ::= common_expression", - /* 228 */ "sort_specification_list ::= sort_specification", - /* 229 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 230 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 231 */ "ordering_specification_opt ::=", - /* 232 */ "ordering_specification_opt ::= ASC", - /* 233 */ "ordering_specification_opt ::= DESC", - /* 234 */ "null_ordering_opt ::=", - /* 235 */ "null_ordering_opt ::= NULLS FIRST", - /* 236 */ "null_ordering_opt ::= NULLS LAST", + /* 4 */ "cmd ::= CREATE DNODE dnode_endpoint", + /* 5 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER", + /* 6 */ "cmd ::= DROP DNODE NK_INTEGER", + /* 7 */ "cmd ::= DROP DNODE dnode_endpoint", + /* 8 */ "dnode_endpoint ::= NK_STRING", + /* 9 */ "dnode_host_name ::= NK_ID", + /* 10 */ "dnode_host_name ::= NK_IPTOKEN", + /* 11 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 12 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 13 */ "cmd ::= USE db_name", + /* 14 */ "not_exists_opt ::= IF NOT EXISTS", + /* 15 */ "not_exists_opt ::=", + /* 16 */ "exists_opt ::= IF EXISTS", + /* 17 */ "exists_opt ::=", + /* 18 */ "db_options ::=", + /* 19 */ "db_options ::= db_options BLOCKS NK_INTEGER", + /* 20 */ "db_options ::= db_options CACHE NK_INTEGER", + /* 21 */ "db_options ::= db_options CACHELAST NK_INTEGER", + /* 22 */ "db_options ::= db_options COMP NK_INTEGER", + /* 23 */ "db_options ::= db_options DAYS NK_INTEGER", + /* 24 */ "db_options ::= db_options FSYNC NK_INTEGER", + /* 25 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 26 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 27 */ "db_options ::= db_options KEEP NK_INTEGER", + /* 28 */ "db_options ::= db_options PRECISION NK_STRING", + /* 29 */ "db_options ::= db_options QUORUM NK_INTEGER", + /* 30 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 31 */ "db_options ::= db_options TTL NK_INTEGER", + /* 32 */ "db_options ::= db_options WAL NK_INTEGER", + /* 33 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 34 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 35 */ "db_options ::= db_options STREAM_MODE NK_INTEGER", + /* 36 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 37 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 38 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 39 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 40 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 41 */ "multi_create_clause ::= create_subtable_clause", + /* 42 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 43 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP", + /* 44 */ "multi_drop_clause ::= drop_table_clause", + /* 45 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 46 */ "drop_table_clause ::= exists_opt full_table_name", + /* 47 */ "specific_tags_opt ::=", + /* 48 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP", + /* 49 */ "full_table_name ::= table_name", + /* 50 */ "full_table_name ::= db_name NK_DOT table_name", + /* 51 */ "column_def_list ::= column_def", + /* 52 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 53 */ "column_def ::= column_name type_name", + /* 54 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 55 */ "type_name ::= BOOL", + /* 56 */ "type_name ::= TINYINT", + /* 57 */ "type_name ::= SMALLINT", + /* 58 */ "type_name ::= INT", + /* 59 */ "type_name ::= INTEGER", + /* 60 */ "type_name ::= BIGINT", + /* 61 */ "type_name ::= FLOAT", + /* 62 */ "type_name ::= DOUBLE", + /* 63 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 64 */ "type_name ::= TIMESTAMP", + /* 65 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 66 */ "type_name ::= TINYINT UNSIGNED", + /* 67 */ "type_name ::= SMALLINT UNSIGNED", + /* 68 */ "type_name ::= INT UNSIGNED", + /* 69 */ "type_name ::= BIGINT UNSIGNED", + /* 70 */ "type_name ::= JSON", + /* 71 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 72 */ "type_name ::= MEDIUMBLOB", + /* 73 */ "type_name ::= BLOB", + /* 74 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 75 */ "type_name ::= DECIMAL", + /* 76 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 77 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 78 */ "tags_def_opt ::=", + /* 79 */ "tags_def_opt ::= tags_def", + /* 80 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 81 */ "table_options ::=", + /* 82 */ "table_options ::= table_options COMMENT NK_STRING", + /* 83 */ "table_options ::= table_options KEEP NK_INTEGER", + /* 84 */ "table_options ::= table_options TTL NK_INTEGER", + /* 85 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 86 */ "col_name_list ::= col_name", + /* 87 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 88 */ "col_name ::= column_name", + /* 89 */ "cmd ::= SHOW DNODES", + /* 90 */ "cmd ::= SHOW USERS", + /* 91 */ "cmd ::= SHOW DATABASES", + /* 92 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 93 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 94 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 95 */ "cmd ::= SHOW MNODES", + /* 96 */ "cmd ::= SHOW MODULES", + /* 97 */ "cmd ::= SHOW QNODES", + /* 98 */ "cmd ::= SHOW FUNCTIONS", + /* 99 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 100 */ "cmd ::= SHOW STREAMS", + /* 101 */ "db_name_cond_opt ::=", + /* 102 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 103 */ "like_pattern_opt ::=", + /* 104 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 105 */ "table_name_cond ::= table_name", + /* 106 */ "from_db_opt ::=", + /* 107 */ "from_db_opt ::= FROM db_name", + /* 108 */ "cmd ::= query_expression", + /* 109 */ "literal ::= NK_INTEGER", + /* 110 */ "literal ::= NK_FLOAT", + /* 111 */ "literal ::= NK_STRING", + /* 112 */ "literal ::= NK_BOOL", + /* 113 */ "literal ::= TIMESTAMP NK_STRING", + /* 114 */ "literal ::= duration_literal", + /* 115 */ "duration_literal ::= NK_VARIABLE", + /* 116 */ "literal_list ::= literal", + /* 117 */ "literal_list ::= literal_list NK_COMMA literal", + /* 118 */ "db_name ::= NK_ID", + /* 119 */ "table_name ::= NK_ID", + /* 120 */ "column_name ::= NK_ID", + /* 121 */ "function_name ::= NK_ID", + /* 122 */ "table_alias ::= NK_ID", + /* 123 */ "column_alias ::= NK_ID", + /* 124 */ "user_name ::= NK_ID", + /* 125 */ "expression ::= literal", + /* 126 */ "expression ::= column_reference", + /* 127 */ "expression ::= function_name NK_LP expression_list NK_RP", + /* 128 */ "expression ::= function_name NK_LP NK_STAR NK_RP", + /* 129 */ "expression ::= subquery", + /* 130 */ "expression ::= NK_LP expression NK_RP", + /* 131 */ "expression ::= NK_PLUS expression", + /* 132 */ "expression ::= NK_MINUS expression", + /* 133 */ "expression ::= expression NK_PLUS expression", + /* 134 */ "expression ::= expression NK_MINUS expression", + /* 135 */ "expression ::= expression NK_STAR expression", + /* 136 */ "expression ::= expression NK_SLASH expression", + /* 137 */ "expression ::= expression NK_REM expression", + /* 138 */ "expression_list ::= expression", + /* 139 */ "expression_list ::= expression_list NK_COMMA expression", + /* 140 */ "column_reference ::= column_name", + /* 141 */ "column_reference ::= table_name NK_DOT column_name", + /* 142 */ "predicate ::= expression compare_op expression", + /* 143 */ "predicate ::= expression BETWEEN expression AND expression", + /* 144 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 145 */ "predicate ::= expression IS NULL", + /* 146 */ "predicate ::= expression IS NOT NULL", + /* 147 */ "predicate ::= expression in_op in_predicate_value", + /* 148 */ "compare_op ::= NK_LT", + /* 149 */ "compare_op ::= NK_GT", + /* 150 */ "compare_op ::= NK_LE", + /* 151 */ "compare_op ::= NK_GE", + /* 152 */ "compare_op ::= NK_NE", + /* 153 */ "compare_op ::= NK_EQ", + /* 154 */ "compare_op ::= LIKE", + /* 155 */ "compare_op ::= NOT LIKE", + /* 156 */ "compare_op ::= MATCH", + /* 157 */ "compare_op ::= NMATCH", + /* 158 */ "in_op ::= IN", + /* 159 */ "in_op ::= NOT IN", + /* 160 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 161 */ "boolean_value_expression ::= boolean_primary", + /* 162 */ "boolean_value_expression ::= NOT boolean_primary", + /* 163 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 164 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 165 */ "boolean_primary ::= predicate", + /* 166 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 167 */ "common_expression ::= expression", + /* 168 */ "common_expression ::= boolean_value_expression", + /* 169 */ "from_clause ::= FROM table_reference_list", + /* 170 */ "table_reference_list ::= table_reference", + /* 171 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 172 */ "table_reference ::= table_primary", + /* 173 */ "table_reference ::= joined_table", + /* 174 */ "table_primary ::= table_name alias_opt", + /* 175 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 176 */ "table_primary ::= subquery alias_opt", + /* 177 */ "table_primary ::= parenthesized_joined_table", + /* 178 */ "alias_opt ::=", + /* 179 */ "alias_opt ::= table_alias", + /* 180 */ "alias_opt ::= AS table_alias", + /* 181 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 182 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 183 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 184 */ "join_type ::=", + /* 185 */ "join_type ::= INNER", + /* 186 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 187 */ "set_quantifier_opt ::=", + /* 188 */ "set_quantifier_opt ::= DISTINCT", + /* 189 */ "set_quantifier_opt ::= ALL", + /* 190 */ "select_list ::= NK_STAR", + /* 191 */ "select_list ::= select_sublist", + /* 192 */ "select_sublist ::= select_item", + /* 193 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 194 */ "select_item ::= common_expression", + /* 195 */ "select_item ::= common_expression column_alias", + /* 196 */ "select_item ::= common_expression AS column_alias", + /* 197 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 198 */ "where_clause_opt ::=", + /* 199 */ "where_clause_opt ::= WHERE search_condition", + /* 200 */ "partition_by_clause_opt ::=", + /* 201 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 202 */ "twindow_clause_opt ::=", + /* 203 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", + /* 204 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", + /* 205 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 206 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 207 */ "sliding_opt ::=", + /* 208 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 209 */ "fill_opt ::=", + /* 210 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 211 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 212 */ "fill_mode ::= NONE", + /* 213 */ "fill_mode ::= PREV", + /* 214 */ "fill_mode ::= NULL", + /* 215 */ "fill_mode ::= LINEAR", + /* 216 */ "fill_mode ::= NEXT", + /* 217 */ "group_by_clause_opt ::=", + /* 218 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 219 */ "group_by_list ::= expression", + /* 220 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 221 */ "having_clause_opt ::=", + /* 222 */ "having_clause_opt ::= HAVING search_condition", + /* 223 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 224 */ "query_expression_body ::= query_primary", + /* 225 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 226 */ "query_primary ::= query_specification", + /* 227 */ "order_by_clause_opt ::=", + /* 228 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 229 */ "slimit_clause_opt ::=", + /* 230 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 231 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 232 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 233 */ "limit_clause_opt ::=", + /* 234 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 235 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 236 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 237 */ "subquery ::= NK_LP query_expression NK_RP", + /* 238 */ "search_condition ::= common_expression", + /* 239 */ "sort_specification_list ::= sort_specification", + /* 240 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 241 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 242 */ "ordering_specification_opt ::=", + /* 243 */ "ordering_specification_opt ::= ASC", + /* 244 */ "ordering_specification_opt ::= DESC", + /* 245 */ "null_ordering_opt ::=", + /* 246 */ "null_ordering_opt ::= NULLS FIRST", + /* 247 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -1172,124 +1199,128 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 135: /* cmd */ - case 143: /* full_table_name */ - case 150: /* create_subtable_clause */ - case 153: /* drop_table_clause */ - case 156: /* column_def */ - case 159: /* col_name */ - case 160: /* query_expression */ - case 161: /* literal */ - case 162: /* duration_literal */ - case 166: /* expression */ - case 167: /* column_reference */ - case 169: /* subquery */ - case 170: /* predicate */ - case 173: /* in_predicate_value */ - case 174: /* boolean_value_expression */ - case 175: /* boolean_primary */ - case 176: /* common_expression */ - case 177: /* from_clause */ - case 178: /* table_reference_list */ - case 179: /* table_reference */ - case 180: /* table_primary */ - case 181: /* joined_table */ - case 183: /* parenthesized_joined_table */ - case 185: /* search_condition */ - case 186: /* query_specification */ - case 189: /* where_clause_opt */ - case 191: /* twindow_clause_opt */ - case 193: /* having_clause_opt */ - case 195: /* select_item */ - case 196: /* sliding_opt */ - case 197: /* fill_opt */ - case 200: /* query_expression_body */ - case 202: /* slimit_clause_opt */ - case 203: /* limit_clause_opt */ - case 204: /* query_primary */ - case 206: /* sort_specification */ + case 140: /* cmd */ + case 148: /* full_table_name */ + case 155: /* create_subtable_clause */ + case 158: /* drop_table_clause */ + case 161: /* column_def */ + case 164: /* col_name */ + case 165: /* db_name_cond_opt */ + case 166: /* like_pattern_opt */ + case 167: /* table_name_cond */ + case 168: /* from_db_opt */ + case 169: /* query_expression */ + case 170: /* literal */ + case 171: /* duration_literal */ + case 175: /* expression */ + case 176: /* column_reference */ + case 178: /* subquery */ + case 179: /* predicate */ + case 182: /* in_predicate_value */ + case 183: /* boolean_value_expression */ + case 184: /* boolean_primary */ + case 185: /* common_expression */ + case 186: /* from_clause */ + case 187: /* table_reference_list */ + case 188: /* table_reference */ + case 189: /* table_primary */ + case 190: /* joined_table */ + case 192: /* parenthesized_joined_table */ + case 194: /* search_condition */ + case 195: /* query_specification */ + case 198: /* where_clause_opt */ + case 200: /* twindow_clause_opt */ + case 202: /* having_clause_opt */ + case 204: /* select_item */ + case 205: /* sliding_opt */ + case 206: /* fill_opt */ + case 209: /* query_expression_body */ + case 211: /* slimit_clause_opt */ + case 212: /* limit_clause_opt */ + case 213: /* query_primary */ + case 215: /* sort_specification */ { - nodesDestroyNode((yypminor->yy256)); + nodesDestroyNode((yypminor->yy68)); } break; - case 136: /* user_name */ - case 137: /* dnode_endpoint */ - case 138: /* dnode_host_name */ - case 140: /* db_name */ - case 155: /* table_name */ - case 157: /* column_name */ - case 163: /* function_name */ - case 164: /* table_alias */ - case 165: /* column_alias */ - case 182: /* alias_opt */ + case 141: /* user_name */ + case 142: /* dnode_endpoint */ + case 143: /* dnode_host_name */ + case 145: /* db_name */ + case 160: /* table_name */ + case 162: /* column_name */ + case 172: /* function_name */ + case 173: /* table_alias */ + case 174: /* column_alias */ + case 191: /* alias_opt */ { } break; - case 139: /* not_exists_opt */ - case 142: /* exists_opt */ - case 187: /* set_quantifier_opt */ + case 144: /* not_exists_opt */ + case 147: /* exists_opt */ + case 196: /* set_quantifier_opt */ { } break; - case 141: /* db_options */ + case 146: /* db_options */ { - tfree((yypminor->yy391)); + tfree((yypminor->yy339)); } break; - case 144: /* column_def_list */ - case 145: /* tags_def_opt */ - case 147: /* multi_create_clause */ - case 148: /* tags_def */ - case 149: /* multi_drop_clause */ - case 151: /* specific_tags_opt */ - case 152: /* literal_list */ - case 154: /* col_name_list */ - case 168: /* expression_list */ - case 188: /* select_list */ - case 190: /* partition_by_clause_opt */ - case 192: /* group_by_clause_opt */ - case 194: /* select_sublist */ - case 199: /* group_by_list */ - case 201: /* order_by_clause_opt */ - case 205: /* sort_specification_list */ + case 149: /* column_def_list */ + case 150: /* tags_def_opt */ + case 152: /* multi_create_clause */ + case 153: /* tags_def */ + case 154: /* multi_drop_clause */ + case 156: /* specific_tags_opt */ + case 157: /* literal_list */ + case 159: /* col_name_list */ + case 177: /* expression_list */ + case 197: /* select_list */ + case 199: /* partition_by_clause_opt */ + case 201: /* group_by_clause_opt */ + case 203: /* select_sublist */ + case 208: /* group_by_list */ + case 210: /* order_by_clause_opt */ + case 214: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy46)); + nodesDestroyList((yypminor->yy40)); } break; - case 146: /* table_options */ + case 151: /* table_options */ { - tfree((yypminor->yy340)); + tfree((yypminor->yy418)); } break; - case 158: /* type_name */ + case 163: /* type_name */ { } break; - case 171: /* compare_op */ - case 172: /* in_op */ + case 180: /* compare_op */ + case 181: /* in_op */ { } break; - case 184: /* join_type */ + case 193: /* join_type */ { } break; - case 198: /* fill_mode */ + case 207: /* fill_mode */ { } break; - case 207: /* ordering_specification_opt */ + case 216: /* ordering_specification_opt */ { } break; - case 208: /* null_ordering_opt */ + case 217: /* null_ordering_opt */ { } @@ -1588,243 +1619,254 @@ 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[] = { - { 135, -5 }, /* (0) cmd ::= CREATE USER user_name PASS NK_STRING */ - { 135, -5 }, /* (1) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 135, -5 }, /* (2) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ - { 135, -3 }, /* (3) cmd ::= DROP USER user_name */ - { 135, -2 }, /* (4) cmd ::= SHOW USERS */ - { 135, -3 }, /* (5) cmd ::= CREATE DNODE dnode_endpoint */ - { 135, -5 }, /* (6) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ - { 135, -3 }, /* (7) cmd ::= DROP DNODE NK_INTEGER */ - { 135, -3 }, /* (8) cmd ::= DROP DNODE dnode_endpoint */ - { 135, -2 }, /* (9) cmd ::= SHOW DNODES */ - { 137, -1 }, /* (10) dnode_endpoint ::= NK_STRING */ - { 138, -1 }, /* (11) dnode_host_name ::= NK_ID */ - { 138, -1 }, /* (12) dnode_host_name ::= NK_IPTOKEN */ - { 135, -5 }, /* (13) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 135, -4 }, /* (14) cmd ::= DROP DATABASE exists_opt db_name */ - { 135, -2 }, /* (15) cmd ::= SHOW DATABASES */ - { 135, -2 }, /* (16) cmd ::= USE db_name */ - { 139, -3 }, /* (17) not_exists_opt ::= IF NOT EXISTS */ - { 139, 0 }, /* (18) not_exists_opt ::= */ - { 142, -2 }, /* (19) exists_opt ::= IF EXISTS */ - { 142, 0 }, /* (20) exists_opt ::= */ - { 141, 0 }, /* (21) db_options ::= */ - { 141, -3 }, /* (22) db_options ::= db_options BLOCKS NK_INTEGER */ - { 141, -3 }, /* (23) db_options ::= db_options CACHE NK_INTEGER */ - { 141, -3 }, /* (24) db_options ::= db_options CACHELAST NK_INTEGER */ - { 141, -3 }, /* (25) db_options ::= db_options COMP NK_INTEGER */ - { 141, -3 }, /* (26) db_options ::= db_options DAYS NK_INTEGER */ - { 141, -3 }, /* (27) db_options ::= db_options FSYNC NK_INTEGER */ - { 141, -3 }, /* (28) db_options ::= db_options MAXROWS NK_INTEGER */ - { 141, -3 }, /* (29) db_options ::= db_options MINROWS NK_INTEGER */ - { 141, -3 }, /* (30) db_options ::= db_options KEEP NK_INTEGER */ - { 141, -3 }, /* (31) db_options ::= db_options PRECISION NK_STRING */ - { 141, -3 }, /* (32) db_options ::= db_options QUORUM NK_INTEGER */ - { 141, -3 }, /* (33) db_options ::= db_options REPLICA NK_INTEGER */ - { 141, -3 }, /* (34) db_options ::= db_options TTL NK_INTEGER */ - { 141, -3 }, /* (35) db_options ::= db_options WAL NK_INTEGER */ - { 141, -3 }, /* (36) db_options ::= db_options VGROUPS NK_INTEGER */ - { 141, -3 }, /* (37) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 141, -3 }, /* (38) db_options ::= db_options STREAM_MODE NK_INTEGER */ - { 135, -9 }, /* (39) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 135, -3 }, /* (40) cmd ::= CREATE TABLE multi_create_clause */ - { 135, -9 }, /* (41) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 135, -3 }, /* (42) cmd ::= DROP TABLE multi_drop_clause */ - { 135, -4 }, /* (43) cmd ::= DROP STABLE exists_opt full_table_name */ - { 135, -2 }, /* (44) cmd ::= SHOW TABLES */ - { 135, -2 }, /* (45) cmd ::= SHOW STABLES */ - { 147, -1 }, /* (46) multi_create_clause ::= create_subtable_clause */ - { 147, -2 }, /* (47) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 150, -9 }, /* (48) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ - { 149, -1 }, /* (49) multi_drop_clause ::= drop_table_clause */ - { 149, -2 }, /* (50) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 153, -2 }, /* (51) drop_table_clause ::= exists_opt full_table_name */ - { 151, 0 }, /* (52) specific_tags_opt ::= */ - { 151, -3 }, /* (53) specific_tags_opt ::= NK_LP col_name_list NK_RP */ - { 143, -1 }, /* (54) full_table_name ::= table_name */ - { 143, -3 }, /* (55) full_table_name ::= db_name NK_DOT table_name */ - { 144, -1 }, /* (56) column_def_list ::= column_def */ - { 144, -3 }, /* (57) column_def_list ::= column_def_list NK_COMMA column_def */ - { 156, -2 }, /* (58) column_def ::= column_name type_name */ - { 156, -4 }, /* (59) column_def ::= column_name type_name COMMENT NK_STRING */ - { 158, -1 }, /* (60) type_name ::= BOOL */ - { 158, -1 }, /* (61) type_name ::= TINYINT */ - { 158, -1 }, /* (62) type_name ::= SMALLINT */ - { 158, -1 }, /* (63) type_name ::= INT */ - { 158, -1 }, /* (64) type_name ::= INTEGER */ - { 158, -1 }, /* (65) type_name ::= BIGINT */ - { 158, -1 }, /* (66) type_name ::= FLOAT */ - { 158, -1 }, /* (67) type_name ::= DOUBLE */ - { 158, -4 }, /* (68) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 158, -1 }, /* (69) type_name ::= TIMESTAMP */ - { 158, -4 }, /* (70) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 158, -2 }, /* (71) type_name ::= TINYINT UNSIGNED */ - { 158, -2 }, /* (72) type_name ::= SMALLINT UNSIGNED */ - { 158, -2 }, /* (73) type_name ::= INT UNSIGNED */ - { 158, -2 }, /* (74) type_name ::= BIGINT UNSIGNED */ - { 158, -1 }, /* (75) type_name ::= JSON */ - { 158, -4 }, /* (76) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 158, -1 }, /* (77) type_name ::= MEDIUMBLOB */ - { 158, -1 }, /* (78) type_name ::= BLOB */ - { 158, -4 }, /* (79) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 158, -1 }, /* (80) type_name ::= DECIMAL */ - { 158, -4 }, /* (81) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 158, -6 }, /* (82) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 145, 0 }, /* (83) tags_def_opt ::= */ - { 145, -1 }, /* (84) tags_def_opt ::= tags_def */ - { 148, -4 }, /* (85) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 146, 0 }, /* (86) table_options ::= */ - { 146, -3 }, /* (87) table_options ::= table_options COMMENT NK_STRING */ - { 146, -3 }, /* (88) table_options ::= table_options KEEP NK_INTEGER */ - { 146, -3 }, /* (89) table_options ::= table_options TTL NK_INTEGER */ - { 146, -5 }, /* (90) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 154, -1 }, /* (91) col_name_list ::= col_name */ - { 154, -3 }, /* (92) col_name_list ::= col_name_list NK_COMMA col_name */ - { 159, -1 }, /* (93) col_name ::= column_name */ - { 135, -2 }, /* (94) cmd ::= SHOW VGROUPS */ - { 135, -4 }, /* (95) cmd ::= SHOW db_name NK_DOT VGROUPS */ - { 135, -2 }, /* (96) cmd ::= SHOW MNODES */ - { 135, -1 }, /* (97) cmd ::= query_expression */ - { 161, -1 }, /* (98) literal ::= NK_INTEGER */ - { 161, -1 }, /* (99) literal ::= NK_FLOAT */ - { 161, -1 }, /* (100) literal ::= NK_STRING */ - { 161, -1 }, /* (101) literal ::= NK_BOOL */ - { 161, -2 }, /* (102) literal ::= TIMESTAMP NK_STRING */ - { 161, -1 }, /* (103) literal ::= duration_literal */ - { 162, -1 }, /* (104) duration_literal ::= NK_VARIABLE */ - { 152, -1 }, /* (105) literal_list ::= literal */ - { 152, -3 }, /* (106) literal_list ::= literal_list NK_COMMA literal */ - { 140, -1 }, /* (107) db_name ::= NK_ID */ - { 155, -1 }, /* (108) table_name ::= NK_ID */ - { 157, -1 }, /* (109) column_name ::= NK_ID */ - { 163, -1 }, /* (110) function_name ::= NK_ID */ - { 164, -1 }, /* (111) table_alias ::= NK_ID */ - { 165, -1 }, /* (112) column_alias ::= NK_ID */ - { 136, -1 }, /* (113) user_name ::= NK_ID */ - { 166, -1 }, /* (114) expression ::= literal */ - { 166, -1 }, /* (115) expression ::= column_reference */ - { 166, -4 }, /* (116) expression ::= function_name NK_LP expression_list NK_RP */ - { 166, -4 }, /* (117) expression ::= function_name NK_LP NK_STAR NK_RP */ - { 166, -1 }, /* (118) expression ::= subquery */ - { 166, -3 }, /* (119) expression ::= NK_LP expression NK_RP */ - { 166, -2 }, /* (120) expression ::= NK_PLUS expression */ - { 166, -2 }, /* (121) expression ::= NK_MINUS expression */ - { 166, -3 }, /* (122) expression ::= expression NK_PLUS expression */ - { 166, -3 }, /* (123) expression ::= expression NK_MINUS expression */ - { 166, -3 }, /* (124) expression ::= expression NK_STAR expression */ - { 166, -3 }, /* (125) expression ::= expression NK_SLASH expression */ - { 166, -3 }, /* (126) expression ::= expression NK_REM expression */ - { 168, -1 }, /* (127) expression_list ::= expression */ - { 168, -3 }, /* (128) expression_list ::= expression_list NK_COMMA expression */ - { 167, -1 }, /* (129) column_reference ::= column_name */ - { 167, -3 }, /* (130) column_reference ::= table_name NK_DOT column_name */ - { 170, -3 }, /* (131) predicate ::= expression compare_op expression */ - { 170, -5 }, /* (132) predicate ::= expression BETWEEN expression AND expression */ - { 170, -6 }, /* (133) predicate ::= expression NOT BETWEEN expression AND expression */ - { 170, -3 }, /* (134) predicate ::= expression IS NULL */ - { 170, -4 }, /* (135) predicate ::= expression IS NOT NULL */ - { 170, -3 }, /* (136) predicate ::= expression in_op in_predicate_value */ - { 171, -1 }, /* (137) compare_op ::= NK_LT */ - { 171, -1 }, /* (138) compare_op ::= NK_GT */ - { 171, -1 }, /* (139) compare_op ::= NK_LE */ - { 171, -1 }, /* (140) compare_op ::= NK_GE */ - { 171, -1 }, /* (141) compare_op ::= NK_NE */ - { 171, -1 }, /* (142) compare_op ::= NK_EQ */ - { 171, -1 }, /* (143) compare_op ::= LIKE */ - { 171, -2 }, /* (144) compare_op ::= NOT LIKE */ - { 171, -1 }, /* (145) compare_op ::= MATCH */ - { 171, -1 }, /* (146) compare_op ::= NMATCH */ - { 172, -1 }, /* (147) in_op ::= IN */ - { 172, -2 }, /* (148) in_op ::= NOT IN */ - { 173, -3 }, /* (149) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 174, -1 }, /* (150) boolean_value_expression ::= boolean_primary */ - { 174, -2 }, /* (151) boolean_value_expression ::= NOT boolean_primary */ - { 174, -3 }, /* (152) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 174, -3 }, /* (153) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 175, -1 }, /* (154) boolean_primary ::= predicate */ - { 175, -3 }, /* (155) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 176, -1 }, /* (156) common_expression ::= expression */ - { 176, -1 }, /* (157) common_expression ::= boolean_value_expression */ - { 177, -2 }, /* (158) from_clause ::= FROM table_reference_list */ - { 178, -1 }, /* (159) table_reference_list ::= table_reference */ - { 178, -3 }, /* (160) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 179, -1 }, /* (161) table_reference ::= table_primary */ - { 179, -1 }, /* (162) table_reference ::= joined_table */ - { 180, -2 }, /* (163) table_primary ::= table_name alias_opt */ - { 180, -4 }, /* (164) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 180, -2 }, /* (165) table_primary ::= subquery alias_opt */ - { 180, -1 }, /* (166) table_primary ::= parenthesized_joined_table */ - { 182, 0 }, /* (167) alias_opt ::= */ - { 182, -1 }, /* (168) alias_opt ::= table_alias */ - { 182, -2 }, /* (169) alias_opt ::= AS table_alias */ - { 183, -3 }, /* (170) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 183, -3 }, /* (171) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 181, -6 }, /* (172) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 184, 0 }, /* (173) join_type ::= */ - { 184, -1 }, /* (174) join_type ::= INNER */ - { 186, -9 }, /* (175) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 187, 0 }, /* (176) set_quantifier_opt ::= */ - { 187, -1 }, /* (177) set_quantifier_opt ::= DISTINCT */ - { 187, -1 }, /* (178) set_quantifier_opt ::= ALL */ - { 188, -1 }, /* (179) select_list ::= NK_STAR */ - { 188, -1 }, /* (180) select_list ::= select_sublist */ - { 194, -1 }, /* (181) select_sublist ::= select_item */ - { 194, -3 }, /* (182) select_sublist ::= select_sublist NK_COMMA select_item */ - { 195, -1 }, /* (183) select_item ::= common_expression */ - { 195, -2 }, /* (184) select_item ::= common_expression column_alias */ - { 195, -3 }, /* (185) select_item ::= common_expression AS column_alias */ - { 195, -3 }, /* (186) select_item ::= table_name NK_DOT NK_STAR */ - { 189, 0 }, /* (187) where_clause_opt ::= */ - { 189, -2 }, /* (188) where_clause_opt ::= WHERE search_condition */ - { 190, 0 }, /* (189) partition_by_clause_opt ::= */ - { 190, -3 }, /* (190) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 191, 0 }, /* (191) twindow_clause_opt ::= */ - { 191, -6 }, /* (192) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ - { 191, -4 }, /* (193) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ - { 191, -6 }, /* (194) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 191, -8 }, /* (195) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 196, 0 }, /* (196) sliding_opt ::= */ - { 196, -4 }, /* (197) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 197, 0 }, /* (198) fill_opt ::= */ - { 197, -4 }, /* (199) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 197, -6 }, /* (200) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 198, -1 }, /* (201) fill_mode ::= NONE */ - { 198, -1 }, /* (202) fill_mode ::= PREV */ - { 198, -1 }, /* (203) fill_mode ::= NULL */ - { 198, -1 }, /* (204) fill_mode ::= LINEAR */ - { 198, -1 }, /* (205) fill_mode ::= NEXT */ - { 192, 0 }, /* (206) group_by_clause_opt ::= */ - { 192, -3 }, /* (207) group_by_clause_opt ::= GROUP BY group_by_list */ - { 199, -1 }, /* (208) group_by_list ::= expression */ - { 199, -3 }, /* (209) group_by_list ::= group_by_list NK_COMMA expression */ - { 193, 0 }, /* (210) having_clause_opt ::= */ - { 193, -2 }, /* (211) having_clause_opt ::= HAVING search_condition */ - { 160, -4 }, /* (212) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 200, -1 }, /* (213) query_expression_body ::= query_primary */ - { 200, -4 }, /* (214) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 204, -1 }, /* (215) query_primary ::= query_specification */ - { 201, 0 }, /* (216) order_by_clause_opt ::= */ - { 201, -3 }, /* (217) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 202, 0 }, /* (218) slimit_clause_opt ::= */ - { 202, -2 }, /* (219) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 202, -4 }, /* (220) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 202, -4 }, /* (221) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 203, 0 }, /* (222) limit_clause_opt ::= */ - { 203, -2 }, /* (223) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 203, -4 }, /* (224) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 203, -4 }, /* (225) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 169, -3 }, /* (226) subquery ::= NK_LP query_expression NK_RP */ - { 185, -1 }, /* (227) search_condition ::= common_expression */ - { 205, -1 }, /* (228) sort_specification_list ::= sort_specification */ - { 205, -3 }, /* (229) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 206, -3 }, /* (230) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 207, 0 }, /* (231) ordering_specification_opt ::= */ - { 207, -1 }, /* (232) ordering_specification_opt ::= ASC */ - { 207, -1 }, /* (233) ordering_specification_opt ::= DESC */ - { 208, 0 }, /* (234) null_ordering_opt ::= */ - { 208, -2 }, /* (235) null_ordering_opt ::= NULLS FIRST */ - { 208, -2 }, /* (236) null_ordering_opt ::= NULLS LAST */ + { 140, -5 }, /* (0) cmd ::= CREATE USER user_name PASS NK_STRING */ + { 140, -5 }, /* (1) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 140, -5 }, /* (2) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ + { 140, -3 }, /* (3) cmd ::= DROP USER user_name */ + { 140, -3 }, /* (4) cmd ::= CREATE DNODE dnode_endpoint */ + { 140, -5 }, /* (5) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ + { 140, -3 }, /* (6) cmd ::= DROP DNODE NK_INTEGER */ + { 140, -3 }, /* (7) cmd ::= DROP DNODE dnode_endpoint */ + { 142, -1 }, /* (8) dnode_endpoint ::= NK_STRING */ + { 143, -1 }, /* (9) dnode_host_name ::= NK_ID */ + { 143, -1 }, /* (10) dnode_host_name ::= NK_IPTOKEN */ + { 140, -5 }, /* (11) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 140, -4 }, /* (12) cmd ::= DROP DATABASE exists_opt db_name */ + { 140, -2 }, /* (13) cmd ::= USE db_name */ + { 144, -3 }, /* (14) not_exists_opt ::= IF NOT EXISTS */ + { 144, 0 }, /* (15) not_exists_opt ::= */ + { 147, -2 }, /* (16) exists_opt ::= IF EXISTS */ + { 147, 0 }, /* (17) exists_opt ::= */ + { 146, 0 }, /* (18) db_options ::= */ + { 146, -3 }, /* (19) db_options ::= db_options BLOCKS NK_INTEGER */ + { 146, -3 }, /* (20) db_options ::= db_options CACHE NK_INTEGER */ + { 146, -3 }, /* (21) db_options ::= db_options CACHELAST NK_INTEGER */ + { 146, -3 }, /* (22) db_options ::= db_options COMP NK_INTEGER */ + { 146, -3 }, /* (23) db_options ::= db_options DAYS NK_INTEGER */ + { 146, -3 }, /* (24) db_options ::= db_options FSYNC NK_INTEGER */ + { 146, -3 }, /* (25) db_options ::= db_options MAXROWS NK_INTEGER */ + { 146, -3 }, /* (26) db_options ::= db_options MINROWS NK_INTEGER */ + { 146, -3 }, /* (27) db_options ::= db_options KEEP NK_INTEGER */ + { 146, -3 }, /* (28) db_options ::= db_options PRECISION NK_STRING */ + { 146, -3 }, /* (29) db_options ::= db_options QUORUM NK_INTEGER */ + { 146, -3 }, /* (30) db_options ::= db_options REPLICA NK_INTEGER */ + { 146, -3 }, /* (31) db_options ::= db_options TTL NK_INTEGER */ + { 146, -3 }, /* (32) db_options ::= db_options WAL NK_INTEGER */ + { 146, -3 }, /* (33) db_options ::= db_options VGROUPS NK_INTEGER */ + { 146, -3 }, /* (34) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 146, -3 }, /* (35) db_options ::= db_options STREAM_MODE NK_INTEGER */ + { 140, -9 }, /* (36) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 140, -3 }, /* (37) cmd ::= CREATE TABLE multi_create_clause */ + { 140, -9 }, /* (38) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 140, -3 }, /* (39) cmd ::= DROP TABLE multi_drop_clause */ + { 140, -4 }, /* (40) cmd ::= DROP STABLE exists_opt full_table_name */ + { 152, -1 }, /* (41) multi_create_clause ::= create_subtable_clause */ + { 152, -2 }, /* (42) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 155, -9 }, /* (43) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ + { 154, -1 }, /* (44) multi_drop_clause ::= drop_table_clause */ + { 154, -2 }, /* (45) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 158, -2 }, /* (46) drop_table_clause ::= exists_opt full_table_name */ + { 156, 0 }, /* (47) specific_tags_opt ::= */ + { 156, -3 }, /* (48) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 148, -1 }, /* (49) full_table_name ::= table_name */ + { 148, -3 }, /* (50) full_table_name ::= db_name NK_DOT table_name */ + { 149, -1 }, /* (51) column_def_list ::= column_def */ + { 149, -3 }, /* (52) column_def_list ::= column_def_list NK_COMMA column_def */ + { 161, -2 }, /* (53) column_def ::= column_name type_name */ + { 161, -4 }, /* (54) column_def ::= column_name type_name COMMENT NK_STRING */ + { 163, -1 }, /* (55) type_name ::= BOOL */ + { 163, -1 }, /* (56) type_name ::= TINYINT */ + { 163, -1 }, /* (57) type_name ::= SMALLINT */ + { 163, -1 }, /* (58) type_name ::= INT */ + { 163, -1 }, /* (59) type_name ::= INTEGER */ + { 163, -1 }, /* (60) type_name ::= BIGINT */ + { 163, -1 }, /* (61) type_name ::= FLOAT */ + { 163, -1 }, /* (62) type_name ::= DOUBLE */ + { 163, -4 }, /* (63) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 163, -1 }, /* (64) type_name ::= TIMESTAMP */ + { 163, -4 }, /* (65) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 163, -2 }, /* (66) type_name ::= TINYINT UNSIGNED */ + { 163, -2 }, /* (67) type_name ::= SMALLINT UNSIGNED */ + { 163, -2 }, /* (68) type_name ::= INT UNSIGNED */ + { 163, -2 }, /* (69) type_name ::= BIGINT UNSIGNED */ + { 163, -1 }, /* (70) type_name ::= JSON */ + { 163, -4 }, /* (71) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 163, -1 }, /* (72) type_name ::= MEDIUMBLOB */ + { 163, -1 }, /* (73) type_name ::= BLOB */ + { 163, -4 }, /* (74) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 163, -1 }, /* (75) type_name ::= DECIMAL */ + { 163, -4 }, /* (76) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 163, -6 }, /* (77) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 150, 0 }, /* (78) tags_def_opt ::= */ + { 150, -1 }, /* (79) tags_def_opt ::= tags_def */ + { 153, -4 }, /* (80) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 151, 0 }, /* (81) table_options ::= */ + { 151, -3 }, /* (82) table_options ::= table_options COMMENT NK_STRING */ + { 151, -3 }, /* (83) table_options ::= table_options KEEP NK_INTEGER */ + { 151, -3 }, /* (84) table_options ::= table_options TTL NK_INTEGER */ + { 151, -5 }, /* (85) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 159, -1 }, /* (86) col_name_list ::= col_name */ + { 159, -3 }, /* (87) col_name_list ::= col_name_list NK_COMMA col_name */ + { 164, -1 }, /* (88) col_name ::= column_name */ + { 140, -2 }, /* (89) cmd ::= SHOW DNODES */ + { 140, -2 }, /* (90) cmd ::= SHOW USERS */ + { 140, -2 }, /* (91) cmd ::= SHOW DATABASES */ + { 140, -4 }, /* (92) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 140, -4 }, /* (93) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 140, -3 }, /* (94) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 140, -2 }, /* (95) cmd ::= SHOW MNODES */ + { 140, -2 }, /* (96) cmd ::= SHOW MODULES */ + { 140, -2 }, /* (97) cmd ::= SHOW QNODES */ + { 140, -2 }, /* (98) cmd ::= SHOW FUNCTIONS */ + { 140, -5 }, /* (99) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 140, -2 }, /* (100) cmd ::= SHOW STREAMS */ + { 165, 0 }, /* (101) db_name_cond_opt ::= */ + { 165, -2 }, /* (102) db_name_cond_opt ::= db_name NK_DOT */ + { 166, 0 }, /* (103) like_pattern_opt ::= */ + { 166, -2 }, /* (104) like_pattern_opt ::= LIKE NK_STRING */ + { 167, -1 }, /* (105) table_name_cond ::= table_name */ + { 168, 0 }, /* (106) from_db_opt ::= */ + { 168, -2 }, /* (107) from_db_opt ::= FROM db_name */ + { 140, -1 }, /* (108) cmd ::= query_expression */ + { 170, -1 }, /* (109) literal ::= NK_INTEGER */ + { 170, -1 }, /* (110) literal ::= NK_FLOAT */ + { 170, -1 }, /* (111) literal ::= NK_STRING */ + { 170, -1 }, /* (112) literal ::= NK_BOOL */ + { 170, -2 }, /* (113) literal ::= TIMESTAMP NK_STRING */ + { 170, -1 }, /* (114) literal ::= duration_literal */ + { 171, -1 }, /* (115) duration_literal ::= NK_VARIABLE */ + { 157, -1 }, /* (116) literal_list ::= literal */ + { 157, -3 }, /* (117) literal_list ::= literal_list NK_COMMA literal */ + { 145, -1 }, /* (118) db_name ::= NK_ID */ + { 160, -1 }, /* (119) table_name ::= NK_ID */ + { 162, -1 }, /* (120) column_name ::= NK_ID */ + { 172, -1 }, /* (121) function_name ::= NK_ID */ + { 173, -1 }, /* (122) table_alias ::= NK_ID */ + { 174, -1 }, /* (123) column_alias ::= NK_ID */ + { 141, -1 }, /* (124) user_name ::= NK_ID */ + { 175, -1 }, /* (125) expression ::= literal */ + { 175, -1 }, /* (126) expression ::= column_reference */ + { 175, -4 }, /* (127) expression ::= function_name NK_LP expression_list NK_RP */ + { 175, -4 }, /* (128) expression ::= function_name NK_LP NK_STAR NK_RP */ + { 175, -1 }, /* (129) expression ::= subquery */ + { 175, -3 }, /* (130) expression ::= NK_LP expression NK_RP */ + { 175, -2 }, /* (131) expression ::= NK_PLUS expression */ + { 175, -2 }, /* (132) expression ::= NK_MINUS expression */ + { 175, -3 }, /* (133) expression ::= expression NK_PLUS expression */ + { 175, -3 }, /* (134) expression ::= expression NK_MINUS expression */ + { 175, -3 }, /* (135) expression ::= expression NK_STAR expression */ + { 175, -3 }, /* (136) expression ::= expression NK_SLASH expression */ + { 175, -3 }, /* (137) expression ::= expression NK_REM expression */ + { 177, -1 }, /* (138) expression_list ::= expression */ + { 177, -3 }, /* (139) expression_list ::= expression_list NK_COMMA expression */ + { 176, -1 }, /* (140) column_reference ::= column_name */ + { 176, -3 }, /* (141) column_reference ::= table_name NK_DOT column_name */ + { 179, -3 }, /* (142) predicate ::= expression compare_op expression */ + { 179, -5 }, /* (143) predicate ::= expression BETWEEN expression AND expression */ + { 179, -6 }, /* (144) predicate ::= expression NOT BETWEEN expression AND expression */ + { 179, -3 }, /* (145) predicate ::= expression IS NULL */ + { 179, -4 }, /* (146) predicate ::= expression IS NOT NULL */ + { 179, -3 }, /* (147) predicate ::= expression in_op in_predicate_value */ + { 180, -1 }, /* (148) compare_op ::= NK_LT */ + { 180, -1 }, /* (149) compare_op ::= NK_GT */ + { 180, -1 }, /* (150) compare_op ::= NK_LE */ + { 180, -1 }, /* (151) compare_op ::= NK_GE */ + { 180, -1 }, /* (152) compare_op ::= NK_NE */ + { 180, -1 }, /* (153) compare_op ::= NK_EQ */ + { 180, -1 }, /* (154) compare_op ::= LIKE */ + { 180, -2 }, /* (155) compare_op ::= NOT LIKE */ + { 180, -1 }, /* (156) compare_op ::= MATCH */ + { 180, -1 }, /* (157) compare_op ::= NMATCH */ + { 181, -1 }, /* (158) in_op ::= IN */ + { 181, -2 }, /* (159) in_op ::= NOT IN */ + { 182, -3 }, /* (160) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 183, -1 }, /* (161) boolean_value_expression ::= boolean_primary */ + { 183, -2 }, /* (162) boolean_value_expression ::= NOT boolean_primary */ + { 183, -3 }, /* (163) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 183, -3 }, /* (164) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 184, -1 }, /* (165) boolean_primary ::= predicate */ + { 184, -3 }, /* (166) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 185, -1 }, /* (167) common_expression ::= expression */ + { 185, -1 }, /* (168) common_expression ::= boolean_value_expression */ + { 186, -2 }, /* (169) from_clause ::= FROM table_reference_list */ + { 187, -1 }, /* (170) table_reference_list ::= table_reference */ + { 187, -3 }, /* (171) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 188, -1 }, /* (172) table_reference ::= table_primary */ + { 188, -1 }, /* (173) table_reference ::= joined_table */ + { 189, -2 }, /* (174) table_primary ::= table_name alias_opt */ + { 189, -4 }, /* (175) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 189, -2 }, /* (176) table_primary ::= subquery alias_opt */ + { 189, -1 }, /* (177) table_primary ::= parenthesized_joined_table */ + { 191, 0 }, /* (178) alias_opt ::= */ + { 191, -1 }, /* (179) alias_opt ::= table_alias */ + { 191, -2 }, /* (180) alias_opt ::= AS table_alias */ + { 192, -3 }, /* (181) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 192, -3 }, /* (182) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 190, -6 }, /* (183) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 193, 0 }, /* (184) join_type ::= */ + { 193, -1 }, /* (185) join_type ::= INNER */ + { 195, -9 }, /* (186) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 196, 0 }, /* (187) set_quantifier_opt ::= */ + { 196, -1 }, /* (188) set_quantifier_opt ::= DISTINCT */ + { 196, -1 }, /* (189) set_quantifier_opt ::= ALL */ + { 197, -1 }, /* (190) select_list ::= NK_STAR */ + { 197, -1 }, /* (191) select_list ::= select_sublist */ + { 203, -1 }, /* (192) select_sublist ::= select_item */ + { 203, -3 }, /* (193) select_sublist ::= select_sublist NK_COMMA select_item */ + { 204, -1 }, /* (194) select_item ::= common_expression */ + { 204, -2 }, /* (195) select_item ::= common_expression column_alias */ + { 204, -3 }, /* (196) select_item ::= common_expression AS column_alias */ + { 204, -3 }, /* (197) select_item ::= table_name NK_DOT NK_STAR */ + { 198, 0 }, /* (198) where_clause_opt ::= */ + { 198, -2 }, /* (199) where_clause_opt ::= WHERE search_condition */ + { 199, 0 }, /* (200) partition_by_clause_opt ::= */ + { 199, -3 }, /* (201) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 200, 0 }, /* (202) twindow_clause_opt ::= */ + { 200, -6 }, /* (203) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ + { 200, -4 }, /* (204) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + { 200, -6 }, /* (205) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 200, -8 }, /* (206) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 205, 0 }, /* (207) sliding_opt ::= */ + { 205, -4 }, /* (208) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 206, 0 }, /* (209) fill_opt ::= */ + { 206, -4 }, /* (210) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 206, -6 }, /* (211) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 207, -1 }, /* (212) fill_mode ::= NONE */ + { 207, -1 }, /* (213) fill_mode ::= PREV */ + { 207, -1 }, /* (214) fill_mode ::= NULL */ + { 207, -1 }, /* (215) fill_mode ::= LINEAR */ + { 207, -1 }, /* (216) fill_mode ::= NEXT */ + { 201, 0 }, /* (217) group_by_clause_opt ::= */ + { 201, -3 }, /* (218) group_by_clause_opt ::= GROUP BY group_by_list */ + { 208, -1 }, /* (219) group_by_list ::= expression */ + { 208, -3 }, /* (220) group_by_list ::= group_by_list NK_COMMA expression */ + { 202, 0 }, /* (221) having_clause_opt ::= */ + { 202, -2 }, /* (222) having_clause_opt ::= HAVING search_condition */ + { 169, -4 }, /* (223) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 209, -1 }, /* (224) query_expression_body ::= query_primary */ + { 209, -4 }, /* (225) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 213, -1 }, /* (226) query_primary ::= query_specification */ + { 210, 0 }, /* (227) order_by_clause_opt ::= */ + { 210, -3 }, /* (228) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 211, 0 }, /* (229) slimit_clause_opt ::= */ + { 211, -2 }, /* (230) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 211, -4 }, /* (231) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 211, -4 }, /* (232) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 212, 0 }, /* (233) limit_clause_opt ::= */ + { 212, -2 }, /* (234) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 212, -4 }, /* (235) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 212, -4 }, /* (236) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 178, -3 }, /* (237) subquery ::= NK_LP query_expression NK_RP */ + { 194, -1 }, /* (238) search_condition ::= common_expression */ + { 214, -1 }, /* (239) sort_specification_list ::= sort_specification */ + { 214, -3 }, /* (240) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 215, -3 }, /* (241) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 216, 0 }, /* (242) ordering_specification_opt ::= */ + { 216, -1 }, /* (243) ordering_specification_opt ::= ASC */ + { 216, -1 }, /* (244) ordering_specification_opt ::= DESC */ + { 217, 0 }, /* (245) null_ordering_opt ::= */ + { 217, -2 }, /* (246) null_ordering_opt ::= NULLS FIRST */ + { 217, -2 }, /* (247) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1912,748 +1954,777 @@ 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);} +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy0);} 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);} +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy5, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0);} break; case 2: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy129, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0);} +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy5, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0);} break; case 3: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy129); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy5); } break; - case 4: /* cmd ::= SHOW USERS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL); } + case 4: /* cmd ::= CREATE DNODE dnode_endpoint */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy5, NULL);} break; - case 5: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy129, NULL);} + case 5: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy0);} break; - case 6: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0);} - break; - case 7: /* cmd ::= DROP DNODE NK_INTEGER */ + case 6: /* 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 7: /* cmd ::= DROP DNODE dnode_endpoint */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy5);} break; - case 9: /* cmd ::= SHOW DNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } + case 8: /* dnode_endpoint ::= NK_STRING */ + case 9: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==9); + case 10: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==10); + case 118: /* db_name ::= NK_ID */ yytestcase(yyruleno==118); + case 119: /* table_name ::= NK_ID */ yytestcase(yyruleno==119); + case 120: /* column_name ::= NK_ID */ yytestcase(yyruleno==120); + case 121: /* function_name ::= NK_ID */ yytestcase(yyruleno==121); + case 122: /* table_alias ::= NK_ID */ yytestcase(yyruleno==122); + case 123: /* column_alias ::= NK_ID */ yytestcase(yyruleno==123); + case 124: /* user_name ::= NK_ID */ yytestcase(yyruleno==124); +{ yylhsminor.yy5 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy5 = yylhsminor.yy5; + break; + case 11: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy25, &yymsp[-1].minor.yy5, yymsp[0].minor.yy339);} 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 107: /* db_name ::= NK_ID */ yytestcase(yyruleno==107); - case 108: /* table_name ::= NK_ID */ yytestcase(yyruleno==108); - case 109: /* column_name ::= NK_ID */ yytestcase(yyruleno==109); - case 110: /* function_name ::= NK_ID */ yytestcase(yyruleno==110); - case 111: /* table_alias ::= NK_ID */ yytestcase(yyruleno==111); - case 112: /* column_alias ::= NK_ID */ yytestcase(yyruleno==112); - case 113: /* user_name ::= NK_ID */ yytestcase(yyruleno==113); -{ yylhsminor.yy129 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy129 = yylhsminor.yy129; + case 12: /* cmd ::= DROP DATABASE exists_opt db_name */ +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy25, &yymsp[0].minor.yy5); } break; - case 13: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy185, &yymsp[-1].minor.yy129, yymsp[0].minor.yy391);} + case 13: /* cmd ::= USE db_name */ +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy5);} + break; + case 14: /* not_exists_opt ::= IF NOT EXISTS */ +{ yymsp[-2].minor.yy25 = true; } + break; + case 15: /* not_exists_opt ::= */ + case 17: /* exists_opt ::= */ yytestcase(yyruleno==17); + case 187: /* set_quantifier_opt ::= */ yytestcase(yyruleno==187); +{ yymsp[1].minor.yy25 = false; } + break; + case 16: /* exists_opt ::= IF EXISTS */ +{ yymsp[-1].minor.yy25 = true; } + break; + case 18: /* db_options ::= */ +{ yymsp[1].minor.yy339 = createDefaultDatabaseOptions(pCxt); } + break; + case 19: /* db_options ::= db_options BLOCKS NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 20: /* db_options ::= db_options CACHE NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 21: /* db_options ::= db_options CACHELAST NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 22: /* db_options ::= db_options COMP NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 23: /* db_options ::= db_options DAYS NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 24: /* db_options ::= db_options FSYNC NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 25: /* db_options ::= db_options MAXROWS NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 26: /* db_options ::= db_options MINROWS NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 27: /* db_options ::= db_options KEEP NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 28: /* db_options ::= db_options PRECISION NK_STRING */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 29: /* db_options ::= db_options QUORUM NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 30: /* db_options ::= db_options REPLICA NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 31: /* db_options ::= db_options TTL NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 32: /* db_options ::= db_options WAL NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 33: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; + break; + case 34: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; break; - case 14: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy129); } + case 35: /* db_options ::= db_options STREAM_MODE NK_INTEGER */ +{ yylhsminor.yy339 = setDatabaseOption(pCxt, yymsp[-2].minor.yy339, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy339 = yylhsminor.yy339; break; - case 15: /* cmd ::= SHOW DATABASES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } + case 36: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 38: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==38); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy25, yymsp[-5].minor.yy68, yymsp[-3].minor.yy40, yymsp[-1].minor.yy40, yymsp[0].minor.yy418);} break; - case 16: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy129);} + case 37: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy40);} break; - case 17: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy185 = true; } + case 39: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy40); } break; - case 18: /* not_exists_opt ::= */ - case 20: /* exists_opt ::= */ yytestcase(yyruleno==20); - case 176: /* set_quantifier_opt ::= */ yytestcase(yyruleno==176); -{ yymsp[1].minor.yy185 = false; } + case 40: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy25, yymsp[0].minor.yy68); } break; - case 19: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy185 = true; } + case 41: /* multi_create_clause ::= create_subtable_clause */ + case 44: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==44); + case 51: /* column_def_list ::= column_def */ yytestcase(yyruleno==51); + case 86: /* col_name_list ::= col_name */ yytestcase(yyruleno==86); + case 192: /* select_sublist ::= select_item */ yytestcase(yyruleno==192); + case 239: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==239); +{ yylhsminor.yy40 = createNodeList(pCxt, yymsp[0].minor.yy68); } + yymsp[0].minor.yy40 = yylhsminor.yy40; break; - case 21: /* db_options ::= */ -{ yymsp[1].minor.yy391 = createDefaultDatabaseOptions(pCxt); } - break; - case 22: /* db_options ::= db_options BLOCKS NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 23: /* db_options ::= db_options CACHE NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 24: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 25: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 26: /* db_options ::= db_options DAYS NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 27: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 28: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 29: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 30: /* db_options ::= db_options KEEP NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 31: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 32: /* db_options ::= db_options QUORUM NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 33: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 34: /* db_options ::= db_options TTL NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 35: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 36: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; - break; - case 37: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; + case 42: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 45: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==45); +{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-1].minor.yy40, yymsp[0].minor.yy68); } + yymsp[-1].minor.yy40 = yylhsminor.yy40; break; - case 38: /* db_options ::= db_options STREAM_MODE NK_INTEGER */ -{ yylhsminor.yy391 = setDatabaseOption(pCxt, yymsp[-2].minor.yy391, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy391 = yylhsminor.yy391; + case 43: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ +{ yylhsminor.yy68 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy25, yymsp[-7].minor.yy68, yymsp[-5].minor.yy68, yymsp[-4].minor.yy40, yymsp[-1].minor.yy40); } + yymsp[-8].minor.yy68 = yylhsminor.yy68; break; - case 39: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 41: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==41); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-5].minor.yy256, yymsp[-3].minor.yy46, yymsp[-1].minor.yy46, yymsp[0].minor.yy340);} + case 46: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy68 = createDropTableClause(pCxt, yymsp[-1].minor.yy25, yymsp[0].minor.yy68); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 40: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy46);} + case 47: /* specific_tags_opt ::= */ + case 78: /* tags_def_opt ::= */ yytestcase(yyruleno==78); + case 200: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==200); + case 217: /* group_by_clause_opt ::= */ yytestcase(yyruleno==217); + case 227: /* order_by_clause_opt ::= */ yytestcase(yyruleno==227); +{ yymsp[1].minor.yy40 = NULL; } break; - case 42: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy46); } + case 48: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ +{ yymsp[-2].minor.yy40 = yymsp[-1].minor.yy40; } break; - case 43: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy256); } + case 49: /* full_table_name ::= table_name */ +{ yylhsminor.yy68 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy5, NULL); } + yymsp[0].minor.yy68 = yylhsminor.yy68; break; - case 44: /* cmd ::= SHOW TABLES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } + case 50: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy68 = createRealTableNode(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy5, NULL); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 45: /* cmd ::= SHOW STABLES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, NULL); } + case 52: /* column_def_list ::= column_def_list NK_COMMA column_def */ + case 87: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==87); + case 193: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==193); + case 240: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==240); +{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-2].minor.yy40, yymsp[0].minor.yy68); } + yymsp[-2].minor.yy40 = yylhsminor.yy40; break; - case 46: /* multi_create_clause ::= create_subtable_clause */ - case 49: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==49); - case 56: /* column_def_list ::= column_def */ yytestcase(yyruleno==56); - case 91: /* col_name_list ::= col_name */ yytestcase(yyruleno==91); - case 181: /* select_sublist ::= select_item */ yytestcase(yyruleno==181); - case 228: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==228); -{ yylhsminor.yy46 = createNodeList(pCxt, yymsp[0].minor.yy256); } - yymsp[0].minor.yy46 = yylhsminor.yy46; + case 53: /* column_def ::= column_name type_name */ +{ yylhsminor.yy68 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy5, yymsp[0].minor.yy372, NULL); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 47: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 50: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==50); -{ yylhsminor.yy46 = addNodeToList(pCxt, yymsp[-1].minor.yy46, yymsp[0].minor.yy256); } - yymsp[-1].minor.yy46 = yylhsminor.yy46; + case 54: /* column_def ::= column_name type_name COMMENT NK_STRING */ +{ yylhsminor.yy68 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy5, yymsp[-2].minor.yy372, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy68 = yylhsminor.yy68; break; - case 48: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ -{ yylhsminor.yy256 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy185, yymsp[-7].minor.yy256, yymsp[-5].minor.yy256, yymsp[-4].minor.yy46, yymsp[-1].minor.yy46); } - yymsp[-8].minor.yy256 = yylhsminor.yy256; + case 55: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 51: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy256 = createDropTableClause(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy256); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + case 56: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 52: /* specific_tags_opt ::= */ - case 83: /* tags_def_opt ::= */ yytestcase(yyruleno==83); - case 189: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==189); - case 206: /* group_by_clause_opt ::= */ yytestcase(yyruleno==206); - case 216: /* order_by_clause_opt ::= */ yytestcase(yyruleno==216); -{ yymsp[1].minor.yy46 = NULL; } + case 57: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 53: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy46 = yymsp[-1].minor.yy46; } + case 58: /* type_name ::= INT */ + case 59: /* type_name ::= INTEGER */ yytestcase(yyruleno==59); +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 54: /* full_table_name ::= table_name */ -{ yylhsminor.yy256 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy129, NULL); } - yymsp[0].minor.yy256 = yylhsminor.yy256; + case 60: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 55: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy256 = createRealTableNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, NULL); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 61: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 57: /* column_def_list ::= column_def_list NK_COMMA column_def */ - case 92: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==92); - case 182: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==182); - case 229: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==229); -{ yylhsminor.yy46 = addNodeToList(pCxt, yymsp[-2].minor.yy46, yymsp[0].minor.yy256); } - yymsp[-2].minor.yy46 = yylhsminor.yy46; + case 62: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 58: /* column_def ::= column_name type_name */ -{ yylhsminor.yy256 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy129, yymsp[0].minor.yy70, NULL); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + case 63: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 59: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy256 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-2].minor.yy70, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy256 = yylhsminor.yy256; + case 64: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 60: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 65: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 61: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 66: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 62: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 67: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 63: /* type_name ::= INT */ - case 64: /* type_name ::= INTEGER */ yytestcase(yyruleno==64); -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_INT); } + case 68: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 65: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 69: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy372 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 66: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 70: /* type_name ::= JSON */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 67: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 71: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 68: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy70 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 72: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 69: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 73: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 70: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy70 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 74: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy372 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 71: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy70 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 75: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy372 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 72: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy70 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 76: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy372 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 73: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy70 = createDataType(TSDB_DATA_TYPE_UINT); } + case 77: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy372 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 74: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy70 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 79: /* tags_def_opt ::= tags_def */ + case 191: /* select_list ::= select_sublist */ yytestcase(yyruleno==191); +{ yylhsminor.yy40 = yymsp[0].minor.yy40; } + yymsp[0].minor.yy40 = yylhsminor.yy40; break; - case 75: /* type_name ::= JSON */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_JSON); } + case 80: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ +{ yymsp[-3].minor.yy40 = yymsp[-1].minor.yy40; } break; - case 76: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy70 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 81: /* table_options ::= */ +{ yymsp[1].minor.yy418 = createDefaultTableOptions(pCxt);} break; - case 77: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 82: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy418 = setTableOption(pCxt, yymsp[-2].minor.yy418, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy418 = yylhsminor.yy418; break; - case 78: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 83: /* table_options ::= table_options KEEP NK_INTEGER */ +{ yylhsminor.yy418 = setTableOption(pCxt, yymsp[-2].minor.yy418, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy418 = yylhsminor.yy418; break; - case 79: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy70 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 84: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy418 = setTableOption(pCxt, yymsp[-2].minor.yy418, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy418 = yylhsminor.yy418; break; - case 80: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy70 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 85: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy418 = setTableSmaOption(pCxt, yymsp[-4].minor.yy418, yymsp[-1].minor.yy40); } + yymsp[-4].minor.yy418 = yylhsminor.yy418; break; - case 81: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy70 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 88: /* col_name ::= column_name */ +{ yylhsminor.yy68 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy5); } + yymsp[0].minor.yy68 = yylhsminor.yy68; break; - case 82: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy70 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 89: /* cmd ::= SHOW DNODES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); } break; - case 84: /* tags_def_opt ::= tags_def */ - case 180: /* select_list ::= select_sublist */ yytestcase(yyruleno==180); -{ yylhsminor.yy46 = yymsp[0].minor.yy46; } - yymsp[0].minor.yy46 = yylhsminor.yy46; + case 90: /* cmd ::= SHOW USERS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); } break; - case 85: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy46 = yymsp[-1].minor.yy46; } + case 91: /* cmd ::= SHOW DATABASES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); } break; - case 86: /* table_options ::= */ -{ yymsp[1].minor.yy340 = createDefaultTableOptions(pCxt);} + case 92: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy68, yymsp[0].minor.yy68); } break; - case 87: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy340 = setTableOption(pCxt, yymsp[-2].minor.yy340, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy340 = yylhsminor.yy340; + case 93: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy68, yymsp[0].minor.yy68); } break; - case 88: /* table_options ::= table_options KEEP NK_INTEGER */ -{ yylhsminor.yy340 = setTableOption(pCxt, yymsp[-2].minor.yy340, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy340 = yylhsminor.yy340; + case 94: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy68, NULL); } break; - case 89: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy340 = setTableOption(pCxt, yymsp[-2].minor.yy340, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy340 = yylhsminor.yy340; + case 95: /* cmd ::= SHOW MNODES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); } break; - case 90: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy340 = setTableSmaOption(pCxt, yymsp[-4].minor.yy340, yymsp[-1].minor.yy46); } - yymsp[-4].minor.yy340 = yylhsminor.yy340; + case 96: /* cmd ::= SHOW MODULES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); } break; - case 93: /* col_name ::= column_name */ -{ yylhsminor.yy256 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129); } - yymsp[0].minor.yy256 = yylhsminor.yy256; + case 97: /* cmd ::= SHOW QNODES */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); } break; - case 94: /* cmd ::= SHOW VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } + case 98: /* cmd ::= SHOW FUNCTIONS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); } break; - case 95: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy129); } + case 99: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy68, yymsp[0].minor.yy68); } break; - case 96: /* cmd ::= SHOW MNODES */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); } + case 100: /* cmd ::= SHOW STREAMS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); } break; - case 97: /* cmd ::= query_expression */ -{ pCxt->pRootNode = yymsp[0].minor.yy256; } + case 101: /* db_name_cond_opt ::= */ + case 103: /* like_pattern_opt ::= */ yytestcase(yyruleno==103); + case 106: /* from_db_opt ::= */ yytestcase(yyruleno==106); + case 198: /* where_clause_opt ::= */ yytestcase(yyruleno==198); + case 202: /* twindow_clause_opt ::= */ yytestcase(yyruleno==202); + case 207: /* sliding_opt ::= */ yytestcase(yyruleno==207); + case 209: /* fill_opt ::= */ yytestcase(yyruleno==209); + case 221: /* having_clause_opt ::= */ yytestcase(yyruleno==221); + case 229: /* slimit_clause_opt ::= */ yytestcase(yyruleno==229); + case 233: /* limit_clause_opt ::= */ yytestcase(yyruleno==233); +{ yymsp[1].minor.yy68 = NULL; } break; - case 98: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy256 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy256 = yylhsminor.yy256; + case 102: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy68 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy5); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 99: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy256 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy256 = yylhsminor.yy256; - break; - case 100: /* literal ::= NK_STRING */ -{ yylhsminor.yy256 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy256 = yylhsminor.yy256; - break; - case 101: /* literal ::= NK_BOOL */ -{ yylhsminor.yy256 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy256 = yylhsminor.yy256; - break; - case 102: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; - break; - case 103: /* literal ::= duration_literal */ - case 114: /* expression ::= literal */ yytestcase(yyruleno==114); - case 115: /* expression ::= column_reference */ yytestcase(yyruleno==115); - case 118: /* expression ::= subquery */ yytestcase(yyruleno==118); - case 150: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==150); - case 154: /* boolean_primary ::= predicate */ yytestcase(yyruleno==154); - case 156: /* common_expression ::= expression */ yytestcase(yyruleno==156); - case 157: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==157); - case 159: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==159); - case 161: /* table_reference ::= table_primary */ yytestcase(yyruleno==161); - case 162: /* table_reference ::= joined_table */ yytestcase(yyruleno==162); - case 166: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==166); - case 213: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==213); - case 215: /* query_primary ::= query_specification */ yytestcase(yyruleno==215); -{ yylhsminor.yy256 = yymsp[0].minor.yy256; } - yymsp[0].minor.yy256 = yylhsminor.yy256; - break; - case 104: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy256 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy256 = yylhsminor.yy256; - break; - case 105: /* literal_list ::= literal */ - case 127: /* expression_list ::= expression */ yytestcase(yyruleno==127); -{ yylhsminor.yy46 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy256)); } - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 106: /* literal_list ::= literal_list NK_COMMA literal */ - case 128: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==128); -{ yylhsminor.yy46 = addNodeToList(pCxt, yymsp[-2].minor.yy46, releaseRawExprNode(pCxt, yymsp[0].minor.yy256)); } - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 116: /* expression ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy129, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy129, yymsp[-1].minor.yy46)); } - yymsp[-3].minor.yy256 = yylhsminor.yy256; - break; - case 117: /* expression ::= function_name NK_LP NK_STAR NK_RP */ -{ yylhsminor.yy256 = 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.yy256 = yylhsminor.yy256; - break; - case 119: /* expression ::= NK_LP expression NK_RP */ - case 155: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==155); -{ yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy256)); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; - break; - case 120: /* expression ::= NK_PLUS expression */ + case 104: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy68 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + break; + case 105: /* table_name_cond ::= table_name */ +{ yylhsminor.yy68 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy5); } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 107: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy68 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy5); } + break; + case 108: /* cmd ::= query_expression */ +{ pCxt->pRootNode = yymsp[0].minor.yy68; } + break; + case 109: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 110: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 111: /* literal ::= NK_STRING */ +{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 112: /* literal ::= NK_BOOL */ +{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 113: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; + break; + case 114: /* literal ::= duration_literal */ + case 125: /* expression ::= literal */ yytestcase(yyruleno==125); + case 126: /* expression ::= column_reference */ yytestcase(yyruleno==126); + case 129: /* expression ::= subquery */ yytestcase(yyruleno==129); + case 161: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==161); + case 165: /* boolean_primary ::= predicate */ yytestcase(yyruleno==165); + case 167: /* common_expression ::= expression */ yytestcase(yyruleno==167); + case 168: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==168); + case 170: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==170); + case 172: /* table_reference ::= table_primary */ yytestcase(yyruleno==172); + case 173: /* table_reference ::= joined_table */ yytestcase(yyruleno==173); + case 177: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==177); + case 224: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==224); + case 226: /* query_primary ::= query_specification */ yytestcase(yyruleno==226); +{ yylhsminor.yy68 = yymsp[0].minor.yy68; } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 115: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy68 = yylhsminor.yy68; + break; + case 116: /* literal_list ::= literal */ + case 138: /* expression_list ::= expression */ yytestcase(yyruleno==138); +{ yylhsminor.yy40 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68)); } + yymsp[0].minor.yy40 = yylhsminor.yy40; + break; + case 117: /* literal_list ::= literal_list NK_COMMA literal */ + case 139: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==139); +{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-2].minor.yy40, releaseRawExprNode(pCxt, yymsp[0].minor.yy68)); } + yymsp[-2].minor.yy40 = yylhsminor.yy40; + break; + case 127: /* expression ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy5, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy5, yymsp[-1].minor.yy40)); } + yymsp[-3].minor.yy68 = yylhsminor.yy68; + break; + case 128: /* expression ::= function_name NK_LP NK_STAR NK_RP */ +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy5, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy5, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } + yymsp[-3].minor.yy68 = yylhsminor.yy68; + break; + case 130: /* expression ::= NK_LP expression NK_RP */ + case 166: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==166); +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68)); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; + break; + case 131: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy256)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy68)); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 121: /* expression ::= NK_MINUS expression */ + case 132: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy256), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy68), NULL)); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 122: /* expression ::= expression NK_PLUS expression */ + case 133: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 123: /* expression ::= expression NK_MINUS expression */ + case 134: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 124: /* expression ::= expression NK_STAR expression */ + case 135: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 125: /* expression ::= expression NK_SLASH expression */ + case 136: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 126: /* expression ::= expression NK_REM expression */ + case 137: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 129: /* column_reference ::= column_name */ -{ yylhsminor.yy256 = createRawExprNode(pCxt, &yymsp[0].minor.yy129, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy129)); } - yymsp[0].minor.yy256 = yylhsminor.yy256; + case 140: /* column_reference ::= column_name */ +{ yylhsminor.yy68 = createRawExprNode(pCxt, &yymsp[0].minor.yy5, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy5)); } + yymsp[0].minor.yy68 = yylhsminor.yy68; break; - case 130: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129, createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy129)); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 141: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy5, createColumnNode(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy5)); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 131: /* predicate ::= expression compare_op expression */ - case 136: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==136); + case 142: /* predicate ::= expression compare_op expression */ + case 147: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==147); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy326, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy416, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 132: /* predicate ::= expression BETWEEN expression AND expression */ + case 143: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy256), releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy68), releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-4].minor.yy256 = yylhsminor.yy256; + yymsp[-4].minor.yy68 = yylhsminor.yy68; break; - case 133: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 144: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[-5].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[-5].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-5].minor.yy256 = yylhsminor.yy256; + yymsp[-5].minor.yy68 = yylhsminor.yy68; break; - case 134: /* predicate ::= expression IS NULL */ + case 145: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), NULL)); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 135: /* predicate ::= expression IS NOT NULL */ + case 146: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy256), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy68), NULL)); } - yymsp[-3].minor.yy256 = yylhsminor.yy256; + yymsp[-3].minor.yy68 = yylhsminor.yy68; break; - case 137: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy326 = OP_TYPE_LOWER_THAN; } + case 148: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy416 = OP_TYPE_LOWER_THAN; } break; - case 138: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy326 = OP_TYPE_GREATER_THAN; } + case 149: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy416 = OP_TYPE_GREATER_THAN; } break; - case 139: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy326 = OP_TYPE_LOWER_EQUAL; } + case 150: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy416 = OP_TYPE_LOWER_EQUAL; } break; - case 140: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy326 = OP_TYPE_GREATER_EQUAL; } + case 151: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy416 = OP_TYPE_GREATER_EQUAL; } break; - case 141: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy326 = OP_TYPE_NOT_EQUAL; } + case 152: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy416 = OP_TYPE_NOT_EQUAL; } break; - case 142: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy326 = OP_TYPE_EQUAL; } + case 153: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy416 = OP_TYPE_EQUAL; } break; - case 143: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy326 = OP_TYPE_LIKE; } + case 154: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy416 = OP_TYPE_LIKE; } break; - case 144: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy326 = OP_TYPE_NOT_LIKE; } + case 155: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy416 = OP_TYPE_NOT_LIKE; } break; - case 145: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy326 = OP_TYPE_MATCH; } + case 156: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy416 = OP_TYPE_MATCH; } break; - case 146: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy326 = OP_TYPE_NMATCH; } + case 157: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy416 = OP_TYPE_NMATCH; } break; - case 147: /* in_op ::= IN */ -{ yymsp[0].minor.yy326 = OP_TYPE_IN; } + case 158: /* in_op ::= IN */ +{ yymsp[0].minor.yy416 = OP_TYPE_IN; } break; - case 148: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy326 = OP_TYPE_NOT_IN; } + case 159: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy416 = OP_TYPE_NOT_IN; } break; - case 149: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy46)); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 160: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy40)); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 151: /* boolean_value_expression ::= NOT boolean_primary */ + case 162: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy256), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy68), NULL)); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 152: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 163: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 153: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 164: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy256); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy68); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 158: /* from_clause ::= FROM table_reference_list */ - case 188: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==188); - case 211: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==211); -{ yymsp[-1].minor.yy256 = yymsp[0].minor.yy256; } + case 169: /* from_clause ::= FROM table_reference_list */ + case 199: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==199); + case 222: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==222); +{ yymsp[-1].minor.yy68 = yymsp[0].minor.yy68; } break; - case 160: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy256 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy256, yymsp[0].minor.yy256, NULL); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 171: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy68 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy68, yymsp[0].minor.yy68, NULL); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 163: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy256 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + case 174: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy68 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy5, &yymsp[0].minor.yy5); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 164: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy256 = createRealTableNode(pCxt, &yymsp[-3].minor.yy129, &yymsp[-1].minor.yy129, &yymsp[0].minor.yy129); } - yymsp[-3].minor.yy256 = yylhsminor.yy256; + case 175: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy68 = createRealTableNode(pCxt, &yymsp[-3].minor.yy5, &yymsp[-1].minor.yy5, &yymsp[0].minor.yy5); } + yymsp[-3].minor.yy68 = yylhsminor.yy68; break; - case 165: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy256 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy256), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + case 176: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy68 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68), &yymsp[0].minor.yy5); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 167: /* alias_opt ::= */ -{ yymsp[1].minor.yy129 = nil_token; } + case 178: /* alias_opt ::= */ +{ yymsp[1].minor.yy5 = nil_token; } break; - case 168: /* alias_opt ::= table_alias */ -{ yylhsminor.yy129 = yymsp[0].minor.yy129; } - yymsp[0].minor.yy129 = yylhsminor.yy129; + case 179: /* alias_opt ::= table_alias */ +{ yylhsminor.yy5 = yymsp[0].minor.yy5; } + yymsp[0].minor.yy5 = yylhsminor.yy5; break; - case 169: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy129 = yymsp[0].minor.yy129; } + case 180: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy5 = yymsp[0].minor.yy5; } break; - case 170: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 171: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==171); -{ yymsp[-2].minor.yy256 = yymsp[-1].minor.yy256; } + case 181: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 182: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==182); +{ yymsp[-2].minor.yy68 = yymsp[-1].minor.yy68; } break; - case 172: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy256 = createJoinTableNode(pCxt, yymsp[-4].minor.yy266, yymsp[-5].minor.yy256, yymsp[-2].minor.yy256, yymsp[0].minor.yy256); } - yymsp[-5].minor.yy256 = yylhsminor.yy256; + case 183: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy68 = createJoinTableNode(pCxt, yymsp[-4].minor.yy92, yymsp[-5].minor.yy68, yymsp[-2].minor.yy68, yymsp[0].minor.yy68); } + yymsp[-5].minor.yy68 = yylhsminor.yy68; break; - case 173: /* join_type ::= */ -{ yymsp[1].minor.yy266 = JOIN_TYPE_INNER; } + case 184: /* join_type ::= */ +{ yymsp[1].minor.yy92 = JOIN_TYPE_INNER; } break; - case 174: /* join_type ::= INNER */ -{ yymsp[0].minor.yy266 = JOIN_TYPE_INNER; } + case 185: /* join_type ::= INNER */ +{ yymsp[0].minor.yy92 = JOIN_TYPE_INNER; } break; - case 175: /* 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 186: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-8].minor.yy256 = createSelectStmt(pCxt, yymsp[-7].minor.yy185, yymsp[-6].minor.yy46, yymsp[-5].minor.yy256); - yymsp[-8].minor.yy256 = addWhereClause(pCxt, yymsp[-8].minor.yy256, yymsp[-4].minor.yy256); - yymsp[-8].minor.yy256 = addPartitionByClause(pCxt, yymsp[-8].minor.yy256, yymsp[-3].minor.yy46); - yymsp[-8].minor.yy256 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy256, yymsp[-2].minor.yy256); - yymsp[-8].minor.yy256 = addGroupByClause(pCxt, yymsp[-8].minor.yy256, yymsp[-1].minor.yy46); - yymsp[-8].minor.yy256 = addHavingClause(pCxt, yymsp[-8].minor.yy256, yymsp[0].minor.yy256); + yymsp[-8].minor.yy68 = createSelectStmt(pCxt, yymsp[-7].minor.yy25, yymsp[-6].minor.yy40, yymsp[-5].minor.yy68); + yymsp[-8].minor.yy68 = addWhereClause(pCxt, yymsp[-8].minor.yy68, yymsp[-4].minor.yy68); + yymsp[-8].minor.yy68 = addPartitionByClause(pCxt, yymsp[-8].minor.yy68, yymsp[-3].minor.yy40); + yymsp[-8].minor.yy68 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy68, yymsp[-2].minor.yy68); + yymsp[-8].minor.yy68 = addGroupByClause(pCxt, yymsp[-8].minor.yy68, yymsp[-1].minor.yy40); + yymsp[-8].minor.yy68 = addHavingClause(pCxt, yymsp[-8].minor.yy68, yymsp[0].minor.yy68); } break; - case 177: /* set_quantifier_opt ::= DISTINCT */ -{ yymsp[0].minor.yy185 = true; } + case 188: /* set_quantifier_opt ::= DISTINCT */ +{ yymsp[0].minor.yy25 = true; } break; - case 178: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy185 = false; } + case 189: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy25 = false; } break; - case 179: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy46 = NULL; } + case 190: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy40 = NULL; } break; - case 183: /* select_item ::= common_expression */ + case 194: /* select_item ::= common_expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy256); - yylhsminor.yy256 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy256), &t); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy68); + yylhsminor.yy68 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68), &t); } - yymsp[0].minor.yy256 = yylhsminor.yy256; + yymsp[0].minor.yy68 = yylhsminor.yy68; break; - case 184: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy256 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy256), &yymsp[0].minor.yy129); } - yymsp[-1].minor.yy256 = yylhsminor.yy256; + case 195: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy68 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68), &yymsp[0].minor.yy5); } + yymsp[-1].minor.yy68 = yylhsminor.yy68; break; - case 185: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy256 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), &yymsp[0].minor.yy129); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 196: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy68 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), &yymsp[0].minor.yy5); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 186: /* select_item ::= table_name NK_DOT NK_STAR */ -{ yylhsminor.yy256 = createColumnNode(pCxt, &yymsp[-2].minor.yy129, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 197: /* select_item ::= table_name NK_DOT NK_STAR */ +{ yylhsminor.yy68 = createColumnNode(pCxt, &yymsp[-2].minor.yy5, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 187: /* where_clause_opt ::= */ - case 191: /* twindow_clause_opt ::= */ yytestcase(yyruleno==191); - case 196: /* sliding_opt ::= */ yytestcase(yyruleno==196); - case 198: /* fill_opt ::= */ yytestcase(yyruleno==198); - case 210: /* having_clause_opt ::= */ yytestcase(yyruleno==210); - case 218: /* slimit_clause_opt ::= */ yytestcase(yyruleno==218); - case 222: /* limit_clause_opt ::= */ yytestcase(yyruleno==222); -{ yymsp[1].minor.yy256 = NULL; } + case 201: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 218: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==218); + case 228: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==228); +{ yymsp[-2].minor.yy40 = yymsp[0].minor.yy40; } break; - case 190: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 207: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==207); - case 217: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==217); -{ yymsp[-2].minor.yy46 = yymsp[0].minor.yy46; } + case 203: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy68 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy68), &yymsp[-1].minor.yy0); } break; - case 192: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy256 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy256), &yymsp[-1].minor.yy0); } + case 204: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ +{ yymsp[-3].minor.yy68 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy68)); } break; - case 193: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ -{ yymsp[-3].minor.yy256 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy256)); } + case 205: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy68 = createIntervalWindowNode(pCxt, yymsp[-3].minor.yy68, NULL, yymsp[-1].minor.yy68, yymsp[0].minor.yy68); } break; - case 194: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy256 = createIntervalWindowNode(pCxt, yymsp[-3].minor.yy256, NULL, yymsp[-1].minor.yy256, yymsp[0].minor.yy256); } + case 206: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy68 = createIntervalWindowNode(pCxt, yymsp[-5].minor.yy68, yymsp[-3].minor.yy68, yymsp[-1].minor.yy68, yymsp[0].minor.yy68); } break; - case 195: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy256 = createIntervalWindowNode(pCxt, yymsp[-5].minor.yy256, yymsp[-3].minor.yy256, yymsp[-1].minor.yy256, yymsp[0].minor.yy256); } + case 208: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ +{ yymsp[-3].minor.yy68 = yymsp[-1].minor.yy68; } break; - case 197: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy256 = yymsp[-1].minor.yy256; } + case 210: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy68 = createFillNode(pCxt, yymsp[-1].minor.yy94, NULL); } break; - case 199: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy256 = createFillNode(pCxt, yymsp[-1].minor.yy360, NULL); } + case 211: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy68 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy40)); } break; - case 200: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy256 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy46)); } + case 212: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy94 = FILL_MODE_NONE; } break; - case 201: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy360 = FILL_MODE_NONE; } + case 213: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy94 = FILL_MODE_PREV; } break; - case 202: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy360 = FILL_MODE_PREV; } + case 214: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy94 = FILL_MODE_NULL; } break; - case 203: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy360 = FILL_MODE_NULL; } + case 215: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy94 = FILL_MODE_LINEAR; } break; - case 204: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy360 = FILL_MODE_LINEAR; } + case 216: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy94 = FILL_MODE_NEXT; } break; - case 205: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy360 = FILL_MODE_NEXT; } + case 219: /* group_by_list ::= expression */ +{ yylhsminor.yy40 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } + yymsp[0].minor.yy40 = yylhsminor.yy40; break; - case 208: /* group_by_list ::= expression */ -{ yylhsminor.yy46 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); } - yymsp[0].minor.yy46 = yylhsminor.yy46; + case 220: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy40 = addNodeToList(pCxt, yymsp[-2].minor.yy40, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy68))); } + yymsp[-2].minor.yy40 = yylhsminor.yy40; break; - case 209: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy46 = addNodeToList(pCxt, yymsp[-2].minor.yy46, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy256))); } - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 212: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 223: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy256 = addOrderByClause(pCxt, yymsp[-3].minor.yy256, yymsp[-2].minor.yy46); - yylhsminor.yy256 = addSlimitClause(pCxt, yylhsminor.yy256, yymsp[-1].minor.yy256); - yylhsminor.yy256 = addLimitClause(pCxt, yylhsminor.yy256, yymsp[0].minor.yy256); + yylhsminor.yy68 = addOrderByClause(pCxt, yymsp[-3].minor.yy68, yymsp[-2].minor.yy40); + yylhsminor.yy68 = addSlimitClause(pCxt, yylhsminor.yy68, yymsp[-1].minor.yy68); + yylhsminor.yy68 = addLimitClause(pCxt, yylhsminor.yy68, yymsp[0].minor.yy68); } - yymsp[-3].minor.yy256 = yylhsminor.yy256; + yymsp[-3].minor.yy68 = yylhsminor.yy68; break; - case 214: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy256 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy256, yymsp[0].minor.yy256); } - yymsp[-3].minor.yy256 = yylhsminor.yy256; + case 225: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy68 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy68, yymsp[0].minor.yy68); } + yymsp[-3].minor.yy68 = yylhsminor.yy68; break; - case 219: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 223: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==223); -{ yymsp[-1].minor.yy256 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 230: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 234: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==234); +{ yymsp[-1].minor.yy68 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 220: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 224: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==224); -{ yymsp[-3].minor.yy256 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 231: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 235: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==235); +{ yymsp[-3].minor.yy68 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 221: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 225: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==225); -{ yymsp[-3].minor.yy256 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 232: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 236: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==236); +{ yymsp[-3].minor.yy68 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 226: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy256 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy256); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 237: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy68 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy68); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 227: /* search_condition ::= common_expression */ -{ yylhsminor.yy256 = releaseRawExprNode(pCxt, yymsp[0].minor.yy256); } - yymsp[0].minor.yy256 = yylhsminor.yy256; + case 238: /* search_condition ::= common_expression */ +{ yylhsminor.yy68 = releaseRawExprNode(pCxt, yymsp[0].minor.yy68); } + yymsp[0].minor.yy68 = yylhsminor.yy68; break; - case 230: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy256 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy256), yymsp[-1].minor.yy202, yymsp[0].minor.yy147); } - yymsp[-2].minor.yy256 = yylhsminor.yy256; + case 241: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy68 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy68), yymsp[-1].minor.yy54, yymsp[0].minor.yy53); } + yymsp[-2].minor.yy68 = yylhsminor.yy68; break; - case 231: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy202 = ORDER_ASC; } + case 242: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy54 = ORDER_ASC; } break; - case 232: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy202 = ORDER_ASC; } + case 243: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy54 = ORDER_ASC; } break; - case 233: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy202 = ORDER_DESC; } + case 244: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy54 = ORDER_DESC; } break; - case 234: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy147 = NULL_ORDER_DEFAULT; } + case 245: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy53 = NULL_ORDER_DEFAULT; } break; - case 235: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy147 = NULL_ORDER_FIRST; } + case 246: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy53 = NULL_ORDER_FIRST; } break; - case 236: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy147 = NULL_ORDER_LAST; } + case 247: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy53 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index 3236ad165c..de354b57f0 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -26,6 +26,64 @@ #include "mockCatalog.h" namespace { +void generateInformationSchema(MockCatalogService* mcs) { + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "dnodes", TSDB_NORMAL_TABLE, 1).addColumn("id", TSDB_DATA_TYPE_INT); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "mnodes", TSDB_NORMAL_TABLE, 1).addColumn("id", TSDB_DATA_TYPE_INT); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "modules", TSDB_NORMAL_TABLE, 1).addColumn("id", TSDB_DATA_TYPE_INT); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "qnodes", TSDB_NORMAL_TABLE, 1).addColumn("id", TSDB_DATA_TYPE_INT); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_databases", TSDB_NORMAL_TABLE, 1).addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_functions", TSDB_NORMAL_TABLE, 1).addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_FUNC_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_indexes", TSDB_NORMAL_TABLE, 2) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN).addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_stables", TSDB_NORMAL_TABLE, 2) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN).addColumn("stable_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_streams", TSDB_NORMAL_TABLE, 1).addColumn("stream_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_tables", TSDB_NORMAL_TABLE, 2) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN).addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_table_distributed", TSDB_NORMAL_TABLE, 1).addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "user_users", TSDB_NORMAL_TABLE, 1).addColumn("user_name", TSDB_DATA_TYPE_BINARY, TSDB_USER_LEN); + builder.done(); + } + { + ITableBuilder& builder = mcs->createTableBuilder("information_schema", "vgroups", TSDB_NORMAL_TABLE, 1).addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); + builder.done(); + } +} + void generateTestT1(MockCatalogService* mcs) { ITableBuilder& builder = mcs->createTableBuilder("test", "t1", TSDB_NORMAL_TABLE, 6) .setPrecision(TSDB_TIME_PRECISION_MILLI).setVgid(1).addColumn("ts", TSDB_DATA_TYPE_TIMESTAMP) @@ -74,6 +132,7 @@ void initMetaDataEnv() { stub.set(catalogGetTableMeta, __catalogGetTableMeta); stub.set(catalogGetTableHashVgroup, __catalogGetTableHashVgroup); stub.set(catalogGetTableDistVgInfo, __catalogGetTableDistVgInfo); + stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion); // { // AddrAny any("libcatalog.so"); // std::map result; @@ -117,6 +176,7 @@ void initMetaDataEnv() { } void generateMetaData() { + generateInformationSchema(mockCatalogService.get()); generateTestT1(mockCatalogService.get()); generateTestST1(mockCatalogService.get()); mockCatalogService->showTables(); diff --git a/source/libs/parser/test/parserAstTest.cpp b/source/libs/parser/test/parserAstTest.cpp index f9a2bafe10..732e8ec0a7 100644 --- a/source/libs/parser/test/parserAstTest.cpp +++ b/source/libs/parser/test/parserAstTest.cpp @@ -295,6 +295,13 @@ TEST_F(ParserTest, createUser) { ASSERT_TRUE(run()); } +TEST_F(ParserTest, showUsers) { + setDatabase("root", "test"); + + bind("show users"); + ASSERT_TRUE(run()); +} + TEST_F(ParserTest, createDnode) { setDatabase("root", "test"); @@ -305,6 +312,13 @@ TEST_F(ParserTest, createDnode) { ASSERT_TRUE(run()); } +TEST_F(ParserTest, showDnodes) { + setDatabase("root", "test"); + + bind("show dnodes"); + ASSERT_TRUE(run()); +} + TEST_F(ParserTest, createDatabase) { setDatabase("root", "test"); @@ -333,7 +347,7 @@ TEST_F(ParserTest, createDatabase) { ASSERT_TRUE(run()); } -TEST_F(ParserTest, showDatabase) { +TEST_F(ParserTest, showDatabases) { setDatabase("root", "test"); bind("show databases"); @@ -391,3 +405,90 @@ TEST_F(ParserTest, createTable) { ); ASSERT_TRUE(run()); } + +TEST_F(ParserTest, showTables) { + setDatabase("root", "test"); + + // bind("show tables"); + // ASSERT_TRUE(run()); + + // bind("show test.tables"); + // ASSERT_TRUE(run()); + + bind("show tables like 'c%'"); + ASSERT_TRUE(run()); + + bind("show test.tables like 'c%'"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showStables) { + setDatabase("root", "test"); + + bind("show stables"); + ASSERT_TRUE(run()); + + bind("show test.stables"); + ASSERT_TRUE(run()); + + bind("show stables like 'c%'"); + ASSERT_TRUE(run()); + + bind("show test.stables like 'c%'"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showVgroups) { + setDatabase("root", "test"); + + bind("show vgroups"); + ASSERT_TRUE(run()); + + bind("show test.vgroups"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showMnodes) { + setDatabase("root", "test"); + + bind("show mnodes"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showModules) { + setDatabase("root", "test"); + + bind("show modules"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showQnodes) { + setDatabase("root", "test"); + + bind("show qnodes"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showFunctions) { + setDatabase("root", "test"); + + bind("show functions"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showIndexes) { + setDatabase("root", "test"); + + bind("show indexes from t1"); + ASSERT_TRUE(run()); + + bind("show indexes from t1 from test"); + ASSERT_TRUE(run()); +} + +TEST_F(ParserTest, showStreams) { + setDatabase("root", "test"); + + bind("show streams"); + ASSERT_TRUE(run()); +} diff --git a/source/libs/parser/test/parserInsertTest.cpp b/source/libs/parser/test/parserInsertTest.cpp index 3d4a6e0eb8..cf40464d2b 100644 --- a/source/libs/parser/test/parserInsertTest.cpp +++ b/source/libs/parser/test/parserInsertTest.cpp @@ -131,7 +131,7 @@ private: TEST_F(InsertTest, singleTableSingleRowTest) { setDatabase("root", "test"); - bind("insert into t1 values (now, 1, \"beijing\")"); + bind("insert into t1 values (now, 1, 'beijing', 3, 4, 5)"); ASSERT_EQ(run(), TSDB_CODE_SUCCESS); dumpReslut(); checkReslut(1, 1); @@ -141,7 +141,7 @@ TEST_F(InsertTest, singleTableSingleRowTest) { TEST_F(InsertTest, singleTableMultiRowTest) { setDatabase("root", "test"); - bind("insert into t1 values (now, 1, \"beijing\")(now+1s, 2, \"shanghai\")(now+2s, 3, \"guangzhou\")"); + bind("insert into t1 values (now, 1, 'beijing', 3, 4, 5)(now+1s, 2, 'shanghai', 6, 7, 8)(now+2s, 3, 'guangzhou', 9, 10, 11)"); ASSERT_EQ(run(), TSDB_CODE_SUCCESS); dumpReslut(); checkReslut(1, 3);