From b00ba324f34879b112195fe3d3d741926625e962 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Wed, 2 Jun 2021 14:04:20 +0800 Subject: [PATCH] support modify tag column length --- src/client/src/tscSQLParser.c | 77 ++- src/inc/taosmsg.h | 1 + src/inc/ttokendef.h | 5 +- src/mnode/src/mnodeTable.c | 5 + src/query/inc/sql.y | 42 +- src/query/src/qSqlParser.c | 2 +- src/query/src/sql.c | 569 ++++++++++--------- src/util/src/ttokenizer.c | 2 +- tests/script/general/parser/alter_column.sim | 81 ++- 9 files changed, 472 insertions(+), 312 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 978fbaf521..80768b64f2 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5079,8 +5079,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 altered"; - const char* msg22 = "invalid column length"; + 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; @@ -5111,8 +5113,8 @@ 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))) { @@ -5334,14 +5336,18 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { 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), NULL); + if (taosArrayGetSize(pAlterSQL->pAddColumns) >= 2) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg16); } - tVariantListItem* pItem = taosArrayGet(pAlterSQL->pAddColumns, 0); + + 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->pVar.pz, .n = pItem->pVar.nLen}; + SStrToken name = {.type = TK_STRING, .z = pItem->name, .n = strlen(pItem->name)}; if (getColumnIndexByName(pCmd, &name, pQueryInfo, &columnIndex) != TSDB_CODE_SUCCESS) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg17); } @@ -5352,14 +5358,61 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg21); } - pItem = taosArrayGet(pAlterSQL->pAddColumns, 1); - int16_t nlen = 0; + if (pItem->type != pColSchema->type) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg23); + } - if (tVariantDump(&pItem->pVar, (char *)&nlen, TSDB_DATA_TYPE_SMALLINT, false) < 0 || nlen <= 0) { + 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 = 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, nlen); + TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes); tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f); } diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index ff3cc6e956..413f72720e 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 e5f1472317..e0c9abed18 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -155,7 +155,7 @@ #define TK_SYNCDB 136 #define TK_ADD 137 #define TK_COLUMN 138 -#define TK_LENGTH 139 +#define TK_MODIFY 139 #define TK_TAG 140 #define TK_CHANGE 141 #define TK_SET 142 @@ -211,6 +211,9 @@ + + + #define TK_SPACE 300 #define TK_COMMENT 301 #define TK_ILLEGAL 302 diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 6eca87514b..5b699c5e24 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -3218,6 +3218,11 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) { (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 { diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 3a6e1c0cc0..1b173a272f 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -754,15 +754,9 @@ 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) ALTER COLUMN LENGTH ids(A) INTEGER(Z). { +cmd ::= ALTER TABLE ids(X) cpxName(F) MODIFY COLUMN columnlist(A). { X.n += F.n; - - toTSDBType(A.type); - SArray* K = tVariantListAppendToken(NULL, &A, -1); - toTSDBType(Z.type); - K = tVariantListAppendToken(K, &Z, -1); - - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, K, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, A, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } @@ -806,6 +800,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). { @@ -824,15 +823,9 @@ 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) ALTER COLUMN LENGTH ids(A) INTEGER(Z). { +cmd ::= ALTER STABLE ids(X) cpxName(F) MODIFY COLUMN columnlist(A). { X.n += F.n; - - toTSDBType(A.type); - SArray* K = tVariantListAppendToken(NULL, &A, -1); - toTSDBType(Z.type); - K = tVariantListAppendToken(K, &Z, -1); - - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, K, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&X, A, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } @@ -865,6 +858,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 b912c9ffdc..d41b474953 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -887,7 +887,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 || type == TSDB_ALTER_TABLE_CHANGE_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 560e499228..588da79883 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -136,18 +136,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 331 -#define YYNRULE 275 -#define YYNRULE_WITH_ACTION 275 +#define YYNSTATE 337 +#define YYNRULE 278 +#define YYNRULE_WITH_ACTION 278 #define YYNTOKEN 188 -#define YY_MAX_SHIFT 330 -#define YY_MIN_SHIFTREDUCE 528 -#define YY_MAX_SHIFTREDUCE 802 -#define YY_ERROR_ACTION 803 -#define YY_ACCEPT_ACTION 804 -#define YY_NO_ACTION 805 -#define YY_MIN_REDUCE 806 -#define YY_MAX_REDUCE 1080 +#define YY_MAX_SHIFT 336 +#define YY_MIN_SHIFTREDUCE 533 +#define YY_MAX_SHIFTREDUCE 810 +#define YY_ERROR_ACTION 811 +#define YY_ACCEPT_ACTION 812 +#define YY_NO_ACTION 813 +#define YY_MIN_REDUCE 814 +#define YY_MAX_REDUCE 1091 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -214,78 +214,79 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (697) +#define YY_ACTTAB_COUNT (707) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 974, 576, 211, 328, 70, 18, 217, 965, 188, 577, - /* 10 */ 804, 330, 186, 48, 49, 146, 52, 53, 220, 1060, - /* 20 */ 223, 42, 214, 51, 272, 56, 54, 58, 55, 939, - /* 30 */ 655, 188, 953, 47, 46, 188, 938, 45, 44, 43, - /* 40 */ 48, 49, 1059, 52, 53, 219, 1060, 223, 42, 576, - /* 50 */ 51, 272, 56, 54, 58, 55, 965, 577, 304, 303, - /* 60 */ 47, 46, 971, 146, 45, 44, 43, 49, 31, 52, - /* 70 */ 53, 250, 139, 223, 42, 83, 51, 272, 56, 54, - /* 80 */ 58, 55, 288, 1009, 88, 267, 47, 46, 72, 314, - /* 90 */ 45, 44, 43, 529, 530, 531, 532, 533, 534, 535, - /* 100 */ 536, 537, 538, 539, 540, 541, 329, 235, 288, 212, - /* 110 */ 71, 576, 949, 48, 49, 31, 52, 53, 941, 577, - /* 120 */ 223, 42, 576, 51, 272, 56, 54, 58, 55, 269, - /* 130 */ 577, 81, 744, 47, 46, 257, 256, 45, 44, 43, - /* 140 */ 48, 50, 951, 52, 53, 146, 192, 223, 42, 77, - /* 150 */ 51, 272, 56, 54, 58, 55, 213, 37, 947, 950, - /* 160 */ 47, 46, 1, 160, 45, 44, 43, 24, 286, 323, - /* 170 */ 322, 285, 284, 283, 321, 282, 320, 319, 318, 281, - /* 180 */ 317, 316, 913, 31, 901, 902, 903, 904, 905, 906, - /* 190 */ 907, 908, 909, 910, 911, 912, 914, 915, 52, 53, - /* 200 */ 229, 29, 223, 42, 278, 51, 272, 56, 54, 58, - /* 210 */ 55, 694, 19, 1008, 25, 47, 46, 746, 965, 45, - /* 220 */ 44, 43, 222, 759, 226, 31, 748, 950, 751, 197, - /* 230 */ 754, 222, 759, 215, 13, 748, 198, 751, 87, 754, - /* 240 */ 84, 123, 122, 196, 45, 44, 43, 110, 56, 54, - /* 250 */ 58, 55, 314, 747, 208, 209, 47, 46, 271, 74, - /* 260 */ 45, 44, 43, 208, 209, 75, 227, 253, 24, 950, - /* 270 */ 323, 322, 77, 253, 750, 321, 753, 320, 319, 318, - /* 280 */ 37, 317, 316, 921, 1056, 679, 919, 920, 676, 698, - /* 290 */ 677, 922, 678, 924, 925, 923, 85, 926, 927, 108, - /* 300 */ 101, 113, 249, 691, 69, 31, 112, 118, 121, 111, - /* 310 */ 8, 205, 5, 34, 162, 115, 237, 238, 273, 161, - /* 320 */ 95, 90, 94, 31, 234, 57, 232, 936, 937, 30, - /* 330 */ 940, 301, 760, 293, 57, 180, 178, 176, 756, 31, - /* 340 */ 31, 760, 175, 126, 125, 124, 294, 756, 146, 950, - /* 350 */ 242, 47, 46, 1055, 755, 45, 44, 43, 1054, 246, - /* 360 */ 245, 228, 230, 755, 295, 324, 749, 950, 752, 852, - /* 370 */ 327, 326, 131, 172, 137, 135, 134, 3, 173, 1071, - /* 380 */ 302, 306, 221, 950, 950, 861, 757, 953, 953, 172, - /* 390 */ 62, 953, 853, 236, 680, 233, 172, 298, 297, 290, - /* 400 */ 725, 726, 251, 710, 716, 717, 32, 141, 61, 21, - /* 410 */ 65, 780, 63, 761, 763, 20, 82, 20, 665, 275, - /* 420 */ 667, 277, 32, 32, 61, 86, 6, 100, 666, 99, - /* 430 */ 66, 15, 61, 14, 107, 68, 106, 654, 206, 683, - /* 440 */ 17, 684, 16, 681, 207, 682, 120, 119, 952, 190, - /* 450 */ 191, 193, 187, 194, 195, 201, 202, 200, 185, 1019, - /* 460 */ 199, 189, 1018, 224, 40, 1015, 1014, 225, 305, 247, - /* 470 */ 138, 973, 156, 984, 1001, 981, 982, 966, 758, 254, - /* 480 */ 1000, 986, 140, 144, 136, 948, 157, 258, 148, 216, - /* 490 */ 709, 917, 963, 147, 149, 946, 150, 151, 158, 266, - /* 500 */ 159, 864, 280, 260, 265, 67, 64, 59, 38, 270, - /* 510 */ 183, 35, 289, 264, 268, 860, 1077, 96, 291, 1076, - /* 520 */ 1073, 163, 262, 296, 1070, 103, 299, 1069, 1066, 164, - /* 530 */ 882, 36, 33, 39, 184, 849, 114, 847, 116, 117, - /* 540 */ 845, 844, 239, 174, 842, 841, 840, 839, 838, 837, - /* 550 */ 177, 179, 41, 834, 832, 830, 828, 181, 825, 182, - /* 560 */ 259, 252, 315, 73, 78, 109, 261, 1002, 307, 308, - /* 570 */ 309, 310, 311, 312, 210, 313, 231, 325, 279, 802, - /* 580 */ 241, 240, 801, 204, 203, 243, 91, 92, 244, 800, - /* 590 */ 843, 786, 785, 248, 127, 274, 253, 686, 836, 167, - /* 600 */ 128, 166, 883, 165, 168, 169, 171, 129, 170, 835, - /* 610 */ 2, 130, 9, 827, 826, 26, 76, 4, 255, 79, - /* 620 */ 711, 152, 153, 154, 155, 929, 142, 218, 714, 143, - /* 630 */ 80, 263, 764, 718, 145, 10, 11, 762, 27, 7, - /* 640 */ 28, 12, 22, 276, 23, 89, 618, 87, 614, 612, - /* 650 */ 611, 610, 607, 580, 287, 93, 97, 796, 32, 789, - /* 660 */ 657, 656, 653, 98, 60, 102, 602, 600, 592, 598, - /* 670 */ 594, 292, 596, 590, 104, 588, 621, 620, 619, 617, - /* 680 */ 105, 300, 616, 615, 613, 609, 608, 61, 578, 545, - /* 690 */ 132, 543, 806, 805, 805, 805, 133, + /* 0 */ 982, 581, 215, 334, 75, 22, 221, 973, 192, 582, + /* 10 */ 812, 336, 190, 52, 53, 150, 56, 57, 224, 1068, + /* 20 */ 227, 46, 218, 55, 278, 60, 58, 62, 59, 947, + /* 30 */ 660, 192, 961, 51, 50, 192, 946, 49, 48, 47, + /* 40 */ 52, 53, 1067, 56, 57, 223, 1068, 227, 46, 581, + /* 50 */ 55, 278, 60, 58, 62, 59, 973, 582, 310, 309, + /* 60 */ 51, 50, 979, 150, 49, 48, 47, 53, 35, 56, + /* 70 */ 57, 256, 143, 227, 46, 88, 55, 278, 60, 58, + /* 80 */ 62, 59, 294, 1017, 93, 273, 51, 50, 77, 320, + /* 90 */ 49, 48, 47, 534, 535, 536, 537, 538, 539, 540, + /* 100 */ 541, 542, 543, 544, 545, 546, 335, 241, 294, 216, + /* 110 */ 76, 581, 957, 52, 53, 35, 56, 57, 949, 582, + /* 120 */ 227, 46, 581, 55, 278, 60, 58, 62, 59, 275, + /* 130 */ 582, 86, 749, 51, 50, 263, 262, 49, 48, 47, + /* 140 */ 52, 54, 959, 56, 57, 150, 196, 227, 46, 82, + /* 150 */ 55, 278, 60, 58, 62, 59, 217, 41, 955, 958, + /* 160 */ 51, 50, 1, 164, 49, 48, 47, 28, 292, 329, + /* 170 */ 328, 291, 290, 289, 327, 288, 326, 325, 324, 287, + /* 180 */ 323, 322, 921, 35, 909, 910, 911, 912, 913, 914, + /* 190 */ 915, 916, 917, 918, 919, 920, 922, 923, 56, 57, + /* 200 */ 233, 1064, 227, 46, 696, 55, 278, 60, 58, 62, + /* 210 */ 59, 8, 23, 1016, 29, 51, 50, 1063, 973, 49, + /* 220 */ 48, 47, 226, 764, 230, 35, 753, 958, 756, 201, + /* 230 */ 759, 226, 764, 219, 1062, 753, 202, 756, 755, 759, + /* 240 */ 758, 127, 126, 200, 49, 48, 47, 210, 60, 58, + /* 250 */ 62, 59, 3, 177, 212, 213, 51, 50, 277, 79, + /* 260 */ 49, 48, 47, 212, 213, 80, 231, 259, 28, 958, + /* 270 */ 329, 328, 82, 259, 754, 327, 757, 326, 325, 324, + /* 280 */ 41, 323, 322, 929, 114, 684, 927, 928, 681, 320, + /* 290 */ 682, 930, 683, 932, 933, 931, 90, 934, 935, 112, + /* 300 */ 106, 117, 255, 150, 74, 35, 116, 122, 125, 115, + /* 310 */ 237, 209, 5, 38, 166, 119, 243, 244, 211, 165, + /* 320 */ 100, 95, 99, 35, 240, 61, 225, 944, 945, 34, + /* 330 */ 948, 35, 765, 35, 61, 184, 182, 180, 761, 232, + /* 340 */ 234, 765, 179, 130, 129, 128, 299, 761, 35, 958, + /* 350 */ 762, 51, 50, 699, 760, 49, 48, 47, 35, 248, + /* 360 */ 35, 330, 35, 760, 300, 961, 961, 958, 252, 251, + /* 370 */ 6, 87, 301, 279, 302, 958, 13, 958, 194, 238, + /* 380 */ 92, 236, 89, 298, 297, 70, 763, 961, 751, 306, + /* 390 */ 124, 123, 958, 242, 685, 239, 860, 305, 304, 307, + /* 400 */ 176, 308, 958, 312, 958, 71, 958, 333, 332, 135, + /* 410 */ 141, 139, 138, 869, 257, 861, 67, 176, 36, 176, + /* 420 */ 730, 731, 715, 1087, 752, 721, 145, 195, 722, 66, + /* 430 */ 785, 703, 25, 766, 24, 670, 281, 24, 68, 36, + /* 440 */ 36, 672, 283, 671, 197, 66, 91, 66, 33, 191, + /* 450 */ 15, 284, 14, 105, 73, 104, 659, 198, 199, 17, + /* 460 */ 19, 16, 18, 205, 111, 21, 110, 20, 688, 768, + /* 470 */ 689, 686, 206, 687, 204, 1079, 960, 189, 203, 193, + /* 480 */ 1027, 1026, 228, 253, 1023, 1022, 229, 311, 142, 981, + /* 490 */ 992, 989, 44, 990, 994, 974, 260, 144, 1009, 148, + /* 500 */ 140, 160, 956, 1008, 161, 264, 925, 220, 266, 714, + /* 510 */ 954, 321, 971, 156, 151, 162, 152, 158, 276, 153, + /* 520 */ 163, 271, 63, 872, 286, 42, 187, 72, 69, 274, + /* 530 */ 39, 295, 868, 154, 296, 272, 1086, 102, 1085, 270, + /* 540 */ 1082, 268, 167, 303, 1078, 108, 1077, 1074, 168, 265, + /* 550 */ 890, 40, 37, 43, 188, 857, 118, 855, 120, 121, + /* 560 */ 853, 852, 245, 178, 850, 849, 848, 847, 846, 845, + /* 570 */ 181, 183, 842, 840, 838, 836, 185, 833, 45, 186, + /* 580 */ 113, 258, 78, 83, 313, 267, 1010, 314, 315, 316, + /* 590 */ 317, 318, 319, 214, 235, 331, 810, 285, 246, 247, + /* 600 */ 809, 207, 208, 96, 97, 249, 250, 808, 791, 790, + /* 610 */ 254, 81, 259, 851, 691, 280, 844, 171, 170, 891, + /* 620 */ 169, 172, 174, 173, 175, 131, 132, 133, 843, 4, + /* 630 */ 134, 835, 9, 834, 30, 261, 2, 716, 84, 146, + /* 640 */ 155, 157, 937, 159, 719, 85, 222, 147, 269, 31, + /* 650 */ 723, 149, 32, 767, 10, 7, 11, 769, 12, 26, + /* 660 */ 282, 27, 94, 623, 92, 619, 617, 616, 615, 612, + /* 670 */ 585, 293, 98, 64, 101, 36, 662, 661, 658, 607, + /* 680 */ 605, 65, 103, 597, 603, 599, 601, 595, 593, 107, + /* 690 */ 109, 626, 625, 624, 622, 621, 620, 618, 614, 613, + /* 700 */ 583, 66, 550, 548, 814, 136, 137, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 191, 1, 190, 191, 197, 252, 210, 234, 252, 9, @@ -308,57 +309,57 @@ static const YYCODETYPE yy_lookahead[] = { /* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, /* 180 */ 101, 102, 209, 191, 211, 212, 213, 214, 215, 216, /* 190 */ 217, 218, 219, 220, 221, 222, 223, 224, 16, 17, - /* 200 */ 233, 104, 20, 21, 107, 23, 24, 25, 26, 27, - /* 210 */ 28, 37, 44, 259, 104, 33, 34, 1, 234, 37, + /* 200 */ 233, 252, 20, 21, 109, 23, 24, 25, 26, 27, + /* 210 */ 28, 116, 44, 259, 104, 33, 34, 252, 234, 37, /* 220 */ 38, 39, 1, 2, 232, 191, 5, 235, 7, 61, - /* 230 */ 9, 1, 2, 249, 104, 5, 68, 7, 108, 9, - /* 240 */ 110, 73, 74, 75, 37, 38, 39, 76, 25, 26, - /* 250 */ 27, 28, 81, 37, 33, 34, 33, 34, 37, 105, + /* 230 */ 9, 1, 2, 249, 252, 5, 68, 7, 5, 9, + /* 240 */ 7, 73, 74, 75, 37, 38, 39, 252, 25, 26, + /* 250 */ 27, 28, 194, 195, 33, 34, 33, 34, 37, 105, /* 260 */ 37, 38, 39, 33, 34, 105, 232, 113, 88, 235, /* 270 */ 90, 91, 104, 113, 5, 95, 7, 97, 98, 99, - /* 280 */ 112, 101, 102, 209, 252, 2, 212, 213, 5, 115, + /* 280 */ 112, 101, 102, 209, 76, 2, 212, 213, 5, 81, /* 290 */ 7, 217, 9, 219, 220, 221, 197, 223, 224, 62, - /* 300 */ 63, 64, 134, 109, 136, 191, 69, 70, 71, 72, - /* 310 */ 116, 143, 62, 63, 64, 78, 33, 34, 15, 69, - /* 320 */ 70, 71, 72, 191, 68, 104, 68, 228, 229, 230, - /* 330 */ 231, 75, 111, 75, 104, 62, 63, 64, 117, 191, - /* 340 */ 191, 111, 69, 70, 71, 72, 232, 117, 191, 235, - /* 350 */ 135, 33, 34, 252, 133, 37, 38, 39, 252, 144, - /* 360 */ 145, 210, 210, 133, 232, 210, 5, 235, 7, 196, - /* 370 */ 65, 66, 67, 200, 62, 63, 64, 194, 195, 236, - /* 380 */ 232, 232, 60, 235, 235, 196, 117, 236, 236, 200, - /* 390 */ 109, 236, 196, 137, 111, 137, 200, 141, 142, 141, - /* 400 */ 124, 125, 105, 105, 105, 105, 109, 109, 109, 109, - /* 410 */ 109, 105, 131, 105, 111, 109, 259, 109, 105, 105, - /* 420 */ 105, 105, 109, 109, 109, 109, 104, 138, 105, 140, - /* 430 */ 129, 138, 109, 140, 138, 104, 140, 106, 252, 5, - /* 440 */ 138, 7, 140, 5, 252, 7, 76, 77, 236, 252, - /* 450 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 227, - /* 460 */ 252, 252, 227, 227, 251, 227, 227, 227, 227, 191, - /* 470 */ 191, 191, 238, 191, 260, 191, 191, 234, 117, 234, - /* 480 */ 260, 191, 191, 191, 60, 234, 191, 256, 246, 256, - /* 490 */ 117, 225, 248, 247, 245, 191, 244, 243, 191, 121, - /* 500 */ 191, 191, 191, 256, 256, 128, 130, 127, 191, 122, - /* 510 */ 191, 191, 191, 120, 126, 191, 191, 191, 191, 191, - /* 520 */ 191, 191, 119, 191, 191, 191, 191, 191, 191, 191, - /* 530 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, - /* 540 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, - /* 550 */ 191, 191, 132, 191, 191, 191, 191, 191, 191, 191, - /* 560 */ 118, 192, 103, 192, 192, 87, 192, 192, 86, 50, - /* 570 */ 83, 85, 54, 84, 192, 82, 192, 79, 192, 5, - /* 580 */ 5, 146, 5, 192, 192, 146, 197, 197, 5, 5, - /* 590 */ 192, 90, 89, 135, 193, 107, 113, 105, 192, 202, - /* 600 */ 193, 206, 208, 207, 205, 203, 201, 193, 204, 192, - /* 610 */ 198, 193, 104, 192, 192, 104, 114, 194, 109, 109, - /* 620 */ 105, 242, 241, 240, 239, 225, 104, 1, 105, 109, - /* 630 */ 104, 104, 111, 105, 104, 123, 123, 105, 109, 104, - /* 640 */ 109, 104, 104, 107, 104, 76, 9, 108, 5, 5, - /* 650 */ 5, 5, 5, 80, 15, 76, 140, 5, 109, 5, - /* 660 */ 5, 5, 105, 139, 16, 140, 5, 5, 5, 5, - /* 670 */ 5, 138, 5, 5, 140, 5, 5, 5, 5, 5, - /* 680 */ 139, 138, 5, 5, 5, 5, 5, 109, 80, 60, - /* 690 */ 21, 59, 0, 264, 264, 264, 21, 264, 264, 264, - /* 700 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 300 */ 63, 64, 134, 191, 136, 191, 69, 70, 71, 72, + /* 310 */ 68, 143, 62, 63, 64, 78, 33, 34, 252, 69, + /* 320 */ 70, 71, 72, 191, 68, 104, 60, 228, 229, 230, + /* 330 */ 231, 191, 111, 191, 104, 62, 63, 64, 117, 210, + /* 340 */ 210, 111, 69, 70, 71, 72, 232, 117, 191, 235, + /* 350 */ 117, 33, 34, 37, 133, 37, 38, 39, 191, 135, + /* 360 */ 191, 210, 191, 133, 232, 236, 236, 235, 144, 145, + /* 370 */ 104, 259, 232, 15, 232, 235, 104, 235, 252, 137, + /* 380 */ 108, 139, 110, 141, 142, 109, 117, 236, 1, 232, + /* 390 */ 76, 77, 235, 137, 111, 139, 196, 141, 142, 232, + /* 400 */ 200, 232, 235, 232, 235, 129, 235, 65, 66, 67, + /* 410 */ 62, 63, 64, 196, 105, 196, 109, 200, 109, 200, + /* 420 */ 124, 125, 105, 236, 37, 105, 109, 252, 105, 109, + /* 430 */ 105, 115, 109, 105, 109, 105, 105, 109, 131, 109, + /* 440 */ 109, 105, 105, 105, 252, 109, 109, 109, 104, 252, + /* 450 */ 138, 107, 140, 138, 104, 140, 106, 252, 252, 138, + /* 460 */ 138, 140, 140, 252, 138, 138, 140, 140, 5, 111, + /* 470 */ 7, 5, 252, 7, 252, 236, 236, 252, 252, 252, + /* 480 */ 227, 227, 227, 191, 227, 227, 227, 227, 191, 191, + /* 490 */ 191, 191, 251, 191, 191, 234, 234, 191, 260, 191, + /* 500 */ 60, 238, 234, 260, 191, 256, 225, 256, 256, 117, + /* 510 */ 191, 103, 248, 242, 247, 191, 246, 240, 122, 245, + /* 520 */ 191, 256, 127, 191, 191, 191, 191, 128, 130, 126, + /* 530 */ 191, 191, 191, 244, 191, 121, 191, 191, 191, 120, + /* 540 */ 191, 119, 191, 191, 191, 191, 191, 191, 191, 118, + /* 550 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + /* 560 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + /* 570 */ 191, 191, 191, 191, 191, 191, 191, 191, 132, 191, + /* 580 */ 87, 192, 192, 192, 86, 192, 192, 50, 83, 85, + /* 590 */ 54, 84, 82, 192, 192, 79, 5, 192, 146, 5, + /* 600 */ 5, 192, 192, 197, 197, 146, 5, 5, 90, 89, + /* 610 */ 135, 114, 113, 192, 105, 107, 192, 202, 206, 208, + /* 620 */ 207, 205, 204, 203, 201, 193, 193, 193, 192, 194, + /* 630 */ 193, 192, 104, 192, 104, 109, 198, 105, 109, 104, + /* 640 */ 243, 241, 225, 239, 105, 104, 1, 109, 104, 109, + /* 650 */ 105, 104, 109, 105, 123, 104, 123, 111, 104, 104, + /* 660 */ 107, 104, 76, 9, 108, 5, 5, 5, 5, 5, + /* 670 */ 80, 15, 76, 16, 140, 109, 5, 5, 105, 5, + /* 680 */ 5, 16, 140, 5, 5, 5, 5, 5, 5, 140, + /* 690 */ 140, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /* 700 */ 80, 109, 60, 59, 0, 21, 21, 264, 264, 264, /* 710 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 720 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 730 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, @@ -376,106 +377,107 @@ static const YYCODETYPE yy_lookahead[] = { /* 850 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 860 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 870 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, - /* 880 */ 264, 264, 264, 264, 264, + /* 880 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 890 */ 264, 264, 264, 264, 264, }; -#define YY_SHIFT_COUNT (330) +#define YY_SHIFT_COUNT (336) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (692) +#define YY_SHIFT_MAX (704) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 168, 79, 79, 180, 180, 3, 221, 230, 110, 121, - /* 10 */ 121, 121, 121, 121, 121, 121, 121, 121, 0, 48, - /* 20 */ 230, 283, 283, 283, 283, 45, 45, 121, 121, 121, - /* 30 */ 29, 121, 121, 171, 3, 8, 8, 697, 697, 697, - /* 40 */ 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + /* 10 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + /* 20 */ 121, 121, 0, 48, 230, 283, 283, 283, 283, 45, + /* 30 */ 45, 121, 121, 121, 29, 121, 121, 208, 3, 8, + /* 40 */ 8, 707, 707, 707, 230, 230, 230, 230, 230, 230, /* 50 */ 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - /* 60 */ 283, 283, 25, 25, 25, 25, 25, 25, 25, 121, - /* 70 */ 121, 121, 174, 121, 121, 121, 45, 45, 121, 121, - /* 80 */ 121, 276, 276, 194, 45, 121, 121, 121, 121, 121, + /* 60 */ 230, 230, 230, 230, 283, 283, 283, 25, 25, 25, + /* 70 */ 25, 25, 25, 25, 121, 121, 121, 316, 121, 121, + /* 80 */ 121, 45, 45, 121, 121, 121, 296, 296, 95, 45, /* 90 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, /* 100 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, /* 110 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, /* 120 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - /* 130 */ 121, 121, 121, 121, 121, 121, 121, 121, 424, 424, - /* 140 */ 424, 373, 373, 373, 424, 373, 424, 377, 376, 380, - /* 150 */ 387, 388, 378, 393, 403, 442, 420, 424, 424, 424, - /* 160 */ 459, 3, 3, 424, 424, 478, 482, 519, 487, 486, - /* 170 */ 518, 489, 493, 459, 424, 498, 498, 424, 498, 424, - /* 180 */ 498, 424, 424, 697, 697, 27, 100, 127, 100, 100, - /* 190 */ 53, 182, 223, 223, 223, 223, 237, 250, 273, 318, - /* 200 */ 318, 318, 318, 256, 258, 215, 207, 207, 269, 361, - /* 210 */ 130, 305, 312, 297, 154, 160, 298, 299, 300, 306, - /* 220 */ 308, 216, 322, 303, 281, 301, 313, 314, 315, 316, - /* 230 */ 323, 97, 289, 293, 296, 331, 302, 434, 438, 370, - /* 240 */ 574, 435, 575, 577, 439, 583, 584, 501, 503, 458, - /* 250 */ 483, 488, 508, 502, 492, 511, 509, 510, 515, 522, - /* 260 */ 523, 520, 526, 626, 527, 528, 530, 529, 512, 531, - /* 270 */ 513, 532, 535, 521, 537, 488, 538, 536, 540, 539, - /* 280 */ 569, 637, 643, 644, 645, 646, 647, 573, 639, 579, - /* 290 */ 516, 652, 524, 533, 549, 549, 648, 525, 534, 654, - /* 300 */ 541, 543, 549, 655, 656, 557, 549, 661, 662, 663, - /* 310 */ 664, 665, 667, 668, 670, 671, 672, 673, 674, 677, - /* 320 */ 678, 679, 680, 681, 578, 608, 669, 675, 629, 632, - /* 330 */ 692, + /* 130 */ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + /* 140 */ 121, 121, 440, 440, 440, 392, 392, 392, 440, 392, + /* 150 */ 440, 399, 398, 395, 396, 403, 414, 419, 422, 431, + /* 160 */ 446, 440, 440, 440, 408, 3, 3, 440, 440, 493, + /* 170 */ 498, 537, 505, 504, 536, 507, 510, 408, 440, 516, + /* 180 */ 516, 440, 516, 440, 516, 440, 440, 707, 707, 27, + /* 190 */ 100, 127, 100, 100, 53, 182, 223, 223, 223, 223, + /* 200 */ 237, 250, 273, 318, 318, 318, 318, 242, 256, 224, + /* 210 */ 207, 207, 233, 269, 272, 342, 348, 309, 154, 160, + /* 220 */ 317, 320, 323, 325, 328, 387, 266, 358, 307, 276, + /* 230 */ 330, 331, 336, 337, 338, 344, 312, 315, 321, 322, + /* 240 */ 326, 350, 327, 463, 466, 314, 591, 452, 594, 595, + /* 250 */ 459, 601, 602, 518, 520, 475, 499, 508, 528, 497, + /* 260 */ 509, 530, 526, 529, 532, 535, 539, 538, 541, 645, + /* 270 */ 544, 545, 547, 540, 531, 543, 533, 548, 551, 546, + /* 280 */ 554, 508, 555, 553, 557, 556, 586, 654, 660, 661, + /* 290 */ 662, 663, 664, 590, 656, 596, 657, 534, 542, 566, + /* 300 */ 566, 566, 566, 665, 549, 550, 566, 566, 566, 671, + /* 310 */ 672, 573, 566, 674, 675, 678, 679, 680, 681, 682, + /* 320 */ 683, 686, 687, 688, 689, 690, 691, 692, 693, 694, + /* 330 */ 592, 620, 684, 685, 642, 644, 704, }; -#define YY_REDUCE_COUNT (184) +#define YY_REDUCE_COUNT (188) #define YY_REDUCE_MIN (-247) -#define YY_REDUCE_MAX (423) +#define YY_REDUCE_MAX (441) static const short yy_reduce_ofst[] = { /* 0 */ -178, -27, -27, 74, 74, 99, -244, -217, -119, -76, - /* 10 */ -176, -128, -8, 34, 114, 132, 148, 149, -191, -188, - /* 20 */ -221, -204, 151, 152, 155, -227, -16, -46, 157, -33, - /* 30 */ -113, -84, -123, 173, -193, 189, 196, -162, -36, 183, - /* 40 */ -247, -240, -106, 32, 101, 106, 186, 192, 197, 198, - /* 50 */ 199, 200, 201, 202, 203, 204, 205, 206, 208, 209, - /* 60 */ 143, 212, 232, 235, 236, 238, 239, 240, 241, 278, - /* 70 */ 279, 280, 213, 282, 284, 285, 243, 245, 290, 291, - /* 80 */ 292, 214, 220, 234, 251, 295, 304, 307, 309, 310, - /* 90 */ 311, 317, 319, 320, 321, 324, 325, 326, 327, 328, - /* 100 */ 329, 330, 332, 333, 334, 335, 336, 337, 338, 339, - /* 110 */ 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - /* 120 */ 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - /* 130 */ 360, 362, 363, 364, 365, 366, 367, 368, 369, 371, - /* 140 */ 372, 231, 233, 247, 374, 248, 375, 244, 246, 242, - /* 150 */ 249, 252, 254, 379, 381, 383, 385, 382, 384, 386, - /* 160 */ 266, 389, 390, 391, 392, 394, 396, 395, 397, 399, - /* 170 */ 402, 404, 405, 400, 398, 401, 407, 406, 414, 417, - /* 180 */ 418, 421, 422, 412, 423, + /* 10 */ -176, -128, -8, 34, 114, 132, 140, 142, 157, 167, + /* 20 */ 169, 171, -191, -188, -221, -204, 129, 130, 151, -227, + /* 30 */ -16, -46, 112, -33, -113, -84, -123, 200, -193, 217, + /* 40 */ 219, -162, -36, 58, -247, -240, -106, -51, -35, -18, + /* 50 */ -5, 66, 126, 175, 192, 197, 205, 206, 211, 220, + /* 60 */ 222, 225, 226, 227, 187, 239, 240, 253, 254, 255, + /* 70 */ 257, 258, 259, 260, 292, 297, 298, 241, 299, 300, + /* 80 */ 302, 261, 262, 303, 306, 308, 238, 243, 263, 268, + /* 90 */ 313, 319, 324, 329, 332, 333, 334, 335, 339, 340, + /* 100 */ 341, 343, 345, 346, 347, 349, 351, 352, 353, 354, + /* 110 */ 355, 356, 357, 359, 360, 361, 362, 363, 364, 365, + /* 120 */ 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + /* 130 */ 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + /* 140 */ 386, 388, 389, 390, 391, 249, 251, 252, 393, 265, + /* 150 */ 394, 264, 267, 270, 274, 289, 397, 271, 400, 277, + /* 160 */ 404, 401, 402, 405, 281, 406, 407, 409, 410, 411, + /* 170 */ 413, 412, 415, 416, 420, 418, 423, 417, 421, 432, + /* 180 */ 433, 424, 434, 436, 437, 439, 441, 438, 435, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 803, 916, 862, 928, 850, 859, 1062, 1062, 803, 803, - /* 10 */ 803, 803, 803, 803, 803, 803, 803, 803, 975, 822, - /* 20 */ 1062, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 30 */ 859, 803, 803, 865, 859, 865, 865, 970, 900, 918, - /* 40 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 50 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 60 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 70 */ 803, 803, 977, 983, 980, 803, 803, 803, 985, 803, - /* 80 */ 803, 1005, 1005, 968, 803, 803, 803, 803, 803, 803, - /* 90 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 100 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 110 */ 803, 803, 803, 803, 848, 803, 846, 803, 803, 803, - /* 120 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 130 */ 803, 833, 803, 803, 803, 803, 803, 803, 824, 824, - /* 140 */ 824, 803, 803, 803, 824, 803, 824, 1012, 1016, 1010, - /* 150 */ 998, 1006, 997, 993, 991, 990, 1020, 824, 824, 824, - /* 160 */ 863, 859, 859, 824, 824, 881, 879, 877, 869, 875, - /* 170 */ 871, 873, 867, 851, 824, 857, 857, 824, 857, 824, - /* 180 */ 857, 824, 824, 900, 918, 803, 1021, 803, 1061, 1011, - /* 190 */ 1051, 1050, 1057, 1049, 1048, 1047, 803, 803, 803, 1043, - /* 200 */ 1044, 1046, 1045, 803, 803, 803, 1053, 1052, 803, 803, - /* 210 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 220 */ 803, 803, 1023, 803, 1017, 1013, 803, 803, 803, 803, - /* 230 */ 803, 803, 803, 803, 803, 930, 803, 803, 803, 803, - /* 240 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 250 */ 967, 803, 803, 803, 803, 803, 979, 978, 803, 803, - /* 260 */ 803, 803, 803, 803, 803, 803, 803, 1007, 803, 999, - /* 270 */ 803, 803, 803, 803, 803, 942, 803, 803, 803, 803, - /* 280 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 290 */ 803, 803, 803, 803, 1075, 1072, 803, 803, 803, 803, - /* 300 */ 803, 803, 1068, 803, 803, 803, 1065, 803, 803, 803, - /* 310 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - /* 320 */ 803, 803, 803, 803, 884, 803, 831, 829, 803, 820, - /* 330 */ 803, + /* 0 */ 811, 924, 870, 936, 858, 867, 1070, 1070, 811, 811, + /* 10 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 20 */ 811, 811, 983, 830, 1070, 811, 811, 811, 811, 811, + /* 30 */ 811, 811, 811, 811, 867, 811, 811, 873, 867, 873, + /* 40 */ 873, 978, 908, 926, 811, 811, 811, 811, 811, 811, + /* 50 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 60 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 70 */ 811, 811, 811, 811, 811, 811, 811, 985, 991, 988, + /* 80 */ 811, 811, 811, 993, 811, 811, 1013, 1013, 976, 811, + /* 90 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 100 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 110 */ 811, 811, 811, 811, 811, 811, 811, 811, 856, 811, + /* 120 */ 854, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 130 */ 811, 811, 811, 811, 811, 841, 811, 811, 811, 811, + /* 140 */ 811, 811, 832, 832, 832, 811, 811, 811, 832, 811, + /* 150 */ 832, 1020, 1024, 1018, 1006, 1014, 1005, 1001, 999, 998, + /* 160 */ 1028, 832, 832, 832, 871, 867, 867, 832, 832, 889, + /* 170 */ 887, 885, 877, 883, 879, 881, 875, 859, 832, 865, + /* 180 */ 865, 832, 865, 832, 865, 832, 832, 908, 926, 811, + /* 190 */ 1029, 811, 1069, 1019, 1059, 1058, 1065, 1057, 1056, 1055, + /* 200 */ 811, 811, 811, 1051, 1052, 1054, 1053, 811, 811, 811, + /* 210 */ 1061, 1060, 811, 811, 811, 811, 811, 811, 811, 811, + /* 220 */ 811, 811, 811, 811, 811, 811, 1031, 811, 1025, 1021, + /* 230 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 240 */ 811, 938, 811, 811, 811, 811, 811, 811, 811, 811, + /* 250 */ 811, 811, 811, 811, 811, 811, 975, 811, 811, 811, + /* 260 */ 811, 811, 987, 986, 811, 811, 811, 811, 811, 811, + /* 270 */ 811, 811, 811, 1015, 811, 1007, 811, 811, 811, 811, + /* 280 */ 811, 950, 811, 811, 811, 811, 811, 811, 811, 811, + /* 290 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 1088, + /* 300 */ 1083, 1084, 1081, 811, 811, 811, 1080, 1075, 1076, 811, + /* 310 */ 811, 811, 1073, 811, 811, 811, 811, 811, 811, 811, + /* 320 */ 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, + /* 330 */ 892, 811, 839, 837, 811, 828, 811, }; /********** End of lemon-generated parsing tables *****************************/ @@ -634,7 +636,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* SYNCDB => nothing */ 0, /* ADD => nothing */ 0, /* COLUMN => nothing */ - 0, /* LENGTH => nothing */ + 0, /* MODIFY => nothing */ 0, /* TAG => nothing */ 0, /* CHANGE => nothing */ 0, /* SET => nothing */ @@ -909,7 +911,7 @@ static const char *const yyTokenName[] = { /* 136 */ "SYNCDB", /* 137 */ "ADD", /* 138 */ "COLUMN", - /* 139 */ "LENGTH", + /* 139 */ "MODIFY", /* 140 */ "TAG", /* 141 */ "CHANGE", /* 142 */ "SET", @@ -1302,20 +1304,23 @@ static const char *const yyRuleName[] = { /* 258 */ "cmd ::= SYNCDB ids REPLICA", /* 259 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", /* 260 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 261 */ "cmd ::= ALTER TABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER", + /* 261 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", /* 262 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", /* 263 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", /* 264 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", /* 265 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 266 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 267 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 268 */ "cmd ::= ALTER STABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER", - /* 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", + /* 266 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 267 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 268 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 269 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 270 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 271 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 272 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 273 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 274 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 275 */ "cmd ::= KILL CONNECTION INTEGER", + /* 276 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 277 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -2043,20 +2048,23 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 189, /* (258) cmd ::= SYNCDB ids REPLICA */ 189, /* (259) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ 189, /* (260) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - 189, /* (261) cmd ::= ALTER TABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER */ + 189, /* (261) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ 189, /* (262) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ 189, /* (263) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ 189, /* (264) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ 189, /* (265) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - 189, /* (266) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - 189, /* (267) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - 189, /* (268) cmd ::= ALTER STABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER */ - 189, /* (269) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - 189, /* (270) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - 189, /* (271) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - 189, /* (272) cmd ::= KILL CONNECTION INTEGER */ - 189, /* (273) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - 189, /* (274) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + 189, /* (266) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + 189, /* (267) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + 189, /* (268) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + 189, /* (269) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + 189, /* (270) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + 189, /* (271) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + 189, /* (272) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + 189, /* (273) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + 189, /* (274) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + 189, /* (275) cmd ::= KILL CONNECTION INTEGER */ + 189, /* (276) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + 189, /* (277) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -2323,20 +2331,23 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (258) cmd ::= SYNCDB ids REPLICA */ -7, /* (259) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ -7, /* (260) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - -9, /* (261) cmd ::= ALTER TABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER */ + -7, /* (261) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ -7, /* (262) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ -7, /* (263) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ -8, /* (264) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ -9, /* (265) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (266) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (267) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - -9, /* (268) cmd ::= ALTER STABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER */ - -7, /* (269) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - -7, /* (270) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - -8, /* (271) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - -3, /* (272) cmd ::= KILL CONNECTION INTEGER */ - -5, /* (273) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - -5, /* (274) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + -7, /* (266) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + -7, /* (267) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (268) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + -7, /* (269) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + -7, /* (270) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + -7, /* (271) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + -8, /* (272) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (273) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (274) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + -3, /* (275) cmd ::= KILL CONNECTION INTEGER */ + -5, /* (276) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + -5, /* (277) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3340,16 +3351,10 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 261: /* cmd ::= ALTER TABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER */ + case 261: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ { - yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; - - toTSDBType(yymsp[-1].minor.yy0.type); - SArray* K = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); - toTSDBType(yymsp[0].minor.yy0.type); - K = tVariantListAppendToken(K, &yymsp[0].minor.yy0, -1); - - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, K, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; @@ -3397,14 +3402,21 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 266: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 266: /* 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.yy285, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 267: /* 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.yy285, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 267: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 268: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3415,27 +3427,21 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 268: /* cmd ::= ALTER STABLE ids cpxName ALTER COLUMN LENGTH ids INTEGER */ + case 269: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ { - yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; - - toTSDBType(yymsp[-1].minor.yy0.type); - SArray* K = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); - toTSDBType(yymsp[0].minor.yy0.type); - K = tVariantListAppendToken(K, &yymsp[0].minor.yy0, -1); - - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, K, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 269: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 270: /* 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.yy285, 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 271: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3446,7 +3452,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 271: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 272: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3460,13 +3466,32 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 272: /* cmd ::= KILL CONNECTION INTEGER */ + case 273: /* 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.yy362, -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 274: /* 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.yy285, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); +} + break; + case 275: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 273: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 276: /* 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 277: /* 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: diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index 24852abbf2..0e661e84c5 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -218,7 +218,7 @@ static SKeyword keywordTable[] = { {"PARTITIONS", TK_PARTITIONS}, {"TOPIC", TK_TOPIC}, {"TOPICS", TK_TOPICS}, - {"LENGTH", TK_LENGTH} + {"MODIFY", TK_MODIFY} }; static const char isIdChar[] = { diff --git a/tests/script/general/parser/alter_column.sim b/tests/script/general/parser/alter_column.sim index 7f30498d06..fe109352d1 100644 --- a/tests/script/general/parser/alter_column.sim +++ b/tests/script/general/parser/alter_column.sim @@ -25,20 +25,49 @@ 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 alter column length c2 20; +sql alter table tb modify column c2 binary(20); if $rows != 0 then return -1 endi -sql alter table tb alter column length c3 20; +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(id int) -sql create table tb1 using stb tags(1) +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 alter column length c2 20; +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 @@ -46,10 +75,44 @@ endi ##### ILLEGAL OPERATIONS # try dropping columns that are defined in metric -sql_error alter table tb alter column length c1 10; -sql_error alter stable tb alter column length c2 10; -sql_error alter table tb1 alter column length c2 10; -sql_error alter stable tb1 alter column length c2 10; +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 -- GitLab