diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index 07be521db4482812e5a04641aefa3ecebedcc6e2..8bb9cde935cdad39aa7318517487a46a108aaa23 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -229,6 +229,10 @@ + + + + #define TK_SPACE 300 #define TK_COMMENT 301 #define TK_ILLEGAL 302 diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index a31c032bf5c3ba3224e37196c810e439cbfccf42..bcc876c953777f465ecb761f19256a86bc375b1d 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -232,6 +232,8 @@ SArray *tVariantListAppendToken(SArray *pList, SStrToken *pAliasToken, uint8_t s tSQLExpr *tSqlExprCreate(tSQLExpr *pLeft, tSQLExpr *pRight, int32_t optrType); +tSQLExpr *tSqlExprClone(tSQLExpr *pSrc); + void tSqlExprDestroy(tSQLExpr *pExpr); tSQLExprList *tSqlExprListAppend(tSQLExprList *pList, tSQLExpr *pNode, SStrToken *pDistinct, SStrToken *pToken); diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 16492c26664f77fc1568430c2298e3dfcbb0a777..8a01a736b73a90ba73c5c952601cdb220765d9e6 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -674,6 +674,8 @@ expr(A) ::= expr(X) GE expr(Y). {A = tSqlExprCreate(X, Y, TK_GE);} expr(A) ::= expr(X) NE expr(Y). {A = tSqlExprCreate(X, Y, TK_NE);} expr(A) ::= expr(X) EQ expr(Y). {A = tSqlExprCreate(X, Y, TK_EQ);} +expr(A) ::= expr(X) BETWEEN expr(Y) AND expr(Z). { tSQLExpr* X2 = tSqlExprClone(X); A = tSqlExprCreate(tSqlExprCreate(X, Y, TK_GE), tSqlExprCreate(X2, Z, TK_LE), TK_AND);} + expr(A) ::= expr(X) AND expr(Y). {A = tSqlExprCreate(X, Y, TK_AND);} expr(A) ::= expr(X) OR expr(Y). {A = tSqlExprCreate(X, Y, TK_OR); } diff --git a/src/query/src/qParserImpl.c b/src/query/src/qParserImpl.c index aa05c655c562eddc3cf49420812e0817f1d5cd1d..07bb307aba22ed0d000aafea659098cf44a9999b 100644 --- a/src/query/src/qParserImpl.c +++ b/src/query/src/qParserImpl.c @@ -289,6 +289,28 @@ tSQLExpr *tSqlExprCreate(tSQLExpr *pLeft, tSQLExpr *pRight, int32_t optrType) { return pExpr; } + + +tSQLExpr *tSqlExprClone(tSQLExpr *pSrc) { + tSQLExpr *pExpr = calloc(1, sizeof(tSQLExpr)); + + memcpy(pExpr, pSrc, sizeof(*pSrc)); + + if (pSrc->pLeft) { + pExpr->pLeft = tSqlExprClone(pSrc->pLeft); + } + + if (pSrc->pRight) { + pExpr->pRight = tSqlExprClone(pSrc->pRight); + } + + //we don't clone pParam now because clone is only used for between/and + assert(pSrc->pParam == NULL); + + return pExpr; +} + + void tSqlExprNodeDestroy(tSQLExpr *pExpr) { if (pExpr == NULL) { return; @@ -309,8 +331,9 @@ void tSqlExprDestroy(tSQLExpr *pExpr) { } tSqlExprDestroy(pExpr->pLeft); + pExpr->pLeft = NULL; tSqlExprDestroy(pExpr->pRight); - + pExpr->pRight = NULL; tSqlExprNodeDestroy(pExpr); } diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 2e5b66a3f57424338524ea60c32108ce313f59f6..2b1109688da3f7d814adea97665b718a30097a71 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -136,18 +136,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 290 -#define YYNRULE 253 -#define YYNRULE_WITH_ACTION 253 +#define YYNSTATE 294 +#define YYNRULE 254 +#define YYNRULE_WITH_ACTION 254 #define YYNTOKEN 210 -#define YY_MAX_SHIFT 289 -#define YY_MIN_SHIFTREDUCE 473 -#define YY_MAX_SHIFTREDUCE 725 -#define YY_ERROR_ACTION 726 -#define YY_ACCEPT_ACTION 727 -#define YY_NO_ACTION 728 -#define YY_MIN_REDUCE 729 -#define YY_MAX_REDUCE 981 +#define YY_MAX_SHIFT 293 +#define YY_MIN_SHIFTREDUCE 477 +#define YY_MAX_SHIFTREDUCE 730 +#define YY_ERROR_ACTION 731 +#define YY_ACCEPT_ACTION 732 +#define YY_NO_ACTION 733 +#define YY_MIN_REDUCE 734 +#define YY_MAX_REDUCE 987 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -214,139 +214,142 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (627) +#define YY_ACTTAB_COUNT (651) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 888, 517, 727, 289, 517, 182, 287, 590, 28, 518, - /* 10 */ 15, 161, 518, 43, 44, 771, 45, 46, 150, 162, - /* 20 */ 194, 37, 126, 517, 238, 49, 47, 51, 48, 963, - /* 30 */ 166, 518, 186, 42, 41, 264, 263, 40, 39, 38, - /* 40 */ 43, 44, 877, 45, 46, 877, 184, 194, 37, 863, - /* 50 */ 121, 238, 49, 47, 51, 48, 183, 866, 885, 221, - /* 60 */ 42, 41, 126, 126, 40, 39, 38, 474, 475, 476, - /* 70 */ 477, 478, 479, 480, 481, 482, 483, 484, 485, 288, - /* 80 */ 43, 44, 211, 45, 46, 916, 254, 194, 37, 162, - /* 90 */ 630, 238, 49, 47, 51, 48, 71, 94, 189, 964, - /* 100 */ 42, 41, 274, 960, 40, 39, 38, 64, 65, 226, - /* 110 */ 21, 252, 282, 281, 251, 250, 249, 280, 248, 279, - /* 120 */ 278, 277, 247, 276, 275, 917, 70, 233, 830, 674, - /* 130 */ 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - /* 140 */ 828, 829, 831, 832, 44, 199, 45, 46, 274, 28, - /* 150 */ 194, 37, 162, 959, 238, 49, 47, 51, 48, 860, - /* 160 */ 201, 188, 964, 42, 41, 634, 214, 40, 39, 38, - /* 170 */ 866, 45, 46, 218, 217, 194, 37, 958, 72, 238, - /* 180 */ 49, 47, 51, 48, 16, 866, 205, 197, 42, 41, - /* 190 */ 863, 283, 40, 39, 38, 193, 687, 22, 200, 678, - /* 200 */ 170, 681, 203, 684, 178, 34, 171, 849, 850, 27, - /* 210 */ 853, 106, 105, 169, 193, 687, 866, 179, 678, 75, - /* 220 */ 681, 780, 684, 21, 150, 282, 281, 190, 191, 164, - /* 230 */ 280, 237, 279, 278, 277, 614, 276, 275, 611, 10, - /* 240 */ 612, 22, 613, 74, 165, 136, 190, 191, 63, 34, - /* 250 */ 836, 854, 207, 834, 835, 261, 260, 167, 837, 852, - /* 260 */ 839, 840, 838, 126, 841, 842, 208, 209, 204, 168, - /* 270 */ 220, 256, 49, 47, 51, 48, 28, 177, 851, 927, - /* 280 */ 42, 41, 92, 96, 40, 39, 38, 28, 86, 101, - /* 290 */ 104, 95, 3, 140, 28, 50, 28, 98, 31, 81, - /* 300 */ 77, 80, 28, 156, 152, 119, 28, 206, 686, 154, - /* 310 */ 109, 108, 107, 34, 50, 42, 41, 862, 224, 40, - /* 320 */ 39, 38, 29, 685, 235, 198, 69, 686, 863, 40, - /* 330 */ 39, 38, 257, 192, 258, 863, 254, 863, 676, 864, - /* 340 */ 262, 615, 685, 863, 266, 655, 656, 863, 286, 285, - /* 350 */ 113, 772, 627, 622, 150, 680, 642, 683, 646, 23, - /* 360 */ 123, 223, 54, 647, 706, 688, 239, 18, 17, 17, - /* 370 */ 679, 55, 682, 26, 677, 4, 244, 58, 600, 241, - /* 380 */ 602, 243, 29, 29, 54, 73, 601, 174, 85, 84, - /* 390 */ 54, 175, 56, 12, 11, 173, 59, 91, 90, 61, - /* 400 */ 973, 589, 14, 13, 618, 616, 619, 617, 103, 102, - /* 410 */ 118, 116, 160, 172, 163, 865, 926, 195, 923, 922, - /* 420 */ 196, 265, 879, 120, 887, 35, 909, 894, 896, 908, - /* 430 */ 122, 137, 859, 135, 34, 138, 139, 782, 222, 246, - /* 440 */ 158, 32, 255, 779, 117, 978, 641, 82, 977, 975, - /* 450 */ 141, 259, 972, 88, 971, 227, 969, 142, 800, 690, - /* 460 */ 185, 33, 30, 159, 231, 769, 97, 60, 876, 128, - /* 470 */ 767, 99, 57, 127, 236, 52, 234, 232, 230, 100, - /* 480 */ 765, 764, 130, 210, 228, 36, 151, 93, 762, 267, - /* 490 */ 268, 269, 270, 761, 760, 271, 759, 272, 273, 758, - /* 500 */ 153, 155, 755, 753, 751, 284, 749, 747, 157, 725, - /* 510 */ 225, 66, 212, 67, 910, 213, 724, 215, 216, 723, - /* 520 */ 180, 202, 711, 245, 219, 181, 176, 223, 78, 624, - /* 530 */ 62, 763, 6, 240, 110, 111, 68, 757, 145, 643, - /* 540 */ 144, 801, 143, 146, 147, 149, 148, 756, 1, 124, - /* 550 */ 112, 187, 748, 229, 125, 2, 648, 861, 7, 8, - /* 560 */ 689, 24, 133, 131, 129, 132, 134, 25, 5, 9, - /* 570 */ 691, 19, 20, 242, 76, 558, 554, 74, 552, 551, - /* 580 */ 550, 547, 253, 521, 83, 29, 79, 592, 53, 591, - /* 590 */ 87, 89, 588, 542, 540, 532, 538, 534, 536, 530, - /* 600 */ 528, 560, 559, 557, 556, 555, 553, 549, 548, 54, - /* 610 */ 519, 489, 487, 729, 728, 728, 728, 728, 728, 728, - /* 620 */ 728, 728, 728, 728, 728, 114, 115, + /* 0 */ 74, 521, 732, 293, 521, 165, 186, 291, 28, 522, + /* 10 */ 190, 893, 522, 43, 44, 969, 47, 48, 15, 776, + /* 20 */ 198, 37, 152, 46, 242, 51, 49, 53, 50, 854, + /* 30 */ 855, 27, 858, 42, 41, 871, 128, 40, 39, 38, + /* 40 */ 43, 44, 882, 47, 48, 882, 188, 198, 37, 868, + /* 50 */ 46, 242, 51, 49, 53, 50, 187, 128, 203, 225, + /* 60 */ 42, 41, 979, 165, 40, 39, 38, 43, 44, 890, + /* 70 */ 47, 48, 193, 970, 198, 37, 165, 46, 242, 51, + /* 80 */ 49, 53, 50, 871, 128, 192, 970, 42, 41, 258, + /* 90 */ 521, 40, 39, 38, 290, 289, 115, 239, 522, 71, + /* 100 */ 77, 43, 45, 128, 47, 48, 205, 66, 198, 37, + /* 110 */ 28, 46, 242, 51, 49, 53, 50, 40, 39, 38, + /* 120 */ 921, 42, 41, 278, 65, 40, 39, 38, 865, 678, + /* 130 */ 287, 871, 859, 210, 478, 479, 480, 481, 482, 483, + /* 140 */ 484, 485, 486, 487, 488, 489, 292, 72, 201, 215, + /* 150 */ 44, 868, 47, 48, 856, 871, 198, 37, 209, 46, + /* 160 */ 242, 51, 49, 53, 50, 869, 922, 204, 237, 42, + /* 170 */ 41, 96, 163, 40, 39, 38, 278, 21, 256, 286, + /* 180 */ 285, 255, 254, 253, 284, 252, 283, 282, 281, 251, + /* 190 */ 280, 279, 835, 594, 823, 824, 825, 826, 827, 828, + /* 200 */ 829, 830, 831, 832, 833, 834, 836, 837, 47, 48, + /* 210 */ 87, 86, 198, 37, 28, 46, 242, 51, 49, 53, + /* 220 */ 50, 268, 267, 16, 211, 42, 41, 265, 264, 40, + /* 230 */ 39, 38, 197, 691, 28, 634, 682, 207, 685, 174, + /* 240 */ 688, 22, 42, 41, 73, 175, 40, 39, 38, 34, + /* 250 */ 108, 107, 173, 197, 691, 867, 67, 682, 28, 685, + /* 260 */ 21, 688, 286, 285, 194, 195, 169, 284, 241, 283, + /* 270 */ 282, 281, 202, 280, 279, 868, 618, 28, 60, 615, + /* 280 */ 22, 616, 631, 617, 218, 194, 195, 123, 34, 23, + /* 290 */ 841, 222, 221, 839, 840, 857, 261, 61, 842, 868, + /* 300 */ 844, 845, 843, 208, 846, 847, 260, 212, 213, 224, + /* 310 */ 638, 51, 49, 53, 50, 262, 181, 28, 868, 42, + /* 320 */ 41, 94, 98, 40, 39, 38, 28, 88, 103, 106, + /* 330 */ 97, 10, 52, 3, 142, 76, 100, 138, 680, 31, + /* 340 */ 83, 79, 82, 158, 154, 690, 230, 659, 660, 156, + /* 350 */ 111, 110, 109, 52, 785, 266, 777, 152, 868, 152, + /* 360 */ 689, 626, 121, 684, 270, 687, 690, 868, 196, 227, + /* 370 */ 34, 228, 258, 646, 681, 29, 683, 125, 686, 650, + /* 380 */ 651, 689, 619, 56, 18, 711, 692, 243, 966, 17, + /* 390 */ 17, 57, 604, 245, 606, 247, 29, 29, 56, 75, + /* 400 */ 605, 63, 26, 593, 56, 248, 12, 11, 93, 92, + /* 410 */ 4, 965, 58, 14, 13, 622, 620, 623, 621, 105, + /* 420 */ 104, 120, 118, 932, 964, 182, 183, 167, 168, 170, + /* 430 */ 164, 171, 172, 178, 179, 177, 162, 176, 166, 870, + /* 440 */ 931, 199, 928, 927, 884, 200, 269, 122, 892, 35, + /* 450 */ 899, 901, 124, 139, 864, 914, 140, 141, 913, 137, + /* 460 */ 787, 250, 160, 32, 259, 34, 784, 984, 84, 983, + /* 470 */ 981, 143, 226, 119, 231, 263, 978, 90, 977, 975, + /* 480 */ 694, 144, 645, 805, 189, 235, 62, 881, 129, 33, + /* 490 */ 59, 240, 30, 54, 161, 132, 130, 238, 236, 131, + /* 500 */ 774, 99, 772, 133, 234, 134, 232, 101, 36, 102, + /* 510 */ 770, 95, 769, 271, 272, 214, 153, 767, 766, 765, + /* 520 */ 764, 763, 273, 155, 157, 760, 758, 756, 754, 752, + /* 530 */ 159, 274, 229, 68, 69, 915, 275, 276, 277, 184, + /* 540 */ 206, 249, 730, 185, 180, 288, 80, 216, 217, 768, + /* 550 */ 729, 220, 219, 112, 728, 762, 147, 761, 146, 806, + /* 560 */ 145, 148, 149, 151, 150, 113, 114, 753, 1, 716, + /* 570 */ 2, 223, 227, 628, 64, 6, 866, 244, 70, 647, + /* 580 */ 126, 135, 136, 191, 24, 233, 7, 652, 127, 8, + /* 590 */ 693, 5, 25, 9, 19, 246, 20, 695, 78, 76, + /* 600 */ 562, 558, 556, 555, 554, 551, 525, 257, 81, 85, + /* 610 */ 29, 55, 596, 595, 89, 91, 592, 546, 544, 536, + /* 620 */ 542, 538, 540, 534, 532, 564, 563, 561, 560, 559, + /* 630 */ 557, 553, 552, 56, 523, 493, 491, 734, 733, 733, + /* 640 */ 733, 733, 733, 733, 733, 733, 733, 733, 733, 116, + /* 650 */ 117, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 213, 1, 210, 211, 1, 212, 213, 5, 213, 9, - /* 10 */ 270, 270, 9, 13, 14, 217, 16, 17, 220, 270, - /* 20 */ 20, 21, 213, 1, 24, 25, 26, 27, 28, 280, - /* 30 */ 270, 9, 230, 33, 34, 33, 34, 37, 38, 39, + /* 0 */ 218, 1, 210, 211, 1, 270, 212, 213, 213, 9, + /* 10 */ 230, 213, 9, 13, 14, 280, 16, 17, 270, 217, + /* 20 */ 20, 21, 220, 23, 24, 25, 26, 27, 28, 247, + /* 30 */ 248, 249, 250, 33, 34, 255, 213, 37, 38, 39, /* 40 */ 13, 14, 253, 16, 17, 253, 251, 20, 21, 254, - /* 50 */ 213, 24, 25, 26, 27, 28, 267, 255, 271, 267, - /* 60 */ 33, 34, 213, 213, 37, 38, 39, 45, 46, 47, - /* 70 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - /* 80 */ 13, 14, 60, 16, 17, 276, 77, 20, 21, 270, - /* 90 */ 37, 24, 25, 26, 27, 28, 256, 74, 279, 280, - /* 100 */ 33, 34, 79, 270, 37, 38, 39, 107, 268, 272, - /* 110 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - /* 120 */ 96, 97, 98, 99, 100, 276, 276, 278, 229, 102, - /* 130 */ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - /* 140 */ 241, 242, 243, 244, 14, 230, 16, 17, 79, 213, - /* 150 */ 20, 21, 270, 270, 24, 25, 26, 27, 28, 213, - /* 160 */ 230, 279, 280, 33, 34, 112, 131, 37, 38, 39, - /* 170 */ 255, 16, 17, 138, 139, 20, 21, 270, 218, 24, - /* 180 */ 25, 26, 27, 28, 44, 255, 66, 251, 33, 34, - /* 190 */ 254, 230, 37, 38, 39, 1, 2, 101, 252, 5, - /* 200 */ 60, 7, 66, 9, 270, 109, 66, 247, 248, 249, - /* 210 */ 250, 71, 72, 73, 1, 2, 255, 270, 5, 218, - /* 220 */ 7, 217, 9, 86, 220, 88, 89, 33, 34, 270, - /* 230 */ 93, 37, 95, 96, 97, 2, 99, 100, 5, 101, - /* 240 */ 7, 101, 9, 105, 270, 107, 33, 34, 218, 109, - /* 250 */ 229, 250, 132, 232, 233, 135, 136, 270, 237, 0, - /* 260 */ 239, 240, 241, 213, 243, 244, 33, 34, 132, 270, - /* 270 */ 130, 135, 25, 26, 27, 28, 213, 137, 248, 246, - /* 280 */ 33, 34, 61, 62, 37, 38, 39, 213, 67, 68, - /* 290 */ 69, 70, 61, 62, 213, 101, 213, 76, 67, 68, - /* 300 */ 69, 70, 213, 61, 62, 101, 213, 213, 114, 67, - /* 310 */ 68, 69, 70, 109, 101, 33, 34, 254, 102, 37, - /* 320 */ 38, 39, 106, 129, 274, 251, 276, 114, 254, 37, - /* 330 */ 38, 39, 251, 59, 251, 254, 77, 254, 1, 245, - /* 340 */ 251, 108, 129, 254, 251, 120, 121, 254, 63, 64, - /* 350 */ 65, 217, 106, 102, 220, 5, 102, 7, 102, 113, - /* 360 */ 106, 110, 106, 102, 102, 102, 15, 106, 106, 106, - /* 370 */ 5, 106, 7, 101, 37, 101, 104, 106, 102, 102, - /* 380 */ 102, 102, 106, 106, 106, 106, 102, 270, 133, 134, - /* 390 */ 106, 270, 127, 133, 134, 270, 125, 133, 134, 101, - /* 400 */ 255, 103, 133, 134, 5, 5, 7, 7, 74, 75, - /* 410 */ 61, 62, 270, 270, 270, 255, 246, 246, 246, 246, - /* 420 */ 246, 246, 253, 213, 213, 269, 277, 213, 213, 277, - /* 430 */ 213, 213, 213, 257, 109, 213, 213, 213, 253, 213, - /* 440 */ 213, 213, 213, 213, 59, 213, 114, 213, 213, 213, - /* 450 */ 213, 213, 213, 213, 213, 273, 213, 213, 213, 108, - /* 460 */ 273, 213, 213, 213, 273, 213, 213, 124, 266, 264, - /* 470 */ 213, 213, 126, 265, 118, 123, 122, 117, 116, 213, - /* 480 */ 213, 213, 262, 213, 115, 128, 213, 85, 213, 84, - /* 490 */ 49, 81, 83, 213, 213, 53, 213, 82, 80, 213, - /* 500 */ 213, 213, 213, 213, 213, 77, 213, 213, 213, 5, - /* 510 */ 214, 214, 140, 214, 214, 5, 5, 140, 5, 5, - /* 520 */ 214, 214, 87, 214, 131, 214, 214, 110, 218, 102, - /* 530 */ 111, 214, 101, 104, 215, 215, 106, 214, 222, 102, - /* 540 */ 226, 228, 227, 225, 223, 221, 224, 214, 219, 101, - /* 550 */ 215, 1, 214, 101, 101, 216, 102, 253, 119, 119, - /* 560 */ 102, 106, 259, 261, 263, 260, 258, 106, 101, 101, - /* 570 */ 108, 101, 101, 104, 74, 9, 5, 105, 5, 5, - /* 580 */ 5, 5, 15, 78, 134, 106, 74, 5, 16, 5, - /* 590 */ 134, 134, 102, 5, 5, 5, 5, 5, 5, 5, - /* 600 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 106, - /* 610 */ 78, 59, 58, 0, 281, 281, 281, 281, 281, 281, - /* 620 */ 281, 281, 281, 281, 281, 21, 21, 281, 281, 281, - /* 630 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - /* 640 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - /* 650 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + /* 50 */ 23, 24, 25, 26, 27, 28, 267, 213, 230, 267, + /* 60 */ 33, 34, 255, 270, 37, 38, 39, 13, 14, 271, + /* 70 */ 16, 17, 279, 280, 20, 21, 270, 23, 24, 25, + /* 80 */ 26, 27, 28, 255, 213, 279, 280, 33, 34, 77, + /* 90 */ 1, 37, 38, 39, 63, 64, 65, 274, 9, 276, + /* 100 */ 218, 13, 14, 213, 16, 17, 230, 107, 20, 21, + /* 110 */ 213, 23, 24, 25, 26, 27, 28, 37, 38, 39, + /* 120 */ 276, 33, 34, 79, 218, 37, 38, 39, 213, 102, + /* 130 */ 230, 255, 250, 213, 45, 46, 47, 48, 49, 50, + /* 140 */ 51, 52, 53, 54, 55, 56, 57, 276, 251, 60, + /* 150 */ 14, 254, 16, 17, 248, 255, 20, 21, 66, 23, + /* 160 */ 24, 25, 26, 27, 28, 245, 276, 252, 278, 33, + /* 170 */ 34, 74, 270, 37, 38, 39, 79, 86, 87, 88, + /* 180 */ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + /* 190 */ 99, 100, 229, 5, 231, 232, 233, 234, 235, 236, + /* 200 */ 237, 238, 239, 240, 241, 242, 243, 244, 16, 17, + /* 210 */ 133, 134, 20, 21, 213, 23, 24, 25, 26, 27, + /* 220 */ 28, 33, 34, 44, 132, 33, 34, 135, 136, 37, + /* 230 */ 38, 39, 1, 2, 213, 37, 5, 66, 7, 60, + /* 240 */ 9, 101, 33, 34, 256, 66, 37, 38, 39, 109, + /* 250 */ 71, 72, 73, 1, 2, 254, 268, 5, 213, 7, + /* 260 */ 86, 9, 88, 89, 33, 34, 270, 93, 37, 95, + /* 270 */ 96, 97, 251, 99, 100, 254, 2, 213, 106, 5, + /* 280 */ 101, 7, 106, 9, 131, 33, 34, 213, 109, 113, + /* 290 */ 229, 138, 139, 232, 233, 0, 251, 125, 237, 254, + /* 300 */ 239, 240, 241, 132, 243, 244, 135, 33, 34, 130, + /* 310 */ 112, 25, 26, 27, 28, 251, 137, 213, 254, 33, + /* 320 */ 34, 61, 62, 37, 38, 39, 213, 67, 68, 69, + /* 330 */ 70, 101, 101, 61, 62, 105, 76, 107, 1, 67, + /* 340 */ 68, 69, 70, 61, 62, 114, 272, 120, 121, 67, + /* 350 */ 68, 69, 70, 101, 217, 251, 217, 220, 254, 220, + /* 360 */ 129, 102, 101, 5, 251, 7, 114, 254, 59, 110, + /* 370 */ 109, 102, 77, 102, 37, 106, 5, 106, 7, 102, + /* 380 */ 102, 129, 108, 106, 106, 102, 102, 15, 270, 106, + /* 390 */ 106, 106, 102, 102, 102, 102, 106, 106, 106, 106, + /* 400 */ 102, 101, 101, 103, 106, 104, 133, 134, 133, 134, + /* 410 */ 101, 270, 127, 133, 134, 5, 5, 7, 7, 74, + /* 420 */ 75, 61, 62, 246, 270, 270, 270, 270, 270, 270, + /* 430 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 255, + /* 440 */ 246, 246, 246, 246, 253, 246, 246, 213, 213, 269, + /* 450 */ 213, 213, 213, 213, 213, 277, 213, 213, 277, 257, + /* 460 */ 213, 213, 213, 213, 213, 109, 213, 213, 213, 213, + /* 470 */ 213, 213, 253, 59, 273, 213, 213, 213, 213, 213, + /* 480 */ 108, 213, 114, 213, 273, 273, 124, 266, 265, 213, + /* 490 */ 126, 118, 213, 123, 213, 262, 264, 122, 117, 263, + /* 500 */ 213, 213, 213, 261, 116, 260, 115, 213, 128, 213, + /* 510 */ 213, 85, 213, 84, 49, 213, 213, 213, 213, 213, + /* 520 */ 213, 213, 81, 213, 213, 213, 213, 213, 213, 213, + /* 530 */ 213, 83, 214, 214, 214, 214, 53, 82, 80, 214, + /* 540 */ 214, 214, 5, 214, 214, 77, 218, 140, 5, 214, + /* 550 */ 5, 5, 140, 215, 5, 214, 222, 214, 226, 228, + /* 560 */ 227, 225, 223, 221, 224, 215, 215, 214, 219, 87, + /* 570 */ 216, 131, 110, 102, 111, 101, 253, 104, 106, 102, + /* 580 */ 101, 259, 258, 1, 106, 101, 119, 102, 101, 119, + /* 590 */ 102, 101, 106, 101, 101, 104, 101, 108, 74, 105, + /* 600 */ 9, 5, 5, 5, 5, 5, 78, 15, 74, 134, + /* 610 */ 106, 16, 5, 5, 134, 134, 102, 5, 5, 5, + /* 620 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /* 630 */ 5, 5, 5, 106, 78, 59, 58, 0, 281, 281, + /* 640 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 21, + /* 650 */ 21, 281, 281, 281, 281, 281, 281, 281, 281, 281, /* 660 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, /* 670 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, /* 680 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, @@ -364,93 +367,99 @@ static const YYCODETYPE yy_lookahead[] = { /* 800 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, /* 810 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, /* 820 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - /* 830 */ 281, 281, 281, 281, 281, 281, 281, + /* 830 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + /* 840 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + /* 850 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + /* 860 */ 281, }; -#define YY_SHIFT_COUNT (289) +#define YY_SHIFT_COUNT (293) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (613) +#define YY_SHIFT_MAX (637) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 140, 24, 137, 9, 194, 213, 3, 3, 3, 3, - /* 10 */ 3, 3, 3, 3, 3, 0, 22, 213, 233, 233, - /* 20 */ 233, 233, 96, 3, 3, 3, 3, 259, 3, 3, - /* 30 */ 23, 9, 69, 69, 627, 213, 213, 213, 213, 213, - /* 40 */ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - /* 50 */ 213, 213, 213, 233, 233, 2, 2, 2, 2, 2, - /* 60 */ 2, 2, 204, 3, 3, 53, 3, 3, 3, 225, - /* 70 */ 225, 246, 3, 3, 3, 3, 3, 3, 3, 3, + /* 0 */ 179, 91, 174, 12, 231, 252, 3, 3, 3, 3, + /* 10 */ 3, 3, 3, 3, 3, 0, 89, 252, 274, 274, + /* 20 */ 274, 274, 140, 3, 3, 3, 3, 295, 3, 3, + /* 30 */ 97, 12, 44, 44, 651, 252, 252, 252, 252, 252, + /* 40 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, + /* 50 */ 252, 252, 252, 252, 252, 274, 274, 188, 188, 188, + /* 60 */ 188, 188, 188, 188, 261, 3, 3, 198, 3, 3, + /* 70 */ 3, 227, 227, 176, 3, 3, 3, 3, 3, 3, /* 80 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 90 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 100 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - /* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 325, - /* 120 */ 385, 385, 385, 332, 332, 332, 385, 343, 346, 352, - /* 130 */ 356, 354, 360, 362, 369, 357, 325, 385, 385, 385, - /* 140 */ 9, 385, 385, 402, 405, 441, 410, 409, 442, 415, - /* 150 */ 418, 385, 428, 385, 428, 385, 428, 385, 627, 627, - /* 160 */ 27, 67, 67, 67, 130, 155, 247, 247, 247, 221, - /* 170 */ 231, 242, 282, 282, 282, 282, 120, 35, 292, 292, - /* 180 */ 138, 136, 285, 251, 216, 254, 256, 261, 262, 263, - /* 190 */ 350, 365, 337, 274, 351, 265, 271, 276, 277, 278, - /* 200 */ 279, 284, 272, 255, 260, 264, 298, 269, 399, 400, - /* 210 */ 334, 349, 504, 372, 510, 511, 377, 513, 514, 435, - /* 220 */ 393, 417, 427, 419, 429, 431, 430, 437, 448, 550, - /* 230 */ 452, 454, 453, 455, 439, 461, 440, 458, 467, 462, - /* 240 */ 468, 429, 470, 469, 471, 472, 500, 566, 571, 573, - /* 250 */ 574, 575, 576, 505, 567, 512, 450, 479, 479, 572, - /* 260 */ 456, 457, 479, 582, 584, 490, 479, 588, 589, 590, - /* 270 */ 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - /* 280 */ 601, 602, 603, 503, 532, 604, 605, 552, 554, 613, + /* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 120 */ 3, 356, 414, 414, 414, 368, 368, 368, 414, 362, + /* 130 */ 364, 370, 373, 375, 381, 388, 391, 380, 356, 414, + /* 140 */ 414, 414, 12, 414, 414, 426, 429, 465, 441, 448, + /* 150 */ 483, 455, 458, 414, 468, 414, 468, 414, 468, 414, + /* 160 */ 651, 651, 27, 54, 88, 54, 54, 136, 192, 286, + /* 170 */ 286, 286, 286, 260, 272, 282, 209, 209, 209, 209, + /* 180 */ 92, 153, 80, 80, 230, 171, 31, 259, 269, 271, + /* 190 */ 277, 278, 283, 284, 358, 371, 337, 309, 372, 285, + /* 200 */ 172, 290, 291, 292, 293, 298, 301, 77, 273, 275, + /* 210 */ 300, 280, 410, 411, 345, 360, 537, 407, 543, 545, + /* 220 */ 412, 546, 549, 482, 440, 462, 471, 463, 473, 474, + /* 230 */ 472, 477, 479, 582, 484, 485, 487, 478, 467, 486, + /* 240 */ 470, 488, 490, 489, 492, 473, 493, 491, 495, 494, + /* 250 */ 524, 591, 596, 597, 598, 599, 600, 528, 592, 534, + /* 260 */ 475, 504, 504, 595, 480, 481, 504, 607, 608, 514, + /* 270 */ 504, 612, 613, 614, 615, 616, 617, 618, 619, 620, + /* 280 */ 621, 622, 623, 624, 625, 626, 627, 527, 556, 628, + /* 290 */ 629, 576, 578, 637, }; -#define YY_REDUCE_COUNT (159) -#define YY_REDUCE_MIN (-260) -#define YY_REDUCE_MAX (339) +#define YY_REDUCE_COUNT (161) +#define YY_REDUCE_MIN (-265) +#define YY_REDUCE_MAX (354) static const short yy_reduce_ofst[] = { - /* 0 */ -208, -101, 21, -40, -181, -118, -205, -151, 50, -64, - /* 10 */ 74, 81, 83, 89, 93, -213, -207, -251, -198, -85, - /* 20 */ -70, -39, -211, -163, -191, -150, -54, 1, 94, 63, - /* 30 */ -202, 30, 4, 134, -160, -260, -259, -240, -167, -117, - /* 40 */ -93, -66, -53, -41, -26, -13, -1, 117, 121, 125, - /* 50 */ 142, 143, 144, 145, 160, 33, 170, 171, 172, 173, - /* 60 */ 174, 175, 169, 210, 211, 156, 214, 215, 217, 149, - /* 70 */ 152, 176, 218, 219, 222, 223, 224, 226, 227, 228, - /* 80 */ 229, 230, 232, 234, 235, 236, 237, 238, 239, 240, - /* 90 */ 241, 243, 244, 245, 248, 249, 250, 252, 253, 257, - /* 100 */ 258, 266, 267, 268, 270, 273, 275, 280, 281, 283, - /* 110 */ 286, 287, 288, 289, 290, 291, 293, 294, 295, 185, - /* 120 */ 296, 297, 299, 182, 187, 191, 300, 202, 208, 205, - /* 130 */ 301, 220, 302, 305, 303, 308, 304, 306, 307, 309, - /* 140 */ 310, 311, 312, 313, 315, 314, 316, 318, 321, 322, - /* 150 */ 324, 317, 319, 323, 320, 333, 335, 338, 329, 339, + /* 0 */ -208, -37, 61, -218, -207, -194, -205, -110, -177, -103, + /* 10 */ 21, 45, 64, 104, 113, -202, -206, -265, -220, -172, + /* 20 */ -124, -100, -211, 74, -156, -129, -85, -118, -80, 1, + /* 30 */ -198, -94, 137, 139, -12, -252, -98, -4, 118, 141, + /* 40 */ 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + /* 50 */ 164, 165, 166, 167, 168, -193, 184, 177, 194, 195, + /* 60 */ 196, 197, 199, 200, 191, 234, 235, 180, 237, 238, + /* 70 */ 239, 178, 181, 202, 240, 241, 243, 244, 247, 248, + /* 80 */ 249, 250, 251, 253, 254, 255, 256, 257, 258, 262, + /* 90 */ 263, 264, 265, 266, 268, 270, 276, 279, 281, 287, + /* 100 */ 288, 289, 294, 296, 297, 299, 302, 303, 304, 305, + /* 110 */ 306, 307, 308, 310, 311, 312, 313, 314, 315, 316, + /* 120 */ 317, 219, 318, 319, 320, 201, 211, 212, 321, 221, + /* 130 */ 223, 232, 236, 233, 242, 245, 322, 324, 323, 325, + /* 140 */ 326, 327, 328, 329, 330, 331, 333, 332, 334, 336, + /* 150 */ 339, 340, 342, 335, 338, 341, 350, 343, 351, 353, + /* 160 */ 349, 354, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 726, 781, 770, 778, 966, 966, 726, 726, 726, 726, - /* 10 */ 726, 726, 726, 726, 726, 889, 744, 966, 726, 726, - /* 20 */ 726, 726, 726, 726, 726, 726, 726, 778, 726, 726, - /* 30 */ 783, 778, 783, 783, 884, 726, 726, 726, 726, 726, - /* 40 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 50 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 60 */ 726, 726, 726, 726, 726, 891, 893, 895, 726, 913, - /* 70 */ 913, 882, 726, 726, 726, 726, 726, 726, 726, 726, - /* 80 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 90 */ 726, 726, 726, 726, 726, 726, 726, 768, 726, 766, - /* 100 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 110 */ 726, 726, 726, 754, 726, 726, 726, 726, 726, 726, - /* 120 */ 746, 746, 746, 726, 726, 726, 746, 920, 924, 918, - /* 130 */ 906, 914, 905, 901, 900, 928, 726, 746, 746, 746, - /* 140 */ 778, 746, 746, 799, 797, 795, 787, 793, 789, 791, - /* 150 */ 785, 746, 776, 746, 776, 746, 776, 746, 817, 833, - /* 160 */ 726, 929, 965, 919, 955, 954, 961, 953, 952, 726, - /* 170 */ 726, 726, 948, 949, 951, 950, 726, 726, 957, 956, - /* 180 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 190 */ 726, 726, 726, 931, 726, 925, 921, 726, 726, 726, - /* 200 */ 726, 726, 726, 726, 726, 726, 843, 726, 726, 726, - /* 210 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 220 */ 726, 881, 726, 726, 726, 726, 892, 726, 726, 726, - /* 230 */ 726, 726, 726, 915, 726, 907, 726, 726, 726, 726, - /* 240 */ 726, 855, 726, 726, 726, 726, 726, 726, 726, 726, - /* 250 */ 726, 726, 726, 726, 726, 726, 726, 976, 974, 726, - /* 260 */ 726, 726, 970, 726, 726, 726, 968, 726, 726, 726, - /* 270 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, - /* 280 */ 726, 726, 726, 802, 726, 752, 750, 726, 742, 726, + /* 0 */ 731, 786, 775, 783, 972, 972, 731, 731, 731, 731, + /* 10 */ 731, 731, 731, 731, 731, 894, 749, 972, 731, 731, + /* 20 */ 731, 731, 731, 731, 731, 731, 731, 783, 731, 731, + /* 30 */ 788, 783, 788, 788, 889, 731, 731, 731, 731, 731, + /* 40 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 50 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 60 */ 731, 731, 731, 731, 731, 731, 731, 896, 898, 900, + /* 70 */ 731, 918, 918, 887, 731, 731, 731, 731, 731, 731, + /* 80 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 90 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 773, + /* 100 */ 731, 771, 731, 731, 731, 731, 731, 731, 731, 731, + /* 110 */ 731, 731, 731, 731, 731, 759, 731, 731, 731, 731, + /* 120 */ 731, 731, 751, 751, 751, 731, 731, 731, 751, 925, + /* 130 */ 929, 923, 911, 919, 910, 906, 905, 933, 731, 751, + /* 140 */ 751, 751, 783, 751, 751, 804, 802, 800, 792, 798, + /* 150 */ 794, 796, 790, 751, 781, 751, 781, 751, 781, 751, + /* 160 */ 822, 838, 731, 934, 731, 971, 924, 961, 960, 967, + /* 170 */ 959, 958, 957, 731, 731, 731, 953, 954, 956, 955, + /* 180 */ 731, 731, 963, 962, 731, 731, 731, 731, 731, 731, + /* 190 */ 731, 731, 731, 731, 731, 731, 731, 936, 731, 930, + /* 200 */ 926, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 210 */ 848, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 220 */ 731, 731, 731, 731, 731, 886, 731, 731, 731, 731, + /* 230 */ 897, 731, 731, 731, 731, 731, 731, 920, 731, 912, + /* 240 */ 731, 731, 731, 731, 731, 860, 731, 731, 731, 731, + /* 250 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 260 */ 731, 982, 980, 731, 731, 731, 976, 731, 731, 731, + /* 270 */ 974, 731, 731, 731, 731, 731, 731, 731, 731, 731, + /* 280 */ 731, 731, 731, 731, 731, 731, 731, 807, 731, 757, + /* 290 */ 755, 731, 747, 731, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1280,34 +1289,35 @@ static const char *const yyRuleName[] = { /* 222 */ "expr ::= expr GE expr", /* 223 */ "expr ::= expr NE expr", /* 224 */ "expr ::= expr EQ expr", - /* 225 */ "expr ::= expr AND expr", - /* 226 */ "expr ::= expr OR expr", - /* 227 */ "expr ::= expr PLUS expr", - /* 228 */ "expr ::= expr MINUS expr", - /* 229 */ "expr ::= expr STAR expr", - /* 230 */ "expr ::= expr SLASH expr", - /* 231 */ "expr ::= expr REM expr", - /* 232 */ "expr ::= expr LIKE expr", - /* 233 */ "expr ::= expr IN LP exprlist RP", - /* 234 */ "exprlist ::= exprlist COMMA expritem", - /* 235 */ "exprlist ::= expritem", - /* 236 */ "expritem ::= expr", - /* 237 */ "expritem ::=", - /* 238 */ "cmd ::= RESET QUERY CACHE", - /* 239 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 240 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 241 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 242 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 243 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 244 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 245 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 246 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 247 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 248 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 249 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 250 */ "cmd ::= KILL CONNECTION INTEGER", - /* 251 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 252 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 225 */ "expr ::= expr BETWEEN expr AND expr", + /* 226 */ "expr ::= expr AND expr", + /* 227 */ "expr ::= expr OR expr", + /* 228 */ "expr ::= expr PLUS expr", + /* 229 */ "expr ::= expr MINUS expr", + /* 230 */ "expr ::= expr STAR expr", + /* 231 */ "expr ::= expr SLASH expr", + /* 232 */ "expr ::= expr REM expr", + /* 233 */ "expr ::= expr LIKE expr", + /* 234 */ "expr ::= expr IN LP exprlist RP", + /* 235 */ "exprlist ::= exprlist COMMA expritem", + /* 236 */ "exprlist ::= expritem", + /* 237 */ "expritem ::= expr", + /* 238 */ "expritem ::=", + /* 239 */ "cmd ::= RESET QUERY CACHE", + /* 240 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 241 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 242 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 243 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 244 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 245 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 246 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 247 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 248 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 249 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 250 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 251 */ "cmd ::= KILL CONNECTION INTEGER", + /* 252 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 253 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1992,34 +2002,35 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 270, /* (222) expr ::= expr GE expr */ 270, /* (223) expr ::= expr NE expr */ 270, /* (224) expr ::= expr EQ expr */ - 270, /* (225) expr ::= expr AND expr */ - 270, /* (226) expr ::= expr OR expr */ - 270, /* (227) expr ::= expr PLUS expr */ - 270, /* (228) expr ::= expr MINUS expr */ - 270, /* (229) expr ::= expr STAR expr */ - 270, /* (230) expr ::= expr SLASH expr */ - 270, /* (231) expr ::= expr REM expr */ - 270, /* (232) expr ::= expr LIKE expr */ - 270, /* (233) expr ::= expr IN LP exprlist RP */ - 279, /* (234) exprlist ::= exprlist COMMA expritem */ - 279, /* (235) exprlist ::= expritem */ - 280, /* (236) expritem ::= expr */ - 280, /* (237) expritem ::= */ - 211, /* (238) cmd ::= RESET QUERY CACHE */ - 211, /* (239) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - 211, /* (240) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - 211, /* (241) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - 211, /* (242) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - 211, /* (243) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - 211, /* (244) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - 211, /* (245) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - 211, /* (246) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - 211, /* (247) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - 211, /* (248) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - 211, /* (249) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - 211, /* (250) cmd ::= KILL CONNECTION INTEGER */ - 211, /* (251) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - 211, /* (252) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + 270, /* (225) expr ::= expr BETWEEN expr AND expr */ + 270, /* (226) expr ::= expr AND expr */ + 270, /* (227) expr ::= expr OR expr */ + 270, /* (228) expr ::= expr PLUS expr */ + 270, /* (229) expr ::= expr MINUS expr */ + 270, /* (230) expr ::= expr STAR expr */ + 270, /* (231) expr ::= expr SLASH expr */ + 270, /* (232) expr ::= expr REM expr */ + 270, /* (233) expr ::= expr LIKE expr */ + 270, /* (234) expr ::= expr IN LP exprlist RP */ + 279, /* (235) exprlist ::= exprlist COMMA expritem */ + 279, /* (236) exprlist ::= expritem */ + 280, /* (237) expritem ::= expr */ + 280, /* (238) expritem ::= */ + 211, /* (239) cmd ::= RESET QUERY CACHE */ + 211, /* (240) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + 211, /* (241) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + 211, /* (242) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + 211, /* (243) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + 211, /* (244) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + 211, /* (245) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + 211, /* (246) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + 211, /* (247) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + 211, /* (248) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + 211, /* (249) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + 211, /* (250) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + 211, /* (251) cmd ::= KILL CONNECTION INTEGER */ + 211, /* (252) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + 211, /* (253) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -2250,34 +2261,35 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (222) expr ::= expr GE expr */ -3, /* (223) expr ::= expr NE expr */ -3, /* (224) expr ::= expr EQ expr */ - -3, /* (225) expr ::= expr AND expr */ - -3, /* (226) expr ::= expr OR expr */ - -3, /* (227) expr ::= expr PLUS expr */ - -3, /* (228) expr ::= expr MINUS expr */ - -3, /* (229) expr ::= expr STAR expr */ - -3, /* (230) expr ::= expr SLASH expr */ - -3, /* (231) expr ::= expr REM expr */ - -3, /* (232) expr ::= expr LIKE expr */ - -5, /* (233) expr ::= expr IN LP exprlist RP */ - -3, /* (234) exprlist ::= exprlist COMMA expritem */ - -1, /* (235) exprlist ::= expritem */ - -1, /* (236) expritem ::= expr */ - 0, /* (237) expritem ::= */ - -3, /* (238) cmd ::= RESET QUERY CACHE */ - -7, /* (239) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (240) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - -7, /* (241) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - -7, /* (242) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - -8, /* (243) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (244) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (245) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (246) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - -7, /* (247) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - -7, /* (248) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - -8, /* (249) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - -3, /* (250) cmd ::= KILL CONNECTION INTEGER */ - -5, /* (251) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - -5, /* (252) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + -5, /* (225) expr ::= expr BETWEEN expr AND expr */ + -3, /* (226) expr ::= expr AND expr */ + -3, /* (227) expr ::= expr OR expr */ + -3, /* (228) expr ::= expr PLUS expr */ + -3, /* (229) expr ::= expr MINUS expr */ + -3, /* (230) expr ::= expr STAR expr */ + -3, /* (231) expr ::= expr SLASH expr */ + -3, /* (232) expr ::= expr REM expr */ + -3, /* (233) expr ::= expr LIKE expr */ + -5, /* (234) expr ::= expr IN LP exprlist RP */ + -3, /* (235) exprlist ::= exprlist COMMA expritem */ + -1, /* (236) exprlist ::= expritem */ + -1, /* (237) expritem ::= expr */ + 0, /* (238) expritem ::= */ + -3, /* (239) cmd ::= RESET QUERY CACHE */ + -7, /* (240) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (241) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + -7, /* (242) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + -7, /* (243) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + -8, /* (244) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + -9, /* (245) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + -7, /* (246) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + -7, /* (247) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + -7, /* (248) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + -7, /* (249) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + -8, /* (250) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + -3, /* (251) cmd ::= KILL CONNECTION INTEGER */ + -5, /* (252) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + -5, /* (253) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3049,7 +3061,7 @@ static YYACTIONTYPE yy_reduce( break; case 189: /* having_opt ::= */ case 199: /* where_opt ::= */ yytestcase(yyruleno==199); - case 237: /* expritem ::= */ yytestcase(yyruleno==237); + case 238: /* expritem ::= */ yytestcase(yyruleno==238); {yymsp[1].minor.yy326 = 0;} break; case 190: /* having_opt ::= HAVING expr */ @@ -3166,65 +3178,69 @@ static YYACTIONTYPE yy_reduce( {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_EQ);} yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 225: /* expr ::= expr AND expr */ + case 225: /* expr ::= expr BETWEEN expr AND expr */ +{ tSQLExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy326); yylhsminor.yy326 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy326, yymsp[-2].minor.yy326, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy326, TK_LE), TK_AND);} + yymsp[-4].minor.yy326 = yylhsminor.yy326; + break; + case 226: /* expr ::= expr AND expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_AND);} yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 226: /* expr ::= expr OR expr */ + case 227: /* expr ::= expr OR expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_OR); } yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 227: /* expr ::= expr PLUS expr */ + case 228: /* expr ::= expr PLUS expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_PLUS); } yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 228: /* expr ::= expr MINUS expr */ + case 229: /* expr ::= expr MINUS expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_MINUS); } yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 229: /* expr ::= expr STAR expr */ + case 230: /* expr ::= expr STAR expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_STAR); } yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 230: /* expr ::= expr SLASH expr */ + case 231: /* expr ::= expr SLASH expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_DIVIDE);} yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 231: /* expr ::= expr REM expr */ + case 232: /* expr ::= expr REM expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_REM); } yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 232: /* expr ::= expr LIKE expr */ + case 233: /* expr ::= expr LIKE expr */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_LIKE); } yymsp[-2].minor.yy326 = yylhsminor.yy326; break; - case 233: /* expr ::= expr IN LP exprlist RP */ + case 234: /* expr ::= expr IN LP exprlist RP */ {yylhsminor.yy326 = tSqlExprCreate(yymsp[-4].minor.yy326, (tSQLExpr*)yymsp[-1].minor.yy522, TK_IN); } yymsp[-4].minor.yy326 = yylhsminor.yy326; break; - case 234: /* exprlist ::= exprlist COMMA expritem */ + case 235: /* exprlist ::= exprlist COMMA expritem */ {yylhsminor.yy522 = tSqlExprListAppend(yymsp[-2].minor.yy522,yymsp[0].minor.yy326,0, 0);} yymsp[-2].minor.yy522 = yylhsminor.yy522; break; - case 235: /* exprlist ::= expritem */ + case 236: /* exprlist ::= expritem */ {yylhsminor.yy522 = tSqlExprListAppend(0,yymsp[0].minor.yy326,0, 0);} yymsp[0].minor.yy522 = yylhsminor.yy522; break; - case 236: /* expritem ::= expr */ + case 237: /* expritem ::= expr */ {yylhsminor.yy326 = yymsp[0].minor.yy326;} yymsp[0].minor.yy326 = yylhsminor.yy326; break; - case 238: /* cmd ::= RESET QUERY CACHE */ + case 239: /* cmd ::= RESET QUERY CACHE */ { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 239: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 240: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 240: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 241: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3235,14 +3251,14 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 241: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 242: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 242: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 243: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3253,7 +3269,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 243: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 244: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3267,7 +3283,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 244: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 245: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; @@ -3279,14 +3295,14 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 245: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 246: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 246: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 247: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3297,14 +3313,14 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 247: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 248: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 248: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + case 249: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3315,7 +3331,7 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 249: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 250: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3329,13 +3345,13 @@ static YYACTIONTYPE yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 250: /* cmd ::= KILL CONNECTION INTEGER */ + case 251: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 251: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 252: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} break; - case 252: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 253: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} break; default: diff --git a/tests/script/general/parser/between_and.sim b/tests/script/general/parser/between_and.sim new file mode 100644 index 0000000000000000000000000000000000000000..2e031c4917cf396044a399493ef0be2849baa830 --- /dev/null +++ b/tests/script/general/parser/between_and.sim @@ -0,0 +1,165 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2 +system sh/exec.sh -n dnode1 -s start + +sleep 100 +sql connect +print ======================== dnode1 start + +$db = testdb + +sql create database $db +sql use $db + +sql create stable st2 (ts timestamp, f1 int, f2 float, f3 double, f4 bigint, f5 smallint, f6 tinyint, f7 bool, f8 binary(10), f9 nchar(10)) tags (id1 int, id2 float, id3 nchar(10), id4 double, id5 smallint, id6 bigint, id7 binary(10)) + +sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1"); +sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2"); +sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3"); +sql create table tb4 using st2 tags (4,4.0,"4",4.0,4,4,"4"); + +sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1") +sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2") +sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3") +sql insert into tb1 values (now+100s,4,4.0,4.0,4,4,4,true,"4","4") +sql insert into tb1 values (now+200s,4,4.0,4.0,4,4,4,true,"4","4") +sql insert into tb1 values (now+300s,4,4.0,4.0,4,4,4,true,"4","4") +sql insert into tb1 values (now+400s,4,4.0,4.0,4,4,4,true,"4","4") +sql insert into tb1 values (now+500s,4,4.0,4.0,4,4,4,true,"4","4") + +sql select tbname,id1 from st2; + +if $rows != 4 then + return -1 +endi + + +sql select * from st2; + +if $rows != 8 then + return -1 +endi + +sql select * from st2 where ts between now-50s and now+450s + +if $rows != 5 then + return -1 +endi + +sql select tbname,id1 from st2 where id1 between 2 and 3; + +if $rows != 2 then + return -1 +endi + +if $data00 != tb2 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data10 != tb3 then + return -1 +endi +if $data11 != 3 then + return -1 +endi + +sql select tbname,id2 from st2 where id2 between 2.0 and 3.0; + +if $rows != 2 then + return -1 +endi + +if $data00 != tb2 then + return -1 +endi +if $data01 != 2.00000 then + return -1 +endi +if $data10 != tb3 then + return -1 +endi +if $data11 != 3.00000 then + return -1 +endi + + +sql select tbname,id4 from st2 where id4 between 2.0 and 3.0; + +if $rows != 2 then + return -1 +endi + +if $data00 != tb2 then + return -1 +endi +if $data01 != 2.000000000 then + return -1 +endi +if $data10 != tb3 then + return -1 +endi +if $data11 != 3.000000000 then + return -1 +endi + + +sql select tbname,id5 from st2 where id5 between 2.0 and 3.0; + +if $rows != 2 then + return -1 +endi + +if $data00 != tb2 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data10 != tb3 then + return -1 +endi +if $data11 != 3 then + return -1 +endi + +sql select tbname,id6 from st2 where id6 between 2.0 and 3.0; + +if $rows != 2 then + return -1 +endi + +if $data00 != tb2 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data10 != tb3 then + return -1 +endi +if $data11 != 3 then + return -1 +endi + +sql select * from st2 where f1 between 2 and 3 and f2 between 2.0 and 3.0 and f3 between 2.0 and 3.0 and f4 between 2.0 and 3.0 and f5 between 2.0 and 3.0 and f6 between 2.0 and 3.0; + +if $rows != 2 then + return -1 +endi + +if $data01 != 2 then + return -1 +endi +if $data11 != 3 then + return -1 +endi + +sql_error select * from st2 where f7 between 2.0 and 3.0; +sql_error select * from st2 where f8 between 2.0 and 3.0; +sql_error select * from st2 where f9 between 2.0 and 3.0; + +system sh/exec.sh -n dnode1 -s stop -x SIGINT