From 0081c145aedc65b2a576d0acc3f36f0e1fd25e7a Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 22 Mar 2022 13:57:50 +0800 Subject: [PATCH 01/15] rename vnodes to vnode --- source/dnode/mgmt/vnode/src/vmInt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mgmt/vnode/src/vmInt.c b/source/dnode/mgmt/vnode/src/vmInt.c index 1c6c7d089e..c6122c0501 100644 --- a/source/dnode/mgmt/vnode/src/vmInt.c +++ b/source/dnode/mgmt/vnode/src/vmInt.c @@ -342,7 +342,7 @@ void vmGetMgmtFp(SMgmtWrapper *pWrapper) { mgmtFp.requiredFp = vmRequire; vmInitMsgHandles(pWrapper); - pWrapper->name = "vnodes"; + pWrapper->name = "vnode"; pWrapper->fp = mgmtFp; } From 3cdeed0d447bc8bee039cdc62fc912b7d7fe1db9 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 22 Mar 2022 13:59:48 +0800 Subject: [PATCH 02/15] rename TDB to TSDB for log --- source/dnode/vnode/src/inc/tsdbLog.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/dnode/vnode/src/inc/tsdbLog.h b/source/dnode/vnode/src/inc/tsdbLog.h index 56dc8ab2a0..3afe628198 100644 --- a/source/dnode/vnode/src/inc/tsdbLog.h +++ b/source/dnode/vnode/src/inc/tsdbLog.h @@ -24,12 +24,12 @@ extern "C" { extern int32_t tsdbDebugFlag; -#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TDB FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0) -#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TDB ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0) -#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TDB WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0) -#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TDB ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0) -#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TDB ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0) -#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) +#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TSDB FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0) +#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TSDB ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0) +#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TSDB WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0) +#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TSDB ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0) +#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSDB ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0) +#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) #ifdef __cplusplus } From 746ed7d795ea4a25f3ce8618b8d8b1951724714c Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 22 Mar 2022 02:09:15 -0400 Subject: [PATCH 03/15] TD-14221 bugfix --- source/libs/parser/inc/sql.y | 25 +- source/libs/parser/src/sql.c | 2687 +++++++++++++++++----------------- 2 files changed, 1402 insertions(+), 1310 deletions(-) diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 2298ae0761..0fcd7e8d35 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -337,10 +337,31 @@ literal(A) ::= duration_literal(B). duration_literal(A) ::= NK_VARIABLE(B). { A = createRawExprNode(pCxt, &B, createDurationValueNode(pCxt, &B)); } +signed(A) ::= NK_INTEGER(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B); } +signed(A) ::= NK_PLUS NK_INTEGER(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B); } +signed(A) ::= NK_MINUS(B) NK_INTEGER(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + } +signed(A) ::= NK_FLOAT(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &B); } +signed(A) ::= NK_PLUS NK_FLOAT(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &B); } +signed(A) ::= NK_MINUS(B) NK_FLOAT(C). { + SToken t = B; + t.n = (C.z + C.n) - B.z; + A = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + } + +signed_literal(A) ::= signed(B). { A = B; } +signed_literal(A) ::= NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } +signed_literal(A) ::= NK_BOOL(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &B); } +signed_literal(A) ::= TIMESTAMP NK_STRING(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &B); } +signed_literal(A) ::= duration_literal(B). { A = releaseRawExprNode(pCxt, B); } + %type literal_list { SNodeList* } %destructor literal_list { nodesDestroyList($$); } -literal_list(A) ::= literal(B). { A = createNodeList(pCxt, releaseRawExprNode(pCxt, B)); } -literal_list(A) ::= literal_list(B) NK_COMMA literal(C). { A = addNodeToList(pCxt, B, releaseRawExprNode(pCxt, C)); } +literal_list(A) ::= signed_literal(B). { A = createNodeList(pCxt, B); } +literal_list(A) ::= literal_list(B) NK_COMMA signed_literal(C). { A = addNodeToList(pCxt, B, C); } /************************************************ names and identifiers ***********************************************/ %type db_name { SToken } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 3d88eb5336..923476bd62 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -99,24 +99,24 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char -#define YYNOCODE 249 +#define YYNOCODE 251 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SNode* yy26; - EOrder yy32; - SNodeList* yy64; - EOperatorType yy80; - bool yy107; - EFillMode yy192; - SToken yy353; - SDataType yy370; - EJoinType yy372; - ENullOrder yy391; - SAlterOption yy443; - int32_t yy448; + int32_t yy88; + EJoinType yy184; + EOperatorType yy194; + SDataType yy218; + SAlterOption yy233; + EFillMode yy256; + SToken yy269; + ENullOrder yy339; + bool yy345; + SNode* yy348; + SNodeList* yy358; + EOrder yy368; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -131,17 +131,17 @@ typedef union { #define ParseCTX_PARAM #define ParseCTX_FETCH #define ParseCTX_STORE -#define YYNSTATE 414 -#define YYNRULE 316 +#define YYNSTATE 417 +#define YYNRULE 327 #define YYNTOKEN 160 -#define YY_MAX_SHIFT 413 -#define YY_MIN_SHIFTREDUCE 631 -#define YY_MAX_SHIFTREDUCE 946 -#define YY_ERROR_ACTION 947 -#define YY_ACCEPT_ACTION 948 -#define YY_NO_ACTION 949 -#define YY_MIN_REDUCE 950 -#define YY_MAX_REDUCE 1265 +#define YY_MAX_SHIFT 416 +#define YY_MIN_SHIFTREDUCE 645 +#define YY_MAX_SHIFTREDUCE 971 +#define YY_ERROR_ACTION 972 +#define YY_ACCEPT_ACTION 973 +#define YY_NO_ACTION 974 +#define YY_MIN_REDUCE 975 +#define YY_MAX_REDUCE 1301 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -208,379 +208,381 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (1182) +#define YY_ACTTAB_COUNT (1198) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 996, 347, 347, 24, 162, 334, 253, 1057, 227, 1049, - /* 10 */ 108, 1115, 1158, 31, 29, 27, 26, 25, 951, 331, - /* 20 */ 347, 1098, 1060, 1060, 103, 64, 962, 31, 29, 27, - /* 30 */ 26, 25, 263, 233, 1051, 973, 1106, 1108, 304, 76, - /* 40 */ 346, 1060, 75, 74, 73, 72, 71, 70, 69, 68, - /* 50 */ 67, 201, 398, 397, 396, 395, 394, 393, 392, 391, - /* 60 */ 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - /* 70 */ 380, 1130, 1130, 30, 28, 829, 31, 29, 27, 26, - /* 80 */ 25, 224, 346, 808, 76, 852, 42, 75, 74, 73, - /* 90 */ 72, 71, 70, 69, 68, 67, 275, 102, 270, 42, - /* 100 */ 806, 274, 1244, 1056, 273, 1063, 271, 1105, 88, 272, - /* 110 */ 289, 12, 950, 214, 201, 1243, 1055, 815, 1103, 1242, - /* 120 */ 23, 222, 346, 847, 848, 849, 850, 851, 853, 855, - /* 130 */ 856, 857, 807, 254, 1, 10, 86, 85, 84, 83, - /* 140 */ 82, 81, 80, 79, 78, 1132, 290, 303, 852, 747, - /* 150 */ 369, 368, 367, 751, 366, 753, 754, 365, 756, 362, - /* 160 */ 410, 762, 359, 764, 765, 356, 353, 287, 1244, 215, - /* 170 */ 942, 943, 817, 310, 305, 10, 913, 1143, 809, 812, - /* 180 */ 285, 116, 1130, 23, 222, 1242, 847, 848, 849, 850, - /* 190 */ 851, 853, 855, 856, 857, 117, 117, 1158, 300, 911, - /* 200 */ 912, 914, 915, 1132, 331, 31, 29, 27, 26, 25, - /* 210 */ 333, 347, 347, 888, 1130, 1143, 344, 345, 815, 319, - /* 220 */ 105, 1025, 60, 1144, 1147, 1183, 948, 230, 249, 200, - /* 230 */ 1179, 117, 1060, 1060, 347, 1158, 972, 292, 248, 64, - /* 240 */ 1130, 1244, 318, 247, 315, 246, 269, 309, 333, 379, - /* 250 */ 1158, 96, 1130, 1197, 116, 1060, 180, 331, 1242, 1090, - /* 260 */ 61, 1144, 1147, 1183, 243, 91, 1105, 217, 1179, 111, - /* 270 */ 1194, 237, 229, 1130, 245, 244, 308, 1103, 1143, 406, - /* 280 */ 405, 158, 30, 28, 889, 89, 347, 296, 1210, 819, - /* 290 */ 224, 175, 808, 1244, 317, 112, 1190, 1191, 1158, 1195, - /* 300 */ 228, 315, 27, 26, 25, 318, 116, 1060, 102, 806, - /* 310 */ 1242, 333, 51, 1143, 239, 1130, 1062, 58, 1202, 884, - /* 320 */ 12, 818, 91, 61, 1144, 1147, 1183, 92, 1036, 1053, - /* 330 */ 217, 1179, 111, 1158, 1052, 31, 29, 27, 26, 25, - /* 340 */ 331, 807, 89, 1, 887, 267, 333, 232, 1143, 266, - /* 350 */ 1130, 1211, 113, 1190, 1191, 102, 1195, 910, 61, 1144, - /* 360 */ 1147, 1183, 235, 1062, 117, 217, 1179, 1256, 1158, 410, - /* 370 */ 102, 77, 372, 971, 268, 331, 1217, 254, 1062, 1143, - /* 380 */ 1105, 333, 30, 28, 157, 1130, 234, 809, 812, 1035, - /* 390 */ 224, 1103, 808, 61, 1144, 1147, 1183, 829, 347, 1158, - /* 400 */ 217, 1179, 1256, 236, 9, 8, 331, 30, 28, 806, - /* 410 */ 1130, 1240, 333, 30, 28, 224, 1130, 808, 1143, 1060, - /* 420 */ 12, 224, 334, 808, 61, 1144, 1147, 1183, 1116, 1197, - /* 430 */ 808, 217, 1179, 1256, 806, 669, 970, 670, 1158, 669, - /* 440 */ 806, 807, 1201, 1, 1045, 331, 1193, 806, 1047, 376, - /* 450 */ 1105, 333, 261, 375, 969, 1130, 1143, 1034, 671, 21, - /* 460 */ 319, 1107, 322, 190, 1144, 1147, 807, 854, 7, 410, - /* 470 */ 858, 149, 807, 1130, 7, 1105, 1158, 865, 377, 807, - /* 480 */ 57, 6, 1244, 331, 968, 147, 1104, 809, 812, 333, - /* 490 */ 1143, 1130, 53, 1130, 410, 116, 967, 374, 373, 1242, - /* 500 */ 410, 62, 1144, 1147, 1183, 820, 379, 410, 1182, 1179, - /* 510 */ 1158, 315, 809, 812, 30, 28, 332, 331, 809, 812, - /* 520 */ 966, 1130, 224, 333, 808, 809, 812, 1130, 896, 117, - /* 530 */ 965, 964, 91, 1130, 817, 62, 1144, 1147, 1183, 1133, - /* 540 */ 961, 806, 329, 1179, 960, 30, 28, 319, 945, 946, - /* 550 */ 959, 1143, 89, 224, 958, 808, 957, 1130, 131, 9, - /* 560 */ 8, 129, 155, 1190, 314, 413, 313, 1130, 1130, 1244, - /* 570 */ 884, 1158, 806, 807, 956, 7, 1130, 1130, 331, 178, - /* 580 */ 1043, 1130, 116, 87, 333, 955, 1242, 1130, 1130, 402, - /* 590 */ 1143, 1130, 177, 1130, 954, 323, 106, 1144, 1147, 330, - /* 600 */ 144, 410, 953, 126, 807, 326, 1, 110, 1197, 321, - /* 610 */ 1158, 1130, 371, 259, 963, 242, 125, 331, 59, 809, - /* 620 */ 812, 173, 1130, 333, 1026, 1192, 133, 1130, 1143, 132, - /* 630 */ 159, 1130, 410, 320, 1257, 62, 1144, 1147, 1183, 1130, - /* 640 */ 991, 135, 43, 1180, 134, 123, 137, 301, 1158, 136, - /* 650 */ 809, 812, 1143, 859, 343, 331, 986, 295, 152, 324, - /* 660 */ 141, 333, 276, 1143, 185, 1130, 984, 32, 223, 187, - /* 670 */ 844, 327, 1158, 196, 1144, 1147, 1099, 826, 278, 331, - /* 680 */ 122, 186, 104, 1158, 120, 333, 1143, 260, 281, 1130, - /* 690 */ 331, 32, 297, 1137, 118, 1213, 333, 196, 1144, 1147, - /* 700 */ 1130, 1143, 316, 798, 167, 1159, 1158, 1135, 195, 1144, - /* 710 */ 1147, 1033, 339, 331, 161, 172, 1143, 32, 165, 333, - /* 720 */ 2, 1158, 250, 1130, 238, 815, 93, 823, 331, 94, - /* 730 */ 119, 106, 1144, 1147, 333, 816, 1158, 1143, 1130, 311, - /* 740 */ 251, 221, 252, 331, 740, 735, 196, 1144, 1147, 333, - /* 750 */ 822, 41, 1143, 1130, 255, 124, 225, 1158, 96, 77, - /* 760 */ 821, 196, 1144, 1147, 331, 262, 264, 768, 1143, 1258, - /* 770 */ 333, 376, 1158, 772, 1130, 375, 778, 1050, 777, 331, - /* 780 */ 117, 351, 194, 1144, 1147, 333, 66, 94, 1158, 1130, - /* 790 */ 95, 1143, 96, 128, 97, 331, 1143, 197, 1144, 1147, - /* 800 */ 377, 333, 1046, 291, 130, 1130, 98, 1143, 94, 99, - /* 810 */ 1048, 1158, 1143, 188, 1144, 1147, 1158, 1044, 331, 374, - /* 820 */ 373, 140, 100, 331, 333, 101, 213, 1158, 1130, 333, - /* 830 */ 820, 1214, 1158, 1130, 331, 293, 198, 1144, 1147, 331, - /* 840 */ 333, 189, 1144, 1147, 1130, 333, 1224, 1143, 294, 1130, - /* 850 */ 1143, 302, 199, 1144, 1147, 337, 145, 1155, 1144, 1147, - /* 860 */ 812, 148, 299, 216, 298, 5, 1204, 1158, 1223, 312, - /* 870 */ 1158, 4, 884, 90, 331, 819, 151, 331, 109, 1198, - /* 880 */ 333, 33, 153, 333, 1130, 1143, 154, 1130, 218, 328, - /* 890 */ 17, 1241, 1154, 1144, 1147, 1153, 1144, 1147, 1259, 325, - /* 900 */ 1143, 160, 1165, 340, 1114, 1158, 335, 169, 336, 50, - /* 910 */ 341, 1113, 331, 226, 1061, 342, 1143, 179, 333, 52, - /* 920 */ 1158, 1143, 1130, 315, 181, 176, 409, 331, 191, 349, - /* 930 */ 204, 1144, 1147, 333, 183, 184, 1158, 1130, 1124, 192, - /* 940 */ 999, 1158, 1123, 331, 91, 203, 1144, 1147, 331, 333, - /* 950 */ 1122, 240, 1143, 1130, 333, 241, 1121, 208, 1130, 1039, - /* 960 */ 1038, 205, 1144, 1147, 89, 998, 202, 1144, 1147, 1000, - /* 970 */ 995, 983, 1158, 121, 114, 1190, 1191, 280, 1195, 331, - /* 980 */ 978, 1120, 267, 1111, 1037, 333, 266, 684, 997, 1130, - /* 990 */ 994, 256, 288, 258, 257, 982, 981, 193, 1144, 1147, - /* 1000 */ 209, 977, 207, 206, 1041, 265, 139, 65, 127, 781, - /* 1010 */ 283, 268, 1040, 783, 782, 277, 713, 712, 711, 138, - /* 1020 */ 992, 275, 210, 270, 710, 709, 274, 987, 708, 273, - /* 1030 */ 211, 271, 279, 985, 272, 212, 282, 976, 284, 975, - /* 1040 */ 286, 63, 1119, 1118, 1110, 38, 36, 142, 37, 44, - /* 1050 */ 3, 20, 32, 143, 14, 39, 146, 15, 306, 34, - /* 1060 */ 307, 31, 29, 27, 26, 25, 22, 909, 903, 47, - /* 1070 */ 11, 107, 150, 931, 930, 45, 31, 29, 27, 26, - /* 1080 */ 25, 902, 46, 8, 881, 880, 219, 935, 1109, 934, - /* 1090 */ 220, 993, 1135, 980, 19, 949, 936, 170, 827, 164, - /* 1100 */ 350, 156, 13, 35, 115, 18, 231, 354, 357, 360, - /* 1110 */ 907, 16, 845, 163, 166, 363, 53, 746, 168, 48, - /* 1120 */ 774, 704, 776, 775, 348, 49, 400, 1134, 769, 40, - /* 1130 */ 352, 399, 766, 355, 401, 378, 763, 757, 682, 358, - /* 1140 */ 171, 338, 174, 703, 361, 702, 755, 364, 701, 700, - /* 1150 */ 699, 698, 54, 55, 697, 56, 696, 705, 695, 694, - /* 1160 */ 761, 693, 692, 691, 690, 689, 403, 370, 688, 687, - /* 1170 */ 404, 979, 974, 407, 760, 408, 759, 810, 758, 182, - /* 1180 */ 411, 412, + /* 0 */ 1021, 1167, 180, 43, 1194, 1115, 215, 1163, 1169, 24, + /* 10 */ 162, 333, 88, 31, 29, 27, 26, 25, 976, 1167, + /* 20 */ 1080, 232, 27, 26, 25, 1163, 1168, 31, 29, 27, + /* 30 */ 26, 25, 306, 235, 1167, 1076, 1131, 1133, 1074, 77, + /* 40 */ 1163, 1168, 76, 75, 74, 73, 72, 71, 70, 69, + /* 50 */ 68, 201, 401, 400, 399, 398, 397, 396, 395, 394, + /* 60 */ 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, + /* 70 */ 383, 840, 1155, 30, 28, 854, 31, 29, 27, 26, + /* 80 */ 25, 224, 348, 822, 77, 877, 43, 76, 75, 74, + /* 90 */ 73, 72, 71, 70, 69, 68, 277, 349, 272, 1130, + /* 100 */ 820, 276, 255, 1081, 275, 214, 273, 9, 8, 274, + /* 110 */ 1128, 12, 975, 336, 201, 348, 227, 6, 1085, 1140, + /* 120 */ 23, 222, 108, 872, 873, 874, 875, 876, 878, 880, + /* 130 */ 881, 882, 821, 1123, 1, 10, 86, 85, 84, 83, + /* 140 */ 82, 81, 80, 79, 78, 291, 409, 408, 877, 761, + /* 150 */ 372, 371, 370, 765, 369, 767, 768, 368, 770, 365, + /* 160 */ 413, 776, 362, 778, 779, 359, 356, 103, 10, 987, + /* 170 */ 967, 968, 31, 29, 27, 26, 25, 1179, 823, 826, + /* 180 */ 890, 292, 844, 23, 222, 117, 872, 873, 874, 875, + /* 190 */ 876, 878, 880, 881, 882, 117, 117, 1194, 126, 348, + /* 200 */ 1194, 842, 110, 1280, 333, 1280, 909, 333, 261, 1061, + /* 210 */ 335, 125, 349, 237, 1155, 1179, 1279, 1082, 116, 321, + /* 220 */ 1278, 102, 1278, 305, 61, 1180, 1183, 1219, 310, 1087, + /* 230 */ 228, 200, 1215, 1085, 854, 1194, 349, 44, 102, 1179, + /* 240 */ 123, 346, 320, 1280, 998, 234, 1087, 1179, 335, 312, + /* 250 */ 307, 52, 1155, 102, 105, 1050, 116, 1085, 256, 1194, + /* 260 */ 1278, 1087, 62, 1180, 1183, 1219, 333, 1194, 1078, 217, + /* 270 */ 1215, 111, 335, 117, 333, 122, 1155, 157, 1179, 120, + /* 280 */ 335, 1155, 59, 158, 1155, 997, 106, 1180, 1183, 298, + /* 290 */ 1246, 325, 92, 973, 63, 1180, 1183, 1219, 1194, 1077, + /* 300 */ 269, 1218, 1215, 822, 268, 320, 31, 29, 27, 26, + /* 310 */ 25, 335, 311, 185, 996, 1155, 256, 1179, 187, 684, + /* 320 */ 820, 683, 1155, 322, 1293, 62, 1180, 1183, 1219, 270, + /* 330 */ 186, 104, 217, 1215, 111, 20, 131, 1194, 239, 129, + /* 340 */ 685, 1179, 1233, 118, 333, 31, 29, 27, 26, 25, + /* 350 */ 335, 1155, 821, 1247, 1155, 326, 995, 336, 1130, 1230, + /* 360 */ 1233, 1194, 1280, 1141, 62, 1180, 1183, 1219, 333, 1132, + /* 370 */ 1130, 217, 1215, 1292, 335, 116, 229, 1229, 1155, 1278, + /* 380 */ 413, 1128, 1253, 1179, 30, 28, 914, 994, 62, 1180, + /* 390 */ 1183, 1219, 224, 1155, 822, 217, 1215, 1292, 823, 826, + /* 400 */ 349, 102, 349, 1194, 21, 347, 1276, 65, 1130, 1088, + /* 410 */ 333, 820, 879, 349, 265, 883, 335, 845, 65, 1129, + /* 420 */ 1155, 1085, 12, 1085, 1155, 271, 1179, 970, 971, 117, + /* 430 */ 62, 1180, 1183, 1219, 1085, 993, 1130, 217, 1215, 1292, + /* 440 */ 1016, 683, 236, 821, 349, 1, 1194, 1128, 1237, 175, + /* 450 */ 992, 1059, 324, 333, 1025, 843, 30, 28, 263, 335, + /* 460 */ 1238, 909, 278, 1155, 224, 1085, 822, 317, 321, 30, + /* 470 */ 28, 413, 1155, 190, 1180, 1183, 349, 224, 921, 822, + /* 480 */ 913, 238, 133, 820, 842, 132, 991, 1155, 91, 823, + /* 490 */ 826, 382, 1280, 375, 12, 990, 820, 1085, 1179, 989, + /* 500 */ 382, 986, 985, 321, 135, 116, 277, 134, 272, 1278, + /* 510 */ 89, 276, 144, 984, 275, 821, 273, 1, 1194, 274, + /* 520 */ 155, 1226, 316, 1155, 315, 333, 983, 1280, 821, 982, + /* 530 */ 7, 335, 1155, 9, 8, 1155, 1155, 1233, 1155, 1155, + /* 540 */ 116, 30, 28, 413, 1278, 63, 1180, 1183, 1219, 224, + /* 550 */ 1155, 822, 331, 1215, 1228, 317, 413, 30, 28, 334, + /* 560 */ 289, 823, 826, 1155, 981, 224, 1155, 822, 820, 416, + /* 570 */ 30, 28, 328, 287, 823, 826, 91, 980, 224, 137, + /* 580 */ 822, 294, 136, 178, 820, 244, 1179, 87, 829, 979, + /* 590 */ 978, 117, 828, 405, 1070, 96, 177, 820, 89, 323, + /* 600 */ 821, 1155, 7, 988, 1072, 1068, 1194, 319, 112, 1226, + /* 610 */ 1227, 912, 1231, 333, 1155, 1011, 821, 1009, 7, 335, + /* 620 */ 832, 332, 60, 1155, 831, 173, 1155, 1155, 413, 821, + /* 630 */ 374, 1, 1179, 63, 1180, 1183, 1219, 280, 329, 283, + /* 640 */ 935, 1216, 149, 58, 413, 208, 823, 826, 1051, 159, + /* 650 */ 1249, 303, 1194, 1124, 41, 54, 147, 413, 345, 333, + /* 660 */ 262, 297, 823, 826, 141, 335, 152, 1179, 884, 1155, + /* 670 */ 269, 1195, 223, 161, 268, 823, 826, 318, 2, 196, + /* 680 */ 1180, 1183, 32, 851, 1173, 1179, 240, 1194, 209, 840, + /* 690 */ 207, 206, 869, 267, 333, 848, 812, 32, 1171, 270, + /* 700 */ 335, 252, 938, 841, 1155, 1194, 167, 299, 119, 1179, + /* 710 */ 32, 253, 333, 1060, 196, 1180, 1183, 341, 335, 847, + /* 720 */ 165, 254, 1155, 42, 302, 936, 937, 939, 940, 1194, + /* 730 */ 257, 93, 195, 1180, 1183, 1179, 333, 172, 754, 840, + /* 740 */ 749, 846, 335, 264, 124, 266, 1155, 1075, 128, 251, + /* 750 */ 1071, 94, 96, 67, 41, 1194, 106, 1180, 1183, 250, + /* 760 */ 1179, 213, 333, 313, 249, 782, 248, 786, 335, 130, + /* 770 */ 98, 99, 1155, 379, 792, 221, 1073, 378, 1058, 354, + /* 780 */ 1194, 94, 196, 1180, 1183, 245, 1069, 333, 95, 791, + /* 790 */ 97, 100, 1179, 335, 1294, 247, 246, 1155, 140, 101, + /* 800 */ 225, 296, 380, 96, 94, 231, 230, 196, 1180, 1183, + /* 810 */ 1179, 293, 1194, 295, 845, 834, 304, 339, 1260, 333, + /* 820 */ 145, 377, 376, 1250, 826, 335, 301, 216, 1179, 1155, + /* 830 */ 1194, 1259, 827, 1179, 148, 241, 1179, 333, 379, 194, + /* 840 */ 1180, 1183, 378, 335, 5, 314, 300, 1155, 1194, 1240, + /* 850 */ 4, 109, 153, 1194, 844, 333, 1194, 197, 1180, 1183, + /* 860 */ 333, 335, 909, 333, 830, 1155, 335, 380, 1179, 335, + /* 870 */ 1155, 1179, 151, 1155, 90, 188, 1180, 1183, 33, 1234, + /* 880 */ 198, 1180, 1183, 189, 1180, 1183, 377, 376, 1194, 218, + /* 890 */ 1295, 1194, 350, 1277, 330, 333, 327, 154, 333, 160, + /* 900 */ 17, 335, 1201, 1179, 335, 1155, 1179, 337, 1155, 342, + /* 910 */ 835, 826, 1139, 1138, 344, 199, 1180, 1183, 1191, 1180, + /* 920 */ 1183, 343, 338, 1194, 226, 169, 1194, 179, 51, 1086, + /* 930 */ 333, 53, 352, 333, 181, 176, 335, 412, 191, 335, + /* 940 */ 1155, 192, 1149, 1155, 1179, 317, 22, 1179, 184, 183, + /* 950 */ 1190, 1180, 1183, 1189, 1180, 1183, 31, 29, 27, 26, + /* 960 */ 25, 1024, 1148, 1147, 1194, 242, 91, 1194, 243, 1146, + /* 970 */ 1064, 333, 1063, 1023, 333, 1020, 1008, 335, 1003, 1145, + /* 980 */ 335, 1155, 1136, 1179, 1155, 121, 1062, 698, 89, 1022, + /* 990 */ 1019, 204, 1180, 1183, 203, 1180, 1183, 258, 113, 1226, + /* 1000 */ 1227, 1179, 1231, 1194, 259, 1007, 1006, 1002, 260, 1066, + /* 1010 */ 333, 66, 127, 797, 795, 1065, 335, 1017, 1012, 1179, + /* 1020 */ 1155, 1194, 796, 727, 726, 210, 725, 724, 333, 1010, + /* 1030 */ 205, 1180, 1183, 317, 335, 723, 282, 722, 1155, 1194, + /* 1040 */ 281, 211, 212, 284, 1001, 286, 333, 1000, 202, 1180, + /* 1050 */ 1183, 290, 335, 288, 91, 64, 1155, 1144, 1143, 1135, + /* 1060 */ 36, 143, 14, 308, 45, 139, 193, 1180, 1183, 285, + /* 1070 */ 142, 146, 15, 934, 279, 107, 89, 11, 138, 34, + /* 1080 */ 48, 3, 32, 37, 150, 46, 114, 1226, 1227, 309, + /* 1090 */ 1231, 956, 955, 219, 960, 928, 927, 1171, 47, 959, + /* 1100 */ 220, 19, 906, 156, 40, 8, 1134, 39, 905, 170, + /* 1110 */ 961, 836, 852, 13, 18, 35, 164, 115, 353, 932, + /* 1120 */ 233, 16, 166, 168, 163, 357, 360, 340, 54, 870, + /* 1130 */ 783, 363, 366, 1170, 351, 49, 50, 38, 174, 355, + /* 1140 */ 760, 780, 358, 790, 777, 361, 789, 771, 364, 171, + /* 1150 */ 788, 769, 696, 367, 718, 381, 55, 56, 57, 719, + /* 1160 */ 717, 716, 715, 714, 713, 712, 711, 710, 709, 775, + /* 1170 */ 708, 373, 774, 707, 706, 773, 705, 704, 703, 772, + /* 1180 */ 702, 701, 1018, 402, 403, 1005, 407, 404, 406, 1004, + /* 1190 */ 999, 410, 411, 974, 824, 182, 414, 415, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 0, 169, 169, 212, 213, 196, 174, 174, 199, 184, - /* 10 */ 182, 202, 183, 12, 13, 14, 15, 16, 0, 190, - /* 20 */ 169, 193, 190, 190, 162, 174, 164, 12, 13, 14, - /* 30 */ 15, 16, 181, 192, 163, 163, 195, 196, 209, 21, - /* 40 */ 20, 190, 24, 25, 26, 27, 28, 29, 30, 31, + /* 0 */ 0, 200, 176, 171, 183, 179, 187, 206, 207, 214, + /* 10 */ 215, 190, 180, 12, 13, 14, 15, 16, 0, 200, + /* 20 */ 188, 187, 14, 15, 16, 206, 207, 12, 13, 14, + /* 30 */ 15, 16, 211, 192, 200, 163, 195, 196, 184, 21, + /* 40 */ 206, 207, 24, 25, 26, 27, 28, 29, 30, 31, /* 50 */ 32, 50, 52, 53, 54, 55, 56, 57, 58, 59, /* 60 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - /* 70 */ 70, 200, 200, 12, 13, 74, 12, 13, 14, 15, + /* 70 */ 70, 20, 200, 12, 13, 74, 12, 13, 14, 15, /* 80 */ 16, 20, 20, 22, 21, 84, 171, 24, 25, 26, - /* 90 */ 27, 28, 29, 30, 31, 32, 52, 183, 54, 171, - /* 100 */ 39, 57, 227, 188, 60, 191, 62, 183, 180, 65, - /* 110 */ 169, 50, 0, 189, 50, 240, 188, 20, 194, 244, - /* 120 */ 119, 120, 20, 122, 123, 124, 125, 126, 127, 128, - /* 130 */ 129, 130, 71, 49, 73, 73, 24, 25, 26, 27, - /* 140 */ 28, 29, 30, 31, 32, 163, 205, 113, 84, 90, + /* 90 */ 27, 28, 29, 30, 31, 32, 52, 169, 54, 183, + /* 100 */ 39, 57, 174, 188, 60, 189, 62, 1, 2, 65, + /* 110 */ 194, 50, 0, 196, 50, 20, 199, 44, 190, 202, + /* 120 */ 119, 120, 182, 122, 123, 124, 125, 126, 127, 128, + /* 130 */ 129, 130, 71, 193, 73, 73, 24, 25, 26, 27, + /* 140 */ 28, 29, 30, 31, 32, 169, 166, 167, 84, 90, /* 150 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - /* 160 */ 99, 102, 103, 104, 105, 106, 107, 21, 227, 187, - /* 170 */ 155, 156, 20, 139, 140, 73, 121, 163, 117, 118, - /* 180 */ 34, 240, 200, 119, 120, 244, 122, 123, 124, 125, - /* 190 */ 126, 127, 128, 129, 130, 134, 134, 183, 143, 144, - /* 200 */ 145, 146, 147, 163, 190, 12, 13, 14, 15, 16, - /* 210 */ 196, 169, 169, 4, 200, 163, 174, 174, 20, 205, - /* 220 */ 172, 173, 208, 209, 210, 211, 160, 187, 30, 215, - /* 230 */ 216, 134, 190, 190, 169, 183, 163, 74, 40, 174, - /* 240 */ 200, 227, 190, 45, 169, 47, 181, 20, 196, 49, - /* 250 */ 183, 88, 200, 206, 240, 190, 176, 190, 244, 179, - /* 260 */ 208, 209, 210, 211, 66, 190, 183, 215, 216, 217, - /* 270 */ 223, 205, 189, 200, 76, 77, 209, 194, 163, 166, - /* 280 */ 167, 229, 12, 13, 14, 210, 169, 235, 236, 20, - /* 290 */ 20, 174, 22, 227, 219, 220, 221, 222, 183, 224, - /* 300 */ 175, 169, 14, 15, 16, 190, 240, 190, 183, 39, - /* 310 */ 244, 196, 168, 163, 116, 200, 191, 168, 132, 133, - /* 320 */ 50, 20, 190, 208, 209, 210, 211, 178, 0, 185, - /* 330 */ 215, 216, 217, 183, 185, 12, 13, 14, 15, 16, - /* 340 */ 190, 71, 210, 73, 135, 60, 196, 175, 163, 64, - /* 350 */ 200, 236, 220, 221, 222, 183, 224, 74, 208, 209, - /* 360 */ 210, 211, 175, 191, 134, 215, 216, 217, 183, 99, - /* 370 */ 183, 88, 86, 163, 89, 190, 226, 49, 191, 163, - /* 380 */ 183, 196, 12, 13, 115, 200, 189, 117, 118, 0, - /* 390 */ 20, 194, 22, 208, 209, 210, 211, 74, 169, 183, - /* 400 */ 215, 216, 217, 174, 1, 2, 190, 12, 13, 39, - /* 410 */ 200, 226, 196, 12, 13, 20, 200, 22, 163, 190, - /* 420 */ 50, 20, 196, 22, 208, 209, 210, 211, 202, 206, - /* 430 */ 22, 215, 216, 217, 39, 22, 163, 20, 183, 22, - /* 440 */ 39, 71, 226, 73, 184, 190, 223, 39, 184, 60, - /* 450 */ 183, 196, 39, 64, 163, 200, 163, 0, 41, 119, - /* 460 */ 205, 194, 3, 208, 209, 210, 71, 127, 73, 99, - /* 470 */ 130, 74, 71, 200, 73, 183, 183, 74, 89, 71, - /* 480 */ 73, 44, 227, 190, 163, 88, 194, 117, 118, 196, - /* 490 */ 163, 200, 85, 200, 99, 240, 163, 108, 109, 244, - /* 500 */ 99, 208, 209, 210, 211, 20, 49, 99, 215, 216, - /* 510 */ 183, 169, 117, 118, 12, 13, 14, 190, 117, 118, - /* 520 */ 163, 200, 20, 196, 22, 117, 118, 200, 14, 134, - /* 530 */ 163, 163, 190, 200, 20, 208, 209, 210, 211, 163, - /* 540 */ 163, 39, 215, 216, 163, 12, 13, 205, 158, 159, - /* 550 */ 163, 163, 210, 20, 163, 22, 163, 200, 79, 1, - /* 560 */ 2, 82, 220, 221, 222, 19, 224, 200, 200, 227, - /* 570 */ 133, 183, 39, 71, 163, 73, 200, 200, 190, 33, - /* 580 */ 184, 200, 240, 37, 196, 163, 244, 200, 200, 43, - /* 590 */ 163, 200, 46, 200, 163, 88, 208, 209, 210, 50, - /* 600 */ 115, 99, 163, 33, 71, 88, 73, 37, 206, 150, - /* 610 */ 183, 200, 184, 43, 164, 169, 46, 190, 72, 117, - /* 620 */ 118, 75, 200, 196, 173, 223, 79, 200, 163, 82, - /* 630 */ 247, 200, 99, 245, 246, 208, 209, 210, 211, 200, - /* 640 */ 0, 79, 72, 216, 82, 75, 79, 238, 183, 82, - /* 650 */ 117, 118, 163, 74, 108, 190, 0, 111, 232, 152, - /* 660 */ 114, 196, 22, 163, 18, 200, 0, 88, 203, 23, - /* 670 */ 121, 154, 183, 208, 209, 210, 193, 74, 22, 190, - /* 680 */ 110, 35, 36, 183, 114, 196, 163, 166, 22, 200, - /* 690 */ 190, 88, 203, 73, 48, 207, 196, 208, 209, 210, - /* 700 */ 200, 163, 225, 74, 74, 183, 183, 87, 208, 209, - /* 710 */ 210, 0, 74, 190, 241, 74, 163, 88, 88, 196, - /* 720 */ 228, 183, 204, 200, 169, 20, 88, 20, 190, 88, - /* 730 */ 171, 208, 209, 210, 196, 20, 183, 163, 200, 239, - /* 740 */ 190, 203, 197, 190, 74, 74, 208, 209, 210, 196, - /* 750 */ 20, 171, 163, 200, 169, 171, 203, 183, 88, 88, - /* 760 */ 20, 208, 209, 210, 190, 165, 183, 74, 163, 246, - /* 770 */ 196, 60, 183, 74, 200, 64, 74, 183, 74, 190, - /* 780 */ 134, 88, 208, 209, 210, 196, 169, 88, 183, 200, - /* 790 */ 88, 163, 88, 183, 74, 190, 163, 208, 209, 210, - /* 800 */ 89, 196, 183, 204, 183, 200, 183, 163, 88, 183, - /* 810 */ 183, 183, 163, 208, 209, 210, 183, 183, 190, 108, - /* 820 */ 109, 168, 183, 190, 196, 183, 165, 183, 200, 196, - /* 830 */ 20, 207, 183, 200, 190, 190, 208, 209, 210, 190, - /* 840 */ 196, 208, 209, 210, 200, 196, 237, 163, 197, 200, - /* 850 */ 163, 142, 208, 209, 210, 141, 201, 208, 209, 210, - /* 860 */ 118, 201, 200, 200, 137, 149, 234, 183, 237, 148, - /* 870 */ 183, 136, 133, 190, 190, 20, 233, 190, 231, 206, - /* 880 */ 196, 131, 230, 196, 200, 163, 218, 200, 157, 153, - /* 890 */ 73, 243, 208, 209, 210, 208, 209, 210, 248, 151, - /* 900 */ 163, 242, 214, 112, 201, 183, 200, 190, 200, 168, - /* 910 */ 198, 201, 190, 200, 190, 197, 163, 179, 196, 73, - /* 920 */ 183, 163, 200, 169, 169, 168, 165, 190, 177, 186, - /* 930 */ 208, 209, 210, 196, 170, 161, 183, 200, 0, 177, - /* 940 */ 0, 183, 0, 190, 190, 208, 209, 210, 190, 196, - /* 950 */ 0, 66, 163, 200, 196, 87, 0, 35, 200, 0, - /* 960 */ 0, 208, 209, 210, 210, 0, 208, 209, 210, 0, - /* 970 */ 0, 0, 183, 44, 220, 221, 222, 4, 224, 190, - /* 980 */ 0, 0, 60, 0, 0, 196, 64, 51, 0, 200, - /* 990 */ 0, 39, 19, 44, 37, 0, 0, 208, 209, 210, - /* 1000 */ 78, 0, 80, 81, 0, 83, 33, 84, 82, 22, - /* 1010 */ 37, 89, 0, 39, 39, 42, 39, 39, 39, 46, - /* 1020 */ 0, 52, 22, 54, 39, 39, 57, 0, 39, 60, - /* 1030 */ 22, 62, 40, 0, 65, 22, 39, 0, 22, 0, - /* 1040 */ 22, 20, 0, 0, 0, 72, 115, 44, 75, 73, - /* 1050 */ 88, 2, 88, 110, 138, 88, 74, 138, 39, 132, - /* 1060 */ 88, 12, 13, 14, 15, 16, 2, 74, 74, 4, - /* 1070 */ 138, 73, 73, 39, 39, 73, 12, 13, 14, 15, - /* 1080 */ 16, 74, 73, 2, 74, 74, 39, 39, 0, 39, - /* 1090 */ 39, 0, 87, 0, 88, 249, 74, 44, 74, 74, - /* 1100 */ 39, 87, 73, 88, 87, 73, 39, 39, 39, 39, - /* 1110 */ 74, 88, 121, 87, 73, 39, 85, 22, 73, 73, - /* 1120 */ 22, 22, 39, 39, 86, 73, 37, 87, 74, 73, - /* 1130 */ 73, 39, 74, 73, 44, 50, 74, 74, 51, 73, - /* 1140 */ 110, 113, 87, 39, 73, 39, 74, 73, 39, 39, - /* 1150 */ 39, 39, 73, 73, 39, 73, 22, 71, 39, 39, - /* 1160 */ 101, 39, 39, 39, 39, 39, 39, 89, 39, 39, - /* 1170 */ 38, 0, 0, 22, 101, 21, 101, 22, 101, 22, - /* 1180 */ 21, 20, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1190 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1200 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1210 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1220 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1230 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1240 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1250 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1260 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1270 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1280 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1290 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1300 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1310 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1320 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1330 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - /* 1340 */ 249, 249, + /* 160 */ 99, 102, 103, 104, 105, 106, 107, 162, 73, 164, + /* 170 */ 155, 156, 12, 13, 14, 15, 16, 163, 117, 118, + /* 180 */ 74, 205, 20, 119, 120, 134, 122, 123, 124, 125, + /* 190 */ 126, 127, 128, 129, 130, 134, 134, 183, 33, 20, + /* 200 */ 183, 20, 37, 229, 190, 229, 133, 190, 43, 0, + /* 210 */ 196, 46, 169, 175, 200, 163, 242, 174, 242, 205, + /* 220 */ 246, 183, 246, 113, 210, 211, 212, 213, 211, 191, + /* 230 */ 175, 217, 218, 190, 74, 183, 169, 72, 183, 163, + /* 240 */ 75, 174, 190, 229, 163, 175, 191, 163, 196, 139, + /* 250 */ 140, 168, 200, 183, 172, 173, 242, 190, 49, 183, + /* 260 */ 246, 191, 210, 211, 212, 213, 190, 183, 185, 217, + /* 270 */ 218, 219, 196, 134, 190, 110, 200, 115, 163, 114, + /* 280 */ 196, 200, 168, 231, 200, 163, 210, 211, 212, 237, + /* 290 */ 238, 88, 178, 160, 210, 211, 212, 213, 183, 185, + /* 300 */ 60, 217, 218, 22, 64, 190, 12, 13, 14, 15, + /* 310 */ 16, 196, 20, 18, 163, 200, 49, 163, 23, 20, + /* 320 */ 39, 22, 200, 247, 248, 210, 211, 212, 213, 89, + /* 330 */ 35, 36, 217, 218, 219, 2, 79, 183, 205, 82, + /* 340 */ 41, 163, 208, 48, 190, 12, 13, 14, 15, 16, + /* 350 */ 196, 200, 71, 238, 200, 152, 163, 196, 183, 225, + /* 360 */ 208, 183, 229, 202, 210, 211, 212, 213, 190, 194, + /* 370 */ 183, 217, 218, 219, 196, 242, 189, 225, 200, 246, + /* 380 */ 99, 194, 228, 163, 12, 13, 14, 163, 210, 211, + /* 390 */ 212, 213, 20, 200, 22, 217, 218, 219, 117, 118, + /* 400 */ 169, 183, 169, 183, 119, 174, 228, 174, 183, 191, + /* 410 */ 190, 39, 127, 169, 181, 130, 196, 20, 174, 194, + /* 420 */ 200, 190, 50, 190, 200, 181, 163, 158, 159, 134, + /* 430 */ 210, 211, 212, 213, 190, 163, 183, 217, 218, 219, + /* 440 */ 0, 22, 189, 71, 169, 73, 183, 194, 228, 174, + /* 450 */ 163, 0, 3, 190, 0, 20, 12, 13, 39, 196, + /* 460 */ 132, 133, 22, 200, 20, 190, 22, 169, 205, 12, + /* 470 */ 13, 99, 200, 210, 211, 212, 169, 20, 14, 22, + /* 480 */ 4, 174, 79, 39, 20, 82, 163, 200, 190, 117, + /* 490 */ 118, 49, 229, 86, 50, 163, 39, 190, 163, 163, + /* 500 */ 49, 163, 163, 205, 79, 242, 52, 82, 54, 246, + /* 510 */ 212, 57, 115, 163, 60, 71, 62, 73, 183, 65, + /* 520 */ 222, 223, 224, 200, 226, 190, 163, 229, 71, 163, + /* 530 */ 73, 196, 200, 1, 2, 200, 200, 208, 200, 200, + /* 540 */ 242, 12, 13, 99, 246, 210, 211, 212, 213, 20, + /* 550 */ 200, 22, 217, 218, 225, 169, 99, 12, 13, 14, + /* 560 */ 21, 117, 118, 200, 163, 20, 200, 22, 39, 19, + /* 570 */ 12, 13, 88, 34, 117, 118, 190, 163, 20, 79, + /* 580 */ 22, 74, 82, 33, 39, 169, 163, 37, 39, 163, + /* 590 */ 163, 134, 39, 43, 184, 88, 46, 39, 212, 150, + /* 600 */ 71, 200, 73, 164, 184, 184, 183, 221, 222, 223, + /* 610 */ 224, 135, 226, 190, 200, 0, 71, 0, 73, 196, + /* 620 */ 71, 50, 72, 200, 71, 75, 200, 200, 99, 71, + /* 630 */ 184, 73, 163, 210, 211, 212, 213, 22, 154, 22, + /* 640 */ 74, 218, 74, 73, 99, 35, 117, 118, 173, 249, + /* 650 */ 209, 240, 183, 193, 88, 85, 88, 99, 108, 190, + /* 660 */ 166, 111, 117, 118, 114, 196, 234, 163, 74, 200, + /* 670 */ 60, 183, 203, 243, 64, 117, 118, 227, 230, 210, + /* 680 */ 211, 212, 88, 74, 73, 163, 169, 183, 78, 20, + /* 690 */ 80, 81, 121, 83, 190, 20, 74, 88, 87, 89, + /* 700 */ 196, 204, 121, 20, 200, 183, 74, 203, 171, 163, + /* 710 */ 88, 190, 190, 0, 210, 211, 212, 74, 196, 20, + /* 720 */ 88, 197, 200, 171, 143, 144, 145, 146, 147, 183, + /* 730 */ 169, 88, 210, 211, 212, 163, 190, 74, 74, 20, + /* 740 */ 74, 20, 196, 165, 171, 183, 200, 183, 183, 30, + /* 750 */ 183, 88, 88, 169, 88, 183, 210, 211, 212, 40, + /* 760 */ 163, 165, 190, 241, 45, 74, 47, 74, 196, 183, + /* 770 */ 183, 183, 200, 60, 74, 203, 183, 64, 0, 88, + /* 780 */ 183, 88, 210, 211, 212, 66, 183, 190, 88, 74, + /* 790 */ 74, 183, 163, 196, 248, 76, 77, 200, 168, 183, + /* 800 */ 203, 197, 89, 88, 88, 12, 13, 210, 211, 212, + /* 810 */ 163, 204, 183, 190, 20, 22, 142, 141, 239, 190, + /* 820 */ 201, 108, 109, 209, 118, 196, 200, 200, 163, 200, + /* 830 */ 183, 239, 39, 163, 201, 116, 163, 190, 60, 210, + /* 840 */ 211, 212, 64, 196, 149, 148, 137, 200, 183, 236, + /* 850 */ 136, 233, 232, 183, 20, 190, 183, 210, 211, 212, + /* 860 */ 190, 196, 133, 190, 71, 200, 196, 89, 163, 196, + /* 870 */ 200, 163, 235, 200, 190, 210, 211, 212, 131, 208, + /* 880 */ 210, 211, 212, 210, 211, 212, 108, 109, 183, 157, + /* 890 */ 250, 183, 99, 245, 153, 190, 151, 220, 190, 244, + /* 900 */ 73, 196, 216, 163, 196, 200, 163, 200, 200, 112, + /* 910 */ 117, 118, 201, 201, 197, 210, 211, 212, 210, 211, + /* 920 */ 212, 198, 200, 183, 200, 190, 183, 179, 168, 190, + /* 930 */ 190, 73, 186, 190, 169, 168, 196, 165, 177, 196, + /* 940 */ 200, 177, 0, 200, 163, 169, 2, 163, 161, 170, + /* 950 */ 210, 211, 212, 210, 211, 212, 12, 13, 14, 15, + /* 960 */ 16, 0, 0, 0, 183, 66, 190, 183, 87, 0, + /* 970 */ 0, 190, 0, 0, 190, 0, 0, 196, 0, 0, + /* 980 */ 196, 200, 0, 163, 200, 44, 0, 51, 212, 0, + /* 990 */ 0, 210, 211, 212, 210, 211, 212, 39, 222, 223, + /* 1000 */ 224, 163, 226, 183, 37, 0, 0, 0, 44, 0, + /* 1010 */ 190, 84, 82, 39, 22, 0, 196, 0, 0, 163, + /* 1020 */ 200, 183, 39, 39, 39, 22, 39, 39, 190, 0, + /* 1030 */ 210, 211, 212, 169, 196, 39, 4, 39, 200, 183, + /* 1040 */ 40, 22, 22, 39, 0, 22, 190, 0, 210, 211, + /* 1050 */ 212, 19, 196, 22, 190, 20, 200, 0, 0, 0, + /* 1060 */ 115, 110, 138, 39, 73, 33, 210, 211, 212, 37, + /* 1070 */ 44, 74, 138, 74, 42, 73, 212, 138, 46, 132, + /* 1080 */ 4, 88, 88, 88, 73, 73, 222, 223, 224, 88, + /* 1090 */ 226, 39, 39, 39, 39, 74, 74, 87, 73, 39, + /* 1100 */ 39, 88, 74, 87, 72, 2, 0, 75, 74, 44, + /* 1110 */ 74, 22, 74, 73, 73, 88, 74, 87, 39, 74, + /* 1120 */ 39, 88, 73, 73, 87, 39, 39, 113, 85, 121, + /* 1130 */ 74, 39, 39, 87, 86, 73, 73, 73, 87, 73, + /* 1140 */ 22, 74, 73, 39, 74, 73, 39, 74, 73, 110, + /* 1150 */ 22, 74, 51, 73, 22, 50, 73, 73, 73, 71, + /* 1160 */ 39, 39, 39, 39, 39, 39, 39, 22, 39, 101, + /* 1170 */ 39, 89, 101, 39, 39, 101, 39, 39, 39, 101, + /* 1180 */ 39, 39, 0, 39, 37, 0, 38, 44, 39, 0, + /* 1190 */ 0, 22, 21, 251, 22, 22, 21, 20, 251, 251, + /* 1200 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1210 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1220 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1230 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1240 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1250 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1260 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1270 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1280 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1290 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1300 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1310 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1320 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1330 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1340 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, + /* 1350 */ 251, 251, 251, 251, 251, 251, 251, 251, }; -#define YY_SHIFT_COUNT (413) +#define YY_SHIFT_COUNT (416) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1172) +#define YY_SHIFT_MAX (1190) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 646, 61, 270, 370, 370, 370, 370, 395, 370, 370, - /* 10 */ 62, 401, 533, 502, 401, 401, 401, 401, 401, 401, - /* 20 */ 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - /* 30 */ 401, 401, 401, 102, 102, 102, 97, 20, 20, 408, - /* 40 */ 408, 20, 20, 84, 152, 227, 227, 230, 301, 152, - /* 50 */ 20, 20, 152, 20, 152, 301, 152, 152, 20, 200, - /* 60 */ 1, 64, 64, 63, 922, 408, 44, 408, 408, 408, - /* 70 */ 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, - /* 80 */ 408, 408, 408, 408, 408, 408, 408, 417, 328, 269, - /* 90 */ 269, 269, 457, 301, 152, 152, 152, 286, 59, 59, - /* 100 */ 59, 59, 59, 18, 198, 969, 15, 55, 285, 34, - /* 110 */ 413, 485, 186, 437, 186, 514, 459, 209, 705, 707, - /* 120 */ 84, 715, 730, 84, 705, 84, 740, 152, 152, 152, - /* 130 */ 152, 152, 152, 152, 152, 152, 152, 152, 705, 740, - /* 140 */ 707, 200, 715, 730, 810, 709, 714, 742, 709, 714, - /* 150 */ 742, 716, 721, 727, 735, 739, 715, 855, 750, 731, - /* 160 */ 736, 748, 817, 152, 714, 742, 742, 714, 742, 791, - /* 170 */ 715, 730, 286, 200, 715, 846, 705, 200, 740, 1182, - /* 180 */ 1182, 1182, 1182, 0, 112, 546, 570, 973, 1049, 1064, - /* 190 */ 323, 389, 711, 193, 193, 193, 193, 193, 193, 193, - /* 200 */ 403, 340, 288, 288, 288, 288, 479, 547, 562, 567, - /* 210 */ 640, 656, 666, 146, 163, 283, 397, 558, 390, 507, - /* 220 */ 517, 579, 549, 603, 620, 629, 630, 638, 641, 670, - /* 230 */ 671, 693, 699, 702, 704, 720, 407, 938, 940, 942, - /* 240 */ 950, 885, 868, 956, 959, 960, 965, 970, 971, 980, - /* 250 */ 981, 983, 929, 984, 936, 988, 990, 952, 957, 949, - /* 260 */ 995, 996, 1001, 1004, 923, 926, 974, 975, 987, 1012, - /* 270 */ 977, 978, 979, 985, 986, 989, 1020, 1000, 1027, 1008, - /* 280 */ 992, 1033, 1013, 997, 1037, 1016, 1039, 1018, 1021, 1042, - /* 290 */ 1043, 931, 1044, 976, 1003, 943, 962, 964, 916, 982, - /* 300 */ 967, 993, 998, 999, 994, 1002, 1007, 1019, 972, 1005, - /* 310 */ 1009, 1006, 919, 1010, 1011, 1014, 927, 1015, 1017, 1022, - /* 320 */ 1023, 932, 1065, 1034, 1035, 1047, 1048, 1050, 1051, 1081, - /* 330 */ 991, 1026, 1024, 1029, 1032, 1025, 1036, 1041, 1045, 1028, - /* 340 */ 1046, 1088, 1053, 1030, 1052, 1031, 1040, 1055, 1056, 1038, - /* 350 */ 1054, 1061, 1067, 1057, 1058, 1068, 1060, 1062, 1069, 1066, - /* 360 */ 1063, 1070, 1071, 1072, 1076, 1074, 1059, 1073, 1075, 1077, - /* 370 */ 1095, 1078, 1079, 1080, 1082, 1083, 1084, 1098, 1087, 1085, - /* 380 */ 1086, 1099, 1104, 1106, 1109, 1110, 1111, 1112, 1115, 1134, - /* 390 */ 1119, 1120, 1122, 1123, 1124, 1125, 1126, 1129, 1130, 1091, - /* 400 */ 1092, 1089, 1090, 1093, 1127, 1132, 1171, 1172, 1151, 1154, - /* 410 */ 1155, 1157, 1159, 1161, + /* 0 */ 295, 61, 372, 444, 444, 444, 444, 457, 444, 444, + /* 10 */ 62, 529, 558, 545, 529, 529, 529, 529, 529, 529, + /* 20 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + /* 30 */ 529, 529, 529, 95, 95, 95, 51, 793, 793, 179, + /* 40 */ 179, 793, 179, 179, 267, 181, 292, 292, 139, 435, + /* 50 */ 181, 179, 179, 181, 179, 181, 435, 181, 181, 179, + /* 60 */ 442, 1, 64, 64, 63, 610, 281, 44, 281, 281, + /* 70 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + /* 80 */ 281, 281, 281, 281, 281, 281, 281, 299, 209, 162, + /* 90 */ 162, 162, 451, 435, 181, 181, 181, 407, 59, 59, + /* 100 */ 59, 59, 59, 18, 719, 454, 15, 581, 240, 110, + /* 110 */ 419, 397, 328, 73, 328, 464, 449, 476, 669, 675, + /* 120 */ 267, 683, 699, 267, 669, 267, 721, 181, 181, 181, + /* 130 */ 181, 181, 181, 181, 181, 181, 181, 181, 669, 721, + /* 140 */ 675, 442, 683, 699, 794, 674, 676, 706, 674, 676, + /* 150 */ 706, 695, 697, 709, 714, 729, 683, 834, 747, 732, + /* 160 */ 741, 745, 827, 181, 676, 706, 706, 676, 706, 797, + /* 170 */ 683, 699, 407, 442, 683, 858, 669, 442, 721, 1198, + /* 180 */ 1198, 1198, 1198, 0, 112, 550, 165, 1032, 333, 944, + /* 190 */ 160, 713, 778, 294, 294, 294, 294, 294, 294, 294, + /* 200 */ 106, 285, 8, 8, 8, 8, 257, 403, 425, 500, + /* 210 */ 440, 615, 617, 539, 507, 566, 568, 532, 269, 203, + /* 220 */ 484, 594, 571, 609, 611, 622, 632, 643, 663, 664, + /* 230 */ 549, 553, 666, 691, 693, 700, 715, 716, 570, 942, + /* 240 */ 961, 962, 963, 899, 881, 969, 970, 972, 973, 975, + /* 250 */ 976, 978, 979, 982, 941, 986, 936, 989, 990, 958, + /* 260 */ 967, 964, 1005, 1006, 1007, 1009, 927, 930, 974, 983, + /* 270 */ 992, 1015, 984, 985, 987, 988, 996, 998, 1017, 1003, + /* 280 */ 1018, 1019, 1000, 1029, 1020, 1004, 1044, 1023, 1047, 1031, + /* 290 */ 1035, 1057, 1058, 945, 1059, 991, 1026, 951, 993, 994, + /* 300 */ 924, 997, 995, 999, 1002, 1011, 1021, 1012, 1022, 1024, + /* 310 */ 1001, 1010, 1025, 1013, 934, 1028, 1034, 1016, 947, 1027, + /* 320 */ 1030, 1036, 1033, 939, 1076, 1052, 1053, 1054, 1055, 1060, + /* 330 */ 1061, 1103, 1008, 1037, 1038, 1040, 1041, 1042, 1045, 1049, + /* 340 */ 1050, 1014, 1062, 1106, 1065, 1039, 1063, 1043, 1046, 1051, + /* 350 */ 1089, 1064, 1048, 1056, 1079, 1081, 1066, 1067, 1086, 1069, + /* 360 */ 1070, 1087, 1072, 1073, 1092, 1075, 1077, 1093, 1080, 1068, + /* 370 */ 1071, 1074, 1078, 1118, 1082, 1083, 1084, 1085, 1104, 1107, + /* 380 */ 1128, 1101, 1105, 1088, 1132, 1121, 1122, 1123, 1124, 1125, + /* 390 */ 1126, 1127, 1145, 1129, 1131, 1134, 1135, 1137, 1138, 1139, + /* 400 */ 1141, 1142, 1182, 1144, 1147, 1143, 1185, 1149, 1148, 1189, + /* 410 */ 1190, 1169, 1171, 1172, 1173, 1175, 1177, }; #define YY_REDUCE_COUNT (182) -#define YY_REDUCE_MIN (-209) -#define YY_REDUCE_MAX (789) +#define YY_REDUCE_MIN (-205) +#define YY_REDUCE_MAX (864) static const short yy_reduce_ofst[] = { - /* 0 */ 66, 14, 52, 115, 150, 185, 216, 255, 293, 327, - /* 10 */ 342, 388, 427, 465, 489, 500, 523, 538, 553, 574, - /* 20 */ 589, 605, 628, 633, 644, 649, 684, 687, 722, 737, - /* 30 */ 753, 758, 789, 75, 132, 754, -59, -149, 65, -18, - /* 40 */ 40, -168, -167, -72, -76, -171, 67, -125, -191, 125, - /* 50 */ 42, 43, 83, 117, 172, -159, 197, 187, 229, 149, - /* 60 */ -209, -209, -209, -138, -172, -129, 48, -128, 73, 210, - /* 70 */ 273, 291, 321, 333, 357, 367, 368, 376, 377, 381, - /* 80 */ 387, 391, 393, 411, 422, 431, 439, 113, -85, 47, - /* 90 */ 223, 402, 144, 226, -86, 267, 292, 80, -175, 260, - /* 100 */ 264, 396, 428, 450, 446, 451, 383, 409, 483, 426, - /* 110 */ 521, 488, 477, 477, 477, 522, 473, 492, 555, 518, - /* 120 */ 559, 550, 545, 580, 585, 584, 600, 583, 594, 610, - /* 130 */ 619, 621, 623, 626, 627, 634, 639, 642, 617, 661, - /* 140 */ 599, 653, 645, 651, 624, 609, 655, 662, 631, 660, - /* 150 */ 663, 632, 643, 647, 652, 477, 683, 673, 668, 650, - /* 160 */ 648, 659, 688, 522, 703, 706, 708, 710, 713, 712, - /* 170 */ 717, 718, 738, 741, 724, 743, 755, 757, 761, 751, - /* 180 */ 762, 764, 774, + /* 0 */ 133, 14, 52, 115, 154, 178, 220, 263, 84, 335, + /* 10 */ 298, 76, 423, 469, 504, 522, 546, 572, 597, 629, + /* 20 */ 647, 665, 670, 673, 705, 708, 740, 743, 781, 784, + /* 30 */ 820, 838, 856, 386, 776, 864, -24, -181, -166, 233, + /* 40 */ 244, -199, -72, 43, -168, -84, -179, 17, -26, -83, + /* 50 */ 55, 67, 231, 187, 275, 70, -159, 253, 38, 307, + /* 60 */ 114, -205, -205, -205, 5, -60, -128, 82, 81, 122, + /* 70 */ 151, 193, 224, 272, 287, 323, 332, 336, 338, 339, + /* 80 */ 350, 363, 366, 401, 414, 426, 427, -20, -85, 134, + /* 90 */ 152, 329, 83, 161, 218, 175, 225, -174, -146, 410, + /* 100 */ 420, 421, 446, 439, 416, 475, 400, 411, 460, 432, + /* 110 */ 494, 441, 450, 450, 450, 488, 430, 448, 517, 497, + /* 120 */ 537, 521, 524, 552, 561, 573, 578, 562, 564, 565, + /* 130 */ 567, 586, 587, 588, 593, 603, 608, 616, 584, 596, + /* 140 */ 607, 630, 623, 604, 614, 579, 619, 626, 592, 633, + /* 150 */ 627, 613, 637, 618, 620, 450, 684, 671, 677, 640, + /* 160 */ 648, 655, 686, 488, 711, 707, 722, 712, 724, 723, + /* 170 */ 735, 717, 748, 760, 739, 746, 765, 767, 772, 761, + /* 180 */ 764, 779, 787, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 10 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 20 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 30 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 40 */ 947, 947, 947, 1004, 947, 947, 947, 947, 947, 947, - /* 50 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 1002, - /* 60 */ 947, 1185, 947, 947, 947, 947, 947, 947, 947, 947, - /* 70 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 80 */ 947, 947, 947, 947, 947, 947, 947, 947, 1004, 1196, - /* 90 */ 1196, 1196, 1002, 947, 947, 947, 947, 1089, 947, 947, - /* 100 */ 947, 947, 947, 947, 947, 947, 1260, 947, 1042, 1220, - /* 110 */ 947, 1212, 1188, 1202, 1189, 947, 1245, 1205, 947, 947, - /* 120 */ 1004, 947, 947, 1004, 947, 1004, 947, 947, 947, 947, - /* 130 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 140 */ 947, 1002, 947, 947, 947, 1227, 1225, 947, 1227, 1225, - /* 150 */ 947, 1239, 1235, 1218, 1216, 1202, 947, 947, 947, 1263, - /* 160 */ 1251, 1247, 947, 947, 1225, 947, 947, 1225, 947, 1112, - /* 170 */ 947, 947, 947, 1002, 947, 1058, 947, 1002, 947, 1092, - /* 180 */ 1092, 1005, 952, 947, 947, 947, 947, 947, 947, 947, - /* 190 */ 947, 947, 947, 1157, 1238, 1237, 1156, 1162, 1161, 1160, - /* 200 */ 947, 947, 1151, 1152, 1150, 1149, 947, 947, 947, 947, - /* 210 */ 947, 947, 947, 947, 947, 947, 947, 1186, 947, 1248, - /* 220 */ 1252, 947, 947, 947, 1136, 947, 947, 947, 947, 947, - /* 230 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 240 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 250 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 260 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 270 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 280 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 290 */ 947, 947, 947, 947, 947, 947, 1209, 1219, 947, 947, - /* 300 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 1136, - /* 310 */ 947, 1236, 947, 1195, 1191, 947, 947, 1187, 947, 947, - /* 320 */ 1246, 947, 947, 947, 947, 947, 947, 947, 947, 1181, - /* 330 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 340 */ 947, 947, 947, 947, 947, 947, 1135, 947, 947, 947, - /* 350 */ 947, 947, 947, 1086, 947, 947, 947, 947, 947, 947, - /* 360 */ 947, 947, 947, 947, 947, 947, 1071, 1069, 1068, 1067, - /* 370 */ 947, 1064, 947, 947, 947, 947, 947, 947, 947, 947, - /* 380 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 390 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 400 */ 947, 947, 947, 947, 947, 947, 947, 947, 947, 947, - /* 410 */ 947, 947, 947, 947, + /* 0 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 10 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 20 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 30 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 40 */ 972, 972, 972, 972, 1029, 972, 972, 972, 972, 972, + /* 50 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 60 */ 1027, 972, 1221, 972, 972, 972, 972, 972, 972, 972, + /* 70 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 80 */ 972, 972, 972, 972, 972, 972, 972, 972, 1029, 1232, + /* 90 */ 1232, 1232, 1027, 972, 972, 972, 972, 1114, 972, 972, + /* 100 */ 972, 972, 972, 972, 972, 972, 1296, 972, 1067, 1256, + /* 110 */ 972, 1248, 1224, 1238, 1225, 972, 1281, 1241, 972, 972, + /* 120 */ 1029, 972, 972, 1029, 972, 1029, 972, 972, 972, 972, + /* 130 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 140 */ 972, 1027, 972, 972, 972, 1263, 1261, 972, 1263, 1261, + /* 150 */ 972, 1275, 1271, 1254, 1252, 1238, 972, 972, 972, 1299, + /* 160 */ 1287, 1283, 972, 972, 1261, 972, 972, 1261, 972, 1137, + /* 170 */ 972, 972, 972, 1027, 972, 1083, 972, 1027, 972, 1117, + /* 180 */ 1117, 1030, 977, 972, 972, 972, 972, 972, 972, 972, + /* 190 */ 972, 972, 972, 1193, 1274, 1273, 1192, 1198, 1197, 1196, + /* 200 */ 972, 972, 1187, 1188, 1186, 1185, 972, 972, 972, 972, + /* 210 */ 972, 972, 972, 972, 972, 972, 972, 1222, 972, 1284, + /* 220 */ 1288, 972, 972, 972, 1172, 972, 972, 972, 972, 972, + /* 230 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 240 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 250 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 260 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 270 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 280 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 290 */ 972, 972, 972, 972, 972, 972, 972, 972, 1245, 1255, + /* 300 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 310 */ 972, 1172, 972, 1272, 972, 1231, 1227, 972, 972, 1223, + /* 320 */ 972, 972, 1282, 972, 972, 972, 972, 972, 972, 972, + /* 330 */ 972, 1217, 972, 972, 972, 972, 972, 972, 972, 972, + /* 340 */ 972, 972, 972, 972, 972, 972, 972, 972, 1171, 972, + /* 350 */ 972, 972, 972, 972, 972, 972, 1111, 972, 972, 972, + /* 360 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 1096, + /* 370 */ 1094, 1093, 1092, 972, 1089, 972, 972, 972, 972, 972, + /* 380 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 390 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 400 */ 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, + /* 410 */ 972, 972, 972, 972, 972, 972, 972, }; /********** End of lemon-generated parsing tables *****************************/ @@ -893,49 +895,51 @@ static const char *const yyTokenName[] = { /* 203 */ "expression_list", /* 204 */ "topic_name", /* 205 */ "query_expression", - /* 206 */ "table_alias", - /* 207 */ "column_alias", - /* 208 */ "expression", - /* 209 */ "column_reference", - /* 210 */ "subquery", - /* 211 */ "predicate", - /* 212 */ "compare_op", - /* 213 */ "in_op", - /* 214 */ "in_predicate_value", - /* 215 */ "boolean_value_expression", - /* 216 */ "boolean_primary", - /* 217 */ "common_expression", - /* 218 */ "from_clause", - /* 219 */ "table_reference_list", - /* 220 */ "table_reference", - /* 221 */ "table_primary", - /* 222 */ "joined_table", - /* 223 */ "alias_opt", - /* 224 */ "parenthesized_joined_table", - /* 225 */ "join_type", - /* 226 */ "search_condition", - /* 227 */ "query_specification", - /* 228 */ "set_quantifier_opt", - /* 229 */ "select_list", - /* 230 */ "where_clause_opt", - /* 231 */ "partition_by_clause_opt", - /* 232 */ "twindow_clause_opt", - /* 233 */ "group_by_clause_opt", - /* 234 */ "having_clause_opt", - /* 235 */ "select_sublist", - /* 236 */ "select_item", - /* 237 */ "fill_opt", - /* 238 */ "fill_mode", - /* 239 */ "group_by_list", - /* 240 */ "query_expression_body", - /* 241 */ "order_by_clause_opt", - /* 242 */ "slimit_clause_opt", - /* 243 */ "limit_clause_opt", - /* 244 */ "query_primary", - /* 245 */ "sort_specification_list", - /* 246 */ "sort_specification", - /* 247 */ "ordering_specification_opt", - /* 248 */ "null_ordering_opt", + /* 206 */ "signed", + /* 207 */ "signed_literal", + /* 208 */ "table_alias", + /* 209 */ "column_alias", + /* 210 */ "expression", + /* 211 */ "column_reference", + /* 212 */ "subquery", + /* 213 */ "predicate", + /* 214 */ "compare_op", + /* 215 */ "in_op", + /* 216 */ "in_predicate_value", + /* 217 */ "boolean_value_expression", + /* 218 */ "boolean_primary", + /* 219 */ "common_expression", + /* 220 */ "from_clause", + /* 221 */ "table_reference_list", + /* 222 */ "table_reference", + /* 223 */ "table_primary", + /* 224 */ "joined_table", + /* 225 */ "alias_opt", + /* 226 */ "parenthesized_joined_table", + /* 227 */ "join_type", + /* 228 */ "search_condition", + /* 229 */ "query_specification", + /* 230 */ "set_quantifier_opt", + /* 231 */ "select_list", + /* 232 */ "where_clause_opt", + /* 233 */ "partition_by_clause_opt", + /* 234 */ "twindow_clause_opt", + /* 235 */ "group_by_clause_opt", + /* 236 */ "having_clause_opt", + /* 237 */ "select_sublist", + /* 238 */ "select_item", + /* 239 */ "fill_opt", + /* 240 */ "fill_mode", + /* 241 */ "group_by_list", + /* 242 */ "query_expression_body", + /* 243 */ "order_by_clause_opt", + /* 244 */ "slimit_clause_opt", + /* 245 */ "limit_clause_opt", + /* 246 */ "query_primary", + /* 247 */ "sort_specification_list", + /* 248 */ "sort_specification", + /* 249 */ "ordering_specification_opt", + /* 250 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1125,140 +1129,151 @@ static const char *const yyRuleName[] = { /* 179 */ "literal ::= TIMESTAMP NK_STRING", /* 180 */ "literal ::= duration_literal", /* 181 */ "duration_literal ::= NK_VARIABLE", - /* 182 */ "literal_list ::= literal", - /* 183 */ "literal_list ::= literal_list NK_COMMA literal", - /* 184 */ "db_name ::= NK_ID", - /* 185 */ "table_name ::= NK_ID", - /* 186 */ "column_name ::= NK_ID", - /* 187 */ "function_name ::= NK_ID", - /* 188 */ "table_alias ::= NK_ID", - /* 189 */ "column_alias ::= NK_ID", - /* 190 */ "user_name ::= NK_ID", - /* 191 */ "index_name ::= NK_ID", - /* 192 */ "topic_name ::= NK_ID", - /* 193 */ "expression ::= literal", - /* 194 */ "expression ::= column_reference", - /* 195 */ "expression ::= function_name NK_LP expression_list NK_RP", - /* 196 */ "expression ::= function_name NK_LP NK_STAR NK_RP", - /* 197 */ "expression ::= subquery", - /* 198 */ "expression ::= NK_LP expression NK_RP", - /* 199 */ "expression ::= NK_PLUS expression", - /* 200 */ "expression ::= NK_MINUS expression", - /* 201 */ "expression ::= expression NK_PLUS expression", - /* 202 */ "expression ::= expression NK_MINUS expression", - /* 203 */ "expression ::= expression NK_STAR expression", - /* 204 */ "expression ::= expression NK_SLASH expression", - /* 205 */ "expression ::= expression NK_REM expression", - /* 206 */ "expression_list ::= expression", - /* 207 */ "expression_list ::= expression_list NK_COMMA expression", - /* 208 */ "column_reference ::= column_name", - /* 209 */ "column_reference ::= table_name NK_DOT column_name", - /* 210 */ "predicate ::= expression compare_op expression", - /* 211 */ "predicate ::= expression BETWEEN expression AND expression", - /* 212 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 213 */ "predicate ::= expression IS NULL", - /* 214 */ "predicate ::= expression IS NOT NULL", - /* 215 */ "predicate ::= expression in_op in_predicate_value", - /* 216 */ "compare_op ::= NK_LT", - /* 217 */ "compare_op ::= NK_GT", - /* 218 */ "compare_op ::= NK_LE", - /* 219 */ "compare_op ::= NK_GE", - /* 220 */ "compare_op ::= NK_NE", - /* 221 */ "compare_op ::= NK_EQ", - /* 222 */ "compare_op ::= LIKE", - /* 223 */ "compare_op ::= NOT LIKE", - /* 224 */ "compare_op ::= MATCH", - /* 225 */ "compare_op ::= NMATCH", - /* 226 */ "in_op ::= IN", - /* 227 */ "in_op ::= NOT IN", - /* 228 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 229 */ "boolean_value_expression ::= boolean_primary", - /* 230 */ "boolean_value_expression ::= NOT boolean_primary", - /* 231 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 232 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 233 */ "boolean_primary ::= predicate", - /* 234 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 235 */ "common_expression ::= expression", - /* 236 */ "common_expression ::= boolean_value_expression", - /* 237 */ "from_clause ::= FROM table_reference_list", - /* 238 */ "table_reference_list ::= table_reference", - /* 239 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 240 */ "table_reference ::= table_primary", - /* 241 */ "table_reference ::= joined_table", - /* 242 */ "table_primary ::= table_name alias_opt", - /* 243 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 244 */ "table_primary ::= subquery alias_opt", - /* 245 */ "table_primary ::= parenthesized_joined_table", - /* 246 */ "alias_opt ::=", - /* 247 */ "alias_opt ::= table_alias", - /* 248 */ "alias_opt ::= AS table_alias", - /* 249 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 250 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 251 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 252 */ "join_type ::=", - /* 253 */ "join_type ::= INNER", - /* 254 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 255 */ "set_quantifier_opt ::=", - /* 256 */ "set_quantifier_opt ::= DISTINCT", - /* 257 */ "set_quantifier_opt ::= ALL", - /* 258 */ "select_list ::= NK_STAR", - /* 259 */ "select_list ::= select_sublist", - /* 260 */ "select_sublist ::= select_item", - /* 261 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 262 */ "select_item ::= common_expression", - /* 263 */ "select_item ::= common_expression column_alias", - /* 264 */ "select_item ::= common_expression AS column_alias", - /* 265 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 266 */ "where_clause_opt ::=", - /* 267 */ "where_clause_opt ::= WHERE search_condition", - /* 268 */ "partition_by_clause_opt ::=", - /* 269 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 270 */ "twindow_clause_opt ::=", - /* 271 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", - /* 272 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", - /* 273 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 274 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 275 */ "sliding_opt ::=", - /* 276 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 277 */ "fill_opt ::=", - /* 278 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 279 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 280 */ "fill_mode ::= NONE", - /* 281 */ "fill_mode ::= PREV", - /* 282 */ "fill_mode ::= NULL", - /* 283 */ "fill_mode ::= LINEAR", - /* 284 */ "fill_mode ::= NEXT", - /* 285 */ "group_by_clause_opt ::=", - /* 286 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 287 */ "group_by_list ::= expression", - /* 288 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 289 */ "having_clause_opt ::=", - /* 290 */ "having_clause_opt ::= HAVING search_condition", - /* 291 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 292 */ "query_expression_body ::= query_primary", - /* 293 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 294 */ "query_primary ::= query_specification", - /* 295 */ "order_by_clause_opt ::=", - /* 296 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 297 */ "slimit_clause_opt ::=", - /* 298 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 299 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 300 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 301 */ "limit_clause_opt ::=", - /* 302 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 303 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 304 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 305 */ "subquery ::= NK_LP query_expression NK_RP", - /* 306 */ "search_condition ::= common_expression", - /* 307 */ "sort_specification_list ::= sort_specification", - /* 308 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 309 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 310 */ "ordering_specification_opt ::=", - /* 311 */ "ordering_specification_opt ::= ASC", - /* 312 */ "ordering_specification_opt ::= DESC", - /* 313 */ "null_ordering_opt ::=", - /* 314 */ "null_ordering_opt ::= NULLS FIRST", - /* 315 */ "null_ordering_opt ::= NULLS LAST", + /* 182 */ "signed ::= NK_INTEGER", + /* 183 */ "signed ::= NK_PLUS NK_INTEGER", + /* 184 */ "signed ::= NK_MINUS NK_INTEGER", + /* 185 */ "signed ::= NK_FLOAT", + /* 186 */ "signed ::= NK_PLUS NK_FLOAT", + /* 187 */ "signed ::= NK_MINUS NK_FLOAT", + /* 188 */ "signed_literal ::= signed", + /* 189 */ "signed_literal ::= NK_STRING", + /* 190 */ "signed_literal ::= NK_BOOL", + /* 191 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 192 */ "signed_literal ::= duration_literal", + /* 193 */ "literal_list ::= signed_literal", + /* 194 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 195 */ "db_name ::= NK_ID", + /* 196 */ "table_name ::= NK_ID", + /* 197 */ "column_name ::= NK_ID", + /* 198 */ "function_name ::= NK_ID", + /* 199 */ "table_alias ::= NK_ID", + /* 200 */ "column_alias ::= NK_ID", + /* 201 */ "user_name ::= NK_ID", + /* 202 */ "index_name ::= NK_ID", + /* 203 */ "topic_name ::= NK_ID", + /* 204 */ "expression ::= literal", + /* 205 */ "expression ::= column_reference", + /* 206 */ "expression ::= function_name NK_LP expression_list NK_RP", + /* 207 */ "expression ::= function_name NK_LP NK_STAR NK_RP", + /* 208 */ "expression ::= subquery", + /* 209 */ "expression ::= NK_LP expression NK_RP", + /* 210 */ "expression ::= NK_PLUS expression", + /* 211 */ "expression ::= NK_MINUS expression", + /* 212 */ "expression ::= expression NK_PLUS expression", + /* 213 */ "expression ::= expression NK_MINUS expression", + /* 214 */ "expression ::= expression NK_STAR expression", + /* 215 */ "expression ::= expression NK_SLASH expression", + /* 216 */ "expression ::= expression NK_REM expression", + /* 217 */ "expression_list ::= expression", + /* 218 */ "expression_list ::= expression_list NK_COMMA expression", + /* 219 */ "column_reference ::= column_name", + /* 220 */ "column_reference ::= table_name NK_DOT column_name", + /* 221 */ "predicate ::= expression compare_op expression", + /* 222 */ "predicate ::= expression BETWEEN expression AND expression", + /* 223 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 224 */ "predicate ::= expression IS NULL", + /* 225 */ "predicate ::= expression IS NOT NULL", + /* 226 */ "predicate ::= expression in_op in_predicate_value", + /* 227 */ "compare_op ::= NK_LT", + /* 228 */ "compare_op ::= NK_GT", + /* 229 */ "compare_op ::= NK_LE", + /* 230 */ "compare_op ::= NK_GE", + /* 231 */ "compare_op ::= NK_NE", + /* 232 */ "compare_op ::= NK_EQ", + /* 233 */ "compare_op ::= LIKE", + /* 234 */ "compare_op ::= NOT LIKE", + /* 235 */ "compare_op ::= MATCH", + /* 236 */ "compare_op ::= NMATCH", + /* 237 */ "in_op ::= IN", + /* 238 */ "in_op ::= NOT IN", + /* 239 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 240 */ "boolean_value_expression ::= boolean_primary", + /* 241 */ "boolean_value_expression ::= NOT boolean_primary", + /* 242 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 243 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 244 */ "boolean_primary ::= predicate", + /* 245 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 246 */ "common_expression ::= expression", + /* 247 */ "common_expression ::= boolean_value_expression", + /* 248 */ "from_clause ::= FROM table_reference_list", + /* 249 */ "table_reference_list ::= table_reference", + /* 250 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 251 */ "table_reference ::= table_primary", + /* 252 */ "table_reference ::= joined_table", + /* 253 */ "table_primary ::= table_name alias_opt", + /* 254 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 255 */ "table_primary ::= subquery alias_opt", + /* 256 */ "table_primary ::= parenthesized_joined_table", + /* 257 */ "alias_opt ::=", + /* 258 */ "alias_opt ::= table_alias", + /* 259 */ "alias_opt ::= AS table_alias", + /* 260 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 261 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 262 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 263 */ "join_type ::=", + /* 264 */ "join_type ::= INNER", + /* 265 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 266 */ "set_quantifier_opt ::=", + /* 267 */ "set_quantifier_opt ::= DISTINCT", + /* 268 */ "set_quantifier_opt ::= ALL", + /* 269 */ "select_list ::= NK_STAR", + /* 270 */ "select_list ::= select_sublist", + /* 271 */ "select_sublist ::= select_item", + /* 272 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 273 */ "select_item ::= common_expression", + /* 274 */ "select_item ::= common_expression column_alias", + /* 275 */ "select_item ::= common_expression AS column_alias", + /* 276 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 277 */ "where_clause_opt ::=", + /* 278 */ "where_clause_opt ::= WHERE search_condition", + /* 279 */ "partition_by_clause_opt ::=", + /* 280 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 281 */ "twindow_clause_opt ::=", + /* 282 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP", + /* 283 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP", + /* 284 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 285 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 286 */ "sliding_opt ::=", + /* 287 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 288 */ "fill_opt ::=", + /* 289 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 290 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 291 */ "fill_mode ::= NONE", + /* 292 */ "fill_mode ::= PREV", + /* 293 */ "fill_mode ::= NULL", + /* 294 */ "fill_mode ::= LINEAR", + /* 295 */ "fill_mode ::= NEXT", + /* 296 */ "group_by_clause_opt ::=", + /* 297 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 298 */ "group_by_list ::= expression", + /* 299 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 300 */ "having_clause_opt ::=", + /* 301 */ "having_clause_opt ::= HAVING search_condition", + /* 302 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 303 */ "query_expression_body ::= query_primary", + /* 304 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 305 */ "query_primary ::= query_specification", + /* 306 */ "order_by_clause_opt ::=", + /* 307 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 308 */ "slimit_clause_opt ::=", + /* 309 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 310 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 311 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 312 */ "limit_clause_opt ::=", + /* 313 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 314 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 315 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 316 */ "subquery ::= NK_LP query_expression NK_RP", + /* 317 */ "search_condition ::= common_expression", + /* 318 */ "sort_specification_list ::= sort_specification", + /* 319 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 320 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 321 */ "ordering_specification_opt ::=", + /* 322 */ "ordering_specification_opt ::= ASC", + /* 323 */ "ordering_specification_opt ::= DESC", + /* 324 */ "null_ordering_opt ::=", + /* 325 */ "null_ordering_opt ::= NULLS FIRST", + /* 326 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -1403,34 +1418,36 @@ static void yy_destructor( case 201: /* sliding_opt */ case 202: /* func */ case 205: /* query_expression */ - case 208: /* expression */ - case 209: /* column_reference */ - case 210: /* subquery */ - case 211: /* predicate */ - case 214: /* in_predicate_value */ - case 215: /* boolean_value_expression */ - case 216: /* boolean_primary */ - case 217: /* common_expression */ - case 218: /* from_clause */ - case 219: /* table_reference_list */ - case 220: /* table_reference */ - case 221: /* table_primary */ - case 222: /* joined_table */ - case 224: /* parenthesized_joined_table */ - case 226: /* search_condition */ - case 227: /* query_specification */ - case 230: /* where_clause_opt */ - case 232: /* twindow_clause_opt */ - case 234: /* having_clause_opt */ - case 236: /* select_item */ - case 237: /* fill_opt */ - case 240: /* query_expression_body */ - case 242: /* slimit_clause_opt */ - case 243: /* limit_clause_opt */ - case 244: /* query_primary */ - case 246: /* sort_specification */ + case 206: /* signed */ + case 207: /* signed_literal */ + case 210: /* expression */ + case 211: /* column_reference */ + case 212: /* subquery */ + case 213: /* predicate */ + case 216: /* in_predicate_value */ + case 217: /* boolean_value_expression */ + case 218: /* boolean_primary */ + case 219: /* common_expression */ + case 220: /* from_clause */ + case 221: /* table_reference_list */ + case 222: /* table_reference */ + case 223: /* table_primary */ + case 224: /* joined_table */ + case 226: /* parenthesized_joined_table */ + case 228: /* search_condition */ + case 229: /* query_specification */ + case 232: /* where_clause_opt */ + case 234: /* twindow_clause_opt */ + case 236: /* having_clause_opt */ + case 238: /* select_item */ + case 239: /* fill_opt */ + case 242: /* query_expression_body */ + case 244: /* slimit_clause_opt */ + case 245: /* limit_clause_opt */ + case 246: /* query_primary */ + case 248: /* sort_specification */ { - nodesDestroyNode((yypminor->yy26)); + nodesDestroyNode((yypminor->yy348)); } break; case 161: /* account_options */ @@ -1449,16 +1466,16 @@ static void yy_destructor( case 196: /* function_name */ case 197: /* index_name */ case 204: /* topic_name */ - case 206: /* table_alias */ - case 207: /* column_alias */ - case 223: /* alias_opt */ + case 208: /* table_alias */ + case 209: /* column_alias */ + case 225: /* alias_opt */ { } break; case 168: /* not_exists_opt */ case 171: /* exists_opt */ - case 228: /* set_quantifier_opt */ + case 230: /* set_quantifier_opt */ { } @@ -1480,15 +1497,15 @@ static void yy_destructor( case 192: /* func_name_list */ case 199: /* func_list */ case 203: /* expression_list */ - case 229: /* select_list */ - case 231: /* partition_by_clause_opt */ - case 233: /* group_by_clause_opt */ - case 235: /* select_sublist */ - case 239: /* group_by_list */ - case 241: /* order_by_clause_opt */ - case 245: /* sort_specification_list */ + case 231: /* select_list */ + case 233: /* partition_by_clause_opt */ + case 235: /* group_by_clause_opt */ + case 237: /* select_sublist */ + case 241: /* group_by_list */ + case 243: /* order_by_clause_opt */ + case 247: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy64)); + nodesDestroyList((yypminor->yy358)); } break; case 184: /* type_name */ @@ -1496,28 +1513,28 @@ static void yy_destructor( } break; - case 212: /* compare_op */ - case 213: /* in_op */ + case 214: /* compare_op */ + case 215: /* in_op */ { } break; - case 225: /* join_type */ + case 227: /* join_type */ { } break; - case 238: /* fill_mode */ + case 240: /* fill_mode */ { } break; - case 247: /* ordering_specification_opt */ + case 249: /* ordering_specification_opt */ { } break; - case 248: /* null_ordering_opt */ + case 250: /* null_ordering_opt */ { } @@ -1998,140 +2015,151 @@ static const struct { { 163, -2 }, /* (179) literal ::= TIMESTAMP NK_STRING */ { 163, -1 }, /* (180) literal ::= duration_literal */ { 200, -1 }, /* (181) duration_literal ::= NK_VARIABLE */ - { 187, -1 }, /* (182) literal_list ::= literal */ - { 187, -3 }, /* (183) literal_list ::= literal_list NK_COMMA literal */ - { 169, -1 }, /* (184) db_name ::= NK_ID */ - { 190, -1 }, /* (185) table_name ::= NK_ID */ - { 183, -1 }, /* (186) column_name ::= NK_ID */ - { 196, -1 }, /* (187) function_name ::= NK_ID */ - { 206, -1 }, /* (188) table_alias ::= NK_ID */ - { 207, -1 }, /* (189) column_alias ::= NK_ID */ - { 165, -1 }, /* (190) user_name ::= NK_ID */ - { 197, -1 }, /* (191) index_name ::= NK_ID */ - { 204, -1 }, /* (192) topic_name ::= NK_ID */ - { 208, -1 }, /* (193) expression ::= literal */ - { 208, -1 }, /* (194) expression ::= column_reference */ - { 208, -4 }, /* (195) expression ::= function_name NK_LP expression_list NK_RP */ - { 208, -4 }, /* (196) expression ::= function_name NK_LP NK_STAR NK_RP */ - { 208, -1 }, /* (197) expression ::= subquery */ - { 208, -3 }, /* (198) expression ::= NK_LP expression NK_RP */ - { 208, -2 }, /* (199) expression ::= NK_PLUS expression */ - { 208, -2 }, /* (200) expression ::= NK_MINUS expression */ - { 208, -3 }, /* (201) expression ::= expression NK_PLUS expression */ - { 208, -3 }, /* (202) expression ::= expression NK_MINUS expression */ - { 208, -3 }, /* (203) expression ::= expression NK_STAR expression */ - { 208, -3 }, /* (204) expression ::= expression NK_SLASH expression */ - { 208, -3 }, /* (205) expression ::= expression NK_REM expression */ - { 203, -1 }, /* (206) expression_list ::= expression */ - { 203, -3 }, /* (207) expression_list ::= expression_list NK_COMMA expression */ - { 209, -1 }, /* (208) column_reference ::= column_name */ - { 209, -3 }, /* (209) column_reference ::= table_name NK_DOT column_name */ - { 211, -3 }, /* (210) predicate ::= expression compare_op expression */ - { 211, -5 }, /* (211) predicate ::= expression BETWEEN expression AND expression */ - { 211, -6 }, /* (212) predicate ::= expression NOT BETWEEN expression AND expression */ - { 211, -3 }, /* (213) predicate ::= expression IS NULL */ - { 211, -4 }, /* (214) predicate ::= expression IS NOT NULL */ - { 211, -3 }, /* (215) predicate ::= expression in_op in_predicate_value */ - { 212, -1 }, /* (216) compare_op ::= NK_LT */ - { 212, -1 }, /* (217) compare_op ::= NK_GT */ - { 212, -1 }, /* (218) compare_op ::= NK_LE */ - { 212, -1 }, /* (219) compare_op ::= NK_GE */ - { 212, -1 }, /* (220) compare_op ::= NK_NE */ - { 212, -1 }, /* (221) compare_op ::= NK_EQ */ - { 212, -1 }, /* (222) compare_op ::= LIKE */ - { 212, -2 }, /* (223) compare_op ::= NOT LIKE */ - { 212, -1 }, /* (224) compare_op ::= MATCH */ - { 212, -1 }, /* (225) compare_op ::= NMATCH */ - { 213, -1 }, /* (226) in_op ::= IN */ - { 213, -2 }, /* (227) in_op ::= NOT IN */ - { 214, -3 }, /* (228) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 215, -1 }, /* (229) boolean_value_expression ::= boolean_primary */ - { 215, -2 }, /* (230) boolean_value_expression ::= NOT boolean_primary */ - { 215, -3 }, /* (231) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 215, -3 }, /* (232) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 216, -1 }, /* (233) boolean_primary ::= predicate */ - { 216, -3 }, /* (234) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 217, -1 }, /* (235) common_expression ::= expression */ - { 217, -1 }, /* (236) common_expression ::= boolean_value_expression */ - { 218, -2 }, /* (237) from_clause ::= FROM table_reference_list */ - { 219, -1 }, /* (238) table_reference_list ::= table_reference */ - { 219, -3 }, /* (239) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 220, -1 }, /* (240) table_reference ::= table_primary */ - { 220, -1 }, /* (241) table_reference ::= joined_table */ - { 221, -2 }, /* (242) table_primary ::= table_name alias_opt */ - { 221, -4 }, /* (243) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 221, -2 }, /* (244) table_primary ::= subquery alias_opt */ - { 221, -1 }, /* (245) table_primary ::= parenthesized_joined_table */ - { 223, 0 }, /* (246) alias_opt ::= */ - { 223, -1 }, /* (247) alias_opt ::= table_alias */ - { 223, -2 }, /* (248) alias_opt ::= AS table_alias */ - { 224, -3 }, /* (249) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 224, -3 }, /* (250) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 222, -6 }, /* (251) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 225, 0 }, /* (252) join_type ::= */ - { 225, -1 }, /* (253) join_type ::= INNER */ - { 227, -9 }, /* (254) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 228, 0 }, /* (255) set_quantifier_opt ::= */ - { 228, -1 }, /* (256) set_quantifier_opt ::= DISTINCT */ - { 228, -1 }, /* (257) set_quantifier_opt ::= ALL */ - { 229, -1 }, /* (258) select_list ::= NK_STAR */ - { 229, -1 }, /* (259) select_list ::= select_sublist */ - { 235, -1 }, /* (260) select_sublist ::= select_item */ - { 235, -3 }, /* (261) select_sublist ::= select_sublist NK_COMMA select_item */ - { 236, -1 }, /* (262) select_item ::= common_expression */ - { 236, -2 }, /* (263) select_item ::= common_expression column_alias */ - { 236, -3 }, /* (264) select_item ::= common_expression AS column_alias */ - { 236, -3 }, /* (265) select_item ::= table_name NK_DOT NK_STAR */ - { 230, 0 }, /* (266) where_clause_opt ::= */ - { 230, -2 }, /* (267) where_clause_opt ::= WHERE search_condition */ - { 231, 0 }, /* (268) partition_by_clause_opt ::= */ - { 231, -3 }, /* (269) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 232, 0 }, /* (270) twindow_clause_opt ::= */ - { 232, -6 }, /* (271) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ - { 232, -4 }, /* (272) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ - { 232, -6 }, /* (273) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 232, -8 }, /* (274) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 201, 0 }, /* (275) sliding_opt ::= */ - { 201, -4 }, /* (276) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 237, 0 }, /* (277) fill_opt ::= */ - { 237, -4 }, /* (278) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 237, -6 }, /* (279) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 238, -1 }, /* (280) fill_mode ::= NONE */ - { 238, -1 }, /* (281) fill_mode ::= PREV */ - { 238, -1 }, /* (282) fill_mode ::= NULL */ - { 238, -1 }, /* (283) fill_mode ::= LINEAR */ - { 238, -1 }, /* (284) fill_mode ::= NEXT */ - { 233, 0 }, /* (285) group_by_clause_opt ::= */ - { 233, -3 }, /* (286) group_by_clause_opt ::= GROUP BY group_by_list */ - { 239, -1 }, /* (287) group_by_list ::= expression */ - { 239, -3 }, /* (288) group_by_list ::= group_by_list NK_COMMA expression */ - { 234, 0 }, /* (289) having_clause_opt ::= */ - { 234, -2 }, /* (290) having_clause_opt ::= HAVING search_condition */ - { 205, -4 }, /* (291) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 240, -1 }, /* (292) query_expression_body ::= query_primary */ - { 240, -4 }, /* (293) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 244, -1 }, /* (294) query_primary ::= query_specification */ - { 241, 0 }, /* (295) order_by_clause_opt ::= */ - { 241, -3 }, /* (296) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 242, 0 }, /* (297) slimit_clause_opt ::= */ - { 242, -2 }, /* (298) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 242, -4 }, /* (299) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 242, -4 }, /* (300) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 243, 0 }, /* (301) limit_clause_opt ::= */ - { 243, -2 }, /* (302) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 243, -4 }, /* (303) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 243, -4 }, /* (304) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 210, -3 }, /* (305) subquery ::= NK_LP query_expression NK_RP */ - { 226, -1 }, /* (306) search_condition ::= common_expression */ - { 245, -1 }, /* (307) sort_specification_list ::= sort_specification */ - { 245, -3 }, /* (308) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 246, -3 }, /* (309) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 247, 0 }, /* (310) ordering_specification_opt ::= */ - { 247, -1 }, /* (311) ordering_specification_opt ::= ASC */ - { 247, -1 }, /* (312) ordering_specification_opt ::= DESC */ - { 248, 0 }, /* (313) null_ordering_opt ::= */ - { 248, -2 }, /* (314) null_ordering_opt ::= NULLS FIRST */ - { 248, -2 }, /* (315) null_ordering_opt ::= NULLS LAST */ + { 206, -1 }, /* (182) signed ::= NK_INTEGER */ + { 206, -2 }, /* (183) signed ::= NK_PLUS NK_INTEGER */ + { 206, -2 }, /* (184) signed ::= NK_MINUS NK_INTEGER */ + { 206, -1 }, /* (185) signed ::= NK_FLOAT */ + { 206, -2 }, /* (186) signed ::= NK_PLUS NK_FLOAT */ + { 206, -2 }, /* (187) signed ::= NK_MINUS NK_FLOAT */ + { 207, -1 }, /* (188) signed_literal ::= signed */ + { 207, -1 }, /* (189) signed_literal ::= NK_STRING */ + { 207, -1 }, /* (190) signed_literal ::= NK_BOOL */ + { 207, -2 }, /* (191) signed_literal ::= TIMESTAMP NK_STRING */ + { 207, -1 }, /* (192) signed_literal ::= duration_literal */ + { 187, -1 }, /* (193) literal_list ::= signed_literal */ + { 187, -3 }, /* (194) literal_list ::= literal_list NK_COMMA signed_literal */ + { 169, -1 }, /* (195) db_name ::= NK_ID */ + { 190, -1 }, /* (196) table_name ::= NK_ID */ + { 183, -1 }, /* (197) column_name ::= NK_ID */ + { 196, -1 }, /* (198) function_name ::= NK_ID */ + { 208, -1 }, /* (199) table_alias ::= NK_ID */ + { 209, -1 }, /* (200) column_alias ::= NK_ID */ + { 165, -1 }, /* (201) user_name ::= NK_ID */ + { 197, -1 }, /* (202) index_name ::= NK_ID */ + { 204, -1 }, /* (203) topic_name ::= NK_ID */ + { 210, -1 }, /* (204) expression ::= literal */ + { 210, -1 }, /* (205) expression ::= column_reference */ + { 210, -4 }, /* (206) expression ::= function_name NK_LP expression_list NK_RP */ + { 210, -4 }, /* (207) expression ::= function_name NK_LP NK_STAR NK_RP */ + { 210, -1 }, /* (208) expression ::= subquery */ + { 210, -3 }, /* (209) expression ::= NK_LP expression NK_RP */ + { 210, -2 }, /* (210) expression ::= NK_PLUS expression */ + { 210, -2 }, /* (211) expression ::= NK_MINUS expression */ + { 210, -3 }, /* (212) expression ::= expression NK_PLUS expression */ + { 210, -3 }, /* (213) expression ::= expression NK_MINUS expression */ + { 210, -3 }, /* (214) expression ::= expression NK_STAR expression */ + { 210, -3 }, /* (215) expression ::= expression NK_SLASH expression */ + { 210, -3 }, /* (216) expression ::= expression NK_REM expression */ + { 203, -1 }, /* (217) expression_list ::= expression */ + { 203, -3 }, /* (218) expression_list ::= expression_list NK_COMMA expression */ + { 211, -1 }, /* (219) column_reference ::= column_name */ + { 211, -3 }, /* (220) column_reference ::= table_name NK_DOT column_name */ + { 213, -3 }, /* (221) predicate ::= expression compare_op expression */ + { 213, -5 }, /* (222) predicate ::= expression BETWEEN expression AND expression */ + { 213, -6 }, /* (223) predicate ::= expression NOT BETWEEN expression AND expression */ + { 213, -3 }, /* (224) predicate ::= expression IS NULL */ + { 213, -4 }, /* (225) predicate ::= expression IS NOT NULL */ + { 213, -3 }, /* (226) predicate ::= expression in_op in_predicate_value */ + { 214, -1 }, /* (227) compare_op ::= NK_LT */ + { 214, -1 }, /* (228) compare_op ::= NK_GT */ + { 214, -1 }, /* (229) compare_op ::= NK_LE */ + { 214, -1 }, /* (230) compare_op ::= NK_GE */ + { 214, -1 }, /* (231) compare_op ::= NK_NE */ + { 214, -1 }, /* (232) compare_op ::= NK_EQ */ + { 214, -1 }, /* (233) compare_op ::= LIKE */ + { 214, -2 }, /* (234) compare_op ::= NOT LIKE */ + { 214, -1 }, /* (235) compare_op ::= MATCH */ + { 214, -1 }, /* (236) compare_op ::= NMATCH */ + { 215, -1 }, /* (237) in_op ::= IN */ + { 215, -2 }, /* (238) in_op ::= NOT IN */ + { 216, -3 }, /* (239) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 217, -1 }, /* (240) boolean_value_expression ::= boolean_primary */ + { 217, -2 }, /* (241) boolean_value_expression ::= NOT boolean_primary */ + { 217, -3 }, /* (242) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 217, -3 }, /* (243) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 218, -1 }, /* (244) boolean_primary ::= predicate */ + { 218, -3 }, /* (245) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 219, -1 }, /* (246) common_expression ::= expression */ + { 219, -1 }, /* (247) common_expression ::= boolean_value_expression */ + { 220, -2 }, /* (248) from_clause ::= FROM table_reference_list */ + { 221, -1 }, /* (249) table_reference_list ::= table_reference */ + { 221, -3 }, /* (250) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 222, -1 }, /* (251) table_reference ::= table_primary */ + { 222, -1 }, /* (252) table_reference ::= joined_table */ + { 223, -2 }, /* (253) table_primary ::= table_name alias_opt */ + { 223, -4 }, /* (254) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 223, -2 }, /* (255) table_primary ::= subquery alias_opt */ + { 223, -1 }, /* (256) table_primary ::= parenthesized_joined_table */ + { 225, 0 }, /* (257) alias_opt ::= */ + { 225, -1 }, /* (258) alias_opt ::= table_alias */ + { 225, -2 }, /* (259) alias_opt ::= AS table_alias */ + { 226, -3 }, /* (260) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 226, -3 }, /* (261) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 224, -6 }, /* (262) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 227, 0 }, /* (263) join_type ::= */ + { 227, -1 }, /* (264) join_type ::= INNER */ + { 229, -9 }, /* (265) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 230, 0 }, /* (266) set_quantifier_opt ::= */ + { 230, -1 }, /* (267) set_quantifier_opt ::= DISTINCT */ + { 230, -1 }, /* (268) set_quantifier_opt ::= ALL */ + { 231, -1 }, /* (269) select_list ::= NK_STAR */ + { 231, -1 }, /* (270) select_list ::= select_sublist */ + { 237, -1 }, /* (271) select_sublist ::= select_item */ + { 237, -3 }, /* (272) select_sublist ::= select_sublist NK_COMMA select_item */ + { 238, -1 }, /* (273) select_item ::= common_expression */ + { 238, -2 }, /* (274) select_item ::= common_expression column_alias */ + { 238, -3 }, /* (275) select_item ::= common_expression AS column_alias */ + { 238, -3 }, /* (276) select_item ::= table_name NK_DOT NK_STAR */ + { 232, 0 }, /* (277) where_clause_opt ::= */ + { 232, -2 }, /* (278) where_clause_opt ::= WHERE search_condition */ + { 233, 0 }, /* (279) partition_by_clause_opt ::= */ + { 233, -3 }, /* (280) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 234, 0 }, /* (281) twindow_clause_opt ::= */ + { 234, -6 }, /* (282) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ + { 234, -4 }, /* (283) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ + { 234, -6 }, /* (284) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 234, -8 }, /* (285) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 201, 0 }, /* (286) sliding_opt ::= */ + { 201, -4 }, /* (287) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 239, 0 }, /* (288) fill_opt ::= */ + { 239, -4 }, /* (289) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 239, -6 }, /* (290) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 240, -1 }, /* (291) fill_mode ::= NONE */ + { 240, -1 }, /* (292) fill_mode ::= PREV */ + { 240, -1 }, /* (293) fill_mode ::= NULL */ + { 240, -1 }, /* (294) fill_mode ::= LINEAR */ + { 240, -1 }, /* (295) fill_mode ::= NEXT */ + { 235, 0 }, /* (296) group_by_clause_opt ::= */ + { 235, -3 }, /* (297) group_by_clause_opt ::= GROUP BY group_by_list */ + { 241, -1 }, /* (298) group_by_list ::= expression */ + { 241, -3 }, /* (299) group_by_list ::= group_by_list NK_COMMA expression */ + { 236, 0 }, /* (300) having_clause_opt ::= */ + { 236, -2 }, /* (301) having_clause_opt ::= HAVING search_condition */ + { 205, -4 }, /* (302) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 242, -1 }, /* (303) query_expression_body ::= query_primary */ + { 242, -4 }, /* (304) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 246, -1 }, /* (305) query_primary ::= query_specification */ + { 243, 0 }, /* (306) order_by_clause_opt ::= */ + { 243, -3 }, /* (307) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 244, 0 }, /* (308) slimit_clause_opt ::= */ + { 244, -2 }, /* (309) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 244, -4 }, /* (310) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 244, -4 }, /* (311) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 245, 0 }, /* (312) limit_clause_opt ::= */ + { 245, -2 }, /* (313) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 245, -4 }, /* (314) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 245, -4 }, /* (315) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 212, -3 }, /* (316) subquery ::= NK_LP query_expression NK_RP */ + { 228, -1 }, /* (317) search_condition ::= common_expression */ + { 247, -1 }, /* (318) sort_specification_list ::= sort_specification */ + { 247, -3 }, /* (319) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 248, -3 }, /* (320) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 249, 0 }, /* (321) ordering_specification_opt ::= */ + { 249, -1 }, /* (322) ordering_specification_opt ::= ASC */ + { 249, -1 }, /* (323) ordering_specification_opt ::= DESC */ + { 250, 0 }, /* (324) null_ordering_opt ::= */ + { 250, -2 }, /* (325) null_ordering_opt ::= NULLS FIRST */ + { 250, -2 }, /* (326) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2268,31 +2296,31 @@ static YYACTIONTYPE yy_reduce( yy_destructor(yypParser,163,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy353, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy353, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy269); } break; case 28: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL); } break; case 29: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy353, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy269, NULL); } break; case 30: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0); } break; case 31: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 32: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy269); } break; case 33: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL); } @@ -2312,17 +2340,17 @@ static YYACTIONTYPE yy_reduce( case 38: /* dnode_endpoint ::= NK_STRING */ case 39: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==39); case 40: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==40); - case 184: /* db_name ::= NK_ID */ yytestcase(yyruleno==184); - case 185: /* table_name ::= NK_ID */ yytestcase(yyruleno==185); - case 186: /* column_name ::= NK_ID */ yytestcase(yyruleno==186); - case 187: /* function_name ::= NK_ID */ yytestcase(yyruleno==187); - case 188: /* table_alias ::= NK_ID */ yytestcase(yyruleno==188); - case 189: /* column_alias ::= NK_ID */ yytestcase(yyruleno==189); - case 190: /* user_name ::= NK_ID */ yytestcase(yyruleno==190); - case 191: /* index_name ::= NK_ID */ yytestcase(yyruleno==191); - case 192: /* topic_name ::= NK_ID */ yytestcase(yyruleno==192); -{ yylhsminor.yy353 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy353 = yylhsminor.yy353; + case 195: /* db_name ::= NK_ID */ yytestcase(yyruleno==195); + case 196: /* table_name ::= NK_ID */ yytestcase(yyruleno==196); + case 197: /* column_name ::= NK_ID */ yytestcase(yyruleno==197); + case 198: /* function_name ::= NK_ID */ yytestcase(yyruleno==198); + case 199: /* table_alias ::= NK_ID */ yytestcase(yyruleno==199); + case 200: /* column_alias ::= NK_ID */ yytestcase(yyruleno==200); + case 201: /* user_name ::= NK_ID */ yytestcase(yyruleno==201); + case 202: /* index_name ::= NK_ID */ yytestcase(yyruleno==202); + case 203: /* topic_name ::= NK_ID */ yytestcase(yyruleno==203); +{ yylhsminor.yy269 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy269 = yylhsminor.yy269; break; case 41: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -2340,148 +2368,148 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL); } break; case 46: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy107, &yymsp[-1].minor.yy353, yymsp[0].minor.yy26); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy345, &yymsp[-1].minor.yy269, yymsp[0].minor.yy348); } break; case 47: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy107, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } break; case 48: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL); } break; case 49: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy269); } break; case 50: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy353, yymsp[0].minor.yy26); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy269, yymsp[0].minor.yy348); } break; case 51: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy107 = true; } +{ yymsp[-2].minor.yy345 = true; } break; case 52: /* not_exists_opt ::= */ case 54: /* exists_opt ::= */ yytestcase(yyruleno==54); - case 255: /* set_quantifier_opt ::= */ yytestcase(yyruleno==255); -{ yymsp[1].minor.yy107 = false; } + case 266: /* set_quantifier_opt ::= */ yytestcase(yyruleno==266); +{ yymsp[1].minor.yy345 = false; } break; case 53: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy107 = true; } +{ yymsp[-1].minor.yy345 = true; } break; case 55: /* db_options ::= */ -{ yymsp[1].minor.yy26 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy348 = createDefaultDatabaseOptions(pCxt); } break; case 56: /* db_options ::= db_options BLOCKS NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 57: /* db_options ::= db_options CACHE NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_CACHE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 58: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 59: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 60: /* db_options ::= db_options DAYS NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 61: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 62: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 63: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 64: /* db_options ::= db_options KEEP NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 65: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 66: /* db_options ::= db_options QUORUM NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 67: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 68: /* db_options ::= db_options TTL NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 69: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 70: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 71: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 72: /* db_options ::= db_options STREAM_MODE NK_INTEGER */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_STREAM_MODE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_STREAM_MODE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 73: /* db_options ::= db_options RETENTIONS NK_STRING */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_RETENTIONS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_RETENTIONS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 74: /* db_options ::= db_options FILE_FACTOR NK_FLOAT */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-2].minor.yy26, DB_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 75: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy26 = createDefaultAlterDatabaseOptions(pCxt); yylhsminor.yy26 = setDatabaseOption(pCxt, yylhsminor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createDefaultAlterDatabaseOptions(pCxt); yylhsminor.yy348 = setDatabaseOption(pCxt, yylhsminor.yy348, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 76: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy26 = setDatabaseOption(pCxt, yymsp[-1].minor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 77: /* alter_db_option ::= BLOCKS NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 78: /* alter_db_option ::= FSYNC NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 79: /* alter_db_option ::= KEEP NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = DB_OPTION_KEEP; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = DB_OPTION_KEEP; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 80: /* alter_db_option ::= WAL NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = DB_OPTION_WAL; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = DB_OPTION_WAL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 81: /* alter_db_option ::= QUORUM NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 82: /* alter_db_option ::= CACHELAST NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 83: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 85: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==85); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy107, yymsp[-5].minor.yy26, yymsp[-3].minor.yy64, yymsp[-1].minor.yy64, yymsp[0].minor.yy26); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy345, yymsp[-5].minor.yy348, yymsp[-3].minor.yy358, yymsp[-1].minor.yy358, yymsp[0].minor.yy348); } break; case 84: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy64); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy358); } break; case 86: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy64); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy358); } break; case 87: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy107, yymsp[0].minor.yy26); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy348); } break; case 88: /* cmd ::= SHOW TABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, NULL); } @@ -2492,47 +2520,47 @@ static YYACTIONTYPE yy_reduce( case 90: /* cmd ::= ALTER TABLE alter_table_clause */ case 91: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==91); case 174: /* cmd ::= query_expression */ yytestcase(yyruleno==174); -{ pCxt->pRootNode = yymsp[0].minor.yy26; } +{ pCxt->pRootNode = yymsp[0].minor.yy348; } break; case 92: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy26 = createAlterTableOption(pCxt, yymsp[-1].minor.yy26, yymsp[0].minor.yy26); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableOption(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 93: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy269, yymsp[0].minor.yy218); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 94: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy26 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy26, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy353); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy348, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy269); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 95: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy269, yymsp[0].minor.yy218); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 96: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy26 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 97: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy269, yymsp[0].minor.yy218); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 98: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy26 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy26, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy353); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy348, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy269); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 99: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy26 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy269, yymsp[0].minor.yy218); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 100: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy26 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy26, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 101: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */ -{ yylhsminor.yy26 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy26, &yymsp[-2].minor.yy353, yymsp[0].minor.yy26); } - yymsp[-5].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy348, &yymsp[-2].minor.yy269, yymsp[0].minor.yy348); } + yymsp[-5].minor.yy348 = yylhsminor.yy348; break; case 102: /* multi_create_clause ::= create_subtable_clause */ case 105: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==105); @@ -2540,642 +2568,685 @@ static YYACTIONTYPE yy_reduce( case 153: /* col_name_list ::= col_name */ yytestcase(yyruleno==153); case 156: /* func_name_list ::= func_name */ yytestcase(yyruleno==156); case 165: /* func_list ::= func */ yytestcase(yyruleno==165); - case 260: /* select_sublist ::= select_item */ yytestcase(yyruleno==260); - case 307: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==307); -{ yylhsminor.yy64 = createNodeList(pCxt, yymsp[0].minor.yy26); } - yymsp[0].minor.yy64 = yylhsminor.yy64; + case 193: /* literal_list ::= signed_literal */ yytestcase(yyruleno==193); + case 271: /* select_sublist ::= select_item */ yytestcase(yyruleno==271); + case 318: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==318); +{ yylhsminor.yy358 = createNodeList(pCxt, yymsp[0].minor.yy348); } + yymsp[0].minor.yy358 = yylhsminor.yy358; break; case 103: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 106: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==106); -{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-1].minor.yy64, yymsp[0].minor.yy26); } - yymsp[-1].minor.yy64 = yylhsminor.yy64; +{ yylhsminor.yy358 = addNodeToList(pCxt, yymsp[-1].minor.yy358, yymsp[0].minor.yy348); } + yymsp[-1].minor.yy358 = yylhsminor.yy358; break; case 104: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */ -{ yylhsminor.yy26 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy107, yymsp[-7].minor.yy26, yymsp[-5].minor.yy26, yymsp[-4].minor.yy64, yymsp[-1].minor.yy64); } - yymsp[-8].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy345, yymsp[-7].minor.yy348, yymsp[-5].minor.yy348, yymsp[-4].minor.yy358, yymsp[-1].minor.yy358); } + yymsp[-8].minor.yy348 = yylhsminor.yy348; break; case 107: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy26 = createDropTableClause(pCxt, yymsp[-1].minor.yy107, yymsp[0].minor.yy26); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createDropTableClause(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy348); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 108: /* specific_tags_opt ::= */ case 139: /* tags_def_opt ::= */ yytestcase(yyruleno==139); - case 268: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==268); - case 285: /* group_by_clause_opt ::= */ yytestcase(yyruleno==285); - case 295: /* order_by_clause_opt ::= */ yytestcase(yyruleno==295); -{ yymsp[1].minor.yy64 = NULL; } + case 279: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==279); + case 296: /* group_by_clause_opt ::= */ yytestcase(yyruleno==296); + case 306: /* order_by_clause_opt ::= */ yytestcase(yyruleno==306); +{ yymsp[1].minor.yy358 = NULL; } break; case 109: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy64 = yymsp[-1].minor.yy64; } +{ yymsp[-2].minor.yy358 = yymsp[-1].minor.yy358; } break; case 110: /* full_table_name ::= table_name */ -{ yylhsminor.yy26 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy353, NULL); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy269, NULL); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 111: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy26 = createRealTableNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353, NULL); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRealTableNode(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269, NULL); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 113: /* column_def_list ::= column_def_list NK_COMMA column_def */ case 154: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==154); case 157: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==157); case 166: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==166); - case 261: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==261); - case 308: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==308); -{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, yymsp[0].minor.yy26); } - yymsp[-2].minor.yy64 = yylhsminor.yy64; + case 194: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==194); + case 272: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==272); + case 319: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==319); +{ yylhsminor.yy358 = addNodeToList(pCxt, yymsp[-2].minor.yy358, yymsp[0].minor.yy348); } + yymsp[-2].minor.yy358 = yylhsminor.yy358; break; case 114: /* column_def ::= column_name type_name */ -{ yylhsminor.yy26 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy353, yymsp[0].minor.yy370, NULL); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy269, yymsp[0].minor.yy218, NULL); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 115: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy26 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-2].minor.yy370, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy269, yymsp[-2].minor.yy218, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 116: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 117: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 118: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 119: /* type_name ::= INT */ case 120: /* type_name ::= INTEGER */ yytestcase(yyruleno==120); -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_INT); } break; case 121: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 122: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 123: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 124: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy218 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 125: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 126: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy218 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 127: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy218 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 128: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy218 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 129: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy218 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 130: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy370 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy218 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 131: /* type_name ::= JSON */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 132: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy218 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 133: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 134: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 135: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy370 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy218 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 136: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy370 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy218 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 137: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy370 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy218 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 138: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy370 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy218 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 140: /* tags_def_opt ::= tags_def */ - case 259: /* select_list ::= select_sublist */ yytestcase(yyruleno==259); -{ yylhsminor.yy64 = yymsp[0].minor.yy64; } - yymsp[0].minor.yy64 = yylhsminor.yy64; + case 270: /* select_list ::= select_sublist */ yytestcase(yyruleno==270); +{ yylhsminor.yy358 = yymsp[0].minor.yy358; } + yymsp[0].minor.yy358 = yylhsminor.yy358; break; case 141: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy64 = yymsp[-1].minor.yy64; } +{ yymsp[-3].minor.yy358 = yymsp[-1].minor.yy358; } break; case 142: /* table_options ::= */ -{ yymsp[1].minor.yy26 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy348 = createDefaultTableOptions(pCxt); } break; case 143: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-2].minor.yy26, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 144: /* table_options ::= table_options KEEP NK_INTEGER */ -{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-2].minor.yy26, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 145: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-2].minor.yy26, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 146: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy26 = setTableSmaOption(pCxt, yymsp[-4].minor.yy26, yymsp[-1].minor.yy64); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setTableSmaOption(pCxt, yymsp[-4].minor.yy348, yymsp[-1].minor.yy358); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 147: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ -{ yylhsminor.yy26 = setTableRollupOption(pCxt, yymsp[-4].minor.yy26, yymsp[-1].minor.yy64); } - yymsp[-4].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setTableRollupOption(pCxt, yymsp[-4].minor.yy348, yymsp[-1].minor.yy358); } + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 148: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy26 = createDefaultAlterTableOptions(pCxt); yylhsminor.yy26 = setTableOption(pCxt, yylhsminor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createDefaultAlterTableOptions(pCxt); yylhsminor.yy348 = setTableOption(pCxt, yylhsminor.yy348, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 149: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy26 = setTableOption(pCxt, yymsp[-1].minor.yy26, yymsp[0].minor.yy443.type, &yymsp[0].minor.yy443.val); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 150: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy443.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 151: /* alter_table_option ::= KEEP NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 152: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy443.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy443.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy233.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } break; case 155: /* col_name ::= column_name */ -{ yylhsminor.yy26 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy353); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy269); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 158: /* func_name ::= function_name */ -{ yylhsminor.yy26 = createFunctionNode(pCxt, &yymsp[0].minor.yy353, NULL); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createFunctionNode(pCxt, &yymsp[0].minor.yy269, NULL); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 159: /* cmd ::= CREATE SMA INDEX index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy353, &yymsp[-1].minor.yy353, NULL, yymsp[0].minor.yy26); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, &yymsp[-3].minor.yy269, &yymsp[-1].minor.yy269, NULL, yymsp[0].minor.yy348); } break; case 160: /* cmd ::= CREATE FULLTEXT INDEX index_name ON table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &yymsp[-5].minor.yy353, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64, NULL); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, &yymsp[-5].minor.yy269, &yymsp[-3].minor.yy269, yymsp[-1].minor.yy358, NULL); } break; case 161: /* cmd ::= DROP INDEX index_name ON table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269); } break; case 162: /* index_options ::= */ - case 266: /* where_clause_opt ::= */ yytestcase(yyruleno==266); - case 270: /* twindow_clause_opt ::= */ yytestcase(yyruleno==270); - case 275: /* sliding_opt ::= */ yytestcase(yyruleno==275); - case 277: /* fill_opt ::= */ yytestcase(yyruleno==277); - case 289: /* having_clause_opt ::= */ yytestcase(yyruleno==289); - case 297: /* slimit_clause_opt ::= */ yytestcase(yyruleno==297); - case 301: /* limit_clause_opt ::= */ yytestcase(yyruleno==301); -{ yymsp[1].minor.yy26 = NULL; } + case 277: /* where_clause_opt ::= */ yytestcase(yyruleno==277); + case 281: /* twindow_clause_opt ::= */ yytestcase(yyruleno==281); + case 286: /* sliding_opt ::= */ yytestcase(yyruleno==286); + case 288: /* fill_opt ::= */ yytestcase(yyruleno==288); + case 300: /* having_clause_opt ::= */ yytestcase(yyruleno==300); + case 308: /* slimit_clause_opt ::= */ yytestcase(yyruleno==308); + case 312: /* limit_clause_opt ::= */ yytestcase(yyruleno==312); +{ yymsp[1].minor.yy348 = NULL; } break; case 163: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ -{ yymsp[-8].minor.yy26 = createIndexOption(pCxt, yymsp[-6].minor.yy64, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), NULL, yymsp[0].minor.yy26); } +{ yymsp[-8].minor.yy348 = createIndexOption(pCxt, yymsp[-6].minor.yy358, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), NULL, yymsp[0].minor.yy348); } break; case 164: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ -{ yymsp[-10].minor.yy26 = createIndexOption(pCxt, yymsp[-8].minor.yy64, releaseRawExprNode(pCxt, yymsp[-4].minor.yy26), releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), yymsp[0].minor.yy26); } +{ yymsp[-10].minor.yy348 = createIndexOption(pCxt, yymsp[-8].minor.yy358, releaseRawExprNode(pCxt, yymsp[-4].minor.yy348), releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), yymsp[0].minor.yy348); } break; case 167: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy26 = createFunctionNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createFunctionNode(pCxt, &yymsp[-3].minor.yy269, yymsp[-1].minor.yy358); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 168: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy107, &yymsp[-2].minor.yy353, yymsp[0].minor.yy26, NULL); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy345, &yymsp[-2].minor.yy269, yymsp[0].minor.yy348, NULL); } break; case 169: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy107, &yymsp[-2].minor.yy353, NULL, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy345, &yymsp[-2].minor.yy269, NULL, &yymsp[0].minor.yy269); } break; case 170: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy107, &yymsp[0].minor.yy353); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } break; case 171: /* cmd ::= SHOW VGROUPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } break; case 172: /* cmd ::= SHOW db_name NK_DOT VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy353); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &yymsp[-2].minor.yy269); } break; case 173: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); } break; case 175: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 176: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 177: /* literal ::= NK_STRING */ -{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 178: /* literal ::= NK_BOOL */ -{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 179: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 180: /* literal ::= duration_literal */ - case 193: /* expression ::= literal */ yytestcase(yyruleno==193); - case 194: /* expression ::= column_reference */ yytestcase(yyruleno==194); - case 197: /* expression ::= subquery */ yytestcase(yyruleno==197); - case 229: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==229); - case 233: /* boolean_primary ::= predicate */ yytestcase(yyruleno==233); - case 235: /* common_expression ::= expression */ yytestcase(yyruleno==235); - case 236: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==236); - case 238: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==238); - case 240: /* table_reference ::= table_primary */ yytestcase(yyruleno==240); - case 241: /* table_reference ::= joined_table */ yytestcase(yyruleno==241); - case 245: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==245); - case 292: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==292); - case 294: /* query_primary ::= query_specification */ yytestcase(yyruleno==294); -{ yylhsminor.yy26 = yymsp[0].minor.yy26; } - yymsp[0].minor.yy26 = yylhsminor.yy26; + case 188: /* signed_literal ::= signed */ yytestcase(yyruleno==188); + case 204: /* expression ::= literal */ yytestcase(yyruleno==204); + case 205: /* expression ::= column_reference */ yytestcase(yyruleno==205); + case 208: /* expression ::= subquery */ yytestcase(yyruleno==208); + case 240: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==240); + case 244: /* boolean_primary ::= predicate */ yytestcase(yyruleno==244); + case 246: /* common_expression ::= expression */ yytestcase(yyruleno==246); + case 247: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==247); + case 249: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==249); + case 251: /* table_reference ::= table_primary */ yytestcase(yyruleno==251); + case 252: /* table_reference ::= joined_table */ yytestcase(yyruleno==252); + case 256: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==256); + case 303: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==303); + case 305: /* query_primary ::= query_specification */ yytestcase(yyruleno==305); +{ yylhsminor.yy348 = yymsp[0].minor.yy348; } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 181: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy26 = yylhsminor.yy26; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 182: /* literal_list ::= literal */ - case 206: /* expression_list ::= expression */ yytestcase(yyruleno==206); -{ yylhsminor.yy64 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26)); } - yymsp[0].minor.yy64 = yylhsminor.yy64; + case 182: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 183: /* literal_list ::= literal_list NK_COMMA literal */ - case 207: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==207); -{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, releaseRawExprNode(pCxt, yymsp[0].minor.yy26)); } - yymsp[-2].minor.yy64 = yylhsminor.yy64; + case 183: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; - case 195: /* expression ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy353, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64)); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; - break; - case 196: /* expression ::= function_name NK_LP NK_STAR NK_RP */ -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy353, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy353, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; - break; - case 198: /* expression ::= NK_LP expression NK_RP */ - case 234: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==234); -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26)); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 199: /* expression ::= NK_PLUS expression */ -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy26)); - } - yymsp[-1].minor.yy26 = yylhsminor.yy26; - break; - case 200: /* expression ::= NK_MINUS expression */ -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy26), NULL)); - } - yymsp[-1].minor.yy26 = yylhsminor.yy26; - break; - case 201: /* expression ::= expression NK_PLUS expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 202: /* expression ::= expression NK_MINUS expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 203: /* expression ::= expression NK_STAR expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 204: /* expression ::= expression NK_SLASH expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 205: /* expression ::= expression NK_REM expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 208: /* column_reference ::= column_name */ -{ yylhsminor.yy26 = createRawExprNode(pCxt, &yymsp[0].minor.yy353, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy353)); } - yymsp[0].minor.yy26 = yylhsminor.yy26; - break; - case 209: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353, createColumnNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353)); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 210: /* predicate ::= expression compare_op expression */ - case 215: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==215); -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy80, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 211: /* predicate ::= expression BETWEEN expression AND expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy26), releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-4].minor.yy26 = yylhsminor.yy26; - break; - case 212: /* predicate ::= expression NOT BETWEEN expression AND expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[-5].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-5].minor.yy26 = yylhsminor.yy26; - break; - case 213: /* predicate ::= expression IS NULL */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), NULL)); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 214: /* predicate ::= expression IS NOT NULL */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), NULL)); - } - yymsp[-3].minor.yy26 = yylhsminor.yy26; - break; - case 216: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy80 = OP_TYPE_LOWER_THAN; } - break; - case 217: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy80 = OP_TYPE_GREATER_THAN; } - break; - case 218: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy80 = OP_TYPE_LOWER_EQUAL; } - break; - case 219: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy80 = OP_TYPE_GREATER_EQUAL; } - break; - case 220: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy80 = OP_TYPE_NOT_EQUAL; } - break; - case 221: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy80 = OP_TYPE_EQUAL; } - break; - case 222: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy80 = OP_TYPE_LIKE; } - break; - case 223: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy80 = OP_TYPE_NOT_LIKE; } - break; - case 224: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy80 = OP_TYPE_MATCH; } - break; - case 225: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy80 = OP_TYPE_NMATCH; } - break; - case 226: /* in_op ::= IN */ -{ yymsp[0].minor.yy80 = OP_TYPE_IN; } - break; - case 227: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy80 = OP_TYPE_NOT_IN; } - break; - case 228: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 230: /* boolean_value_expression ::= NOT boolean_primary */ -{ - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy26), NULL)); - } - yymsp[-1].minor.yy26 = yylhsminor.yy26; - break; - case 231: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 232: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy26); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); - } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 237: /* from_clause ::= FROM table_reference_list */ - case 267: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==267); - case 290: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==290); -{ yymsp[-1].minor.yy26 = yymsp[0].minor.yy26; } - break; - case 239: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy26 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy26, yymsp[0].minor.yy26, NULL); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 242: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy26 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; - break; - case 243: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy26 = createRealTableNode(pCxt, &yymsp[-3].minor.yy353, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; - break; - case 244: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy26 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26), &yymsp[0].minor.yy353); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; - break; - case 246: /* alias_opt ::= */ -{ yymsp[1].minor.yy353 = nil_token; } - break; - case 247: /* alias_opt ::= table_alias */ -{ yylhsminor.yy353 = yymsp[0].minor.yy353; } - yymsp[0].minor.yy353 = yylhsminor.yy353; - break; - case 248: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy353 = yymsp[0].minor.yy353; } - break; - case 249: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 250: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==250); -{ yymsp[-2].minor.yy26 = yymsp[-1].minor.yy26; } - break; - case 251: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy26 = createJoinTableNode(pCxt, yymsp[-4].minor.yy372, yymsp[-5].minor.yy26, yymsp[-2].minor.yy26, yymsp[0].minor.yy26); } - yymsp[-5].minor.yy26 = yylhsminor.yy26; - break; - case 252: /* join_type ::= */ -{ yymsp[1].minor.yy372 = JOIN_TYPE_INNER; } - break; - case 253: /* join_type ::= INNER */ -{ yymsp[0].minor.yy372 = JOIN_TYPE_INNER; } - break; - case 254: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 184: /* signed ::= NK_MINUS NK_INTEGER */ { - yymsp[-8].minor.yy26 = createSelectStmt(pCxt, yymsp[-7].minor.yy107, yymsp[-6].minor.yy64, yymsp[-5].minor.yy26); - yymsp[-8].minor.yy26 = addWhereClause(pCxt, yymsp[-8].minor.yy26, yymsp[-4].minor.yy26); - yymsp[-8].minor.yy26 = addPartitionByClause(pCxt, yymsp[-8].minor.yy26, yymsp[-3].minor.yy64); - yymsp[-8].minor.yy26 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy26, yymsp[-2].minor.yy26); - yymsp[-8].minor.yy26 = addGroupByClause(pCxt, yymsp[-8].minor.yy26, yymsp[-1].minor.yy64); - yymsp[-8].minor.yy26 = addHavingClause(pCxt, yymsp[-8].minor.yy26, yymsp[0].minor.yy26); + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 256: /* set_quantifier_opt ::= DISTINCT */ -{ yymsp[0].minor.yy107 = true; } + case 185: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 257: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy107 = false; } + case 186: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 258: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy64 = NULL; } - break; - case 262: /* select_item ::= common_expression */ -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy26); - yylhsminor.yy26 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26), &t); - } - yymsp[0].minor.yy26 = yylhsminor.yy26; - break; - case 263: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy26 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26), &yymsp[0].minor.yy353); } - yymsp[-1].minor.yy26 = yylhsminor.yy26; - break; - case 264: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy26 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), &yymsp[0].minor.yy353); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 265: /* select_item ::= table_name NK_DOT NK_STAR */ -{ yylhsminor.yy26 = createColumnNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; - break; - case 269: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 286: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==286); - case 296: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==296); -{ yymsp[-2].minor.yy64 = yymsp[0].minor.yy64; } - break; - case 271: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy26 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), &yymsp[-1].minor.yy0); } - break; - case 272: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ -{ yymsp[-3].minor.yy26 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy26)); } - break; - case 273: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy26 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), NULL, yymsp[-1].minor.yy26, yymsp[0].minor.yy26); } - break; - case 274: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy26 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy26), releaseRawExprNode(pCxt, yymsp[-3].minor.yy26), yymsp[-1].minor.yy26, yymsp[0].minor.yy26); } - break; - case 276: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy26 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy26); } - break; - case 278: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy26 = createFillNode(pCxt, yymsp[-1].minor.yy192, NULL); } - break; - case 279: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy26 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); } - break; - case 280: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy192 = FILL_MODE_NONE; } - break; - case 281: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy192 = FILL_MODE_PREV; } - break; - case 282: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy192 = FILL_MODE_NULL; } - break; - case 283: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy192 = FILL_MODE_LINEAR; } - break; - case 284: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy192 = FILL_MODE_NEXT; } - break; - case 287: /* group_by_list ::= expression */ -{ yylhsminor.yy64 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); } - yymsp[0].minor.yy64 = yylhsminor.yy64; - break; - case 288: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy26))); } - yymsp[-2].minor.yy64 = yylhsminor.yy64; - break; - case 291: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 187: /* signed ::= NK_MINUS NK_FLOAT */ { - yylhsminor.yy26 = addOrderByClause(pCxt, yymsp[-3].minor.yy26, yymsp[-2].minor.yy64); - yylhsminor.yy26 = addSlimitClause(pCxt, yylhsminor.yy26, yymsp[-1].minor.yy26); - yylhsminor.yy26 = addLimitClause(pCxt, yylhsminor.yy26, yymsp[0].minor.yy26); + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 293: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy26 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy26, yymsp[0].minor.yy26); } - yymsp[-3].minor.yy26 = yylhsminor.yy26; + case 189: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 298: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 302: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==302); -{ yymsp[-1].minor.yy26 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 190: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 299: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 303: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==303); -{ yymsp[-3].minor.yy26 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 191: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 300: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 304: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==304); -{ yymsp[-3].minor.yy26 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 192: /* signed_literal ::= duration_literal */ + case 317: /* search_condition ::= common_expression */ yytestcase(yyruleno==317); +{ yylhsminor.yy348 = releaseRawExprNode(pCxt, yymsp[0].minor.yy348); } + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 305: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy26 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy26); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; + case 206: /* expression ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy269, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy269, yymsp[-1].minor.yy358)); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; - case 306: /* search_condition ::= common_expression */ -{ yylhsminor.yy26 = releaseRawExprNode(pCxt, yymsp[0].minor.yy26); } - yymsp[0].minor.yy26 = yylhsminor.yy26; + case 207: /* expression ::= function_name NK_LP NK_STAR NK_RP */ +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy269, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy269, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; - case 309: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy26 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy26), yymsp[-1].minor.yy32, yymsp[0].minor.yy391); } - yymsp[-2].minor.yy26 = yylhsminor.yy26; + case 209: /* expression ::= NK_LP expression NK_RP */ + case 245: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==245); +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 310: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy32 = ORDER_ASC; } + case 210: /* expression ::= NK_PLUS expression */ +{ + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); + } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 311: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy32 = ORDER_ASC; } + case 211: /* expression ::= NK_MINUS expression */ +{ + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy348), NULL)); + } + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 312: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy32 = ORDER_DESC; } + case 212: /* expression ::= expression NK_PLUS expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 313: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy391 = NULL_ORDER_DEFAULT; } + case 213: /* expression ::= expression NK_MINUS expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 314: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy391 = NULL_ORDER_FIRST; } + case 214: /* expression ::= expression NK_STAR expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 315: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy391 = NULL_ORDER_LAST; } + case 215: /* expression ::= expression NK_SLASH expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 216: /* expression ::= expression NK_REM expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 217: /* expression_list ::= expression */ +{ yylhsminor.yy358 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } + yymsp[0].minor.yy358 = yylhsminor.yy358; + break; + case 218: /* expression_list ::= expression_list NK_COMMA expression */ +{ yylhsminor.yy358 = addNodeToList(pCxt, yymsp[-2].minor.yy358, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } + yymsp[-2].minor.yy358 = yylhsminor.yy358; + break; + case 219: /* column_reference ::= column_name */ +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy269, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy269)); } + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 220: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269, createColumnNode(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269)); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 221: /* predicate ::= expression compare_op expression */ + case 226: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==226); +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy194, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 222: /* predicate ::= expression BETWEEN expression AND expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy348), releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-4].minor.yy348 = yylhsminor.yy348; + break; + case 223: /* predicate ::= expression NOT BETWEEN expression AND expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[-5].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-5].minor.yy348 = yylhsminor.yy348; + break; + case 224: /* predicate ::= expression IS NULL */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), NULL)); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 225: /* predicate ::= expression IS NOT NULL */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), NULL)); + } + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 227: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy194 = OP_TYPE_LOWER_THAN; } + break; + case 228: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy194 = OP_TYPE_GREATER_THAN; } + break; + case 229: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy194 = OP_TYPE_LOWER_EQUAL; } + break; + case 230: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy194 = OP_TYPE_GREATER_EQUAL; } + break; + case 231: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy194 = OP_TYPE_NOT_EQUAL; } + break; + case 232: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy194 = OP_TYPE_EQUAL; } + break; + case 233: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy194 = OP_TYPE_LIKE; } + break; + case 234: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy194 = OP_TYPE_NOT_LIKE; } + break; + case 235: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy194 = OP_TYPE_MATCH; } + break; + case 236: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy194 = OP_TYPE_NMATCH; } + break; + case 237: /* in_op ::= IN */ +{ yymsp[0].minor.yy194 = OP_TYPE_IN; } + break; + case 238: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy194 = OP_TYPE_NOT_IN; } + break; + case 239: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy358)); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 241: /* boolean_value_expression ::= NOT boolean_primary */ +{ + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy348), NULL)); + } + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 242: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 243: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 248: /* from_clause ::= FROM table_reference_list */ + case 278: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==278); + case 301: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==301); +{ yymsp[-1].minor.yy348 = yymsp[0].minor.yy348; } + break; + case 250: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy348 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy348, yymsp[0].minor.yy348, NULL); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 253: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy348 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 254: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy348 = createRealTableNode(pCxt, &yymsp[-3].minor.yy269, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 255: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy348 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348), &yymsp[0].minor.yy269); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 257: /* alias_opt ::= */ +{ yymsp[1].minor.yy269 = nil_token; } + break; + case 258: /* alias_opt ::= table_alias */ +{ yylhsminor.yy269 = yymsp[0].minor.yy269; } + yymsp[0].minor.yy269 = yylhsminor.yy269; + break; + case 259: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy269 = yymsp[0].minor.yy269; } + break; + case 260: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 261: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==261); +{ yymsp[-2].minor.yy348 = yymsp[-1].minor.yy348; } + break; + case 262: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy348 = createJoinTableNode(pCxt, yymsp[-4].minor.yy184, yymsp[-5].minor.yy348, yymsp[-2].minor.yy348, yymsp[0].minor.yy348); } + yymsp[-5].minor.yy348 = yylhsminor.yy348; + break; + case 263: /* join_type ::= */ +{ yymsp[1].minor.yy184 = JOIN_TYPE_INNER; } + break; + case 264: /* join_type ::= INNER */ +{ yymsp[0].minor.yy184 = JOIN_TYPE_INNER; } + break; + case 265: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ +{ + yymsp[-8].minor.yy348 = createSelectStmt(pCxt, yymsp[-7].minor.yy345, yymsp[-6].minor.yy358, yymsp[-5].minor.yy348); + yymsp[-8].minor.yy348 = addWhereClause(pCxt, yymsp[-8].minor.yy348, yymsp[-4].minor.yy348); + yymsp[-8].minor.yy348 = addPartitionByClause(pCxt, yymsp[-8].minor.yy348, yymsp[-3].minor.yy358); + yymsp[-8].minor.yy348 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy348, yymsp[-2].minor.yy348); + yymsp[-8].minor.yy348 = addGroupByClause(pCxt, yymsp[-8].minor.yy348, yymsp[-1].minor.yy358); + yymsp[-8].minor.yy348 = addHavingClause(pCxt, yymsp[-8].minor.yy348, yymsp[0].minor.yy348); + } + break; + case 267: /* set_quantifier_opt ::= DISTINCT */ +{ yymsp[0].minor.yy345 = true; } + break; + case 268: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy345 = false; } + break; + case 269: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy358 = NULL; } + break; + case 273: /* select_item ::= common_expression */ +{ + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348), &t); + } + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 274: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy348 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348), &yymsp[0].minor.yy269); } + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 275: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy348 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), &yymsp[0].minor.yy269); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 276: /* select_item ::= table_name NK_DOT NK_STAR */ +{ yylhsminor.yy348 = createColumnNode(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 280: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 297: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==297); + case 307: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==307); +{ yymsp[-2].minor.yy358 = yymsp[0].minor.yy358; } + break; + case 282: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy348 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), &yymsp[-1].minor.yy0); } + break; + case 283: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */ +{ yymsp[-3].minor.yy348 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } + break; + case 284: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy348 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), NULL, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } + break; + case 285: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy348 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy348), releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } + break; + case 287: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ +{ yymsp[-3].minor.yy348 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy348); } + break; + case 289: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy348 = createFillNode(pCxt, yymsp[-1].minor.yy256, NULL); } + break; + case 290: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy348 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy358)); } + break; + case 291: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy256 = FILL_MODE_NONE; } + break; + case 292: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy256 = FILL_MODE_PREV; } + break; + case 293: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy256 = FILL_MODE_NULL; } + break; + case 294: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy256 = FILL_MODE_LINEAR; } + break; + case 295: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy256 = FILL_MODE_NEXT; } + break; + case 298: /* group_by_list ::= expression */ +{ yylhsminor.yy358 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } + yymsp[0].minor.yy358 = yylhsminor.yy358; + break; + case 299: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy358 = addNodeToList(pCxt, yymsp[-2].minor.yy358, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } + yymsp[-2].minor.yy358 = yylhsminor.yy358; + break; + case 302: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ +{ + yylhsminor.yy348 = addOrderByClause(pCxt, yymsp[-3].minor.yy348, yymsp[-2].minor.yy358); + yylhsminor.yy348 = addSlimitClause(pCxt, yylhsminor.yy348, yymsp[-1].minor.yy348); + yylhsminor.yy348 = addLimitClause(pCxt, yylhsminor.yy348, yymsp[0].minor.yy348); + } + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 304: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy348 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy348, yymsp[0].minor.yy348); } + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 309: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 313: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==313); +{ yymsp[-1].minor.yy348 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + break; + case 310: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 314: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==314); +{ yymsp[-3].minor.yy348 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 311: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 315: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==315); +{ yymsp[-3].minor.yy348 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + break; + case 316: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy348); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 320: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy348 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), yymsp[-1].minor.yy368, yymsp[0].minor.yy339); } + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 321: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy368 = ORDER_ASC; } + break; + case 322: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy368 = ORDER_ASC; } + break; + case 323: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy368 = ORDER_DESC; } + break; + case 324: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy339 = NULL_ORDER_DEFAULT; } + break; + case 325: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy339 = NULL_ORDER_FIRST; } + break; + case 326: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy339 = NULL_ORDER_LAST; } break; default: break; From 48822785e1548b4543e3c80f2619a174a296da43 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 22 Mar 2022 02:56:51 -0400 Subject: [PATCH 04/15] TD-14178 bugfix --- source/libs/parser/src/parTranslater.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index f20bc5f2e6..e0b11938f4 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -255,7 +255,7 @@ static int32_t trimStringWithVarFormat(const char* src, int32_t len, bool format static EDealRes translateValue(STranslateContext* pCxt, SValueNode* pVal) { if (pVal->isDuration) { - if (parseAbsoluteDuration(pVal->literal, strlen(pVal->literal), &pVal->datum.i, &pVal->unit, pVal->node.resType.precision) != TSDB_CODE_SUCCESS) { + if (parseNatualDuration(pVal->literal, strlen(pVal->literal), &pVal->datum.i, &pVal->unit, pVal->node.resType.precision) != TSDB_CODE_SUCCESS) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, pVal->literal); } } else { From eb5471fdd62b0d349b58efea27e1139181a8aa7f Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 22 Mar 2022 14:57:16 +0800 Subject: [PATCH 05/15] tsdb merge --- include/common/trow.h | 8 ++++++-- source/dnode/vnode/src/tsdb/tsdbReadImpl.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/common/trow.h b/include/common/trow.h index 47edf6f1ad..4ae5a2277d 100644 --- a/include/common/trow.h +++ b/include/common/trow.h @@ -968,10 +968,14 @@ static FORCE_INLINE int32_t tdGetColDataOfRow(SCellVal *pVal, SDataCol *pCol, in #endif return TSDB_CODE_SUCCESS; } - if (tdGetBitmapValType(pCol->pBitmap, row, &(pVal->valType)) < 0) { + + if (TD_COL_ROWS_NORM(pCol)) { + pVal->valType = TD_VTYPE_NORM; + } else if (tdGetBitmapValType(pCol->pBitmap, row, &(pVal->valType)) < 0) { return terrno; } - if (TD_COL_ROWS_NORM(pCol) || tdValTypeIsNorm(pVal->valType)) { + + if (tdValTypeIsNorm(pVal->valType)) { if (IS_VAR_DATA_TYPE(pCol->type)) { pVal->val = POINTER_SHIFT(pCol->pData, pCol->dataOff[row]); } else { diff --git a/source/dnode/vnode/src/tsdb/tsdbReadImpl.c b/source/dnode/vnode/src/tsdb/tsdbReadImpl.c index f6827eaae1..9619ac036e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReadImpl.c +++ b/source/dnode/vnode/src/tsdb/tsdbReadImpl.c @@ -727,9 +727,9 @@ static int tsdbLoadBlockDataColsImpl(SReadH *pReadh, SBlock *pBlock, SDataCols * } ASSERT(pBlockCol->colId == pDataCol->colId); - // set the bitmap - pDataCol->bitmap = pBlockCol->bitmap; } + // set the bitmap + pDataCol->bitmap = pBlockCol->bitmap; if (tsdbLoadColData(pReadh, pDFile, pBlock, pBlockCol, pDataCol) < 0) return -1; } From 1a1008548eadc5ab8686976f1fb7eeeadf14aa94 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 22 Mar 2022 15:17:45 +0800 Subject: [PATCH 06/15] trigger CI From 2dc845fba9856c24263190fa628e9f27781fd4c7 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 22 Mar 2022 15:32:36 +0800 Subject: [PATCH 07/15] restore --- source/dnode/mgmt/vnode/src/vmInt.c | 2 +- source/dnode/vnode/src/inc/tsdbLog.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/dnode/mgmt/vnode/src/vmInt.c b/source/dnode/mgmt/vnode/src/vmInt.c index c6122c0501..1c6c7d089e 100644 --- a/source/dnode/mgmt/vnode/src/vmInt.c +++ b/source/dnode/mgmt/vnode/src/vmInt.c @@ -342,7 +342,7 @@ void vmGetMgmtFp(SMgmtWrapper *pWrapper) { mgmtFp.requiredFp = vmRequire; vmInitMsgHandles(pWrapper); - pWrapper->name = "vnode"; + pWrapper->name = "vnodes"; pWrapper->fp = mgmtFp; } diff --git a/source/dnode/vnode/src/inc/tsdbLog.h b/source/dnode/vnode/src/inc/tsdbLog.h index 3afe628198..56dc8ab2a0 100644 --- a/source/dnode/vnode/src/inc/tsdbLog.h +++ b/source/dnode/vnode/src/inc/tsdbLog.h @@ -24,12 +24,12 @@ extern "C" { extern int32_t tsdbDebugFlag; -#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TSDB FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0) -#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TSDB ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0) -#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TSDB WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0) -#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TSDB ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0) -#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSDB ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0) -#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) +#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TDB FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0) +#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TDB ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0) +#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TDB WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0) +#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TDB ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0) +#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TDB ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0) +#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) #ifdef __cplusplus } From a25de3475bf1a9ba04ab16bb81cd7009da13f0d5 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 22 Mar 2022 05:55:45 -0400 Subject: [PATCH 08/15] ignore test generated file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3eda69f60d..1bfbf00cd5 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,7 @@ tests/examples/JDBC/JDBCDemo/.classpath tests/examples/JDBC/JDBCDemo/.project tests/examples/JDBC/JDBCDemo/.settings/ source/libs/parser/inc/sql.* +tests/script/tmqResult.txt # Emacs # -*- mode: gitignore; -*- From d3104e78ece4fda40715d98fb6662aa76df3431e Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 22 Mar 2022 18:00:03 +0800 Subject: [PATCH 09/15] stream task exec --- example/CMakeLists.txt | 30 ++- example/src/tstream.c | 224 +++++++++++++++++++++ include/client/taos.h | 8 +- include/common/tcommon.h | 3 + include/common/tmsg.h | 14 +- include/libs/executor/executor.h | 50 ++--- source/client/src/tmq.c | 4 +- source/common/src/tdatablock.c | 23 +++ source/common/src/tmsg.c | 8 +- source/dnode/mgmt/vnode/src/vmMsg.c | 1 + source/dnode/mnode/impl/inc/mndSnode.h | 1 + source/dnode/mnode/impl/src/mndScheduler.c | 62 +++--- source/dnode/mnode/impl/src/mndSnode.c | 9 + source/dnode/snode/src/snode.c | 4 +- source/dnode/vnode/src/tq/tq.c | 164 ++++++++++++++- source/libs/executor/src/executor.c | 7 +- 16 files changed, 531 insertions(+), 81 deletions(-) create mode 100644 example/src/tstream.c diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 51e1e996dc..acb99caffc 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,12 +1,30 @@ -aux_source_directory(src TMQ_DEMO_SRC) +add_executable(tmq "") +add_executable(tstream "") -add_executable(tmq ${TMQ_DEMO_SRC}) -target_link_libraries( - tmq taos +target_sources(tmq + PRIVATE + "src/tmq.c" ) -target_include_directories( - tmq + +target_sources(tstream + PRIVATE + "src/tstream.c" +) +target_link_libraries(tmq + taos +) + +target_link_libraries(tstream + taos +) + +target_include_directories(tmq + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) + +target_include_directories(tstream PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" ) SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) +SET_TARGET_PROPERTIES(tstream PROPERTIES OUTPUT_NAME tstream) diff --git a/example/src/tstream.c b/example/src/tstream.c new file mode 100644 index 0000000000..73ab655fbd --- /dev/null +++ b/example/src/tstream.c @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include "taos.h" + +static int running = 1; +static void msg_process(tmq_message_t* message) { tmqShowMsg(message); } + +int32_t init_env() { + TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); + if (pConn == NULL) { + return -1; + } + + TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 1"); + if (taos_errno(pRes) != 0) { + printf("error in create db, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + + pRes = taos_query(pConn, "use abc1"); + if (taos_errno(pRes) != 0) { + printf("error in use db, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + + pRes = taos_query(pConn, "create stable if not exists st1 (ts timestamp, k int) tags(a int)"); + if (taos_errno(pRes) != 0) { + printf("failed to create super table st1, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + + pRes = taos_query(pConn, "create table if not exists tu1 using st1 tags(1)"); + if (taos_errno(pRes) != 0) { + printf("failed to create child table tu1, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + + pRes = taos_query(pConn, "create table if not exists tu2 using st1 tags(2)"); + if (taos_errno(pRes) != 0) { + printf("failed to create child table tu2, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + return 0; +} + +int32_t create_stream() { + printf("create topic\n"); + TAOS_RES* pRes; + TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); + if (pConn == NULL) { + return -1; + } + + pRes = taos_query(pConn, "use abc1"); + if (taos_errno(pRes) != 0) { + printf("error in use db, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + + const char* sql = "select ts,k from tu1"; + pRes = tmq_create_stream(pConn, "stream1", "out1", sql); + if (taos_errno(pRes) != 0) { + printf("failed to create stream out1, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + taos_close(pConn); + return 0; +} + +void tmq_commit_cb_print(tmq_t* tmq, tmq_resp_err_t resp, tmq_topic_vgroup_list_t* offsets, void* param) { + printf("commit %d\n", resp); +} + +tmq_t* build_consumer() { + TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); + assert(pConn != NULL); + + TAOS_RES* pRes = taos_query(pConn, "use abc1"); + if (taos_errno(pRes) != 0) { + printf("error in use db, reason:%s\n", taos_errstr(pRes)); + } + taos_free_result(pRes); + + tmq_conf_t* conf = tmq_conf_new(); + tmq_conf_set(conf, "group.id", "tg2"); + tmq_conf_set_offset_commit_cb(conf, tmq_commit_cb_print); + tmq_t* tmq = tmq_consumer_new(pConn, conf, NULL, 0); + return tmq; +} + +tmq_list_t* build_topic_list() { + tmq_list_t* topic_list = tmq_list_new(); + tmq_list_append(topic_list, "test_stb_topic_1"); + return topic_list; +} + +void basic_consume_loop(tmq_t* tmq, tmq_list_t* topics) { + tmq_resp_err_t err; + + if ((err = tmq_subscribe(tmq, topics))) { + fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(err)); + printf("subscribe err\n"); + return; + } + /*int32_t cnt = 0;*/ + /*clock_t startTime = clock();*/ + while (running) { + tmq_message_t* tmqmessage = tmq_consumer_poll(tmq, 500); + if (tmqmessage) { + /*cnt++;*/ + msg_process(tmqmessage); + tmq_message_destroy(tmqmessage); + /*} else {*/ + /*break;*/ + } + } + /*clock_t endTime = clock();*/ + /*printf("log cnt: %d %f s\n", cnt, (double)(endTime - startTime) / CLOCKS_PER_SEC);*/ + + err = tmq_consumer_close(tmq); + if (err) + fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(err)); + else + fprintf(stderr, "%% Consumer closed\n"); +} + +void sync_consume_loop(tmq_t* tmq, tmq_list_t* topics) { + static const int MIN_COMMIT_COUNT = 1; + + int msg_count = 0; + tmq_resp_err_t err; + + if ((err = tmq_subscribe(tmq, topics))) { + fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(err)); + return; + } + + while (running) { + tmq_message_t* tmqmessage = tmq_consumer_poll(tmq, 1000); + if (tmqmessage) { + msg_process(tmqmessage); + tmq_message_destroy(tmqmessage); + + if ((++msg_count % MIN_COMMIT_COUNT) == 0) tmq_commit(tmq, NULL, 0); + } + } + + err = tmq_consumer_close(tmq); + if (err) + fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(err)); + else + fprintf(stderr, "%% Consumer closed\n"); +} + +void perf_loop(tmq_t* tmq, tmq_list_t* topics) { + tmq_resp_err_t err; + + if ((err = tmq_subscribe(tmq, topics))) { + fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(err)); + printf("subscribe err\n"); + return; + } + int32_t batchCnt = 0; + int32_t skipLogNum = 0; + clock_t startTime = clock(); + while (running) { + tmq_message_t* tmqmessage = tmq_consumer_poll(tmq, 500); + if (tmqmessage) { + batchCnt++; + skipLogNum += tmqGetSkipLogNum(tmqmessage); + /*msg_process(tmqmessage);*/ + tmq_message_destroy(tmqmessage); + } else { + break; + } + } + clock_t endTime = clock(); + printf("log batch cnt: %d, skip log cnt: %d, time used:%f s\n", batchCnt, skipLogNum, + (double)(endTime - startTime) / CLOCKS_PER_SEC); + + err = tmq_consumer_close(tmq); + if (err) + fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(err)); + else + fprintf(stderr, "%% Consumer closed\n"); +} + +int main(int argc, char* argv[]) { + int code; + if (argc > 1) { + printf("env init\n"); + code = init_env(); + } + create_topic(); + tmq_t* tmq = build_consumer(); + tmq_list_t* topic_list = build_topic_list(); + /*perf_loop(tmq, topic_list);*/ + /*basic_consume_loop(tmq, topic_list);*/ + sync_consume_loop(tmq, topic_list); +} diff --git a/include/client/taos.h b/include/client/taos.h index da24136d80..82f0635612 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -214,7 +214,6 @@ typedef void(tmq_commit_cb(tmq_t *, tmq_resp_err_t, tmq_topic_vgroup_list_t *, v DLL_EXPORT tmq_list_t *tmq_list_new(); DLL_EXPORT int32_t tmq_list_append(tmq_list_t *, const char *); -DLL_EXPORT TAOS_RES *tmq_create_topic(TAOS *taos, const char *name, const char *sql, int sqlLen); DLL_EXPORT tmq_t *tmq_consumer_new(void *conn, tmq_conf_t *conf, char *errstr, int32_t errstrLen); DLL_EXPORT void tmq_message_destroy(tmq_message_t *tmq_message); DLL_EXPORT const char *tmq_err2str(tmq_resp_err_t); @@ -258,7 +257,12 @@ int32_t tmqGetSkipLogNum(tmq_message_t *tmq_message); DLL_EXPORT TAOS_ROW tmq_get_row(tmq_message_t *message); DLL_EXPORT char *tmq_get_topic_name(tmq_message_t *message); -/* ---------------------- OTHER ---------------------------- */ +/* --------------------TMPORARY INTERFACE FOR TESTING--------------------- */ +DLL_EXPORT TAOS_RES *tmq_create_topic(TAOS *taos, const char *name, const char *sql, int sqlLen); + +DLL_EXPORT TAOS_RES *tmq_create_stream(TAOS *taos, const char *streamName, const char *tbName, const char *sql); + +/* -------------------------------- OTHER -------------------------------- */ typedef void (*TAOS_SUBSCRIBE_CALLBACK)(TAOS_SUB *tsub, TAOS_RES *res, void *param, int code); DLL_EXPORT int taos_stmt_affected_rows(TAOS_STMT *stmt); diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 5308be72bb..15e39d2bad 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -101,6 +101,9 @@ void* blockDataDestroy(SSDataBlock* pBlock); int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock); void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock); +int32_t tEncodeDataBlocks(void** buf, const SArray* blocks); +void* tDecodeDataBlocks(const void* buf, SArray* blocks); + static FORCE_INLINE void blockDestroyInner(SSDataBlock* pBlock) { // WARNING: do not use info.numOfCols, // sometimes info.numOfCols != array size diff --git a/include/common/tmsg.h b/include/common/tmsg.h index ca4e6b97a4..5000dbfd18 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2271,20 +2271,22 @@ enum { typedef struct { void* inputHandle; - void* executor[4]; -} SStreamTaskParRunner; + void* executor; +} SStreamRunner; typedef struct { int64_t streamId; int32_t taskId; int32_t level; int8_t status; - int8_t pipeEnd; - int8_t parallel; + int8_t pipeSource; + int8_t pipeSink; + int8_t numOfRunners; + int8_t parallelizable; SEpSet NextOpEp; char* qmsg; // not applied to encoder and decoder - SStreamTaskParRunner runner; + SStreamRunner runner[8]; // void* executor; // void* stateStore; // storage handle @@ -2316,7 +2318,7 @@ typedef struct { typedef struct { SStreamExecMsgHead head; - // TODO: other info needed by task + SArray* data; // SArray } SStreamTaskExecReq; typedef struct { diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h index b08ee5303d..a342c33afa 100644 --- a/include/libs/executor/executor.h +++ b/include/libs/executor/executor.h @@ -33,15 +33,15 @@ typedef struct SReadHandle { } SReadHandle; #define STREAM_DATA_TYPE_SUBMIT_BLOCK 0x1 -#define STREAM_DATA_TYPE_SSDAT_BLOCK 0x2 +#define STREAM_DATA_TYPE_SSDATA_BLOCK 0x2 - /** - * Create the exec task for streaming mode - * @param pMsg - * @param streamReadHandle - * @return - */ -qTaskInfo_t qCreateStreamExecTaskInfo(void *msg, void* streamReadHandle); +/** + * Create the exec task for streaming mode + * @param pMsg + * @param streamReadHandle + * @return + */ +qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, void* streamReadHandle); /** * Set the input data block for the stream scan. @@ -62,16 +62,17 @@ int32_t qSetStreamInput(qTaskInfo_t tinfo, const void* input, int32_t type); */ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, SArray* tableIdList, bool isAdd); - /** - * Create the exec task object according to task json - * @param readHandle - * @param vgId - * @param pTaskInfoMsg - * @param pTaskInfo - * @param qId - * @return - */ -int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, struct SSubplan* pPlan, qTaskInfo_t* pTaskInfo, DataSinkHandle* handle); +/** + * Create the exec task object according to task json + * @param readHandle + * @param vgId + * @param pTaskInfoMsg + * @param pTaskInfo + * @param qId + * @return + */ +int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, struct SSubplan* pPlan, + qTaskInfo_t* pTaskInfo, DataSinkHandle* handle); /** * The main task execution function, including query on both table and multiple tables, @@ -81,7 +82,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, * @param handle * @return */ -int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t *useconds); +int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds); /** * Retrieve the produced results information, if current query is not paused or completed, @@ -144,7 +145,8 @@ int32_t qGetQualifiedTableIdList(void* pTableList, const char* tagCond, int32_t * @param numOfIndex * @return */ -//int32_t qCreateTableGroupByGroupExpr(SArray* pTableIdList, TSKEY skey, STableGroupInfo groupInfo, SColIndex* groupByIndex, int32_t numOfIndex); +// int32_t qCreateTableGroupByGroupExpr(SArray* pTableIdList, TSKEY skey, STableGroupInfo groupInfo, SColIndex* +// groupByIndex, int32_t numOfIndex); /** * Update the table id list of a given query. @@ -167,19 +169,19 @@ void* qOpenTaskMgmt(int32_t vgId); * broadcast the close information and wait for all query stop. * @param pExecutor */ -void qTaskMgmtNotifyClosing(void* pExecutor); +void qTaskMgmtNotifyClosing(void* pExecutor); /** * Re-open the query handle management module when opening the vnode again. * @param pExecutor */ -void qQueryMgmtReOpen(void *pExecutor); +void qQueryMgmtReOpen(void* pExecutor); /** * Close query mgmt and clean up resources. * @param pExecutor */ -void qCleanupTaskMgmt(void* pExecutor); +void qCleanupTaskMgmt(void* pExecutor); /** * Add the query into the query mgmt object @@ -188,7 +190,7 @@ void qCleanupTaskMgmt(void* pExecutor); * @param qInfo * @return */ -void** qRegisterTask(void* pMgmt, uint64_t qId, void *qInfo); +void** qRegisterTask(void* pMgmt, uint64_t qId, void* qInfo); /** * acquire the query handle according to the key from query mgmt object. diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c index 7c35b7c149..9208d1f634 100644 --- a/source/client/src/tmq.c +++ b/source/client/src/tmq.c @@ -471,8 +471,8 @@ TAOS_RES* tmq_create_stream(TAOS* taos, const char* streamName, const char* tbNa } sqlLen = strlen(sql); - if (strlen(streamName) >= TSDB_TABLE_NAME_LEN) { - tscError("stream name too long, max length:%d", TSDB_TABLE_NAME_LEN - 1); + if (strlen(tbName) >= TSDB_TABLE_NAME_LEN) { + tscError("output tb name too long, max length:%d", TSDB_TABLE_NAME_LEN - 1); terrno = TSDB_CODE_TSC_INVALID_INPUT; goto _return; } diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 0d48d7cc14..3e32f9d58b 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1250,3 +1250,26 @@ void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock) { } return (void*)buf; } + +int32_t tEncodeDataBlocks(void** buf, const SArray* blocks) { + int32_t tlen = 0; + int32_t sz = taosArrayGetSize(blocks); + tlen += taosEncodeFixedI32(buf, sz); + + for (int32_t i = 0; i < sz; i++) { + SSDataBlock* pBlock = taosArrayGet(blocks, i); + tlen += tEncodeDataBlock(buf, pBlock); + } + + return tlen; +} + +void* tDecodeDataBlocks(const void* buf, SArray* blocks) { + int32_t sz; + buf = taosDecodeFixedI32(buf, &sz); + for (int32_t i = 0; i < sz; i++) { + SSDataBlock pBlock = {0}; + buf = tDecodeDataBlock(buf, &pBlock); + } + return (void*)buf; +} diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index b4caf5ba97..44a8334848 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -2720,8 +2720,8 @@ int32_t tEncodeSStreamTask(SCoder *pEncoder, const SStreamTask *pTask) { if (tEncodeI32(pEncoder, pTask->taskId) < 0) return -1; if (tEncodeI32(pEncoder, pTask->level) < 0) return -1; if (tEncodeI8(pEncoder, pTask->status) < 0) return -1; - if (tEncodeI8(pEncoder, pTask->pipeEnd) < 0) return -1; - if (tEncodeI8(pEncoder, pTask->parallel) < 0) return -1; + if (tEncodeI8(pEncoder, pTask->pipeSink) < 0) return -1; + // if (tEncodeI8(pEncoder, pTask->numOfRunners) < 0) return -1; if (tEncodeSEpSet(pEncoder, &pTask->NextOpEp) < 0) return -1; if (tEncodeCStr(pEncoder, pTask->qmsg) < 0) return -1; tEndEncode(pEncoder); @@ -2734,8 +2734,8 @@ int32_t tDecodeSStreamTask(SCoder *pDecoder, SStreamTask *pTask) { if (tDecodeI32(pDecoder, &pTask->taskId) < 0) return -1; if (tDecodeI32(pDecoder, &pTask->level) < 0) return -1; if (tDecodeI8(pDecoder, &pTask->status) < 0) return -1; - if (tDecodeI8(pDecoder, &pTask->pipeEnd) < 0) return -1; - if (tDecodeI8(pDecoder, &pTask->parallel) < 0) return -1; + if (tDecodeI8(pDecoder, &pTask->pipeSink) < 0) return -1; + // if (tDecodeI8(pDecoder, &pTask->numOfRunners) < 0) return -1; if (tDecodeSEpSet(pDecoder, &pTask->NextOpEp) < 0) return -1; if (tDecodeCStrAlloc(pDecoder, &pTask->qmsg) < 0) return -1; tEndDecode(pDecoder); diff --git a/source/dnode/mgmt/vnode/src/vmMsg.c b/source/dnode/mgmt/vnode/src/vmMsg.c index 9f86351985..597a9862fc 100644 --- a/source/dnode/mgmt/vnode/src/vmMsg.c +++ b/source/dnode/mgmt/vnode/src/vmMsg.c @@ -273,6 +273,7 @@ void vmInitMsgHandles(SMgmtWrapper *pWrapper) { dndSetMsgHandle(pWrapper, TDMT_VND_MQ_REB, (NodeMsgFp)vmProcessWriteMsg, 0); dndSetMsgHandle(pWrapper, TDMT_VND_MQ_SET_CUR, (NodeMsgFp)vmProcessFetchMsg, 0); dndSetMsgHandle(pWrapper, TDMT_VND_CONSUME, (NodeMsgFp)vmProcessFetchMsg, 0); + dndSetMsgHandle(pWrapper, TDMT_VND_TASK_DEPLOY, (NodeMsgFp)vmProcessWriteMsg, 0); dndSetMsgHandle(pWrapper, TDMT_VND_QUERY_HEARTBEAT, (NodeMsgFp)vmProcessFetchMsg, 0); dndSetMsgHandle(pWrapper, TDMT_VND_TASK_EXEC, (NodeMsgFp)vmProcessFetchMsg, 0); diff --git a/source/dnode/mnode/impl/inc/mndSnode.h b/source/dnode/mnode/impl/inc/mndSnode.h index 8d64879605..180f18a6dd 100644 --- a/source/dnode/mnode/impl/inc/mndSnode.h +++ b/source/dnode/mnode/impl/inc/mndSnode.h @@ -24,6 +24,7 @@ extern "C" { int32_t mndInitSnode(SMnode *pMnode); void mndCleanupSnode(SMnode *pMnode); +SEpSet mndAcquireEpFromSnode(SMnode *pMnode, const SSnodeObj *pSnode); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index c28c0d76c4..b95574ea41 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -20,6 +20,7 @@ #include "mndMnode.h" #include "mndOffset.h" #include "mndShow.h" +#include "mndSnode.h" #include "mndStb.h" #include "mndStream.h" #include "mndSubscribe.h" @@ -31,7 +32,7 @@ #include "tname.h" #include "tuuid.h" -int32_t mndPersistTaskDeployReq(STrans* pTrans, SStreamTask* pTask, const SEpSet* pEpSet) { +int32_t mndPersistTaskDeployReq(STrans* pTrans, SStreamTask* pTask, const SEpSet* pEpSet, tmsg_t type) { SCoder encoder; tCoderInit(&encoder, TD_LITTLE_ENDIAN, NULL, 0, TD_ENCODER); tEncodeSStreamTask(&encoder, pTask); @@ -52,7 +53,7 @@ int32_t mndPersistTaskDeployReq(STrans* pTrans, SStreamTask* pTask, const SEpSet memcpy(&action.epSet, pEpSet, sizeof(SEpSet)); action.pCont = buf; action.contLen = tlen; - action.msgType = TDMT_SND_TASK_DEPLOY; + action.msgType = type; if (mndTransAppendRedoAction(pTrans, &action) != 0) { rpcFreeCont(buf); return -1; @@ -69,12 +70,27 @@ int32_t mndAssignTaskToVg(SMnode* pMnode, STrans* pTrans, SStreamTask* pTask, SS terrno = TSDB_CODE_QRY_INVALID_INPUT; return -1; } - mndPersistTaskDeployReq(pTrans, pTask, &plan->execNode.epSet); + mndPersistTaskDeployReq(pTrans, pTask, &plan->execNode.epSet, TDMT_VND_TASK_DEPLOY); return 0; } +SSnodeObj* mndSchedFetchSnode(SMnode* pMnode) { + SSnodeObj* pObj = NULL; + pObj = sdbFetch(pMnode->pSdb, SDB_SNODE, NULL, (void**)&pObj); + return pObj; +} + int32_t mndAssignTaskToSnode(SMnode* pMnode, STrans* pTrans, SStreamTask* pTask, SSubplan* plan, const SSnodeObj* pSnode) { + int32_t msgLen; + plan->execNode.nodeId = pSnode->id; + plan->execNode.epSet = mndAcquireEpFromSnode(pMnode, pSnode); + + if (qSubPlanToString(plan, &pTask->qmsg, &msgLen) < 0) { + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } + mndPersistTaskDeployReq(pTrans, pTask, &plan->execNode.epSet, TDMT_SND_TASK_DEPLOY); return 0; } @@ -113,8 +129,8 @@ int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream) { // send to vnode SStreamTask* pTask = streamTaskNew(pStream->uid, level); + pTask->pipeSink = level == totLevel - 1 ? 1 : 0; // TODO: set to - pTask->parallel = 4; if (mndAssignTaskToVg(pMnode, pTrans, pTask, plan, pVgroup) < 0) { sdbRelease(pSdb, pVgroup); qDestroyQueryPlan(pPlan); @@ -122,34 +138,20 @@ int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream) { } taosArrayPush(taskOneLevel, pTask); } - - } else if (plan->subplanType == SUBPLAN_TYPE_SCAN) { - // duplicatable - - int32_t parallel = 0; - // if no snode, parallel set to fetch thread num in vnode - - // if has snode, set to shared thread num in snode - parallel = SND_SHARED_THREAD_NUM; - - SStreamTask* pTask = streamTaskNew(pStream->uid, level); - pTask->parallel = parallel; - // TODO:get snode id and ep - if (mndAssignTaskToVg(pMnode, pTrans, pTask, plan, pVgroup) < 0) { - sdbRelease(pSdb, pVgroup); - qDestroyQueryPlan(pPlan); - return -1; - } - taosArrayPush(taskOneLevel, pTask); } else { - // not duplicatable SStreamTask* pTask = streamTaskNew(pStream->uid, level); - - // TODO: get snode - if (mndAssignTaskToVg(pMnode, pTrans, pTask, plan, pVgroup) < 0) { - sdbRelease(pSdb, pVgroup); - qDestroyQueryPlan(pPlan); - return -1; + pTask->pipeSink = level == totLevel - 1 ? 1 : 0; + SSnodeObj* pSnode = mndSchedFetchSnode(pMnode); + if (pSnode != NULL) { + if (mndAssignTaskToSnode(pMnode, pTrans, pTask, plan, pSnode) < 0) { + sdbRelease(pSdb, pSnode); + qDestroyQueryPlan(pPlan); + return -1; + } + sdbRelease(pMnode->pSdb, pSnode); + } else { + // TODO: assign to one vg + ASSERT(0); } taosArrayPush(taskOneLevel, pTask); } diff --git a/source/dnode/mnode/impl/src/mndSnode.c b/source/dnode/mnode/impl/src/mndSnode.c index dda02fecf2..f01b143fbc 100644 --- a/source/dnode/mnode/impl/src/mndSnode.c +++ b/source/dnode/mnode/impl/src/mndSnode.c @@ -60,6 +60,15 @@ int32_t mndInitSnode(SMnode *pMnode) { void mndCleanupSnode(SMnode *pMnode) {} +SEpSet mndAcquireEpFromSnode(SMnode *pMnode, const SSnodeObj *pSnode) { + SEpSet epSet; + memcpy(epSet.eps->fqdn, pSnode->pDnode->fqdn, 128); + epSet.eps->port = pSnode->pDnode->port; + epSet.numOfEps = 1; + epSet.inUse = 0; + return epSet; +} + static SSnodeObj *mndAcquireSnode(SMnode *pMnode, int32_t snodeId) { SSnodeObj *pObj = sdbAcquire(pMnode->pSdb, SDB_SNODE, &snodeId); if (pObj == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { diff --git a/source/dnode/snode/src/snode.c b/source/dnode/snode/src/snode.c index 147f44b260..afa5930821 100644 --- a/source/dnode/snode/src/snode.c +++ b/source/dnode/snode/src/snode.c @@ -57,8 +57,8 @@ void sndMetaDelete(SStreamMeta *pMeta) { } int32_t sndMetaDeployTask(SStreamMeta *pMeta, SStreamTask *pTask) { - for (int i = 0; i < pTask->parallel; i++) { - pTask->runner.executor[i] = qCreateStreamExecTaskInfo(pTask->qmsg, NULL); + for (int i = 0; i < pTask->numOfRunners; i++) { + pTask->runner[i].executor = qCreateStreamExecTaskInfo(pTask->qmsg, NULL); } return taosHashPut(pMeta->pHash, &pTask->taskId, sizeof(int32_t), pTask, sizeof(void *)); } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 87c670a4e9..3af79ca461 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -70,6 +70,46 @@ void tqClose(STQ* pTq) { int tqPushMsg(STQ* pTq, void* msg, tmsg_t msgType, int64_t version) { if (msgType != TDMT_VND_SUBMIT) return 0; + + void* pIter = NULL; + + while (1) { + pIter = taosHashIterate(pTq->pStreamTasks, pIter); + if (pIter == NULL) break; + SStreamTask* pTask = (SStreamTask*)pIter; + if (!pTask->pipeSource) continue; + + int32_t workerId = 0; + void* exec = pTask->runner[workerId].executor; + qSetStreamInput(exec, msg, STREAM_DATA_TYPE_SUBMIT_BLOCK); + SArray* pRes = taosArrayInit(0, sizeof(SSDataBlock)); + while (1) { + SSDataBlock* output; + uint64_t ts; + if (qExecTask(exec, &output, &ts) < 0) { + ASSERT(false); + } + if (output == NULL) { + break; + } + taosArrayPush(pRes, output); + } + if (pTask->pipeSink) { + // write back + } else { + int32_t tlen = sizeof(SStreamExecMsgHead) + tEncodeDataBlocks(NULL, pRes); + void* buf = rpcMallocCont(tlen); + if (buf == NULL) { + return -1; + } + void* abuf = POINTER_SHIFT(buf, sizeof(SStreamExecMsgHead)); + tEncodeDataBlocks(abuf, pRes); + // serialize + // to next level + } + } + +#if 0 void* pIter = taosHashIterate(pTq->tqPushMgr->pHash, NULL); while (pIter != NULL) { STqPusher* pusher = *(STqPusher**)pIter; @@ -97,6 +137,7 @@ int tqPushMsg(STQ* pTq, void* msg, tmsg_t msgType, int64_t version) { // if handle waiting, launch query and response to consumer // // if no waiting handle, return +#endif return 0; } @@ -420,6 +461,21 @@ int32_t tqProcessSetConnReq(STQ* pTq, char* msg) { return 0; } +int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int32_t parallel) { + ASSERT(parallel <= 8); + pTask->numOfRunners = parallel; + for (int32_t i = 0; i < parallel; i++) { + STqReadHandle* pReadHandle = tqInitSubmitMsgScanner(pTq->pVnodeMeta); + SReadHandle handle = { + .reader = pReadHandle, + .meta = pTq->pVnodeMeta, + }; + pTask->runner[i].inputHandle = pReadHandle; + pTask->runner[i].executor = qCreateStreamExecTaskInfo(pTask->qmsg, &handle); + } + return 0; +} + int32_t tqProcessTaskDeploy(STQ* pTq, char* msg, int32_t msgLen) { SStreamTask* pTask = malloc(sizeof(SStreamTask)); if (pTask == NULL) { @@ -430,12 +486,118 @@ int32_t tqProcessTaskDeploy(STQ* pTq, char* msg, int32_t msgLen) { tDecodeSStreamTask(&decoder, pTask); tCoderClear(&decoder); + tqExpandTask(pTq, pTask, 8); taosHashPut(pTq->pStreamTasks, &pTask->taskId, sizeof(int32_t), pTask, sizeof(SStreamTask)); return 0; } +static char* formatTimestamp(char* buf, int64_t val, int precision) { + time_t tt; + int32_t ms = 0; + if (precision == TSDB_TIME_PRECISION_NANO) { + tt = (time_t)(val / 1000000000); + ms = val % 1000000000; + } else if (precision == TSDB_TIME_PRECISION_MICRO) { + tt = (time_t)(val / 1000000); + ms = val % 1000000; + } else { + tt = (time_t)(val / 1000); + ms = val % 1000; + } + + /* comment out as it make testcases like select_with_tags.sim fail. + but in windows, this may cause the call to localtime crash if tt < 0, + need to find a better solution. + if (tt < 0) { + tt = 0; + } + */ + +#ifdef WINDOWS + if (tt < 0) tt = 0; +#endif + if (tt <= 0 && ms < 0) { + tt--; + if (precision == TSDB_TIME_PRECISION_NANO) { + ms += 1000000000; + } else if (precision == TSDB_TIME_PRECISION_MICRO) { + ms += 1000000; + } else { + ms += 1000; + } + } + + struct tm* ptm = localtime(&tt); + size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", ptm); + + if (precision == TSDB_TIME_PRECISION_NANO) { + sprintf(buf + pos, ".%09d", ms); + } else if (precision == TSDB_TIME_PRECISION_MICRO) { + sprintf(buf + pos, ".%06d", ms); + } else { + sprintf(buf + pos, ".%03d", ms); + } + + return buf; +} +void tqDebugShowSSData(SArray* dataBlocks) { + char pBuf[128]; + int32_t sz = taosArrayGetSize(dataBlocks); + for (int32_t i = 0; i < sz; i++) { + SSDataBlock* pDataBlock = taosArrayGet(dataBlocks, i); + int32_t colNum = pDataBlock->info.numOfCols; + int32_t rows = pDataBlock->info.rows; + for (int32_t j = 0; j < rows; j++) { + printf("|"); + for (int32_t k = 0; k < colNum; k++) { + SColumnInfoData* pColInfoData = taosArrayGet(pDataBlock->pDataBlock, k); + void* var = POINTER_SHIFT(pColInfoData->pData, j * pColInfoData->info.bytes); + switch (pColInfoData->info.type) { + case TSDB_DATA_TYPE_TIMESTAMP: + formatTimestamp(pBuf, *(uint64_t*)var, TSDB_TIME_PRECISION_MILLI); + printf(" %25s |", pBuf); + break; + case TSDB_DATA_TYPE_INT: + case TSDB_DATA_TYPE_UINT: + printf(" %15u |", *(uint32_t*)var); + break; + } + } + printf("\n"); + } + } +} + int32_t tqProcessTaskExec(STQ* pTq, SRpcMsg* msg) { - // + SStreamTaskExecReq* pReq = msg->pCont; + + int32_t taskId = pReq->head.streamTaskId; + int32_t workerType = pReq->head.workerType; + + SStreamTask* pTask = taosHashGet(pTq->pStreamTasks, &taskId, sizeof(int32_t)); + // assume worker id is 1 + int32_t workerId = 1; + void* exec = pTask->runner[workerId].executor; + int32_t sz = taosArrayGetSize(pReq->data); + printf("input data:\n"); + tqDebugShowSSData(pReq->data); + SArray* pRes = taosArrayInit(0, sizeof(void*)); + for (int32_t i = 0; i < sz; i++) { + SSDataBlock* input = taosArrayGet(pReq->data, i); + SSDataBlock* output; + uint64_t ts; + qSetStreamInput(exec, input, STREAM_DATA_TYPE_SSDATA_BLOCK); + if (qExecTask(exec, &output, &ts) < 0) { + ASSERT(0); + } + if (output == NULL) { + break; + } + taosArrayPush(pRes, &output); + } + printf("output data:\n"); + tqDebugShowSSData(pRes); + return 0; } diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index e6cdbcf10f..edacfc339f 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -52,9 +52,8 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, int32_t t SSDataBlock* pDataBlock = input; pInfo->pRes->info = pDataBlock->info; - for(int32_t i = 0; i < pInfo->pRes->info.numOfCols; ++i) { - pInfo->pRes->pDataBlock = pDataBlock->pDataBlock; - } + taosArrayClear(pInfo->pRes->pDataBlock); + taosArrayAddAll(pInfo->pRes->pDataBlock, pDataBlock->pDataBlock); // set current block valid. pInfo->blockValid = true; @@ -121,7 +120,7 @@ int32_t qUpdateQualifiedTableId(qTaskInfo_t tinfo, SArray* tableIdList, bool isA // traverse to the streamscan node to add this table id SOperatorInfo* pInfo = pTaskInfo->pRoot; - while(pInfo->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { + while (pInfo->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { pInfo = pInfo->pDownstream[0]; } From afe8439095abadb8e559f3a644a46b3ef46f176c Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 22 Mar 2022 18:58:43 +0800 Subject: [PATCH 10/15] fix typo --- example/src/tstream.c | 4 +++- source/libs/executor/src/executorimpl.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/src/tstream.c b/example/src/tstream.c index 73ab655fbd..a606024cf1 100644 --- a/example/src/tstream.c +++ b/example/src/tstream.c @@ -215,10 +215,12 @@ int main(int argc, char* argv[]) { printf("env init\n"); code = init_env(); } - create_topic(); + create_stream(); +#if 0 tmq_t* tmq = build_consumer(); tmq_list_t* topic_list = build_topic_list(); /*perf_loop(tmq, topic_list);*/ /*basic_consume_loop(tmq, topic_list);*/ sync_consume_loop(tmq, topic_list); +#endif } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index befb210b80..0e3e76faf0 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -4873,7 +4873,7 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo *pOperator, bool* newgroup) SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SStreamBlockScanInfo* pInfo = pOperator->info; - if (pInfo->blockType == STREAM_DATA_TYPE_SSDAT_BLOCK) { + if (pInfo->blockType == STREAM_DATA_TYPE_SSDATA_BLOCK) { if (pInfo->blockValid) { pInfo->blockValid = false; // this block can only be used once. return pInfo->pRes; From c74b88afbbd63d3d384bc2845caf48462c7ce6ab Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 22 Mar 2022 19:47:57 +0800 Subject: [PATCH 11/15] put tq header input vnd --- example/src/tstream.c | 121 ------------------- source/dnode/vnode/inc/tq.h | 66 ---------- source/dnode/vnode/src/inc/tqInt.h | 7 +- source/dnode/vnode/src/inc/vnd.h | 22 +++- source/dnode/vnode/src/vnd/vnodeQuery.c | 1 + source/dnode/vnode/src/vnd/vnodeWrite.c | 3 +- source/dnode/vnode/test/tqSerializerTest.cpp | 13 -- source/libs/executor/src/executor.c | 2 +- 8 files changed, 30 insertions(+), 205 deletions(-) delete mode 100644 source/dnode/vnode/inc/tq.h delete mode 100644 source/dnode/vnode/test/tqSerializerTest.cpp diff --git a/example/src/tstream.c b/example/src/tstream.c index a606024cf1..62d94b041d 100644 --- a/example/src/tstream.c +++ b/example/src/tstream.c @@ -19,9 +19,6 @@ #include #include "taos.h" -static int running = 1; -static void msg_process(tmq_message_t* message) { tmqShowMsg(message); } - int32_t init_env() { TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); if (pConn == NULL) { @@ -91,124 +88,6 @@ int32_t create_stream() { return 0; } -void tmq_commit_cb_print(tmq_t* tmq, tmq_resp_err_t resp, tmq_topic_vgroup_list_t* offsets, void* param) { - printf("commit %d\n", resp); -} - -tmq_t* build_consumer() { - TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); - assert(pConn != NULL); - - TAOS_RES* pRes = taos_query(pConn, "use abc1"); - if (taos_errno(pRes) != 0) { - printf("error in use db, reason:%s\n", taos_errstr(pRes)); - } - taos_free_result(pRes); - - tmq_conf_t* conf = tmq_conf_new(); - tmq_conf_set(conf, "group.id", "tg2"); - tmq_conf_set_offset_commit_cb(conf, tmq_commit_cb_print); - tmq_t* tmq = tmq_consumer_new(pConn, conf, NULL, 0); - return tmq; -} - -tmq_list_t* build_topic_list() { - tmq_list_t* topic_list = tmq_list_new(); - tmq_list_append(topic_list, "test_stb_topic_1"); - return topic_list; -} - -void basic_consume_loop(tmq_t* tmq, tmq_list_t* topics) { - tmq_resp_err_t err; - - if ((err = tmq_subscribe(tmq, topics))) { - fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(err)); - printf("subscribe err\n"); - return; - } - /*int32_t cnt = 0;*/ - /*clock_t startTime = clock();*/ - while (running) { - tmq_message_t* tmqmessage = tmq_consumer_poll(tmq, 500); - if (tmqmessage) { - /*cnt++;*/ - msg_process(tmqmessage); - tmq_message_destroy(tmqmessage); - /*} else {*/ - /*break;*/ - } - } - /*clock_t endTime = clock();*/ - /*printf("log cnt: %d %f s\n", cnt, (double)(endTime - startTime) / CLOCKS_PER_SEC);*/ - - err = tmq_consumer_close(tmq); - if (err) - fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(err)); - else - fprintf(stderr, "%% Consumer closed\n"); -} - -void sync_consume_loop(tmq_t* tmq, tmq_list_t* topics) { - static const int MIN_COMMIT_COUNT = 1; - - int msg_count = 0; - tmq_resp_err_t err; - - if ((err = tmq_subscribe(tmq, topics))) { - fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(err)); - return; - } - - while (running) { - tmq_message_t* tmqmessage = tmq_consumer_poll(tmq, 1000); - if (tmqmessage) { - msg_process(tmqmessage); - tmq_message_destroy(tmqmessage); - - if ((++msg_count % MIN_COMMIT_COUNT) == 0) tmq_commit(tmq, NULL, 0); - } - } - - err = tmq_consumer_close(tmq); - if (err) - fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(err)); - else - fprintf(stderr, "%% Consumer closed\n"); -} - -void perf_loop(tmq_t* tmq, tmq_list_t* topics) { - tmq_resp_err_t err; - - if ((err = tmq_subscribe(tmq, topics))) { - fprintf(stderr, "%% Failed to start consuming topics: %s\n", tmq_err2str(err)); - printf("subscribe err\n"); - return; - } - int32_t batchCnt = 0; - int32_t skipLogNum = 0; - clock_t startTime = clock(); - while (running) { - tmq_message_t* tmqmessage = tmq_consumer_poll(tmq, 500); - if (tmqmessage) { - batchCnt++; - skipLogNum += tmqGetSkipLogNum(tmqmessage); - /*msg_process(tmqmessage);*/ - tmq_message_destroy(tmqmessage); - } else { - break; - } - } - clock_t endTime = clock(); - printf("log batch cnt: %d, skip log cnt: %d, time used:%f s\n", batchCnt, skipLogNum, - (double)(endTime - startTime) / CLOCKS_PER_SEC); - - err = tmq_consumer_close(tmq); - if (err) - fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(err)); - else - fprintf(stderr, "%% Consumer closed\n"); -} - int main(int argc, char* argv[]) { int code; if (argc > 1) { diff --git a/source/dnode/vnode/inc/tq.h b/source/dnode/vnode/inc/tq.h deleted file mode 100644 index 6391eaffea..0000000000 --- a/source/dnode/vnode/inc/tq.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TQ_H_ -#define _TQ_H_ - -#include "executor.h" -#include "meta.h" -#include "taoserror.h" -#include "tcommon.h" -#include "tmallocator.h" -#include "tmsg.h" -#include "trpc.h" -#include "ttimer.h" -#include "tutil.h" -#include "vnode.h" -#include "wal.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct STQ STQ; - -// memory allocator provided by vnode -typedef struct { - SMemAllocatorFactory* pAllocatorFactory; - SMemAllocator* pAllocator; -} STqMemRef; - -// init once -int tqInit(); -void tqCleanUp(); - -// open in each vnode -STQ* tqOpen(const char* path, SWal* pWal, SMeta* pMeta, STqCfg* tqConfig, SMemAllocatorFactory* allocFac); -void tqClose(STQ*); - -// required by vnode -int tqPushMsg(STQ*, void* msg, tmsg_t msgType, int64_t version); -int tqCommit(STQ*); - -int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg); -int32_t tqProcessSetConnReq(STQ* pTq, char* msg); -int32_t tqProcessRebReq(STQ* pTq, char* msg); -int32_t tqProcessTaskExec(STQ* pTq, SRpcMsg* msg); - -int32_t tqProcessTaskDeploy(STQ* pTq, char* msg, int32_t msgLen); - -#ifdef __cplusplus -} -#endif - -#endif /*_TQ_H_*/ diff --git a/source/dnode/vnode/src/inc/tqInt.h b/source/dnode/vnode/src/inc/tqInt.h index 9b21cf92ce..4d4bb12a21 100644 --- a/source/dnode/vnode/src/inc/tqInt.h +++ b/source/dnode/vnode/src/inc/tqInt.h @@ -18,8 +18,8 @@ #include "meta.h" #include "tlog.h" -#include "tq.h" #include "tqPush.h" +#include "vnd.h" #ifdef __cplusplus extern "C" { @@ -153,6 +153,11 @@ typedef struct { FTqDelete pDeleter; } STqMetaStore; +typedef struct { + SMemAllocatorFactory* pAllocatorFactory; + SMemAllocator* pAllocator; +} STqMemRef; + struct STQ { // the collection of groups // the handle of meta kvstore diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h index c911f95e4a..ed9aad9277 100644 --- a/source/dnode/vnode/src/inc/vnd.h +++ b/source/dnode/vnode/src/inc/vnd.h @@ -23,7 +23,6 @@ #include "tlist.h" #include "tlockfree.h" #include "tmacro.h" -#include "tq.h" #include "wal.h" #include "vnode.h" @@ -34,6 +33,8 @@ extern "C" { #endif +typedef struct STQ STQ; + typedef struct SVState SVState; typedef struct SVBufPool SVBufPool; @@ -171,6 +172,25 @@ void* vmaMalloc(SVMemAllocator* pVMA, uint64_t size); void vmaFree(SVMemAllocator* pVMA, void* ptr); bool vmaIsFull(SVMemAllocator* pVMA); +// init once +int tqInit(); +void tqCleanUp(); + +// open in each vnode +STQ* tqOpen(const char* path, SWal* pWal, SMeta* pMeta, STqCfg* tqConfig, SMemAllocatorFactory* allocFac); +void tqClose(STQ*); + +// required by vnode +int tqPushMsg(STQ*, void* msg, tmsg_t msgType, int64_t version); +int tqCommit(STQ*); + +int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg); +int32_t tqProcessSetConnReq(STQ* pTq, char* msg); +int32_t tqProcessRebReq(STQ* pTq, char* msg); +int32_t tqProcessTaskExec(STQ* pTq, SRpcMsg* msg); + +int32_t tqProcessTaskDeploy(STQ* pTq, char* msg, int32_t msgLen); + #ifdef __cplusplus } #endif diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index d7af04c462..ef755b10ec 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -14,6 +14,7 @@ */ #include "vnodeQuery.h" +#include "executor.h" #include "vnd.h" static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg); diff --git a/source/dnode/vnode/src/vnd/vnodeWrite.c b/source/dnode/vnode/src/vnd/vnodeWrite.c index d3769b8a30..5443194efd 100644 --- a/source/dnode/vnode/src/vnd/vnodeWrite.c +++ b/source/dnode/vnode/src/vnd/vnodeWrite.c @@ -13,12 +13,11 @@ * along with this program. If not, see . */ -#include "tq.h" #include "vnd.h" void vnodeProcessWMsgs(SVnode *pVnode, SArray *pMsgs) { SNodeMsg *pMsg; - SRpcMsg *pRpc; + SRpcMsg *pRpc; for (int i = 0; i < taosArrayGetSize(pMsgs); i++) { pMsg = *(SNodeMsg **)taosArrayGet(pMsgs, i); diff --git a/source/dnode/vnode/test/tqSerializerTest.cpp b/source/dnode/vnode/test/tqSerializerTest.cpp deleted file mode 100644 index 0d76322c17..0000000000 --- a/source/dnode/vnode/test/tqSerializerTest.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include - -#include "tq.h" - -using namespace std; - -TEST(TqSerializerTest, basicTest) { - TqGroupHandle* gHandle = (TqGroupHandle*)malloc(sizeof(TqGroupHandle)); - -} diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index edacfc339f..19100d7560 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -16,7 +16,7 @@ #include "executor.h" #include "executorimpl.h" #include "planner.h" -#include "tq.h" +#include "vnode.h" static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, int32_t type, char* id) { ASSERT(pOperator != NULL); From 997a0a939548cfdde96a476ed85f99514b0bad91 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 22 Mar 2022 20:07:01 +0800 Subject: [PATCH 12/15] remove duplicate msg handler --- source/dnode/mgmt/mnode/src/mmMsg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/dnode/mgmt/mnode/src/mmMsg.c b/source/dnode/mgmt/mnode/src/mmMsg.c index 8445e73787..56a580ed93 100644 --- a/source/dnode/mgmt/mnode/src/mmMsg.c +++ b/source/dnode/mgmt/mnode/src/mmMsg.c @@ -149,5 +149,4 @@ void mmInitMsgHandles(SMgmtWrapper *pWrapper) { dndSetMsgHandle(pWrapper, TDMT_VND_CREATE_STB_RSP, (NodeMsgFp)mmProcessWriteMsg, 0); dndSetMsgHandle(pWrapper, TDMT_VND_ALTER_STB_RSP, (NodeMsgFp)mmProcessWriteMsg, 0); dndSetMsgHandle(pWrapper, TDMT_VND_DROP_STB_RSP, (NodeMsgFp)mmProcessWriteMsg, 0); - dndSetMsgHandle(pWrapper, TDMT_VND_TASK_DEPLOY, (NodeMsgFp)mmProcessWriteMsg, 0); } From 044db54e741f516e8cd62efcb6402f016a650349 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 23 Mar 2022 06:25:24 +0800 Subject: [PATCH 13/15] refactor --- source/dnode/mgmt/vnode/src/vmInt.c | 2 +- source/dnode/vnode/src/inc/tsdbLog.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/dnode/mgmt/vnode/src/vmInt.c b/source/dnode/mgmt/vnode/src/vmInt.c index a324c60618..746fcd4855 100644 --- a/source/dnode/mgmt/vnode/src/vmInt.c +++ b/source/dnode/mgmt/vnode/src/vmInt.c @@ -343,7 +343,7 @@ void vmGetMgmtFp(SMgmtWrapper *pWrapper) { mgmtFp.requiredFp = vmRequire; vmInitMsgHandles(pWrapper); - pWrapper->name = "vnodes"; + pWrapper->name = "vnode"; pWrapper->fp = mgmtFp; } diff --git a/source/dnode/vnode/src/inc/tsdbLog.h b/source/dnode/vnode/src/inc/tsdbLog.h index 56dc8ab2a0..3afe628198 100644 --- a/source/dnode/vnode/src/inc/tsdbLog.h +++ b/source/dnode/vnode/src/inc/tsdbLog.h @@ -24,12 +24,12 @@ extern "C" { extern int32_t tsdbDebugFlag; -#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TDB FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0) -#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TDB ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0) -#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TDB WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0) -#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TDB ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0) -#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TDB ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0) -#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) +#define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TSDB FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0) +#define tsdbError(...) do { if (tsdbDebugFlag & DEBUG_ERROR) { taosPrintLog("TSDB ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0) +#define tsdbWarn(...) do { if (tsdbDebugFlag & DEBUG_WARN) { taosPrintLog("TSDB WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0) +#define tsdbInfo(...) do { if (tsdbDebugFlag & DEBUG_INFO) { taosPrintLog("TSDB ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0) +#define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSDB ", DEBUG_DEBUG, tsdbDebugFlag, __VA_ARGS__); }} while(0) +#define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TSDB ", DEBUG_TRACE, tsdbDebugFlag, __VA_ARGS__); }} while(0) #ifdef __cplusplus } From d4cc6c1fe7e888bfcb55fc50446be4921c68be5c Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 23 Mar 2022 07:58:07 +0800 Subject: [PATCH 14/15] add bSma/rSma param --- include/common/tmsg.h | 36 +++++++--- source/common/src/tmsg.c | 84 ++++++++++++++++++++++- source/dnode/vnode/src/meta/metaBDBImpl.c | 2 +- source/dnode/vnode/test/tsdbSmaTest.cpp | 55 +++++++++++++++ 4 files changed, 166 insertions(+), 11 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 560490569a..583496a4c6 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1363,28 +1363,48 @@ typedef struct { int64_t tuid; } SDDropTopicReq; +typedef struct { + float xFilesFactor; + int8_t delayUnit; + int8_t nFuncIds; + int32_t* pFuncIds; + int64_t delay; +} SRSmaParam; + typedef struct SVCreateTbReq { int64_t ver; // use a general definition char* dbFName; char* name; uint32_t ttl; uint32_t keep; - uint8_t type; + union { + uint8_t info; + struct { + uint8_t rollup : 1; // 1 means rollup sma + uint8_t type : 7; + }; + }; union { struct { - tb_uid_t suid; - uint32_t nCols; - SSchema* pSchema; - uint32_t nTagCols; - SSchema* pTagSchema; + tb_uid_t suid; + uint32_t nCols; + SSchema* pSchema; + uint32_t nTagCols; + SSchema* pTagSchema; + col_id_t nBSmaCols; + col_id_t* pBSmaCols; + SRSmaParam* pRSmaParam; } stbCfg; struct { tb_uid_t suid; SKVRow pTag; } ctbCfg; struct { - uint32_t nCols; - SSchema* pSchema; + uint32_t nCols; + SSchema* pSchema; + col_id_t nBSmaCols; + col_id_t* pBSmaCols; + SRSmaParam* pRSmaParam; } ntbCfg; }; } SVCreateTbReq, SVUpdateTbReq; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 47872b89d5..1ea00566f4 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -290,7 +290,7 @@ int32_t tSerializeSVCreateTbReq(void **buf, SVCreateTbReq *pReq) { tlen += taosEncodeString(buf, pReq->name); tlen += taosEncodeFixedU32(buf, pReq->ttl); tlen += taosEncodeFixedU32(buf, pReq->keep); - tlen += taosEncodeFixedU8(buf, pReq->type); + tlen += taosEncodeFixedU8(buf, pReq->info); switch (pReq->type) { case TD_SUPER_TABLE: @@ -309,6 +309,20 @@ int32_t tSerializeSVCreateTbReq(void **buf, SVCreateTbReq *pReq) { tlen += taosEncodeFixedI32(buf, pReq->stbCfg.pTagSchema[i].bytes); tlen += taosEncodeString(buf, pReq->stbCfg.pTagSchema[i].name); } + tlen += taosEncodeFixedI16(buf, pReq->stbCfg.nBSmaCols); + for (col_id_t i = 0; i < pReq->stbCfg.nBSmaCols; ++i) { + tlen += taosEncodeFixedI16(buf, pReq->stbCfg.pBSmaCols[i]); + } + if(pReq->rollup && NULL != pReq->stbCfg.pRSmaParam) { + SRSmaParam *param = pReq->stbCfg.pRSmaParam; + tlen += taosEncodeFixedU32(buf, (uint32_t)param->xFilesFactor); + tlen += taosEncodeFixedI8(buf, param->delayUnit); + tlen += taosEncodeFixedI8(buf, param->nFuncIds); + for(int8_t i=0; i< param->nFuncIds; ++i) { + tlen += taosEncodeFixedI32(buf, param->pFuncIds[i]); + } + tlen += taosEncodeFixedI64(buf, param->delay); + } break; case TD_CHILD_TABLE: tlen += taosEncodeFixedI64(buf, pReq->ctbCfg.suid); @@ -322,6 +336,20 @@ int32_t tSerializeSVCreateTbReq(void **buf, SVCreateTbReq *pReq) { tlen += taosEncodeFixedI32(buf, pReq->ntbCfg.pSchema[i].bytes); tlen += taosEncodeString(buf, pReq->ntbCfg.pSchema[i].name); } + tlen += taosEncodeFixedI16(buf, pReq->stbCfg.nBSmaCols); + for (col_id_t i = 0; i < pReq->stbCfg.nBSmaCols; ++i) { + tlen += taosEncodeFixedI16(buf, pReq->stbCfg.pBSmaCols[i]); + } + if(pReq->rollup && NULL != pReq->stbCfg.pRSmaParam) { + SRSmaParam *param = pReq->stbCfg.pRSmaParam; + tlen += taosEncodeFixedU32(buf, (uint32_t)param->xFilesFactor); + tlen += taosEncodeFixedI8(buf, param->delayUnit); + tlen += taosEncodeFixedI8(buf, param->nFuncIds); + for(int8_t i=0; i< param->nFuncIds; ++i) { + tlen += taosEncodeFixedI32(buf, param->pFuncIds[i]); + } + tlen += taosEncodeFixedI64(buf, param->delay); + } break; default: ASSERT(0); @@ -335,7 +363,7 @@ void *tDeserializeSVCreateTbReq(void *buf, SVCreateTbReq *pReq) { buf = taosDecodeString(buf, &(pReq->name)); buf = taosDecodeFixedU32(buf, &(pReq->ttl)); buf = taosDecodeFixedU32(buf, &(pReq->keep)); - buf = taosDecodeFixedU8(buf, &(pReq->type)); + buf = taosDecodeFixedU8(buf, &(pReq->info)); switch (pReq->type) { case TD_SUPER_TABLE: @@ -356,6 +384,32 @@ void *tDeserializeSVCreateTbReq(void *buf, SVCreateTbReq *pReq) { buf = taosDecodeFixedI32(buf, &pReq->stbCfg.pTagSchema[i].bytes); buf = taosDecodeStringTo(buf, pReq->stbCfg.pTagSchema[i].name); } + buf = taosDecodeFixedI16(buf, &(pReq->stbCfg.nBSmaCols)); + if(pReq->stbCfg.nBSmaCols > 0) { + pReq->stbCfg.pBSmaCols = (col_id_t *)malloc(pReq->stbCfg.nBSmaCols * sizeof(col_id_t)); + for (col_id_t i = 0; i < pReq->stbCfg.nBSmaCols; ++i) { + buf = taosDecodeFixedI16(buf, pReq->stbCfg.pBSmaCols + i); + } + } else { + pReq->stbCfg.pBSmaCols = NULL; + } + if(pReq->rollup) { + pReq->stbCfg.pRSmaParam = (SRSmaParam *)malloc(sizeof(SRSmaParam)); + SRSmaParam *param = pReq->stbCfg.pRSmaParam; + buf = taosDecodeFixedU32(buf, (uint32_t*)¶m->xFilesFactor); + buf = taosDecodeFixedI8(buf, ¶m->delayUnit); + buf = taosDecodeFixedI8(buf, ¶m->nFuncIds); + if(param->nFuncIds > 0) { + for (int8_t i = 0; i< param->nFuncIds; ++i) { + buf = taosDecodeFixedI32(buf, param->pFuncIds + i); + } + } else { + param->pFuncIds = NULL; + } + buf = taosDecodeFixedI64(buf, ¶m->delay); + } else { + pReq->stbCfg.pRSmaParam = NULL; + } break; case TD_CHILD_TABLE: buf = taosDecodeFixedI64(buf, &pReq->ctbCfg.suid); @@ -370,6 +424,32 @@ void *tDeserializeSVCreateTbReq(void *buf, SVCreateTbReq *pReq) { buf = taosDecodeFixedI32(buf, &pReq->ntbCfg.pSchema[i].bytes); buf = taosDecodeStringTo(buf, pReq->ntbCfg.pSchema[i].name); } + buf = taosDecodeFixedI16(buf, &(pReq->stbCfg.nBSmaCols)); + if(pReq->stbCfg.nBSmaCols > 0) { + pReq->stbCfg.pBSmaCols = (col_id_t *)malloc(pReq->stbCfg.nBSmaCols * sizeof(col_id_t)); + for (col_id_t i = 0; i < pReq->stbCfg.nBSmaCols; ++i) { + buf = taosDecodeFixedI16(buf, pReq->stbCfg.pBSmaCols + i); + } + } else { + pReq->stbCfg.pBSmaCols = NULL; + } + if(pReq->rollup) { + pReq->stbCfg.pRSmaParam = (SRSmaParam *)malloc(sizeof(SRSmaParam)); + SRSmaParam *param = pReq->stbCfg.pRSmaParam; + buf = taosDecodeFixedU32(buf, (uint32_t*)¶m->xFilesFactor); + buf = taosDecodeFixedI8(buf, ¶m->delayUnit); + buf = taosDecodeFixedI8(buf, ¶m->nFuncIds); + if(param->nFuncIds > 0) { + for (int8_t i = 0; i< param->nFuncIds; ++i) { + buf = taosDecodeFixedI32(buf, param->pFuncIds + i); + } + } else { + param->pFuncIds = NULL; + } + buf = taosDecodeFixedI64(buf, ¶m->delay); + } else { + pReq->stbCfg.pRSmaParam = NULL; + } break; default: ASSERT(0); diff --git a/source/dnode/vnode/src/meta/metaBDBImpl.c b/source/dnode/vnode/src/meta/metaBDBImpl.c index 3eb9a480ac..0a93ea67b3 100644 --- a/source/dnode/vnode/src/meta/metaBDBImpl.c +++ b/source/dnode/vnode/src/meta/metaBDBImpl.c @@ -527,7 +527,7 @@ static void *metaDecodeTbInfo(void *buf, STbCfg *pTbCfg) { buf = taosDecodeString(buf, &(pTbCfg->name)); buf = taosDecodeFixedU32(buf, &(pTbCfg->ttl)); buf = taosDecodeFixedU32(buf, &(pTbCfg->keep)); - buf = taosDecodeFixedU8(buf, &(pTbCfg->type)); + buf = taosDecodeFixedU8(buf, &(pTbCfg->info)); if (pTbCfg->type == META_SUPER_TABLE) { SSchemaWrapper sw; diff --git a/source/dnode/vnode/test/tsdbSmaTest.cpp b/source/dnode/vnode/test/tsdbSmaTest.cpp index b9bf432a72..3c51ad5d71 100644 --- a/source/dnode/vnode/test/tsdbSmaTest.cpp +++ b/source/dnode/vnode/test/tsdbSmaTest.cpp @@ -33,6 +33,61 @@ int main(int argc, char **argv) { return RUN_ALL_TESTS(); } +TEST(testCase, unionEncodeDecodeTest) { + typedef struct { + union { + uint8_t info; + struct { + uint8_t rollup : 1; // 1 means rollup sma + uint8_t type : 7; + }; + }; + col_id_t nBSmaCols; + col_id_t* pBSmaCols; + } SUnionTest; + + SUnionTest sut = {0}; + sut.rollup = 1; + sut.type = 1; + + sut.nBSmaCols = 2; + sut.pBSmaCols = (col_id_t*)malloc(sut.nBSmaCols * sizeof(col_id_t)); + for (col_id_t i = 0; i < sut.nBSmaCols; ++i) { + sut.pBSmaCols[i] = i + 100; + } + + void* buf = malloc(1024); + void * pBuf = buf; + int32_t tlen = 0; + tlen += taosEncodeFixedU8(&buf, sut.info); + tlen += taosEncodeFixedI16(&buf, sut.nBSmaCols); + for (col_id_t i = 0; i < sut.nBSmaCols; ++i) { + tlen += taosEncodeFixedI16(&buf, sut.pBSmaCols[i]); + } + + SUnionTest dut = {0}; + pBuf = taosDecodeFixedU8(pBuf, &dut.info); + pBuf = taosDecodeFixedI16(pBuf, &dut.nBSmaCols); + if(dut.nBSmaCols > 0) { + dut.pBSmaCols = (col_id_t*)malloc(dut.nBSmaCols * sizeof(col_id_t)); + for(col_id_t i=0; i < dut.nBSmaCols; ++i) { + pBuf = taosDecodeFixedI16(pBuf, dut.pBSmaCols + i); + } + } else { + dut.pBSmaCols = NULL; + } + + printf("sut.rollup=%" PRIu8 ", type=%" PRIu8 ", info=%" PRIu8 "\n", sut.rollup, sut.type, sut.info); + printf("dut.rollup=%" PRIu8 ", type=%" PRIu8 ", info=%" PRIu8 "\n", dut.rollup, dut.type, dut.info); + + ASSERT_EQ(sut.rollup, dut.rollup); + ASSERT_EQ(sut.type, dut.type); + ASSERT_EQ(sut.nBSmaCols, dut.nBSmaCols); + for (col_id_t i = 0; i< sut.nBSmaCols; ++i) { + ASSERT_EQ(*(col_id_t*)(sut.pBSmaCols + i), sut.pBSmaCols[i]); + ASSERT_EQ(*(col_id_t*)(sut.pBSmaCols + i), dut.pBSmaCols[i]); + } +} #if 1 TEST(testCase, tSma_Meta_Encode_Decode_Test) { // encode From ea034335bba3db3432438ee38336ce9ce82b703b Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 23 Mar 2022 09:36:22 +0800 Subject: [PATCH 15/15] encode info --- source/dnode/vnode/src/meta/metaBDBImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/meta/metaBDBImpl.c b/source/dnode/vnode/src/meta/metaBDBImpl.c index 0a93ea67b3..2dd8386d7a 100644 --- a/source/dnode/vnode/src/meta/metaBDBImpl.c +++ b/source/dnode/vnode/src/meta/metaBDBImpl.c @@ -507,7 +507,7 @@ static int metaEncodeTbInfo(void **buf, STbCfg *pTbCfg) { tsize += taosEncodeString(buf, pTbCfg->name); tsize += taosEncodeFixedU32(buf, pTbCfg->ttl); tsize += taosEncodeFixedU32(buf, pTbCfg->keep); - tsize += taosEncodeFixedU8(buf, pTbCfg->type); + tsize += taosEncodeFixedU8(buf, pTbCfg->info); if (pTbCfg->type == META_SUPER_TABLE) { SSchemaWrapper sw = {.nCols = pTbCfg->stbCfg.nTagCols, .pSchema = pTbCfg->stbCfg.pTagSchema};