diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index d255abe602d984a723d033f57241c7ffdae0e8e2..4e9e5a865473ab34f5a9e1e25db98c09e2727040 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5142,6 +5142,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { const char* msg18 = "primary timestamp column cannot be dropped"; const char* msg19 = "invalid new tag name"; const char* msg20 = "table is not super table"; + const char* msg21 = "only binary/nchar column length could be modified"; + const char* msg22 = "new column length should be bigger than old one"; + const char* msg23 = "only column length coulbe be modified"; + const char* msg24 = "invalid binary/nchar column length"; int32_t code = TSDB_CODE_SUCCESS; @@ -5172,13 +5176,13 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } if (pAlterSQL->type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_DROP_TAG_COLUMN || - pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN) { - if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) { + pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) { + if (!UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3); } } else if ((pAlterSQL->type == TSDB_ALTER_TABLE_UPDATE_TAG_VAL) && (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo))) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4); - } else if ((pAlterSQL->type == TSDB_ALTER_TABLE_ADD_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_DROP_COLUMN) && + } else if ((pAlterSQL->type == TSDB_ALTER_TABLE_ADD_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_DROP_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) && UTIL_TABLE_IS_CHILD_TABLE(pTableMetaInfo)) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); } @@ -5394,6 +5398,85 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { tstrncpy(name1, pItem->pVar.pz, sizeof(name1)); TAOS_FIELD f = tscCreateField(TSDB_DATA_TYPE_INT, name1, tDataTypes[TSDB_DATA_TYPE_INT].bytes); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); + } else if (pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) { + if (taosArrayGetSize(pAlterSQL->pAddColumns) >= 2) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg16); + } + + + TAOS_FIELD* pItem = taosArrayGet(pAlterSQL->pAddColumns, 0); + if (pItem->type != TSDB_DATA_TYPE_BINARY && pItem->type != TSDB_DATA_TYPE_NCHAR) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg21); + } + + SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; + SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)}; + if (getColumnIndexByName(pCmd, &name, pQueryInfo, &columnIndex) != TSDB_CODE_SUCCESS) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg17); + } + + SSchema* pColSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, columnIndex.columnIndex); + + if (pColSchema->type != TSDB_DATA_TYPE_BINARY && pColSchema->type != TSDB_DATA_TYPE_NCHAR) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg21); + } + + if (pItem->type != pColSchema->type) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg23); + } + + if ((pItem->type == TSDB_DATA_TYPE_BINARY && (pItem->bytes <= 0 || pItem->bytes > TSDB_MAX_BINARY_LEN)) || + (pItem->type == TSDB_DATA_TYPE_NCHAR && (pItem->bytes <= 0 || pItem->bytes > TSDB_MAX_NCHAR_LEN))) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg24); + } + + if (pItem->bytes <= pColSchema->bytes) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg22); + } + + TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes); + tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); + }else if (pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) { + if (taosArrayGetSize(pAlterSQL->pAddColumns) >= 2) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg16); + } + + TAOS_FIELD* pItem = taosArrayGet(pAlterSQL->pAddColumns, 0); + if (pItem->type != TSDB_DATA_TYPE_BINARY && pItem->type != TSDB_DATA_TYPE_NCHAR) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg21); + } + + SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; + SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = (uint32_t)strlen(pItem->name)}; + if (getColumnIndexByName(pCmd, &name, pQueryInfo, &columnIndex) != TSDB_CODE_SUCCESS) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg17); + } + + SSchema* pColSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, columnIndex.columnIndex); + + if (columnIndex.columnIndex < tscGetNumOfColumns(pTableMetaInfo->pTableMeta)) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg10); + } + + if (pColSchema->type != TSDB_DATA_TYPE_BINARY && pColSchema->type != TSDB_DATA_TYPE_NCHAR) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg21); + } + + if (pItem->type != pColSchema->type) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg23); + } + + if ((pItem->type == TSDB_DATA_TYPE_BINARY && (pItem->bytes <= 0 || pItem->bytes > TSDB_MAX_BINARY_LEN)) || + (pItem->type == TSDB_DATA_TYPE_NCHAR && (pItem->bytes <= 0 || pItem->bytes > TSDB_MAX_NCHAR_LEN))) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg24); + } + + if (pItem->bytes <= pColSchema->bytes) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg22); + } + + TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes); + tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); } return TSDB_CODE_SUCCESS; diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 0d8f555670f642ee580d02a435462c689287230e..15b1da1dd31ea7df4a7772515e1dc8812aaddadb 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -161,6 +161,7 @@ enum _mgmt_table { #define TSDB_ALTER_TABLE_ADD_COLUMN 5 #define TSDB_ALTER_TABLE_DROP_COLUMN 6 #define TSDB_ALTER_TABLE_CHANGE_COLUMN 7 +#define TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN 8 #define TSDB_FILL_NONE 0 #define TSDB_FILL_NULL 1 diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index e9585636fd97bd4bcb856317689aed615d275026..c7d630891b59e88af1360af67542dbe5ca601418 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -156,54 +156,62 @@ #define TK_SYNCDB 137 #define TK_ADD 138 #define TK_COLUMN 139 -#define TK_TAG 140 -#define TK_CHANGE 141 -#define TK_SET 142 -#define TK_KILL 143 -#define TK_CONNECTION 144 -#define TK_STREAM 145 -#define TK_COLON 146 -#define TK_ABORT 147 -#define TK_AFTER 148 -#define TK_ATTACH 149 -#define TK_BEFORE 150 -#define TK_BEGIN 151 -#define TK_CASCADE 152 -#define TK_CLUSTER 153 -#define TK_CONFLICT 154 -#define TK_COPY 155 -#define TK_DEFERRED 156 -#define TK_DELIMITERS 157 -#define TK_DETACH 158 -#define TK_EACH 159 -#define TK_END 160 -#define TK_EXPLAIN 161 -#define TK_FAIL 162 -#define TK_FOR 163 -#define TK_IGNORE 164 -#define TK_IMMEDIATE 165 -#define TK_INITIALLY 166 -#define TK_INSTEAD 167 -#define TK_MATCH 168 -#define TK_KEY 169 -#define TK_OF 170 -#define TK_RAISE 171 -#define TK_REPLACE 172 -#define TK_RESTRICT 173 -#define TK_ROW 174 -#define TK_STATEMENT 175 -#define TK_TRIGGER 176 -#define TK_VIEW 177 -#define TK_SEMI 178 -#define TK_NONE 179 -#define TK_PREV 180 -#define TK_LINEAR 181 -#define TK_IMPORT 182 -#define TK_TBNAME 183 -#define TK_JOIN 184 -#define TK_INSERT 185 -#define TK_INTO 186 -#define TK_VALUES 187 +#define TK_MODIFY 140 +#define TK_TAG 141 +#define TK_CHANGE 142 +#define TK_SET 143 +#define TK_KILL 144 +#define TK_CONNECTION 145 +#define TK_STREAM 146 +#define TK_COLON 147 +#define TK_ABORT 148 +#define TK_AFTER 149 +#define TK_ATTACH 150 +#define TK_BEFORE 151 +#define TK_BEGIN 152 +#define TK_CASCADE 153 +#define TK_CLUSTER 154 +#define TK_CONFLICT 155 +#define TK_COPY 156 +#define TK_DEFERRED 157 +#define TK_DELIMITERS 158 +#define TK_DETACH 159 +#define TK_EACH 160 +#define TK_END 161 +#define TK_EXPLAIN 162 +#define TK_FAIL 163 +#define TK_FOR 164 +#define TK_IGNORE 165 +#define TK_IMMEDIATE 166 +#define TK_INITIALLY 167 +#define TK_INSTEAD 168 +#define TK_MATCH 169 +#define TK_KEY 170 +#define TK_OF 171 +#define TK_RAISE 172 +#define TK_REPLACE 173 +#define TK_RESTRICT 174 +#define TK_ROW 175 +#define TK_STATEMENT 176 +#define TK_TRIGGER 177 +#define TK_VIEW 178 +#define TK_SEMI 179 +#define TK_NONE 180 +#define TK_PREV 181 +#define TK_LINEAR 182 +#define TK_IMPORT 183 +#define TK_TBNAME 184 +#define TK_JOIN 185 +#define TK_INSERT 186 +#define TK_INTO 187 +#define TK_VALUES 188 + + + + + + + #define TK_SPACE 300 #define TK_COMMENT 301 diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 5710601e5c057282637bd6c67ac5d7b1e41d7341..5b699c5e2454f2039681fe198103ddcc606b8913 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -3214,7 +3214,15 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) { } else if (pAlter->type == TSDB_ALTER_TABLE_DROP_COLUMN) { code = mnodeDropSuperTableColumn(pMsg, pAlter->schema[0].name); } else if (pAlter->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) { - code = mnodeChangeSuperTableColumn(pMsg, pAlter->schema[0].name, pAlter->schema[1].name); + //code = mnodeChangeSuperTableColumn(pMsg, pAlter->schema[0].name, pAlter->schema[1].name); + (void)mnodeChangeSuperTableColumn; + mError("change table[%s] column[%s] length to [%d] is not processed", pAlter->tableFname, pAlter->schema[0].name, pAlter->schema[0].bytes); + code = TSDB_CODE_SUCCESS; + } else if (pAlter->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) { + //code = mnodeChangeSuperTableColumn(pMsg, pAlter->schema[0].name, pAlter->schema[1].name); + (void)mnodeChangeSuperTableColumn; + mError("change table[%s] tag[%s] length to [%d] is not processed", pAlter->tableFname, pAlter->schema[0].name, pAlter->schema[0].bytes); + code = TSDB_CODE_SUCCESS; } else { } } else { @@ -3226,7 +3234,10 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) { } else if (pAlter->type == TSDB_ALTER_TABLE_DROP_COLUMN) { code = mnodeDropNormalTableColumn(pMsg, pAlter->schema[0].name); } else if (pAlter->type == TSDB_ALTER_TABLE_CHANGE_COLUMN) { - code = mnodeChangeNormalTableColumn(pMsg, pAlter->schema[0].name, pAlter->schema[1].name); + //code = mnodeChangeNormalTableColumn(pMsg, pAlter->schema[0].name, pAlter->schema[1].name); + (void)mnodeChangeNormalTableColumn; + mError("change table[%s] column[%s] length to [%d] is not processed", pAlter->tableFname, pAlter->schema[0].name, pAlter->schema[0].bytes); + code = TSDB_CODE_SUCCESS; } else { } } @@ -3417,4 +3428,4 @@ int32_t mnodeCompactTables() { mnodeCompactChildTables(); return 0; -} \ No newline at end of file +} diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index ba16eef763adc48b0492aedbaa825b23c3a74e0a..01eaf3bbb6e7996a9eabc8fee0c81bdc6f4c231e 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -759,6 +759,12 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) DROP COLUMN ids(A). { setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } +cmd ::= ALTER TABLE ids(X) cpxName(F) MODIFY COLUMN columnlist(A). { + X.n += F.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, A, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + //////////////////////////////////ALTER TAGS statement///////////////////////////////////// cmd ::= ALTER TABLE ids(X) cpxName(Y) ADD TAG columnlist(A). { X.n += Y.n; @@ -799,6 +805,11 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). { setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } +cmd ::= ALTER TABLE ids(X) cpxName(F) MODIFY TAG columnlist(A). { + X.n += F.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, A, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} ///////////////////////////////////ALTER STABLE statement////////////////////////////////// cmd ::= ALTER STABLE ids(X) cpxName(F) ADD COLUMN columnlist(A). { @@ -817,6 +828,12 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) DROP COLUMN ids(A). { setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } +cmd ::= ALTER STABLE ids(X) cpxName(F) MODIFY COLUMN columnlist(A). { + X.n += F.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, A, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + //////////////////////////////////ALTER TAGS statement///////////////////////////////////// cmd ::= ALTER STABLE ids(X) cpxName(Y) ADD TAG columnlist(A). { X.n += Y.n; @@ -846,6 +863,23 @@ cmd ::= ALTER STABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). { setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } +cmd ::= ALTER STABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). { + X.n += F.n; + + toTSDBType(Y.type); + SArray* A = tVariantListAppendToken(NULL, &Y, -1); + A = tVariantListAppend(A, &Z, -1); + + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + +cmd ::= ALTER STABLE ids(X) cpxName(F) MODIFY TAG columnlist(A). { + X.n += F.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, A, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + ////////////////////////////////////////kill statement/////////////////////////////////////// cmd ::= KILL CONNECTION INTEGER(Y). {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &Y);} cmd ::= KILL STREAM INTEGER(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &X);} diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index efe35ba72b51a4bbc7c2b838eced738de3eedd6f..2cf3463d6009f47802e89f0651257d6f6f803376 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -893,7 +893,7 @@ SAlterTableInfo *tSetAlterTableInfo(SStrToken *pTableName, SArray *pCols, SArray pAlterTable->type = type; pAlterTable->tableType = tableType; - if (type == TSDB_ALTER_TABLE_ADD_COLUMN || type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN) { + if (type == TSDB_ALTER_TABLE_ADD_COLUMN || type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN || type == TSDB_ALTER_TABLE_CHANGE_COLUMN || type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) { pAlterTable->pAddColumns = pCols; assert(pVals == NULL); } else { diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 55a6833cc1238a2a17f2c621c292b9b1b1322b29..0d11153e8e0ca70e2a58be3ae5724dd4facaf241 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -23,6 +23,7 @@ ** input grammar file: */ #include +#include /************ Begin %include sections from the grammar ************************/ #include @@ -76,8 +77,10 @@ ** zero the stack is dynamically sized using realloc() ** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_PDECL A parameter declaration for the %extra_argument +** ParseARG_PARAM Code to pass %extra_argument as a subroutine parameter ** ParseARG_STORE Code to store %extra_argument into yypParser ** ParseARG_FETCH Code to extract %extra_argument from yypParser +** ParseCTX_* As ParseARG_ except for %extra_context ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. ** YYNSTATE the combined number of states. @@ -97,7 +100,7 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 267 +#define YYNOCODE 266 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { @@ -125,21 +128,29 @@ typedef union { #endif #define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_PDECL ,SSqlInfo* pInfo -#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo -#define ParseARG_STORE yypParser->pInfo = pInfo +#define ParseARG_PARAM ,pInfo +#define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo; +#define ParseARG_STORE yypParser->pInfo=pInfo; +#define ParseCTX_SDECL +#define ParseCTX_PDECL +#define ParseCTX_PARAM +#define ParseCTX_FETCH +#define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 327 -#define YYNRULE 275 -#define YYNTOKEN 188 -#define YY_MAX_SHIFT 326 -#define YY_MIN_SHIFTREDUCE 523 -#define YY_MAX_SHIFTREDUCE 797 -#define YY_ERROR_ACTION 798 -#define YY_ACCEPT_ACTION 799 -#define YY_NO_ACTION 800 -#define YY_MIN_REDUCE 801 -#define YY_MAX_REDUCE 1075 +#define YYNSTATE 341 +#define YYNRULE 280 +#define YYNRULE_WITH_ACTION 280 +#define YYNTOKEN 189 +#define YY_MAX_SHIFT 340 +#define YY_MIN_SHIFTREDUCE 538 +#define YY_MAX_SHIFTREDUCE 817 +#define YY_ERROR_ACTION 818 +#define YY_ACCEPT_ACTION 819 +#define YY_NO_ACTION 820 +#define YY_MIN_REDUCE 821 +#define YY_MAX_REDUCE 1100 /************* End control #defines *******************************************/ +#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) /* Define the yytestcase() macro to be a no-op if is not already defined ** otherwise. @@ -204,78 +215,81 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (700) +#define YY_ACTTAB_COUNT (722) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 969, 571, 211, 324, 934, 18, 217, 186, 188, 572, - /* 10 */ 799, 326, 192, 48, 49, 145, 52, 53, 220, 1057, - /* 20 */ 223, 42, 275, 51, 274, 56, 54, 58, 55, 1053, - /* 30 */ 650, 188, 948, 47, 46, 188, 228, 45, 44, 43, - /* 40 */ 48, 49, 1056, 52, 53, 219, 1057, 223, 42, 571, - /* 50 */ 51, 274, 56, 54, 58, 55, 960, 572, 300, 299, - /* 60 */ 47, 46, 948, 966, 45, 44, 43, 49, 31, 52, - /* 70 */ 53, 138, 250, 223, 42, 1067, 51, 274, 56, 54, - /* 80 */ 58, 55, 271, 290, 82, 1052, 47, 46, 89, 234, - /* 90 */ 45, 44, 43, 524, 525, 526, 527, 528, 529, 530, - /* 100 */ 531, 532, 533, 534, 535, 536, 325, 571, 290, 212, - /* 110 */ 71, 571, 944, 48, 49, 572, 52, 53, 760, 572, - /* 120 */ 223, 42, 936, 51, 274, 56, 54, 58, 55, 45, - /* 130 */ 44, 43, 741, 47, 46, 257, 256, 45, 44, 43, - /* 140 */ 48, 50, 145, 52, 53, 1, 160, 223, 42, 145, - /* 150 */ 51, 274, 56, 54, 58, 55, 323, 322, 130, 236, - /* 160 */ 47, 46, 297, 296, 45, 44, 43, 24, 288, 319, - /* 170 */ 318, 287, 286, 285, 317, 284, 316, 315, 314, 283, - /* 180 */ 313, 312, 908, 31, 896, 897, 898, 899, 900, 901, - /* 190 */ 902, 903, 904, 905, 906, 907, 909, 910, 52, 53, - /* 200 */ 847, 960, 223, 42, 172, 51, 274, 56, 54, 58, - /* 210 */ 55, 1005, 19, 86, 25, 47, 46, 214, 83, 45, - /* 220 */ 44, 43, 222, 756, 213, 310, 745, 945, 748, 197, - /* 230 */ 751, 222, 756, 230, 13, 745, 198, 748, 88, 751, - /* 240 */ 85, 122, 121, 196, 931, 932, 30, 935, 56, 54, - /* 250 */ 58, 55, 3, 173, 207, 208, 47, 46, 273, 948, - /* 260 */ 45, 44, 43, 207, 208, 242, 232, 747, 24, 750, - /* 270 */ 319, 318, 77, 246, 245, 317, 689, 316, 315, 314, - /* 280 */ 37, 313, 312, 62, 916, 47, 46, 914, 915, 45, - /* 290 */ 44, 43, 917, 942, 919, 920, 918, 145, 921, 922, - /* 300 */ 107, 101, 112, 249, 31, 69, 63, 111, 117, 120, - /* 310 */ 110, 204, 674, 109, 235, 671, 114, 672, 310, 673, - /* 320 */ 5, 34, 162, 1051, 70, 57, 31, 161, 96, 91, - /* 330 */ 95, 31, 757, 31, 57, 229, 233, 31, 753, 292, - /* 340 */ 746, 757, 749, 237, 238, 226, 31, 753, 945, 946, - /* 350 */ 180, 178, 176, 205, 693, 752, 933, 175, 125, 124, - /* 360 */ 123, 136, 134, 133, 752, 77, 1006, 227, 269, 320, - /* 370 */ 945, 84, 293, 37, 294, 945, 856, 945, 298, 754, - /* 380 */ 172, 945, 848, 960, 686, 72, 172, 302, 722, 723, - /* 390 */ 945, 8, 251, 743, 74, 948, 32, 75, 221, 215, - /* 400 */ 705, 206, 253, 713, 140, 253, 714, 61, 777, 758, - /* 410 */ 21, 65, 20, 20, 660, 678, 277, 679, 32, 662, - /* 420 */ 32, 675, 279, 61, 661, 190, 87, 29, 61, 744, - /* 430 */ 280, 191, 66, 100, 99, 15, 14, 119, 118, 106, - /* 440 */ 105, 68, 6, 649, 17, 16, 676, 193, 677, 187, - /* 450 */ 194, 195, 755, 201, 202, 200, 185, 199, 189, 947, - /* 460 */ 1016, 1015, 224, 1012, 1011, 247, 137, 40, 225, 301, - /* 470 */ 968, 979, 976, 977, 981, 139, 143, 961, 254, 998, - /* 480 */ 997, 943, 263, 156, 135, 157, 704, 258, 311, 941, - /* 490 */ 912, 306, 108, 303, 155, 150, 148, 958, 158, 159, - /* 500 */ 859, 67, 146, 216, 282, 38, 260, 183, 35, 267, - /* 510 */ 291, 64, 855, 1072, 97, 59, 1071, 1069, 163, 295, - /* 520 */ 1066, 103, 1065, 1063, 164, 877, 36, 272, 33, 270, - /* 530 */ 268, 39, 184, 844, 113, 842, 115, 116, 840, 839, - /* 540 */ 239, 174, 837, 836, 835, 834, 833, 832, 177, 179, - /* 550 */ 829, 827, 825, 266, 823, 181, 820, 182, 264, 252, - /* 560 */ 73, 78, 262, 261, 999, 259, 41, 304, 305, 307, - /* 570 */ 209, 231, 308, 309, 281, 321, 797, 240, 241, 210, - /* 580 */ 796, 92, 93, 203, 244, 243, 795, 783, 782, 838, - /* 590 */ 248, 253, 681, 276, 126, 171, 166, 878, 167, 165, - /* 600 */ 168, 169, 831, 170, 9, 127, 128, 830, 76, 129, - /* 610 */ 822, 821, 2, 26, 4, 255, 79, 706, 153, 151, - /* 620 */ 149, 147, 152, 154, 141, 924, 709, 142, 80, 218, - /* 630 */ 711, 81, 265, 761, 715, 144, 90, 10, 11, 27, - /* 640 */ 759, 28, 7, 12, 22, 88, 23, 613, 278, 609, - /* 650 */ 607, 606, 605, 602, 575, 289, 94, 32, 60, 98, - /* 660 */ 652, 651, 648, 102, 597, 595, 104, 587, 593, 589, - /* 670 */ 591, 585, 583, 616, 615, 614, 612, 611, 610, 608, - /* 680 */ 604, 603, 573, 540, 538, 61, 801, 800, 800, 800, - /* 690 */ 800, 800, 800, 800, 800, 800, 800, 800, 131, 132, + /* 0 */ 989, 586, 217, 338, 954, 22, 223, 192, 194, 587, + /* 10 */ 819, 340, 198, 52, 53, 151, 56, 57, 226, 1077, + /* 20 */ 229, 46, 283, 55, 282, 60, 58, 62, 59, 1073, + /* 30 */ 665, 194, 968, 51, 50, 194, 234, 49, 48, 47, + /* 40 */ 52, 53, 1076, 56, 57, 225, 1077, 229, 46, 586, + /* 50 */ 55, 282, 60, 58, 62, 59, 980, 587, 314, 313, + /* 60 */ 51, 50, 968, 986, 49, 48, 47, 53, 35, 56, + /* 70 */ 57, 144, 258, 229, 46, 75, 55, 282, 60, 58, + /* 80 */ 62, 59, 279, 298, 87, 867, 51, 50, 94, 178, + /* 90 */ 49, 48, 47, 539, 540, 541, 542, 543, 544, 545, + /* 100 */ 546, 547, 548, 549, 550, 551, 339, 953, 298, 218, + /* 110 */ 76, 586, 964, 52, 53, 35, 56, 57, 775, 587, + /* 120 */ 229, 46, 956, 55, 282, 60, 58, 62, 59, 49, + /* 130 */ 48, 47, 756, 51, 50, 265, 264, 49, 48, 47, + /* 140 */ 52, 54, 980, 56, 57, 324, 980, 229, 46, 586, + /* 150 */ 55, 282, 60, 58, 62, 59, 219, 587, 220, 965, + /* 160 */ 51, 50, 221, 1072, 49, 48, 47, 28, 296, 333, + /* 170 */ 332, 295, 294, 293, 331, 292, 330, 329, 328, 291, + /* 180 */ 327, 326, 928, 35, 916, 917, 918, 919, 920, 921, + /* 190 */ 922, 923, 924, 925, 926, 927, 929, 930, 56, 57, + /* 200 */ 876, 1071, 229, 46, 178, 55, 282, 60, 58, 62, + /* 210 */ 59, 962, 23, 91, 29, 51, 50, 1, 166, 49, + /* 220 */ 48, 47, 228, 771, 232, 79, 760, 965, 763, 203, + /* 230 */ 766, 228, 771, 261, 13, 760, 204, 763, 93, 766, + /* 240 */ 90, 128, 127, 202, 951, 952, 34, 955, 60, 58, + /* 250 */ 62, 59, 89, 235, 214, 215, 51, 50, 281, 151, + /* 260 */ 49, 48, 47, 214, 215, 762, 77, 765, 28, 1096, + /* 270 */ 333, 332, 82, 35, 35, 331, 701, 330, 329, 328, + /* 280 */ 41, 327, 326, 8, 936, 51, 50, 934, 935, 49, + /* 290 */ 48, 47, 937, 868, 939, 940, 938, 178, 941, 942, + /* 300 */ 113, 107, 118, 257, 239, 74, 704, 117, 123, 126, + /* 310 */ 116, 242, 211, 35, 233, 303, 120, 965, 965, 689, + /* 320 */ 212, 761, 686, 764, 687, 61, 688, 213, 1026, 35, + /* 330 */ 277, 35, 772, 1036, 61, 5, 38, 168, 768, 151, + /* 340 */ 196, 772, 167, 101, 96, 100, 35, 768, 35, 151, + /* 350 */ 245, 246, 35, 35, 304, 767, 236, 965, 186, 184, + /* 360 */ 182, 142, 140, 139, 767, 181, 131, 130, 129, 334, + /* 370 */ 305, 243, 306, 965, 240, 965, 238, 769, 302, 301, + /* 380 */ 82, 244, 968, 241, 708, 309, 308, 310, 41, 311, + /* 390 */ 965, 250, 965, 312, 316, 968, 965, 965, 3, 179, + /* 400 */ 254, 253, 337, 336, 136, 115, 966, 80, 1025, 259, + /* 410 */ 324, 737, 738, 36, 758, 261, 720, 728, 88, 729, + /* 420 */ 146, 66, 227, 25, 67, 792, 197, 773, 690, 24, + /* 430 */ 675, 24, 70, 770, 36, 285, 677, 287, 676, 36, + /* 440 */ 66, 92, 66, 33, 125, 124, 288, 68, 199, 15, + /* 450 */ 759, 14, 106, 71, 105, 193, 200, 17, 19, 16, + /* 460 */ 18, 201, 73, 112, 664, 111, 6, 207, 693, 691, + /* 470 */ 694, 692, 208, 206, 21, 1035, 20, 1088, 191, 205, + /* 480 */ 195, 967, 230, 255, 1032, 1031, 231, 315, 44, 143, + /* 490 */ 988, 1018, 999, 996, 1017, 997, 981, 262, 1001, 145, + /* 500 */ 149, 271, 162, 963, 141, 114, 266, 222, 719, 268, + /* 510 */ 158, 275, 154, 163, 978, 152, 155, 276, 961, 164, + /* 520 */ 165, 280, 153, 72, 156, 63, 879, 69, 290, 278, + /* 530 */ 42, 274, 189, 39, 299, 875, 300, 1095, 103, 1094, + /* 540 */ 1091, 169, 307, 1087, 109, 1086, 1083, 170, 897, 40, + /* 550 */ 272, 37, 43, 190, 270, 864, 119, 862, 121, 122, + /* 560 */ 267, 860, 859, 247, 180, 857, 856, 855, 854, 853, + /* 570 */ 852, 183, 185, 849, 847, 845, 843, 187, 840, 188, + /* 580 */ 45, 260, 78, 83, 325, 269, 1019, 317, 318, 319, + /* 590 */ 320, 321, 322, 323, 335, 817, 248, 216, 237, 289, + /* 600 */ 249, 816, 251, 252, 209, 210, 97, 98, 815, 798, + /* 610 */ 797, 256, 261, 263, 858, 696, 284, 9, 132, 851, + /* 620 */ 173, 133, 172, 898, 171, 174, 175, 177, 176, 4, + /* 630 */ 134, 850, 842, 932, 135, 30, 841, 81, 84, 721, + /* 640 */ 2, 161, 159, 157, 160, 147, 944, 724, 148, 85, + /* 650 */ 224, 726, 86, 273, 10, 730, 150, 11, 776, 774, + /* 660 */ 31, 7, 32, 12, 26, 286, 27, 95, 628, 93, + /* 670 */ 624, 622, 621, 620, 617, 297, 99, 590, 64, 36, + /* 680 */ 65, 102, 667, 666, 104, 108, 663, 612, 610, 602, + /* 690 */ 608, 604, 606, 600, 598, 631, 110, 630, 629, 627, + /* 700 */ 626, 625, 623, 619, 618, 588, 555, 553, 66, 821, + /* 710 */ 820, 820, 137, 820, 820, 820, 820, 820, 820, 820, + /* 720 */ 820, 138, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 192, 1, 191, 192, 0, 254, 211, 254, 254, 9, @@ -285,72 +299,72 @@ static const YYCODETYPE yy_lookahead[] = { /* 40 */ 13, 14, 265, 16, 17, 264, 265, 20, 21, 1, /* 50 */ 23, 24, 25, 26, 27, 28, 235, 9, 33, 34, /* 60 */ 33, 34, 237, 255, 37, 38, 39, 14, 192, 16, - /* 70 */ 17, 192, 251, 20, 21, 237, 23, 24, 25, 26, - /* 80 */ 27, 28, 259, 79, 261, 254, 33, 34, 198, 68, + /* 70 */ 17, 192, 251, 20, 21, 198, 23, 24, 25, 26, + /* 80 */ 27, 28, 259, 79, 261, 197, 33, 34, 198, 201, /* 90 */ 37, 38, 39, 45, 46, 47, 48, 49, 50, 51, - /* 100 */ 52, 53, 54, 55, 56, 57, 58, 1, 79, 61, - /* 110 */ 110, 1, 236, 13, 14, 9, 16, 17, 111, 9, + /* 100 */ 52, 53, 54, 55, 56, 57, 58, 230, 79, 61, + /* 110 */ 110, 1, 236, 13, 14, 192, 16, 17, 111, 9, /* 120 */ 20, 21, 232, 23, 24, 25, 26, 27, 28, 37, /* 130 */ 38, 39, 105, 33, 34, 256, 257, 37, 38, 39, - /* 140 */ 13, 14, 192, 16, 17, 199, 200, 20, 21, 192, - /* 150 */ 23, 24, 25, 26, 27, 28, 65, 66, 67, 138, - /* 160 */ 33, 34, 141, 142, 37, 38, 39, 88, 89, 90, + /* 140 */ 13, 14, 235, 16, 17, 81, 235, 20, 21, 1, + /* 150 */ 23, 24, 25, 26, 27, 28, 233, 9, 251, 236, + /* 160 */ 33, 34, 251, 254, 37, 38, 39, 88, 89, 90, /* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, /* 180 */ 101, 102, 210, 192, 212, 213, 214, 215, 216, 217, /* 190 */ 218, 219, 220, 221, 222, 223, 224, 225, 16, 17, - /* 200 */ 197, 235, 20, 21, 201, 23, 24, 25, 26, 27, - /* 210 */ 28, 261, 44, 198, 104, 33, 34, 251, 261, 37, - /* 220 */ 38, 39, 1, 2, 233, 81, 5, 236, 7, 61, - /* 230 */ 9, 1, 2, 211, 104, 5, 68, 7, 108, 9, + /* 200 */ 197, 254, 20, 21, 201, 23, 24, 25, 26, 27, + /* 210 */ 28, 192, 44, 198, 104, 33, 34, 199, 200, 37, + /* 220 */ 38, 39, 1, 2, 233, 105, 5, 236, 7, 61, + /* 230 */ 9, 1, 2, 113, 104, 5, 68, 7, 108, 9, /* 240 */ 110, 73, 74, 75, 229, 230, 231, 232, 25, 26, - /* 250 */ 27, 28, 195, 196, 33, 34, 33, 34, 37, 237, - /* 260 */ 37, 38, 39, 33, 34, 136, 68, 5, 88, 7, - /* 270 */ 90, 91, 104, 144, 145, 95, 37, 97, 98, 99, - /* 280 */ 112, 101, 102, 109, 210, 33, 34, 213, 214, 37, - /* 290 */ 38, 39, 218, 192, 220, 221, 222, 192, 224, 225, - /* 300 */ 62, 63, 64, 135, 192, 137, 132, 69, 70, 71, - /* 310 */ 72, 143, 2, 76, 192, 5, 78, 7, 81, 9, - /* 320 */ 62, 63, 64, 254, 198, 104, 192, 69, 70, 71, - /* 330 */ 72, 192, 111, 192, 104, 234, 138, 192, 117, 141, - /* 340 */ 5, 111, 7, 33, 34, 233, 192, 117, 236, 227, - /* 350 */ 62, 63, 64, 254, 115, 134, 230, 69, 70, 71, - /* 360 */ 72, 62, 63, 64, 134, 104, 261, 233, 263, 211, - /* 370 */ 236, 238, 233, 112, 233, 236, 197, 236, 233, 117, - /* 380 */ 201, 236, 197, 235, 109, 252, 201, 233, 125, 126, - /* 390 */ 236, 116, 105, 1, 105, 237, 109, 105, 60, 251, - /* 400 */ 105, 254, 113, 105, 109, 113, 105, 109, 105, 105, - /* 410 */ 109, 109, 109, 109, 105, 5, 105, 7, 109, 105, - /* 420 */ 109, 111, 105, 109, 105, 254, 109, 104, 109, 37, - /* 430 */ 107, 254, 130, 139, 140, 139, 140, 76, 77, 139, - /* 440 */ 140, 104, 104, 106, 139, 140, 5, 254, 7, 254, - /* 450 */ 254, 254, 117, 254, 254, 254, 254, 254, 254, 237, - /* 460 */ 228, 228, 228, 228, 228, 192, 192, 253, 228, 228, - /* 470 */ 192, 192, 192, 192, 192, 192, 192, 235, 235, 262, - /* 480 */ 262, 235, 192, 239, 60, 192, 117, 258, 103, 192, - /* 490 */ 226, 85, 87, 86, 240, 245, 247, 250, 192, 192, - /* 500 */ 192, 129, 249, 258, 192, 192, 258, 192, 192, 258, - /* 510 */ 192, 131, 192, 192, 192, 128, 192, 192, 192, 192, - /* 520 */ 192, 192, 192, 192, 192, 192, 192, 123, 192, 127, - /* 530 */ 122, 192, 192, 192, 192, 192, 192, 192, 192, 192, + /* 250 */ 27, 28, 238, 234, 33, 34, 33, 34, 37, 192, + /* 260 */ 37, 38, 39, 33, 34, 5, 252, 7, 88, 237, + /* 270 */ 90, 91, 104, 192, 192, 95, 109, 97, 98, 99, + /* 280 */ 112, 101, 102, 116, 210, 33, 34, 213, 214, 37, + /* 290 */ 38, 39, 218, 197, 220, 221, 222, 201, 224, 225, + /* 300 */ 62, 63, 64, 135, 68, 137, 37, 69, 70, 71, + /* 310 */ 72, 68, 144, 192, 233, 233, 78, 236, 236, 2, + /* 320 */ 254, 5, 5, 7, 7, 104, 9, 254, 261, 192, + /* 330 */ 263, 192, 111, 228, 104, 62, 63, 64, 117, 192, + /* 340 */ 254, 111, 69, 70, 71, 72, 192, 117, 192, 192, + /* 350 */ 33, 34, 192, 192, 233, 134, 211, 236, 62, 63, + /* 360 */ 64, 62, 63, 64, 134, 69, 70, 71, 72, 211, + /* 370 */ 233, 192, 233, 236, 138, 236, 140, 117, 142, 143, + /* 380 */ 104, 138, 237, 140, 115, 142, 143, 233, 112, 233, + /* 390 */ 236, 136, 236, 233, 233, 237, 236, 236, 195, 196, + /* 400 */ 145, 146, 65, 66, 67, 76, 227, 105, 261, 105, + /* 410 */ 81, 125, 126, 109, 1, 113, 105, 105, 261, 105, + /* 420 */ 109, 109, 60, 109, 109, 105, 254, 105, 111, 109, + /* 430 */ 105, 109, 109, 117, 109, 105, 105, 105, 105, 109, + /* 440 */ 109, 109, 109, 104, 76, 77, 107, 132, 254, 139, + /* 450 */ 37, 141, 139, 130, 141, 254, 254, 139, 139, 141, + /* 460 */ 141, 254, 104, 139, 106, 141, 104, 254, 5, 5, + /* 470 */ 7, 7, 254, 254, 139, 228, 141, 237, 254, 254, + /* 480 */ 254, 237, 228, 192, 228, 228, 228, 228, 253, 192, + /* 490 */ 192, 262, 192, 192, 262, 192, 235, 235, 192, 192, + /* 500 */ 192, 192, 239, 235, 60, 87, 258, 258, 117, 258, + /* 510 */ 243, 258, 247, 192, 250, 249, 246, 122, 192, 192, + /* 520 */ 192, 123, 248, 129, 245, 128, 192, 131, 192, 127, + /* 530 */ 192, 121, 192, 192, 192, 192, 192, 192, 192, 192, /* 540 */ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, - /* 550 */ 192, 192, 192, 121, 192, 192, 192, 192, 120, 193, - /* 560 */ 193, 193, 119, 193, 193, 118, 133, 50, 83, 54, - /* 570 */ 193, 193, 84, 82, 193, 79, 5, 146, 5, 193, - /* 580 */ 5, 198, 198, 193, 5, 146, 5, 90, 89, 193, - /* 590 */ 136, 113, 105, 107, 194, 202, 207, 209, 203, 208, - /* 600 */ 206, 204, 193, 205, 104, 194, 194, 193, 114, 194, - /* 610 */ 193, 193, 199, 104, 195, 109, 109, 105, 242, 244, - /* 620 */ 246, 248, 243, 241, 104, 226, 105, 109, 104, 1, - /* 630 */ 105, 104, 104, 111, 105, 104, 76, 124, 124, 109, - /* 640 */ 105, 109, 104, 104, 104, 108, 104, 9, 107, 5, - /* 650 */ 5, 5, 5, 5, 80, 15, 76, 109, 16, 140, - /* 660 */ 5, 5, 105, 140, 5, 5, 140, 5, 5, 5, - /* 670 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - /* 680 */ 5, 5, 80, 60, 59, 109, 0, 266, 266, 266, - /* 690 */ 266, 266, 266, 266, 266, 266, 266, 266, 21, 21, - /* 700 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, - /* 710 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, - /* 720 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + /* 550 */ 120, 192, 192, 192, 119, 192, 192, 192, 192, 192, + /* 560 */ 118, 192, 192, 192, 192, 192, 192, 192, 192, 192, + /* 570 */ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + /* 580 */ 133, 193, 193, 193, 103, 193, 193, 86, 50, 83, + /* 590 */ 85, 54, 84, 82, 79, 5, 147, 193, 193, 193, + /* 600 */ 5, 5, 147, 5, 193, 193, 198, 198, 5, 90, + /* 610 */ 89, 136, 113, 109, 193, 105, 107, 104, 194, 193, + /* 620 */ 203, 194, 207, 209, 208, 206, 204, 202, 205, 195, + /* 630 */ 194, 193, 193, 226, 194, 104, 193, 114, 109, 105, + /* 640 */ 199, 240, 242, 244, 241, 104, 226, 105, 109, 104, + /* 650 */ 1, 105, 104, 104, 124, 105, 104, 124, 111, 105, + /* 660 */ 109, 104, 109, 104, 104, 107, 104, 76, 9, 108, + /* 670 */ 5, 5, 5, 5, 5, 15, 76, 80, 16, 109, + /* 680 */ 16, 141, 5, 5, 141, 141, 105, 5, 5, 5, + /* 690 */ 5, 5, 5, 5, 5, 5, 141, 5, 5, 5, + /* 700 */ 5, 5, 5, 5, 5, 80, 60, 59, 109, 0, + /* 710 */ 266, 266, 21, 266, 266, 266, 266, 266, 266, 266, + /* 720 */ 266, 21, 266, 266, 266, 266, 266, 266, 266, 266, /* 730 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, /* 740 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, /* 750 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, @@ -366,104 +380,112 @@ static const YYCODETYPE yy_lookahead[] = { /* 850 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, /* 860 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, /* 870 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, - /* 880 */ 266, 266, 266, 266, 266, 266, 266, 266, + /* 880 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + /* 890 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + /* 900 */ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + /* 910 */ 266, }; -#define YY_SHIFT_COUNT (326) +#define YY_SHIFT_COUNT (340) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (686) +#define YY_SHIFT_MAX (709) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 168, 79, 79, 180, 180, 29, 221, 230, 110, 106, - /* 10 */ 106, 106, 106, 106, 106, 106, 106, 106, 0, 48, - /* 20 */ 230, 310, 310, 310, 310, 261, 261, 106, 106, 106, - /* 30 */ 4, 106, 106, 237, 29, 144, 144, 700, 700, 700, - /* 40 */ 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + /* 0 */ 168, 79, 79, 180, 180, 29, 221, 230, 110, 148, + /* 10 */ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + /* 20 */ 148, 148, 0, 48, 230, 317, 317, 317, 317, 276, + /* 30 */ 276, 148, 148, 148, 4, 148, 148, 329, 29, 64, + /* 40 */ 64, 722, 722, 722, 230, 230, 230, 230, 230, 230, /* 50 */ 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - /* 60 */ 310, 310, 25, 25, 25, 25, 25, 25, 25, 106, - /* 70 */ 106, 106, 239, 106, 106, 106, 261, 261, 106, 106, - /* 80 */ 106, 106, 263, 263, 275, 261, 106, 106, 106, 106, - /* 90 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - /* 100 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - /* 110 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - /* 120 */ 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - /* 130 */ 106, 106, 106, 106, 106, 106, 106, 424, 424, 424, - /* 140 */ 369, 369, 369, 424, 369, 424, 372, 380, 387, 404, - /* 150 */ 402, 408, 432, 438, 443, 447, 433, 424, 424, 424, - /* 160 */ 385, 29, 29, 424, 424, 405, 407, 517, 485, 406, - /* 170 */ 515, 488, 491, 385, 424, 496, 496, 424, 496, 424, - /* 180 */ 496, 424, 424, 700, 700, 27, 100, 127, 100, 100, - /* 190 */ 53, 182, 223, 223, 223, 223, 238, 258, 288, 252, - /* 200 */ 252, 252, 252, 21, 129, 92, 92, 262, 335, 130, - /* 210 */ 198, 91, 299, 287, 289, 292, 295, 298, 301, 303, - /* 220 */ 304, 392, 338, 7, 174, 302, 309, 311, 314, 317, - /* 230 */ 319, 323, 294, 296, 300, 337, 305, 410, 441, 361, - /* 240 */ 571, 431, 573, 575, 439, 579, 581, 497, 499, 454, - /* 250 */ 478, 486, 500, 494, 487, 509, 506, 507, 512, 520, - /* 260 */ 521, 518, 524, 525, 527, 628, 528, 529, 531, 530, - /* 270 */ 513, 532, 514, 535, 538, 522, 539, 486, 540, 541, - /* 280 */ 542, 537, 560, 638, 644, 645, 646, 647, 648, 574, - /* 290 */ 640, 580, 519, 548, 548, 642, 523, 526, 548, 655, - /* 300 */ 656, 557, 548, 659, 660, 662, 663, 664, 665, 666, - /* 310 */ 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, - /* 320 */ 576, 602, 677, 678, 623, 625, 686, + /* 60 */ 230, 230, 230, 230, 317, 317, 317, 25, 25, 25, + /* 70 */ 25, 25, 25, 25, 148, 148, 148, 269, 148, 148, + /* 80 */ 148, 276, 276, 148, 148, 148, 148, 286, 286, 167, + /* 90 */ 276, 148, 148, 148, 148, 148, 148, 148, 148, 148, + /* 100 */ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + /* 110 */ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + /* 120 */ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + /* 130 */ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + /* 140 */ 148, 148, 148, 444, 444, 444, 391, 391, 391, 444, + /* 150 */ 391, 444, 394, 396, 397, 398, 402, 395, 410, 430, + /* 160 */ 435, 442, 447, 444, 444, 444, 481, 29, 29, 444, + /* 170 */ 444, 418, 501, 538, 506, 505, 537, 508, 511, 481, + /* 180 */ 444, 515, 515, 444, 515, 444, 515, 444, 444, 722, + /* 190 */ 722, 27, 100, 127, 100, 100, 53, 182, 223, 223, + /* 200 */ 223, 223, 238, 273, 296, 252, 252, 252, 252, 236, + /* 210 */ 243, 255, 92, 92, 260, 316, 130, 337, 299, 304, + /* 220 */ 120, 302, 311, 312, 314, 320, 322, 413, 362, 7, + /* 230 */ 315, 323, 325, 330, 331, 332, 333, 339, 310, 313, + /* 240 */ 318, 319, 324, 358, 335, 463, 464, 368, 590, 449, + /* 250 */ 595, 596, 455, 598, 603, 519, 521, 475, 499, 509, + /* 260 */ 513, 523, 510, 531, 504, 529, 534, 541, 542, 539, + /* 270 */ 545, 546, 548, 649, 549, 550, 552, 551, 530, 553, + /* 280 */ 533, 554, 557, 547, 559, 509, 560, 558, 562, 561, + /* 290 */ 591, 659, 665, 666, 667, 668, 669, 597, 660, 600, + /* 300 */ 662, 540, 543, 570, 570, 570, 570, 664, 544, 555, + /* 310 */ 570, 570, 570, 677, 678, 581, 570, 682, 683, 684, + /* 320 */ 685, 686, 687, 688, 689, 690, 692, 693, 694, 695, + /* 330 */ 696, 697, 698, 699, 599, 625, 691, 700, 646, 648, + /* 340 */ 709, }; -#define YY_REDUCE_COUNT (184) +#define YY_REDUCE_COUNT (190) #define YY_REDUCE_MIN (-249) -#define YY_REDUCE_MAX (419) +#define YY_REDUCE_MAX (443) static const short yy_reduce_ofst[] = { - /* 0 */ -179, -28, -28, 74, 74, 15, -246, -219, -121, -9, - /* 10 */ 105, -177, 112, 134, 139, 141, 145, 154, -192, -189, - /* 20 */ -223, -205, -175, 22, 158, -34, 148, -50, -43, 101, - /* 30 */ -110, 122, -124, 3, 126, 179, 185, 133, -54, 57, - /* 40 */ -249, -247, -242, -225, -169, 69, 99, 147, 171, 177, - /* 50 */ 193, 195, 196, 197, 199, 200, 201, 202, 203, 204, - /* 60 */ -162, 222, 232, 233, 234, 235, 236, 240, 241, 273, - /* 70 */ 274, 278, 214, 279, 280, 281, 242, 243, 282, 283, - /* 80 */ 284, 290, 217, 218, 244, 246, 293, 297, 306, 307, - /* 90 */ 308, 312, 313, 315, 316, 318, 320, 321, 322, 324, - /* 100 */ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - /* 110 */ 336, 339, 340, 341, 342, 343, 344, 345, 346, 347, - /* 120 */ 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - /* 130 */ 358, 359, 360, 362, 363, 364, 365, 366, 367, 368, - /* 140 */ 229, 245, 248, 370, 251, 371, 247, 253, 373, 249, - /* 150 */ 374, 250, 375, 379, 376, 382, 254, 377, 378, 381, - /* 160 */ 264, 383, 384, 386, 390, 388, 391, 389, 395, 394, - /* 170 */ 397, 398, 393, 399, 396, 400, 411, 409, 412, 414, - /* 180 */ 415, 417, 418, 413, 419, + /* 0 */ -179, -28, -28, 74, 74, 15, -246, -219, -121, -77, + /* 10 */ 67, -177, -9, 81, 82, 121, 137, 139, 154, 156, + /* 20 */ 160, 161, -192, -189, -223, -205, -175, 145, 158, -93, + /* 30 */ -89, 147, 157, 19, -110, 179, -124, -112, -123, 3, + /* 40 */ 96, 14, 18, 203, -249, -247, -242, -225, -91, -53, + /* 50 */ 66, 73, 86, 172, 194, 201, 202, 207, 213, 218, + /* 60 */ 219, 224, 225, 226, 32, 240, 244, 105, 247, 254, + /* 70 */ 256, 257, 258, 259, 291, 297, 298, 235, 300, 301, + /* 80 */ 303, 261, 262, 306, 307, 308, 309, 229, 232, 263, + /* 90 */ 268, 321, 326, 327, 328, 334, 336, 338, 340, 341, + /* 100 */ 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + /* 110 */ 352, 353, 354, 355, 356, 357, 359, 360, 361, 363, + /* 120 */ 364, 365, 366, 367, 369, 370, 371, 372, 373, 374, + /* 130 */ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + /* 140 */ 385, 386, 387, 388, 389, 390, 248, 249, 251, 392, + /* 150 */ 253, 393, 264, 266, 274, 265, 270, 279, 399, 267, + /* 160 */ 400, 403, 401, 404, 405, 406, 407, 408, 409, 411, + /* 170 */ 412, 414, 416, 415, 417, 419, 422, 423, 425, 420, + /* 180 */ 421, 424, 427, 426, 436, 438, 440, 439, 443, 441, + /* 190 */ 434, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 798, 911, 857, 923, 845, 854, 1059, 1059, 798, 798, - /* 10 */ 798, 798, 798, 798, 798, 798, 798, 798, 970, 817, - /* 20 */ 1059, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 30 */ 854, 798, 798, 860, 854, 860, 860, 965, 895, 913, - /* 40 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 50 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 60 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 70 */ 798, 798, 972, 978, 975, 798, 798, 798, 980, 798, - /* 80 */ 798, 798, 1002, 1002, 963, 798, 798, 798, 798, 798, - /* 90 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 100 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 110 */ 798, 798, 798, 843, 798, 841, 798, 798, 798, 798, - /* 120 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 130 */ 828, 798, 798, 798, 798, 798, 798, 819, 819, 819, - /* 140 */ 798, 798, 798, 819, 798, 819, 1009, 1013, 1007, 995, - /* 150 */ 1003, 994, 990, 988, 986, 985, 1017, 819, 819, 819, - /* 160 */ 858, 854, 854, 819, 819, 876, 874, 872, 864, 870, - /* 170 */ 866, 868, 862, 846, 819, 852, 852, 819, 852, 819, - /* 180 */ 852, 819, 819, 895, 913, 798, 1018, 798, 1058, 1008, - /* 190 */ 1048, 1047, 1054, 1046, 1045, 1044, 798, 798, 798, 1040, - /* 200 */ 1041, 1043, 1042, 798, 798, 1050, 1049, 798, 798, 798, - /* 210 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 220 */ 798, 798, 1020, 798, 1014, 1010, 798, 798, 798, 798, - /* 230 */ 798, 798, 798, 798, 798, 925, 798, 798, 798, 798, - /* 240 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 250 */ 962, 798, 798, 798, 798, 798, 974, 973, 798, 798, - /* 260 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 1004, - /* 270 */ 798, 996, 798, 798, 798, 798, 798, 937, 798, 798, - /* 280 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 290 */ 798, 798, 798, 1070, 1068, 798, 798, 798, 1064, 798, - /* 300 */ 798, 798, 1062, 798, 798, 798, 798, 798, 798, 798, - /* 310 */ 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, - /* 320 */ 879, 798, 826, 824, 798, 815, 798, + /* 0 */ 818, 931, 877, 943, 865, 874, 1079, 1079, 818, 818, + /* 10 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 20 */ 818, 818, 990, 837, 1079, 818, 818, 818, 818, 818, + /* 30 */ 818, 818, 818, 818, 874, 818, 818, 880, 874, 880, + /* 40 */ 880, 985, 915, 933, 818, 818, 818, 818, 818, 818, + /* 50 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 60 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 70 */ 818, 818, 818, 818, 818, 818, 818, 992, 998, 995, + /* 80 */ 818, 818, 818, 1000, 818, 818, 818, 1022, 1022, 983, + /* 90 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 100 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 110 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 863, + /* 120 */ 818, 861, 818, 818, 818, 818, 818, 818, 818, 818, + /* 130 */ 818, 818, 818, 818, 818, 818, 848, 818, 818, 818, + /* 140 */ 818, 818, 818, 839, 839, 839, 818, 818, 818, 839, + /* 150 */ 818, 839, 1029, 1033, 1027, 1015, 1023, 1014, 1010, 1008, + /* 160 */ 1006, 1005, 1037, 839, 839, 839, 878, 874, 874, 839, + /* 170 */ 839, 896, 894, 892, 884, 890, 886, 888, 882, 866, + /* 180 */ 839, 872, 872, 839, 872, 839, 872, 839, 839, 915, + /* 190 */ 933, 818, 1038, 818, 1078, 1028, 1068, 1067, 1074, 1066, + /* 200 */ 1065, 1064, 818, 818, 818, 1060, 1061, 1063, 1062, 818, + /* 210 */ 818, 818, 1070, 1069, 818, 818, 818, 818, 818, 818, + /* 220 */ 818, 818, 818, 818, 818, 818, 818, 818, 1040, 818, + /* 230 */ 1034, 1030, 818, 818, 818, 818, 818, 818, 818, 818, + /* 240 */ 818, 818, 818, 945, 818, 818, 818, 818, 818, 818, + /* 250 */ 818, 818, 818, 818, 818, 818, 818, 818, 982, 818, + /* 260 */ 818, 818, 818, 818, 994, 993, 818, 818, 818, 818, + /* 270 */ 818, 818, 818, 818, 818, 818, 818, 1024, 818, 1016, + /* 280 */ 818, 818, 818, 818, 818, 957, 818, 818, 818, 818, + /* 290 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 300 */ 818, 818, 818, 1097, 1092, 1093, 1090, 818, 818, 818, + /* 310 */ 1089, 1084, 1085, 818, 818, 818, 1082, 818, 818, 818, + /* 320 */ 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, + /* 330 */ 818, 818, 818, 818, 899, 818, 846, 844, 818, 835, + /* 340 */ 818, }; /********** End of lemon-generated parsing tables *****************************/ @@ -623,6 +645,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* SYNCDB => nothing */ 0, /* ADD => nothing */ 0, /* COLUMN => nothing */ + 0, /* MODIFY => nothing */ 0, /* TAG => nothing */ 0, /* CHANGE => nothing */ 0, /* SET => nothing */ @@ -710,6 +733,7 @@ struct yyParser { int yyerrcnt; /* Shifts left before out of the error */ #endif ParseARG_SDECL /* A place to hold %extra_argument */ + ParseCTX_SDECL /* A place to hold %extra_context */ #if YYSTACKDEPTH<=0 int yystksz; /* Current side of the stack */ yyStackEntry *yystack; /* The parser's stack */ @@ -897,55 +921,55 @@ static const char *const yyTokenName[] = { /* 137 */ "SYNCDB", /* 138 */ "ADD", /* 139 */ "COLUMN", - /* 140 */ "TAG", - /* 141 */ "CHANGE", - /* 142 */ "SET", - /* 143 */ "KILL", - /* 144 */ "CONNECTION", - /* 145 */ "STREAM", - /* 146 */ "COLON", - /* 147 */ "ABORT", - /* 148 */ "AFTER", - /* 149 */ "ATTACH", - /* 150 */ "BEFORE", - /* 151 */ "BEGIN", - /* 152 */ "CASCADE", - /* 153 */ "CLUSTER", - /* 154 */ "CONFLICT", - /* 155 */ "COPY", - /* 156 */ "DEFERRED", - /* 157 */ "DELIMITERS", - /* 158 */ "DETACH", - /* 159 */ "EACH", - /* 160 */ "END", - /* 161 */ "EXPLAIN", - /* 162 */ "FAIL", - /* 163 */ "FOR", - /* 164 */ "IGNORE", - /* 165 */ "IMMEDIATE", - /* 166 */ "INITIALLY", - /* 167 */ "INSTEAD", - /* 168 */ "MATCH", - /* 169 */ "KEY", - /* 170 */ "OF", - /* 171 */ "RAISE", - /* 172 */ "REPLACE", - /* 173 */ "RESTRICT", - /* 174 */ "ROW", - /* 175 */ "STATEMENT", - /* 176 */ "TRIGGER", - /* 177 */ "VIEW", - /* 178 */ "SEMI", - /* 179 */ "NONE", - /* 180 */ "PREV", - /* 181 */ "LINEAR", - /* 182 */ "IMPORT", - /* 183 */ "TBNAME", - /* 184 */ "JOIN", - /* 185 */ "INSERT", - /* 186 */ "INTO", - /* 187 */ "VALUES", - /* 188 */ "error", + /* 140 */ "MODIFY", + /* 141 */ "TAG", + /* 142 */ "CHANGE", + /* 143 */ "SET", + /* 144 */ "KILL", + /* 145 */ "CONNECTION", + /* 146 */ "STREAM", + /* 147 */ "COLON", + /* 148 */ "ABORT", + /* 149 */ "AFTER", + /* 150 */ "ATTACH", + /* 151 */ "BEFORE", + /* 152 */ "BEGIN", + /* 153 */ "CASCADE", + /* 154 */ "CLUSTER", + /* 155 */ "CONFLICT", + /* 156 */ "COPY", + /* 157 */ "DEFERRED", + /* 158 */ "DELIMITERS", + /* 159 */ "DETACH", + /* 160 */ "EACH", + /* 161 */ "END", + /* 162 */ "EXPLAIN", + /* 163 */ "FAIL", + /* 164 */ "FOR", + /* 165 */ "IGNORE", + /* 166 */ "IMMEDIATE", + /* 167 */ "INITIALLY", + /* 168 */ "INSTEAD", + /* 169 */ "MATCH", + /* 170 */ "KEY", + /* 171 */ "OF", + /* 172 */ "RAISE", + /* 173 */ "REPLACE", + /* 174 */ "RESTRICT", + /* 175 */ "ROW", + /* 176 */ "STATEMENT", + /* 177 */ "TRIGGER", + /* 178 */ "VIEW", + /* 179 */ "SEMI", + /* 180 */ "NONE", + /* 181 */ "PREV", + /* 182 */ "LINEAR", + /* 183 */ "IMPORT", + /* 184 */ "TBNAME", + /* 185 */ "JOIN", + /* 186 */ "INSERT", + /* 187 */ "INTO", + /* 188 */ "VALUES", /* 189 */ "program", /* 190 */ "cmd", /* 191 */ "dbPrefix", @@ -1293,18 +1317,23 @@ static const char *const yyRuleName[] = { /* 260 */ "cmd ::= SYNCDB ids REPLICA", /* 261 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", /* 262 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 263 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 264 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 265 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 266 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 267 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 268 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 269 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 270 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 271 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 272 */ "cmd ::= KILL CONNECTION INTEGER", - /* 273 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 274 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 263 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", + /* 264 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 265 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 266 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 267 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 268 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 269 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 270 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 271 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 272 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 273 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 274 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 275 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 276 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 277 */ "cmd ::= KILL CONNECTION INTEGER", + /* 278 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 279 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1353,28 +1382,29 @@ static int yyGrowStack(yyParser *p){ /* Initialize a new parser that has already been allocated. */ -void ParseInit(void *yypParser){ - yyParser *pParser = (yyParser*)yypParser; +void ParseInit(void *yypRawParser ParseCTX_PDECL){ + yyParser *yypParser = (yyParser*)yypRawParser; + ParseCTX_STORE #ifdef YYTRACKMAXSTACKDEPTH - pParser->yyhwm = 0; + yypParser->yyhwm = 0; #endif #if YYSTACKDEPTH<=0 - pParser->yytos = NULL; - pParser->yystack = NULL; - pParser->yystksz = 0; - if( yyGrowStack(pParser) ){ - pParser->yystack = &pParser->yystk0; - pParser->yystksz = 1; + yypParser->yytos = NULL; + yypParser->yystack = NULL; + yypParser->yystksz = 0; + if( yyGrowStack(yypParser) ){ + yypParser->yystack = &yypParser->yystk0; + yypParser->yystksz = 1; } #endif #ifndef YYNOERRORRECOVERY - pParser->yyerrcnt = -1; + yypParser->yyerrcnt = -1; #endif - pParser->yytos = pParser->yystack; - pParser->yystack[0].stateno = 0; - pParser->yystack[0].major = 0; + yypParser->yytos = yypParser->yystack; + yypParser->yystack[0].stateno = 0; + yypParser->yystack[0].major = 0; #if YYSTACKDEPTH>0 - pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; + yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; #endif } @@ -1391,11 +1421,14 @@ void ParseInit(void *yypParser){ ** A pointer to a parser. This pointer is used in subsequent calls ** to Parse and ParseFree. */ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( pParser ) ParseInit(pParser); - return pParser; +void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ + yyParser *yypParser; + yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); + if( yypParser ){ + ParseCTX_STORE + ParseInit(yypParser ParseCTX_PARAM); + } + return (void*)yypParser; } #endif /* Parse_ENGINEALWAYSONSTACK */ @@ -1412,7 +1445,8 @@ static void yy_destructor( YYCODETYPE yymajor, /* Type code for object to destroy */ YYMINORTYPE *yypminor /* The object to be destroyed */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH switch( yymajor ){ /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen @@ -1589,13 +1623,12 @@ int ParseCoverage(FILE *out){ ** Find the appropriate action for a parser given the terminal ** look-ahead token iLookAhead. */ -static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ - YYCODETYPE iLookAhead /* The look-ahead token */ +static YYACTIONTYPE yy_find_shift_action( + YYCODETYPE iLookAhead, /* The look-ahead token */ + YYACTIONTYPE stateno /* Current state number */ ){ int i; - int stateno = pParser->yytos->stateno; - + if( stateno>YY_MAX_SHIFT ) return stateno; assert( stateno <= YY_SHIFT_COUNT ); #if defined(YYCOVERAGE) @@ -1603,15 +1636,19 @@ static unsigned int yy_find_shift_action( #endif do{ i = yy_shift_ofst[stateno]; - assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) ); + assert( i>=0 ); + assert( i<=YY_ACTTAB_COUNT ); + assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; + assert( i<(int)YY_NLOOKAHEAD ); if( yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", @@ -1626,15 +1663,8 @@ static unsigned int yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ + assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); + if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -1648,6 +1678,7 @@ static unsigned int yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ + assert( i>=0 && iyytos; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; + yytos->stateno = yyNewState; + yytos->major = yyMajor; yytos->minor.yy0 = yyMinor; yyTraceShift(yypParser, yyNewState, "Shift"); } -/* The following table contains information about every rule that -** is used during the reduce. -*/ -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[] = { - { 189, -1 }, /* (0) program ::= cmd */ - { 190, -2 }, /* (1) cmd ::= SHOW DATABASES */ - { 190, -2 }, /* (2) cmd ::= SHOW TOPICS */ - { 190, -2 }, /* (3) cmd ::= SHOW MNODES */ - { 190, -2 }, /* (4) cmd ::= SHOW DNODES */ - { 190, -2 }, /* (5) cmd ::= SHOW ACCOUNTS */ - { 190, -2 }, /* (6) cmd ::= SHOW USERS */ - { 190, -2 }, /* (7) cmd ::= SHOW MODULES */ - { 190, -2 }, /* (8) cmd ::= SHOW QUERIES */ - { 190, -2 }, /* (9) cmd ::= SHOW CONNECTIONS */ - { 190, -2 }, /* (10) cmd ::= SHOW STREAMS */ - { 190, -2 }, /* (11) cmd ::= SHOW VARIABLES */ - { 190, -2 }, /* (12) cmd ::= SHOW SCORES */ - { 190, -2 }, /* (13) cmd ::= SHOW GRANTS */ - { 190, -2 }, /* (14) cmd ::= SHOW VNODES */ - { 190, -3 }, /* (15) cmd ::= SHOW VNODES IPTOKEN */ - { 191, 0 }, /* (16) dbPrefix ::= */ - { 191, -2 }, /* (17) dbPrefix ::= ids DOT */ - { 193, 0 }, /* (18) cpxName ::= */ - { 193, -2 }, /* (19) cpxName ::= DOT ids */ - { 190, -5 }, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */ - { 190, -5 }, /* (21) cmd ::= SHOW CREATE STABLE ids cpxName */ - { 190, -4 }, /* (22) cmd ::= SHOW CREATE DATABASE ids */ - { 190, -3 }, /* (23) cmd ::= SHOW dbPrefix TABLES */ - { 190, -5 }, /* (24) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - { 190, -3 }, /* (25) cmd ::= SHOW dbPrefix STABLES */ - { 190, -5 }, /* (26) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - { 190, -3 }, /* (27) cmd ::= SHOW dbPrefix VGROUPS */ - { 190, -4 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS ids */ - { 190, -5 }, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */ - { 190, -5 }, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */ - { 190, -4 }, /* (31) cmd ::= DROP DATABASE ifexists ids */ - { 190, -4 }, /* (32) cmd ::= DROP TOPIC ifexists ids */ - { 190, -3 }, /* (33) cmd ::= DROP DNODE ids */ - { 190, -3 }, /* (34) cmd ::= DROP USER ids */ - { 190, -3 }, /* (35) cmd ::= DROP ACCOUNT ids */ - { 190, -2 }, /* (36) cmd ::= USE ids */ - { 190, -3 }, /* (37) cmd ::= DESCRIBE ids cpxName */ - { 190, -5 }, /* (38) cmd ::= ALTER USER ids PASS ids */ - { 190, -5 }, /* (39) cmd ::= ALTER USER ids PRIVILEGE ids */ - { 190, -4 }, /* (40) cmd ::= ALTER DNODE ids ids */ - { 190, -5 }, /* (41) cmd ::= ALTER DNODE ids ids ids */ - { 190, -3 }, /* (42) cmd ::= ALTER LOCAL ids */ - { 190, -4 }, /* (43) cmd ::= ALTER LOCAL ids ids */ - { 190, -4 }, /* (44) cmd ::= ALTER DATABASE ids alter_db_optr */ - { 190, -4 }, /* (45) cmd ::= ALTER TOPIC ids alter_topic_optr */ - { 190, -4 }, /* (46) cmd ::= ALTER ACCOUNT ids acct_optr */ - { 190, -6 }, /* (47) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - { 192, -1 }, /* (48) ids ::= ID */ - { 192, -1 }, /* (49) ids ::= STRING */ - { 194, -2 }, /* (50) ifexists ::= IF EXISTS */ - { 194, 0 }, /* (51) ifexists ::= */ - { 198, -3 }, /* (52) ifnotexists ::= IF NOT EXISTS */ - { 198, 0 }, /* (53) ifnotexists ::= */ - { 190, -3 }, /* (54) cmd ::= CREATE DNODE ids */ - { 190, -6 }, /* (55) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - { 190, -5 }, /* (56) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - { 190, -5 }, /* (57) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - { 190, -5 }, /* (58) cmd ::= CREATE USER ids PASS ids */ - { 201, 0 }, /* (59) pps ::= */ - { 201, -2 }, /* (60) pps ::= PPS INTEGER */ - { 202, 0 }, /* (61) tseries ::= */ - { 202, -2 }, /* (62) tseries ::= TSERIES INTEGER */ - { 203, 0 }, /* (63) dbs ::= */ - { 203, -2 }, /* (64) dbs ::= DBS INTEGER */ - { 204, 0 }, /* (65) streams ::= */ - { 204, -2 }, /* (66) streams ::= STREAMS INTEGER */ - { 205, 0 }, /* (67) storage ::= */ - { 205, -2 }, /* (68) storage ::= STORAGE INTEGER */ - { 206, 0 }, /* (69) qtime ::= */ - { 206, -2 }, /* (70) qtime ::= QTIME INTEGER */ - { 207, 0 }, /* (71) users ::= */ - { 207, -2 }, /* (72) users ::= USERS INTEGER */ - { 208, 0 }, /* (73) conns ::= */ - { 208, -2 }, /* (74) conns ::= CONNS INTEGER */ - { 209, 0 }, /* (75) state ::= */ - { 209, -2 }, /* (76) state ::= STATE ids */ - { 197, -9 }, /* (77) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - { 210, -2 }, /* (78) keep ::= KEEP tagitemlist */ - { 212, -2 }, /* (79) cache ::= CACHE INTEGER */ - { 213, -2 }, /* (80) replica ::= REPLICA INTEGER */ - { 214, -2 }, /* (81) quorum ::= QUORUM INTEGER */ - { 215, -2 }, /* (82) days ::= DAYS INTEGER */ - { 216, -2 }, /* (83) minrows ::= MINROWS INTEGER */ - { 217, -2 }, /* (84) maxrows ::= MAXROWS INTEGER */ - { 218, -2 }, /* (85) blocks ::= BLOCKS INTEGER */ - { 219, -2 }, /* (86) ctime ::= CTIME INTEGER */ - { 220, -2 }, /* (87) wal ::= WAL INTEGER */ - { 221, -2 }, /* (88) fsync ::= FSYNC INTEGER */ - { 222, -2 }, /* (89) comp ::= COMP INTEGER */ - { 223, -2 }, /* (90) prec ::= PRECISION STRING */ - { 224, -2 }, /* (91) update ::= UPDATE INTEGER */ - { 225, -2 }, /* (92) cachelast ::= CACHELAST INTEGER */ - { 226, -2 }, /* (93) partitions ::= PARTITIONS INTEGER */ - { 199, 0 }, /* (94) db_optr ::= */ - { 199, -2 }, /* (95) db_optr ::= db_optr cache */ - { 199, -2 }, /* (96) db_optr ::= db_optr replica */ - { 199, -2 }, /* (97) db_optr ::= db_optr quorum */ - { 199, -2 }, /* (98) db_optr ::= db_optr days */ - { 199, -2 }, /* (99) db_optr ::= db_optr minrows */ - { 199, -2 }, /* (100) db_optr ::= db_optr maxrows */ - { 199, -2 }, /* (101) db_optr ::= db_optr blocks */ - { 199, -2 }, /* (102) db_optr ::= db_optr ctime */ - { 199, -2 }, /* (103) db_optr ::= db_optr wal */ - { 199, -2 }, /* (104) db_optr ::= db_optr fsync */ - { 199, -2 }, /* (105) db_optr ::= db_optr comp */ - { 199, -2 }, /* (106) db_optr ::= db_optr prec */ - { 199, -2 }, /* (107) db_optr ::= db_optr keep */ - { 199, -2 }, /* (108) db_optr ::= db_optr update */ - { 199, -2 }, /* (109) db_optr ::= db_optr cachelast */ - { 200, -1 }, /* (110) topic_optr ::= db_optr */ - { 200, -2 }, /* (111) topic_optr ::= topic_optr partitions */ - { 195, 0 }, /* (112) alter_db_optr ::= */ - { 195, -2 }, /* (113) alter_db_optr ::= alter_db_optr replica */ - { 195, -2 }, /* (114) alter_db_optr ::= alter_db_optr quorum */ - { 195, -2 }, /* (115) alter_db_optr ::= alter_db_optr keep */ - { 195, -2 }, /* (116) alter_db_optr ::= alter_db_optr blocks */ - { 195, -2 }, /* (117) alter_db_optr ::= alter_db_optr comp */ - { 195, -2 }, /* (118) alter_db_optr ::= alter_db_optr wal */ - { 195, -2 }, /* (119) alter_db_optr ::= alter_db_optr fsync */ - { 195, -2 }, /* (120) alter_db_optr ::= alter_db_optr update */ - { 195, -2 }, /* (121) alter_db_optr ::= alter_db_optr cachelast */ - { 196, -1 }, /* (122) alter_topic_optr ::= alter_db_optr */ - { 196, -2 }, /* (123) alter_topic_optr ::= alter_topic_optr partitions */ - { 227, -1 }, /* (124) typename ::= ids */ - { 227, -4 }, /* (125) typename ::= ids LP signed RP */ - { 227, -2 }, /* (126) typename ::= ids UNSIGNED */ - { 228, -1 }, /* (127) signed ::= INTEGER */ - { 228, -2 }, /* (128) signed ::= PLUS INTEGER */ - { 228, -2 }, /* (129) signed ::= MINUS INTEGER */ - { 190, -3 }, /* (130) cmd ::= CREATE TABLE create_table_args */ - { 190, -3 }, /* (131) cmd ::= CREATE TABLE create_stable_args */ - { 190, -3 }, /* (132) cmd ::= CREATE STABLE create_stable_args */ - { 190, -3 }, /* (133) cmd ::= CREATE TABLE create_table_list */ - { 231, -1 }, /* (134) create_table_list ::= create_from_stable */ - { 231, -2 }, /* (135) create_table_list ::= create_table_list create_from_stable */ - { 229, -6 }, /* (136) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - { 230, -10 }, /* (137) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - { 232, -10 }, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - { 232, -13 }, /* (139) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - { 234, -3 }, /* (140) tagNamelist ::= tagNamelist COMMA ids */ - { 234, -1 }, /* (141) tagNamelist ::= ids */ - { 229, -5 }, /* (142) create_table_args ::= ifnotexists ids cpxName AS select */ - { 233, -3 }, /* (143) columnlist ::= columnlist COMMA column */ - { 233, -1 }, /* (144) columnlist ::= column */ - { 236, -2 }, /* (145) column ::= ids typename */ - { 211, -3 }, /* (146) tagitemlist ::= tagitemlist COMMA tagitem */ - { 211, -1 }, /* (147) tagitemlist ::= tagitem */ - { 237, -1 }, /* (148) tagitem ::= INTEGER */ - { 237, -1 }, /* (149) tagitem ::= FLOAT */ - { 237, -1 }, /* (150) tagitem ::= STRING */ - { 237, -1 }, /* (151) tagitem ::= BOOL */ - { 237, -1 }, /* (152) tagitem ::= NULL */ - { 237, -2 }, /* (153) tagitem ::= MINUS INTEGER */ - { 237, -2 }, /* (154) tagitem ::= MINUS FLOAT */ - { 237, -2 }, /* (155) tagitem ::= PLUS INTEGER */ - { 237, -2 }, /* (156) tagitem ::= PLUS FLOAT */ - { 235, -14 }, /* (157) select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ - { 235, -3 }, /* (158) select ::= LP select RP */ - { 251, -1 }, /* (159) union ::= select */ - { 251, -4 }, /* (160) union ::= union UNION ALL select */ - { 190, -1 }, /* (161) cmd ::= union */ - { 235, -2 }, /* (162) select ::= SELECT selcollist */ - { 252, -2 }, /* (163) sclp ::= selcollist COMMA */ - { 252, 0 }, /* (164) sclp ::= */ - { 238, -4 }, /* (165) selcollist ::= sclp distinct expr as */ - { 238, -2 }, /* (166) selcollist ::= sclp STAR */ - { 255, -2 }, /* (167) as ::= AS ids */ - { 255, -1 }, /* (168) as ::= ids */ - { 255, 0 }, /* (169) as ::= */ - { 253, -1 }, /* (170) distinct ::= DISTINCT */ - { 253, 0 }, /* (171) distinct ::= */ - { 239, -2 }, /* (172) from ::= FROM tablelist */ - { 239, -2 }, /* (173) from ::= FROM sub */ - { 257, -3 }, /* (174) sub ::= LP union RP */ - { 257, -4 }, /* (175) sub ::= LP union RP ids */ - { 257, -6 }, /* (176) sub ::= sub COMMA LP union RP ids */ - { 256, -2 }, /* (177) tablelist ::= ids cpxName */ - { 256, -3 }, /* (178) tablelist ::= ids cpxName ids */ - { 256, -4 }, /* (179) tablelist ::= tablelist COMMA ids cpxName */ - { 256, -5 }, /* (180) tablelist ::= tablelist COMMA ids cpxName ids */ - { 258, -1 }, /* (181) tmvar ::= VARIABLE */ - { 241, -4 }, /* (182) interval_opt ::= INTERVAL LP tmvar RP */ - { 241, -6 }, /* (183) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ - { 241, 0 }, /* (184) interval_opt ::= */ - { 242, 0 }, /* (185) session_option ::= */ - { 242, -7 }, /* (186) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - { 243, 0 }, /* (187) windowstate_option ::= */ - { 243, -4 }, /* (188) windowstate_option ::= STATE_WINDOW LP ids RP */ - { 244, 0 }, /* (189) fill_opt ::= */ - { 244, -6 }, /* (190) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - { 244, -4 }, /* (191) fill_opt ::= FILL LP ID RP */ - { 245, -4 }, /* (192) sliding_opt ::= SLIDING LP tmvar RP */ - { 245, 0 }, /* (193) sliding_opt ::= */ - { 247, 0 }, /* (194) orderby_opt ::= */ - { 247, -3 }, /* (195) orderby_opt ::= ORDER BY sortlist */ - { 259, -4 }, /* (196) sortlist ::= sortlist COMMA item sortorder */ - { 259, -2 }, /* (197) sortlist ::= item sortorder */ - { 261, -2 }, /* (198) item ::= ids cpxName */ - { 262, -1 }, /* (199) sortorder ::= ASC */ - { 262, -1 }, /* (200) sortorder ::= DESC */ - { 262, 0 }, /* (201) sortorder ::= */ - { 246, 0 }, /* (202) groupby_opt ::= */ - { 246, -3 }, /* (203) groupby_opt ::= GROUP BY grouplist */ - { 263, -3 }, /* (204) grouplist ::= grouplist COMMA item */ - { 263, -1 }, /* (205) grouplist ::= item */ - { 248, 0 }, /* (206) having_opt ::= */ - { 248, -2 }, /* (207) having_opt ::= HAVING expr */ - { 250, 0 }, /* (208) limit_opt ::= */ - { 250, -2 }, /* (209) limit_opt ::= LIMIT signed */ - { 250, -4 }, /* (210) limit_opt ::= LIMIT signed OFFSET signed */ - { 250, -4 }, /* (211) limit_opt ::= LIMIT signed COMMA signed */ - { 249, 0 }, /* (212) slimit_opt ::= */ - { 249, -2 }, /* (213) slimit_opt ::= SLIMIT signed */ - { 249, -4 }, /* (214) slimit_opt ::= SLIMIT signed SOFFSET signed */ - { 249, -4 }, /* (215) slimit_opt ::= SLIMIT signed COMMA signed */ - { 240, 0 }, /* (216) where_opt ::= */ - { 240, -2 }, /* (217) where_opt ::= WHERE expr */ - { 254, -3 }, /* (218) expr ::= LP expr RP */ - { 254, -1 }, /* (219) expr ::= ID */ - { 254, -3 }, /* (220) expr ::= ID DOT ID */ - { 254, -3 }, /* (221) expr ::= ID DOT STAR */ - { 254, -1 }, /* (222) expr ::= INTEGER */ - { 254, -2 }, /* (223) expr ::= MINUS INTEGER */ - { 254, -2 }, /* (224) expr ::= PLUS INTEGER */ - { 254, -1 }, /* (225) expr ::= FLOAT */ - { 254, -2 }, /* (226) expr ::= MINUS FLOAT */ - { 254, -2 }, /* (227) expr ::= PLUS FLOAT */ - { 254, -1 }, /* (228) expr ::= STRING */ - { 254, -1 }, /* (229) expr ::= NOW */ - { 254, -1 }, /* (230) expr ::= VARIABLE */ - { 254, -2 }, /* (231) expr ::= PLUS VARIABLE */ - { 254, -2 }, /* (232) expr ::= MINUS VARIABLE */ - { 254, -1 }, /* (233) expr ::= BOOL */ - { 254, -1 }, /* (234) expr ::= NULL */ - { 254, -4 }, /* (235) expr ::= ID LP exprlist RP */ - { 254, -4 }, /* (236) expr ::= ID LP STAR RP */ - { 254, -3 }, /* (237) expr ::= expr IS NULL */ - { 254, -4 }, /* (238) expr ::= expr IS NOT NULL */ - { 254, -3 }, /* (239) expr ::= expr LT expr */ - { 254, -3 }, /* (240) expr ::= expr GT expr */ - { 254, -3 }, /* (241) expr ::= expr LE expr */ - { 254, -3 }, /* (242) expr ::= expr GE expr */ - { 254, -3 }, /* (243) expr ::= expr NE expr */ - { 254, -3 }, /* (244) expr ::= expr EQ expr */ - { 254, -5 }, /* (245) expr ::= expr BETWEEN expr AND expr */ - { 254, -3 }, /* (246) expr ::= expr AND expr */ - { 254, -3 }, /* (247) expr ::= expr OR expr */ - { 254, -3 }, /* (248) expr ::= expr PLUS expr */ - { 254, -3 }, /* (249) expr ::= expr MINUS expr */ - { 254, -3 }, /* (250) expr ::= expr STAR expr */ - { 254, -3 }, /* (251) expr ::= expr SLASH expr */ - { 254, -3 }, /* (252) expr ::= expr REM expr */ - { 254, -3 }, /* (253) expr ::= expr LIKE expr */ - { 254, -5 }, /* (254) expr ::= expr IN LP exprlist RP */ - { 264, -3 }, /* (255) exprlist ::= exprlist COMMA expritem */ - { 264, -1 }, /* (256) exprlist ::= expritem */ - { 265, -1 }, /* (257) expritem ::= expr */ - { 265, 0 }, /* (258) expritem ::= */ - { 190, -3 }, /* (259) cmd ::= RESET QUERY CACHE */ - { 190, -3 }, /* (260) cmd ::= SYNCDB ids REPLICA */ - { 190, -7 }, /* (261) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - { 190, -7 }, /* (262) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - { 190, -7 }, /* (263) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - { 190, -7 }, /* (264) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - { 190, -8 }, /* (265) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - { 190, -9 }, /* (266) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - { 190, -7 }, /* (267) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - { 190, -7 }, /* (268) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - { 190, -7 }, /* (269) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - { 190, -7 }, /* (270) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - { 190, -8 }, /* (271) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - { 190, -3 }, /* (272) cmd ::= KILL CONNECTION INTEGER */ - { 190, -5 }, /* (273) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - { 190, -5 }, /* (274) cmd ::= KILL QUERY INTEGER COLON INTEGER */ +/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side +** of that rule */ +static const YYCODETYPE yyRuleInfoLhs[] = { + 189, /* (0) program ::= cmd */ + 190, /* (1) cmd ::= SHOW DATABASES */ + 190, /* (2) cmd ::= SHOW TOPICS */ + 190, /* (3) cmd ::= SHOW MNODES */ + 190, /* (4) cmd ::= SHOW DNODES */ + 190, /* (5) cmd ::= SHOW ACCOUNTS */ + 190, /* (6) cmd ::= SHOW USERS */ + 190, /* (7) cmd ::= SHOW MODULES */ + 190, /* (8) cmd ::= SHOW QUERIES */ + 190, /* (9) cmd ::= SHOW CONNECTIONS */ + 190, /* (10) cmd ::= SHOW STREAMS */ + 190, /* (11) cmd ::= SHOW VARIABLES */ + 190, /* (12) cmd ::= SHOW SCORES */ + 190, /* (13) cmd ::= SHOW GRANTS */ + 190, /* (14) cmd ::= SHOW VNODES */ + 190, /* (15) cmd ::= SHOW VNODES IPTOKEN */ + 191, /* (16) dbPrefix ::= */ + 191, /* (17) dbPrefix ::= ids DOT */ + 193, /* (18) cpxName ::= */ + 193, /* (19) cpxName ::= DOT ids */ + 190, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */ + 190, /* (21) cmd ::= SHOW CREATE STABLE ids cpxName */ + 190, /* (22) cmd ::= SHOW CREATE DATABASE ids */ + 190, /* (23) cmd ::= SHOW dbPrefix TABLES */ + 190, /* (24) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + 190, /* (25) cmd ::= SHOW dbPrefix STABLES */ + 190, /* (26) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + 190, /* (27) cmd ::= SHOW dbPrefix VGROUPS */ + 190, /* (28) cmd ::= SHOW dbPrefix VGROUPS ids */ + 190, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */ + 190, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */ + 190, /* (31) cmd ::= DROP DATABASE ifexists ids */ + 190, /* (32) cmd ::= DROP TOPIC ifexists ids */ + 190, /* (33) cmd ::= DROP DNODE ids */ + 190, /* (34) cmd ::= DROP USER ids */ + 190, /* (35) cmd ::= DROP ACCOUNT ids */ + 190, /* (36) cmd ::= USE ids */ + 190, /* (37) cmd ::= DESCRIBE ids cpxName */ + 190, /* (38) cmd ::= ALTER USER ids PASS ids */ + 190, /* (39) cmd ::= ALTER USER ids PRIVILEGE ids */ + 190, /* (40) cmd ::= ALTER DNODE ids ids */ + 190, /* (41) cmd ::= ALTER DNODE ids ids ids */ + 190, /* (42) cmd ::= ALTER LOCAL ids */ + 190, /* (43) cmd ::= ALTER LOCAL ids ids */ + 190, /* (44) cmd ::= ALTER DATABASE ids alter_db_optr */ + 190, /* (45) cmd ::= ALTER TOPIC ids alter_topic_optr */ + 190, /* (46) cmd ::= ALTER ACCOUNT ids acct_optr */ + 190, /* (47) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + 192, /* (48) ids ::= ID */ + 192, /* (49) ids ::= STRING */ + 194, /* (50) ifexists ::= IF EXISTS */ + 194, /* (51) ifexists ::= */ + 198, /* (52) ifnotexists ::= IF NOT EXISTS */ + 198, /* (53) ifnotexists ::= */ + 190, /* (54) cmd ::= CREATE DNODE ids */ + 190, /* (55) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + 190, /* (56) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + 190, /* (57) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + 190, /* (58) cmd ::= CREATE USER ids PASS ids */ + 201, /* (59) pps ::= */ + 201, /* (60) pps ::= PPS INTEGER */ + 202, /* (61) tseries ::= */ + 202, /* (62) tseries ::= TSERIES INTEGER */ + 203, /* (63) dbs ::= */ + 203, /* (64) dbs ::= DBS INTEGER */ + 204, /* (65) streams ::= */ + 204, /* (66) streams ::= STREAMS INTEGER */ + 205, /* (67) storage ::= */ + 205, /* (68) storage ::= STORAGE INTEGER */ + 206, /* (69) qtime ::= */ + 206, /* (70) qtime ::= QTIME INTEGER */ + 207, /* (71) users ::= */ + 207, /* (72) users ::= USERS INTEGER */ + 208, /* (73) conns ::= */ + 208, /* (74) conns ::= CONNS INTEGER */ + 209, /* (75) state ::= */ + 209, /* (76) state ::= STATE ids */ + 197, /* (77) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + 210, /* (78) keep ::= KEEP tagitemlist */ + 212, /* (79) cache ::= CACHE INTEGER */ + 213, /* (80) replica ::= REPLICA INTEGER */ + 214, /* (81) quorum ::= QUORUM INTEGER */ + 215, /* (82) days ::= DAYS INTEGER */ + 216, /* (83) minrows ::= MINROWS INTEGER */ + 217, /* (84) maxrows ::= MAXROWS INTEGER */ + 218, /* (85) blocks ::= BLOCKS INTEGER */ + 219, /* (86) ctime ::= CTIME INTEGER */ + 220, /* (87) wal ::= WAL INTEGER */ + 221, /* (88) fsync ::= FSYNC INTEGER */ + 222, /* (89) comp ::= COMP INTEGER */ + 223, /* (90) prec ::= PRECISION STRING */ + 224, /* (91) update ::= UPDATE INTEGER */ + 225, /* (92) cachelast ::= CACHELAST INTEGER */ + 226, /* (93) partitions ::= PARTITIONS INTEGER */ + 199, /* (94) db_optr ::= */ + 199, /* (95) db_optr ::= db_optr cache */ + 199, /* (96) db_optr ::= db_optr replica */ + 199, /* (97) db_optr ::= db_optr quorum */ + 199, /* (98) db_optr ::= db_optr days */ + 199, /* (99) db_optr ::= db_optr minrows */ + 199, /* (100) db_optr ::= db_optr maxrows */ + 199, /* (101) db_optr ::= db_optr blocks */ + 199, /* (102) db_optr ::= db_optr ctime */ + 199, /* (103) db_optr ::= db_optr wal */ + 199, /* (104) db_optr ::= db_optr fsync */ + 199, /* (105) db_optr ::= db_optr comp */ + 199, /* (106) db_optr ::= db_optr prec */ + 199, /* (107) db_optr ::= db_optr keep */ + 199, /* (108) db_optr ::= db_optr update */ + 199, /* (109) db_optr ::= db_optr cachelast */ + 200, /* (110) topic_optr ::= db_optr */ + 200, /* (111) topic_optr ::= topic_optr partitions */ + 195, /* (112) alter_db_optr ::= */ + 195, /* (113) alter_db_optr ::= alter_db_optr replica */ + 195, /* (114) alter_db_optr ::= alter_db_optr quorum */ + 195, /* (115) alter_db_optr ::= alter_db_optr keep */ + 195, /* (116) alter_db_optr ::= alter_db_optr blocks */ + 195, /* (117) alter_db_optr ::= alter_db_optr comp */ + 195, /* (118) alter_db_optr ::= alter_db_optr wal */ + 195, /* (119) alter_db_optr ::= alter_db_optr fsync */ + 195, /* (120) alter_db_optr ::= alter_db_optr update */ + 195, /* (121) alter_db_optr ::= alter_db_optr cachelast */ + 196, /* (122) alter_topic_optr ::= alter_db_optr */ + 196, /* (123) alter_topic_optr ::= alter_topic_optr partitions */ + 227, /* (124) typename ::= ids */ + 227, /* (125) typename ::= ids LP signed RP */ + 227, /* (126) typename ::= ids UNSIGNED */ + 228, /* (127) signed ::= INTEGER */ + 228, /* (128) signed ::= PLUS INTEGER */ + 228, /* (129) signed ::= MINUS INTEGER */ + 190, /* (130) cmd ::= CREATE TABLE create_table_args */ + 190, /* (131) cmd ::= CREATE TABLE create_stable_args */ + 190, /* (132) cmd ::= CREATE STABLE create_stable_args */ + 190, /* (133) cmd ::= CREATE TABLE create_table_list */ + 231, /* (134) create_table_list ::= create_from_stable */ + 231, /* (135) create_table_list ::= create_table_list create_from_stable */ + 229, /* (136) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + 230, /* (137) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + 232, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + 232, /* (139) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + 234, /* (140) tagNamelist ::= tagNamelist COMMA ids */ + 234, /* (141) tagNamelist ::= ids */ + 229, /* (142) create_table_args ::= ifnotexists ids cpxName AS select */ + 233, /* (143) columnlist ::= columnlist COMMA column */ + 233, /* (144) columnlist ::= column */ + 236, /* (145) column ::= ids typename */ + 211, /* (146) tagitemlist ::= tagitemlist COMMA tagitem */ + 211, /* (147) tagitemlist ::= tagitem */ + 237, /* (148) tagitem ::= INTEGER */ + 237, /* (149) tagitem ::= FLOAT */ + 237, /* (150) tagitem ::= STRING */ + 237, /* (151) tagitem ::= BOOL */ + 237, /* (152) tagitem ::= NULL */ + 237, /* (153) tagitem ::= MINUS INTEGER */ + 237, /* (154) tagitem ::= MINUS FLOAT */ + 237, /* (155) tagitem ::= PLUS INTEGER */ + 237, /* (156) tagitem ::= PLUS FLOAT */ + 235, /* (157) select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + 235, /* (158) select ::= LP select RP */ + 251, /* (159) union ::= select */ + 251, /* (160) union ::= union UNION ALL select */ + 190, /* (161) cmd ::= union */ + 235, /* (162) select ::= SELECT selcollist */ + 252, /* (163) sclp ::= selcollist COMMA */ + 252, /* (164) sclp ::= */ + 238, /* (165) selcollist ::= sclp distinct expr as */ + 238, /* (166) selcollist ::= sclp STAR */ + 255, /* (167) as ::= AS ids */ + 255, /* (168) as ::= ids */ + 255, /* (169) as ::= */ + 253, /* (170) distinct ::= DISTINCT */ + 253, /* (171) distinct ::= */ + 239, /* (172) from ::= FROM tablelist */ + 239, /* (173) from ::= FROM sub */ + 257, /* (174) sub ::= LP union RP */ + 257, /* (175) sub ::= LP union RP ids */ + 257, /* (176) sub ::= sub COMMA LP union RP ids */ + 256, /* (177) tablelist ::= ids cpxName */ + 256, /* (178) tablelist ::= ids cpxName ids */ + 256, /* (179) tablelist ::= tablelist COMMA ids cpxName */ + 256, /* (180) tablelist ::= tablelist COMMA ids cpxName ids */ + 258, /* (181) tmvar ::= VARIABLE */ + 241, /* (182) interval_opt ::= INTERVAL LP tmvar RP */ + 241, /* (183) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ + 241, /* (184) interval_opt ::= */ + 242, /* (185) session_option ::= */ + 242, /* (186) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + 243, /* (187) windowstate_option ::= */ + 243, /* (188) windowstate_option ::= STATE_WINDOW LP ids RP */ + 244, /* (189) fill_opt ::= */ + 244, /* (190) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + 244, /* (191) fill_opt ::= FILL LP ID RP */ + 245, /* (192) sliding_opt ::= SLIDING LP tmvar RP */ + 245, /* (193) sliding_opt ::= */ + 247, /* (194) orderby_opt ::= */ + 247, /* (195) orderby_opt ::= ORDER BY sortlist */ + 259, /* (196) sortlist ::= sortlist COMMA item sortorder */ + 259, /* (197) sortlist ::= item sortorder */ + 261, /* (198) item ::= ids cpxName */ + 262, /* (199) sortorder ::= ASC */ + 262, /* (200) sortorder ::= DESC */ + 262, /* (201) sortorder ::= */ + 246, /* (202) groupby_opt ::= */ + 246, /* (203) groupby_opt ::= GROUP BY grouplist */ + 263, /* (204) grouplist ::= grouplist COMMA item */ + 263, /* (205) grouplist ::= item */ + 248, /* (206) having_opt ::= */ + 248, /* (207) having_opt ::= HAVING expr */ + 250, /* (208) limit_opt ::= */ + 250, /* (209) limit_opt ::= LIMIT signed */ + 250, /* (210) limit_opt ::= LIMIT signed OFFSET signed */ + 250, /* (211) limit_opt ::= LIMIT signed COMMA signed */ + 249, /* (212) slimit_opt ::= */ + 249, /* (213) slimit_opt ::= SLIMIT signed */ + 249, /* (214) slimit_opt ::= SLIMIT signed SOFFSET signed */ + 249, /* (215) slimit_opt ::= SLIMIT signed COMMA signed */ + 240, /* (216) where_opt ::= */ + 240, /* (217) where_opt ::= WHERE expr */ + 254, /* (218) expr ::= LP expr RP */ + 254, /* (219) expr ::= ID */ + 254, /* (220) expr ::= ID DOT ID */ + 254, /* (221) expr ::= ID DOT STAR */ + 254, /* (222) expr ::= INTEGER */ + 254, /* (223) expr ::= MINUS INTEGER */ + 254, /* (224) expr ::= PLUS INTEGER */ + 254, /* (225) expr ::= FLOAT */ + 254, /* (226) expr ::= MINUS FLOAT */ + 254, /* (227) expr ::= PLUS FLOAT */ + 254, /* (228) expr ::= STRING */ + 254, /* (229) expr ::= NOW */ + 254, /* (230) expr ::= VARIABLE */ + 254, /* (231) expr ::= PLUS VARIABLE */ + 254, /* (232) expr ::= MINUS VARIABLE */ + 254, /* (233) expr ::= BOOL */ + 254, /* (234) expr ::= NULL */ + 254, /* (235) expr ::= ID LP exprlist RP */ + 254, /* (236) expr ::= ID LP STAR RP */ + 254, /* (237) expr ::= expr IS NULL */ + 254, /* (238) expr ::= expr IS NOT NULL */ + 254, /* (239) expr ::= expr LT expr */ + 254, /* (240) expr ::= expr GT expr */ + 254, /* (241) expr ::= expr LE expr */ + 254, /* (242) expr ::= expr GE expr */ + 254, /* (243) expr ::= expr NE expr */ + 254, /* (244) expr ::= expr EQ expr */ + 254, /* (245) expr ::= expr BETWEEN expr AND expr */ + 254, /* (246) expr ::= expr AND expr */ + 254, /* (247) expr ::= expr OR expr */ + 254, /* (248) expr ::= expr PLUS expr */ + 254, /* (249) expr ::= expr MINUS expr */ + 254, /* (250) expr ::= expr STAR expr */ + 254, /* (251) expr ::= expr SLASH expr */ + 254, /* (252) expr ::= expr REM expr */ + 254, /* (253) expr ::= expr LIKE expr */ + 254, /* (254) expr ::= expr IN LP exprlist RP */ + 264, /* (255) exprlist ::= exprlist COMMA expritem */ + 264, /* (256) exprlist ::= expritem */ + 265, /* (257) expritem ::= expr */ + 265, /* (258) expritem ::= */ + 190, /* (259) cmd ::= RESET QUERY CACHE */ + 190, /* (260) cmd ::= SYNCDB ids REPLICA */ + 190, /* (261) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + 190, /* (262) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + 190, /* (263) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + 190, /* (264) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + 190, /* (265) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + 190, /* (266) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + 190, /* (267) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + 190, /* (268) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + 190, /* (269) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + 190, /* (270) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + 190, /* (271) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + 190, /* (272) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + 190, /* (273) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + 190, /* (274) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + 190, /* (275) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + 190, /* (276) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + 190, /* (277) cmd ::= KILL CONNECTION INTEGER */ + 190, /* (278) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + 190, /* (279) cmd ::= KILL QUERY INTEGER COLON INTEGER */ +}; + +/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number +** of symbols on the right-hand side of that rule. */ +static const signed char yyRuleInfoNRhs[] = { + -1, /* (0) program ::= cmd */ + -2, /* (1) cmd ::= SHOW DATABASES */ + -2, /* (2) cmd ::= SHOW TOPICS */ + -2, /* (3) cmd ::= SHOW MNODES */ + -2, /* (4) cmd ::= SHOW DNODES */ + -2, /* (5) cmd ::= SHOW ACCOUNTS */ + -2, /* (6) cmd ::= SHOW USERS */ + -2, /* (7) cmd ::= SHOW MODULES */ + -2, /* (8) cmd ::= SHOW QUERIES */ + -2, /* (9) cmd ::= SHOW CONNECTIONS */ + -2, /* (10) cmd ::= SHOW STREAMS */ + -2, /* (11) cmd ::= SHOW VARIABLES */ + -2, /* (12) cmd ::= SHOW SCORES */ + -2, /* (13) cmd ::= SHOW GRANTS */ + -2, /* (14) cmd ::= SHOW VNODES */ + -3, /* (15) cmd ::= SHOW VNODES IPTOKEN */ + 0, /* (16) dbPrefix ::= */ + -2, /* (17) dbPrefix ::= ids DOT */ + 0, /* (18) cpxName ::= */ + -2, /* (19) cpxName ::= DOT ids */ + -5, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */ + -5, /* (21) cmd ::= SHOW CREATE STABLE ids cpxName */ + -4, /* (22) cmd ::= SHOW CREATE DATABASE ids */ + -3, /* (23) cmd ::= SHOW dbPrefix TABLES */ + -5, /* (24) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + -3, /* (25) cmd ::= SHOW dbPrefix STABLES */ + -5, /* (26) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + -3, /* (27) cmd ::= SHOW dbPrefix VGROUPS */ + -4, /* (28) cmd ::= SHOW dbPrefix VGROUPS ids */ + -5, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */ + -5, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */ + -4, /* (31) cmd ::= DROP DATABASE ifexists ids */ + -4, /* (32) cmd ::= DROP TOPIC ifexists ids */ + -3, /* (33) cmd ::= DROP DNODE ids */ + -3, /* (34) cmd ::= DROP USER ids */ + -3, /* (35) cmd ::= DROP ACCOUNT ids */ + -2, /* (36) cmd ::= USE ids */ + -3, /* (37) cmd ::= DESCRIBE ids cpxName */ + -5, /* (38) cmd ::= ALTER USER ids PASS ids */ + -5, /* (39) cmd ::= ALTER USER ids PRIVILEGE ids */ + -4, /* (40) cmd ::= ALTER DNODE ids ids */ + -5, /* (41) cmd ::= ALTER DNODE ids ids ids */ + -3, /* (42) cmd ::= ALTER LOCAL ids */ + -4, /* (43) cmd ::= ALTER LOCAL ids ids */ + -4, /* (44) cmd ::= ALTER DATABASE ids alter_db_optr */ + -4, /* (45) cmd ::= ALTER TOPIC ids alter_topic_optr */ + -4, /* (46) cmd ::= ALTER ACCOUNT ids acct_optr */ + -6, /* (47) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + -1, /* (48) ids ::= ID */ + -1, /* (49) ids ::= STRING */ + -2, /* (50) ifexists ::= IF EXISTS */ + 0, /* (51) ifexists ::= */ + -3, /* (52) ifnotexists ::= IF NOT EXISTS */ + 0, /* (53) ifnotexists ::= */ + -3, /* (54) cmd ::= CREATE DNODE ids */ + -6, /* (55) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + -5, /* (56) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + -5, /* (57) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + -5, /* (58) cmd ::= CREATE USER ids PASS ids */ + 0, /* (59) pps ::= */ + -2, /* (60) pps ::= PPS INTEGER */ + 0, /* (61) tseries ::= */ + -2, /* (62) tseries ::= TSERIES INTEGER */ + 0, /* (63) dbs ::= */ + -2, /* (64) dbs ::= DBS INTEGER */ + 0, /* (65) streams ::= */ + -2, /* (66) streams ::= STREAMS INTEGER */ + 0, /* (67) storage ::= */ + -2, /* (68) storage ::= STORAGE INTEGER */ + 0, /* (69) qtime ::= */ + -2, /* (70) qtime ::= QTIME INTEGER */ + 0, /* (71) users ::= */ + -2, /* (72) users ::= USERS INTEGER */ + 0, /* (73) conns ::= */ + -2, /* (74) conns ::= CONNS INTEGER */ + 0, /* (75) state ::= */ + -2, /* (76) state ::= STATE ids */ + -9, /* (77) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + -2, /* (78) keep ::= KEEP tagitemlist */ + -2, /* (79) cache ::= CACHE INTEGER */ + -2, /* (80) replica ::= REPLICA INTEGER */ + -2, /* (81) quorum ::= QUORUM INTEGER */ + -2, /* (82) days ::= DAYS INTEGER */ + -2, /* (83) minrows ::= MINROWS INTEGER */ + -2, /* (84) maxrows ::= MAXROWS INTEGER */ + -2, /* (85) blocks ::= BLOCKS INTEGER */ + -2, /* (86) ctime ::= CTIME INTEGER */ + -2, /* (87) wal ::= WAL INTEGER */ + -2, /* (88) fsync ::= FSYNC INTEGER */ + -2, /* (89) comp ::= COMP INTEGER */ + -2, /* (90) prec ::= PRECISION STRING */ + -2, /* (91) update ::= UPDATE INTEGER */ + -2, /* (92) cachelast ::= CACHELAST INTEGER */ + -2, /* (93) partitions ::= PARTITIONS INTEGER */ + 0, /* (94) db_optr ::= */ + -2, /* (95) db_optr ::= db_optr cache */ + -2, /* (96) db_optr ::= db_optr replica */ + -2, /* (97) db_optr ::= db_optr quorum */ + -2, /* (98) db_optr ::= db_optr days */ + -2, /* (99) db_optr ::= db_optr minrows */ + -2, /* (100) db_optr ::= db_optr maxrows */ + -2, /* (101) db_optr ::= db_optr blocks */ + -2, /* (102) db_optr ::= db_optr ctime */ + -2, /* (103) db_optr ::= db_optr wal */ + -2, /* (104) db_optr ::= db_optr fsync */ + -2, /* (105) db_optr ::= db_optr comp */ + -2, /* (106) db_optr ::= db_optr prec */ + -2, /* (107) db_optr ::= db_optr keep */ + -2, /* (108) db_optr ::= db_optr update */ + -2, /* (109) db_optr ::= db_optr cachelast */ + -1, /* (110) topic_optr ::= db_optr */ + -2, /* (111) topic_optr ::= topic_optr partitions */ + 0, /* (112) alter_db_optr ::= */ + -2, /* (113) alter_db_optr ::= alter_db_optr replica */ + -2, /* (114) alter_db_optr ::= alter_db_optr quorum */ + -2, /* (115) alter_db_optr ::= alter_db_optr keep */ + -2, /* (116) alter_db_optr ::= alter_db_optr blocks */ + -2, /* (117) alter_db_optr ::= alter_db_optr comp */ + -2, /* (118) alter_db_optr ::= alter_db_optr wal */ + -2, /* (119) alter_db_optr ::= alter_db_optr fsync */ + -2, /* (120) alter_db_optr ::= alter_db_optr update */ + -2, /* (121) alter_db_optr ::= alter_db_optr cachelast */ + -1, /* (122) alter_topic_optr ::= alter_db_optr */ + -2, /* (123) alter_topic_optr ::= alter_topic_optr partitions */ + -1, /* (124) typename ::= ids */ + -4, /* (125) typename ::= ids LP signed RP */ + -2, /* (126) typename ::= ids UNSIGNED */ + -1, /* (127) signed ::= INTEGER */ + -2, /* (128) signed ::= PLUS INTEGER */ + -2, /* (129) signed ::= MINUS INTEGER */ + -3, /* (130) cmd ::= CREATE TABLE create_table_args */ + -3, /* (131) cmd ::= CREATE TABLE create_stable_args */ + -3, /* (132) cmd ::= CREATE STABLE create_stable_args */ + -3, /* (133) cmd ::= CREATE TABLE create_table_list */ + -1, /* (134) create_table_list ::= create_from_stable */ + -2, /* (135) create_table_list ::= create_table_list create_from_stable */ + -6, /* (136) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + -10, /* (137) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + -10, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + -13, /* (139) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + -3, /* (140) tagNamelist ::= tagNamelist COMMA ids */ + -1, /* (141) tagNamelist ::= ids */ + -5, /* (142) create_table_args ::= ifnotexists ids cpxName AS select */ + -3, /* (143) columnlist ::= columnlist COMMA column */ + -1, /* (144) columnlist ::= column */ + -2, /* (145) column ::= ids typename */ + -3, /* (146) tagitemlist ::= tagitemlist COMMA tagitem */ + -1, /* (147) tagitemlist ::= tagitem */ + -1, /* (148) tagitem ::= INTEGER */ + -1, /* (149) tagitem ::= FLOAT */ + -1, /* (150) tagitem ::= STRING */ + -1, /* (151) tagitem ::= BOOL */ + -1, /* (152) tagitem ::= NULL */ + -2, /* (153) tagitem ::= MINUS INTEGER */ + -2, /* (154) tagitem ::= MINUS FLOAT */ + -2, /* (155) tagitem ::= PLUS INTEGER */ + -2, /* (156) tagitem ::= PLUS FLOAT */ + -14, /* (157) select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + -3, /* (158) select ::= LP select RP */ + -1, /* (159) union ::= select */ + -4, /* (160) union ::= union UNION ALL select */ + -1, /* (161) cmd ::= union */ + -2, /* (162) select ::= SELECT selcollist */ + -2, /* (163) sclp ::= selcollist COMMA */ + 0, /* (164) sclp ::= */ + -4, /* (165) selcollist ::= sclp distinct expr as */ + -2, /* (166) selcollist ::= sclp STAR */ + -2, /* (167) as ::= AS ids */ + -1, /* (168) as ::= ids */ + 0, /* (169) as ::= */ + -1, /* (170) distinct ::= DISTINCT */ + 0, /* (171) distinct ::= */ + -2, /* (172) from ::= FROM tablelist */ + -2, /* (173) from ::= FROM sub */ + -3, /* (174) sub ::= LP union RP */ + -4, /* (175) sub ::= LP union RP ids */ + -6, /* (176) sub ::= sub COMMA LP union RP ids */ + -2, /* (177) tablelist ::= ids cpxName */ + -3, /* (178) tablelist ::= ids cpxName ids */ + -4, /* (179) tablelist ::= tablelist COMMA ids cpxName */ + -5, /* (180) tablelist ::= tablelist COMMA ids cpxName ids */ + -1, /* (181) tmvar ::= VARIABLE */ + -4, /* (182) interval_opt ::= INTERVAL LP tmvar RP */ + -6, /* (183) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ + 0, /* (184) interval_opt ::= */ + 0, /* (185) session_option ::= */ + -7, /* (186) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + 0, /* (187) windowstate_option ::= */ + -4, /* (188) windowstate_option ::= STATE_WINDOW LP ids RP */ + 0, /* (189) fill_opt ::= */ + -6, /* (190) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + -4, /* (191) fill_opt ::= FILL LP ID RP */ + -4, /* (192) sliding_opt ::= SLIDING LP tmvar RP */ + 0, /* (193) sliding_opt ::= */ + 0, /* (194) orderby_opt ::= */ + -3, /* (195) orderby_opt ::= ORDER BY sortlist */ + -4, /* (196) sortlist ::= sortlist COMMA item sortorder */ + -2, /* (197) sortlist ::= item sortorder */ + -2, /* (198) item ::= ids cpxName */ + -1, /* (199) sortorder ::= ASC */ + -1, /* (200) sortorder ::= DESC */ + 0, /* (201) sortorder ::= */ + 0, /* (202) groupby_opt ::= */ + -3, /* (203) groupby_opt ::= GROUP BY grouplist */ + -3, /* (204) grouplist ::= grouplist COMMA item */ + -1, /* (205) grouplist ::= item */ + 0, /* (206) having_opt ::= */ + -2, /* (207) having_opt ::= HAVING expr */ + 0, /* (208) limit_opt ::= */ + -2, /* (209) limit_opt ::= LIMIT signed */ + -4, /* (210) limit_opt ::= LIMIT signed OFFSET signed */ + -4, /* (211) limit_opt ::= LIMIT signed COMMA signed */ + 0, /* (212) slimit_opt ::= */ + -2, /* (213) slimit_opt ::= SLIMIT signed */ + -4, /* (214) slimit_opt ::= SLIMIT signed SOFFSET signed */ + -4, /* (215) slimit_opt ::= SLIMIT signed COMMA signed */ + 0, /* (216) where_opt ::= */ + -2, /* (217) where_opt ::= WHERE expr */ + -3, /* (218) expr ::= LP expr RP */ + -1, /* (219) expr ::= ID */ + -3, /* (220) expr ::= ID DOT ID */ + -3, /* (221) expr ::= ID DOT STAR */ + -1, /* (222) expr ::= INTEGER */ + -2, /* (223) expr ::= MINUS INTEGER */ + -2, /* (224) expr ::= PLUS INTEGER */ + -1, /* (225) expr ::= FLOAT */ + -2, /* (226) expr ::= MINUS FLOAT */ + -2, /* (227) expr ::= PLUS FLOAT */ + -1, /* (228) expr ::= STRING */ + -1, /* (229) expr ::= NOW */ + -1, /* (230) expr ::= VARIABLE */ + -2, /* (231) expr ::= PLUS VARIABLE */ + -2, /* (232) expr ::= MINUS VARIABLE */ + -1, /* (233) expr ::= BOOL */ + -1, /* (234) expr ::= NULL */ + -4, /* (235) expr ::= ID LP exprlist RP */ + -4, /* (236) expr ::= ID LP STAR RP */ + -3, /* (237) expr ::= expr IS NULL */ + -4, /* (238) expr ::= expr IS NOT NULL */ + -3, /* (239) expr ::= expr LT expr */ + -3, /* (240) expr ::= expr GT expr */ + -3, /* (241) expr ::= expr LE expr */ + -3, /* (242) expr ::= expr GE expr */ + -3, /* (243) expr ::= expr NE expr */ + -3, /* (244) expr ::= expr EQ expr */ + -5, /* (245) expr ::= expr BETWEEN expr AND expr */ + -3, /* (246) expr ::= expr AND expr */ + -3, /* (247) expr ::= expr OR expr */ + -3, /* (248) expr ::= expr PLUS expr */ + -3, /* (249) expr ::= expr MINUS expr */ + -3, /* (250) expr ::= expr STAR expr */ + -3, /* (251) expr ::= expr SLASH expr */ + -3, /* (252) expr ::= expr REM expr */ + -3, /* (253) expr ::= expr LIKE expr */ + -5, /* (254) expr ::= expr IN LP exprlist RP */ + -3, /* (255) exprlist ::= exprlist COMMA expritem */ + -1, /* (256) exprlist ::= expritem */ + -1, /* (257) expritem ::= expr */ + 0, /* (258) expritem ::= */ + -3, /* (259) cmd ::= RESET QUERY CACHE */ + -3, /* (260) cmd ::= SYNCDB ids REPLICA */ + -7, /* (261) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (262) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + -7, /* (263) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (264) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + -7, /* (265) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + -8, /* (266) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (267) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (268) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + -7, /* (269) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (270) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + -7, /* (271) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (272) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + -7, /* (273) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + -8, /* (274) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (275) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (276) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + -3, /* (277) cmd ::= KILL CONNECTION INTEGER */ + -5, /* (278) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + -5, /* (279) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2060,30 +2379,34 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ** only called from one place, optimizing compilers will in-line it, which ** means that the extra parameters have no performance impact. */ -static void yy_reduce( +static YYACTIONTYPE yy_reduce( yyParser *yypParser, /* The parser */ unsigned int yyruleno, /* Number of the rule by which to reduce */ int yyLookahead, /* Lookahead token, or YYNOCODE if none */ ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ + ParseCTX_PDECL /* %extra_context */ ){ int yygoto; /* The next state */ - int yyact; /* The next action */ + YYACTIONTYPE yyact; /* The next action */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ - ParseARG_FETCH; + ParseARG_FETCH (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; #ifndef NDEBUG if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; + yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", yyTracePrompt, - yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; @@ -2101,13 +2424,19 @@ static void yy_reduce( #if YYSTACKDEPTH>0 if( yypParser->yytos>=yypParser->yystackEnd ){ yyStackOverflow(yypParser); - return; + /* The call to yyStackOverflow() above pops the stack until it is + ** empty, causing the main parser loop to exit. So the return value + ** is never used and does not matter. */ + return 0; } #else if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ if( yyGrowStack(yypParser) ){ yyStackOverflow(yypParser); - return; + /* The call to yyStackOverflow() above pops the stack until it is + ** empty, causing the main parser loop to exit. So the return value + ** is never used and does not matter. */ + return 0; } yymsp = yypParser->yytos; } @@ -3047,14 +3376,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 263: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 263: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 264: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 264: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 265: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3065,7 +3401,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 265: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 266: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3079,7 +3415,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 266: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 267: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; @@ -3091,14 +3427,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 267: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 268: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 269: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 268: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 270: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3109,14 +3452,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 269: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 271: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 272: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 270: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + case 273: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3127,7 +3477,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 271: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 274: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3141,22 +3491,41 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 272: /* cmd ::= KILL CONNECTION INTEGER */ + case 275: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ +{ + yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; + + toTSDBType(yymsp[-2].minor.yy0.type); + SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy442, -1); + + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 276: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy193, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 277: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 273: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 278: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} break; - case 274: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 279: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} break; default: break; /********** End reduce actions ************************************************/ }; - assert( yyrulenostateno = (YYACTIONTYPE)yyact; yymsp->major = (YYCODETYPE)yygoto; yyTraceShift(yypParser, yyact, "... then shift"); + return yyact; } /* @@ -3180,7 +3550,8 @@ static void yy_reduce( static void yy_parse_failed( yyParser *yypParser /* The parser */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); @@ -3191,7 +3562,8 @@ static void yy_parse_failed( ** parser fails */ /************ Begin %parse_failure code ***************************************/ /************ End %parse_failure code *****************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE } #endif /* YYNOERRORRECOVERY */ @@ -3203,7 +3575,8 @@ static void yy_syntax_error( int yymajor, /* The major type of the error token */ ParseTOKENTYPE yyminor /* The minor type of the error token */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ @@ -3229,7 +3602,8 @@ static void yy_syntax_error( assert(len <= outputBufLen); /************ End %syntax_error code ******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE } /* @@ -3238,7 +3612,8 @@ static void yy_syntax_error( static void yy_accept( yyParser *yypParser /* The parser */ ){ - ParseARG_FETCH; + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); @@ -3253,7 +3628,8 @@ static void yy_accept( /*********** Begin %parse_accept code *****************************************/ /*********** End %parse_accept code *******************************************/ - ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ + ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ + ParseCTX_STORE } /* The main parser program. @@ -3282,45 +3658,47 @@ void Parse( ParseARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; - unsigned int yyact; /* The parser action. */ + YYACTIONTYPE yyact; /* The parser action. */ #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) int yyendofinput; /* True if we are at the end of input */ #endif #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif - yyParser *yypParser; /* The parser */ + yyParser *yypParser = (yyParser*)yyp; /* The parser */ + ParseCTX_FETCH + ParseARG_STORE - yypParser = (yyParser*)yyp; assert( yypParser->yytos!=0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif - ParseARG_STORE; + yyact = yypParser->yytos->stateno; #ifndef NDEBUG if( yyTraceFILE ){ - int stateno = yypParser->yytos->stateno; - if( stateno < YY_MIN_REDUCE ){ + if( yyact < YY_MIN_REDUCE ){ fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", - yyTracePrompt,yyTokenName[yymajor],stateno); + yyTracePrompt,yyTokenName[yymajor],yyact); }else{ fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", - yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE); + yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE); } } #endif do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); + assert( yyact==yypParser->yytos->stateno ); + yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact >= YY_MIN_REDUCE ){ - yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); + yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, + yyminor ParseCTX_PARAM); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,yymajor,yyminor); + yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt--; #endif - yymajor = YYNOCODE; + break; }else if( yyact==YY_ACCEPT_ACTION ){ yypParser->yytos--; yy_accept(yypParser); @@ -3371,10 +3749,9 @@ void Parse( yymajor = YYNOCODE; }else{ while( yypParser->yytos >= yypParser->yystack - && yymx != YYERRORSYMBOL && (yyact = yy_find_reduce_action( yypParser->yytos->stateno, - YYERRORSYMBOL)) >= YY_MIN_REDUCE + YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE ){ yy_pop_parser_stack(yypParser); } @@ -3391,6 +3768,8 @@ void Parse( } yypParser->yyerrcnt = 3; yyerrorhit = 1; + if( yymajor==YYNOCODE ) break; + yyact = yypParser->yytos->stateno; #elif defined(YYNOERRORRECOVERY) /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax @@ -3401,8 +3780,7 @@ void Parse( */ yy_syntax_error(yypParser,yymajor, yyminor); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - yymajor = YYNOCODE; - + break; #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** @@ -3424,10 +3802,10 @@ void Parse( yypParser->yyerrcnt = -1; #endif } - yymajor = YYNOCODE; + break; #endif } - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); + }while( yypParser->yytos>yypParser->yystack ); #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; @@ -3442,3 +3820,17 @@ void Parse( #endif return; } + +/* +** Return the fallback token corresponding to canonical token iToken, or +** 0 if iToken has no fallback. +*/ +int ParseFallback(int iToken){ +#ifdef YYFALLBACK + assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ); + return yyFallback[iToken]; +#else + (void)iToken; + return 0; +#endif +} diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index ea15ced8983206809190c70d3f94f1be2d4c67ac..7026fcda0f156c9edc6fb17dd192aae88e3042a3 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -218,7 +218,8 @@ static SKeyword keywordTable[] = { {"DISTINCT", TK_DISTINCT}, {"PARTITIONS", TK_PARTITIONS}, {"TOPIC", TK_TOPIC}, - {"TOPICS", TK_TOPICS} + {"TOPICS", TK_TOPICS}, + {"MODIFY", TK_MODIFY} }; static const char isIdChar[] = { diff --git a/tests/pytest/query/queryInsertValue.py b/tests/pytest/query/queryInsertValue.py index 856801b4ee162a35e1e4e4b864860180960a1432..a6b2a88008a8f61a910b5bc6dfa7e41433da1758 100644 --- a/tests/pytest/query/queryInsertValue.py +++ b/tests/pytest/query/queryInsertValue.py @@ -45,7 +45,7 @@ class TDTestCase: tdSql.query("select * from st") tdSql.checkRows(1) - tdSql.execute("alter table st add column length int") + tdSql.execute("alter table st add column len int") tdSql.execute("insert into t1 values(now, 1, 2)") tdSql.query("select last(*) from st") tdSql.checkData(0, 2, 2); diff --git a/tests/script/general/parser/alter_column.sim b/tests/script/general/parser/alter_column.sim new file mode 100644 index 0000000000000000000000000000000000000000..fe109352d12ba42a5c9fe318766764a850132abf --- /dev/null +++ b/tests/script/general/parser/alter_column.sim @@ -0,0 +1,118 @@ +system sh/stop_dnodes.sh + +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/exec.sh -n dnode1 -s start +sleep 100 +sql connect + +$dbPrefix = m_alt_db +$tbPrefix = m_alt_tb +$mtPrefix = m_alt_mt +$tbNum = 10 +$rowNum = 5 +$totalNum = $tbNum * $rowNum +$ts0 = 1537146000000 +$delta = 600000 +print ========== alter.sim +$i = 0 +$db = $dbPrefix . $i +$mt = $mtPrefix . $i + +sql drop database if exists $db +sql create database $db +sql use $db +##### alter table test, simeplest case +sql create table tb (ts timestamp, c1 int, c2 binary(10), c3 nchar(10)) +sql insert into tb values (now, 1, "1", "1") +sql alter table tb modify column c2 binary(20); +if $rows != 0 then + return -1 +endi +sql alter table tb modify column c3 nchar(20); +if $rows != 0 then + return -1 +endi + + +sql create stable stb (ts timestamp, c1 int, c2 binary(10), c3 nchar(10)) tags(id1 int, id2 binary(10), id3 nchar(10)) +sql create table tb1 using stb tags(1, "a", "b") +sql insert into tb1 values (now, 1, "1", "1") +sql alter stable stb modify column c2 binary(20); +if $rows != 0 then + return -1 +endi +sql alter table stb modify column c2 binary(30); +if $rows != 0 then + return -1 +endi +sql alter stable stb modify column c3 nchar(20); +if $rows != 0 then + return -1 +endi +sql alter table stb modify column c3 nchar(30); +if $rows != 0 then + return -1 +endi + +sql alter table stb modify tag id2 binary(11); +if $rows != 0 then + return -1 +endi +sql alter stable stb modify tag id2 binary(11); +if $rows != 0 then + return -1 +endi +sql alter table stb modify tag id3 nchar(11); +if $rows != 0 then + return -1 +endi +sql alter stable stb modify tag id3 nchar(11); +if $rows != 0 then + return -1 +endi + +##### ILLEGAL OPERATIONS + +# try dropping columns that are defined in metric +sql_error alter table tb modify column c1 binary(10); +sql_error alter table tb modify column c1 double; +sql_error alter table tb modify column c2 int; +sql_error alter table tb modify column c2 binary(10); +sql_error alter table tb modify column c2 binary(9); +sql_error alter table tb modify column c2 binary(-9); +sql_error alter table tb modify column c2 binary(0); +sql_error alter table tb modify column c2 binary(17000); +sql_error alter table tb modify column c2 nchar(30); +sql_error alter table tb modify column c3 double; +sql_error alter table tb modify column c3 nchar(10); +sql_error alter table tb modify column c3 nchar(0); +sql_error alter table tb modify column c3 nchar(-1); +sql_error alter table tb modify column c3 binary(80); +sql_error alter table tb modify column c3 nchar(17000); +sql_error alter table tb modify column c3 nchar(100), c2 binary(30); +sql_error alter table tb modify column c1 nchar(100), c2 binary(30); +sql_error alter stable tb modify column c2 binary(30); +sql_error alter table tb modify tag c2 binary(30); +sql_error alter table stb modify tag id2 binary(10); +sql_error alter table stb modify tag id2 nchar(30); +sql_error alter stable stb modify tag id2 binary(10); +sql_error alter stable stb modify tag id2 nchar(30); +sql_error alter table stb modify tag id3 nchar(10); +sql_error alter table stb modify tag id3 binary(30); +sql_error alter stable stb modify tag id3 nchar(10); +sql_error alter stable stb modify tag id3 binary(30); +sql_error alter stable stb modify tag id1 binary(30); +sql_error alter stable stb modify tag c1 binary(30); + + +sql_error alter table tb1 modify column c2 binary(30); +sql_error alter table tb1 modify column c3 nchar(30); +sql_error alter table tb1 modify tag id2 binary(30); +sql_error alter table tb1 modify tag id3 nchar(30); +sql_error alter stable tb1 modify tag id2 binary(30); +sql_error alter stable tb1 modify tag id3 nchar(30); +sql_error alter stable tb1 modify column c2 binary(30); + + +system sh/exec.sh -n dnode1 -s stop -x SIGINT