From 0d0ba53546b48e79d877bd6e53b54a3837d101d7 Mon Sep 17 00:00:00 2001 From: Moritz Eyssen Date: Thu, 12 Oct 2017 19:18:38 +0200 Subject: [PATCH] Formatting and more tests --- src/parser/bison_parser.cpp | 2187 +++++++++++++++++---------------- src/parser/bison_parser.h | 5 +- src/parser/bison_parser.y | 2 +- test/queries/queries-good.sql | 3 + 4 files changed, 1122 insertions(+), 1075 deletions(-) diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 6cbaf04..8aafc9b 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -325,7 +325,8 @@ union HSQL_STYPE hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; - + + hsql::TableName table_name; hsql::TableRef* table; hsql::Expr* expr; hsql::OrderDescription* order; @@ -344,7 +345,7 @@ union HSQL_STYPE std::vector* expr_vec; std::vector* order_vec; -#line 348 "bison_parser.cpp" /* yacc.c:355 */ +#line 349 "bison_parser.cpp" /* yacc.c:355 */ }; typedef union HSQL_STYPE HSQL_STYPE; @@ -374,7 +375,7 @@ int hsql_parse (hsql::SQLParserResult* result, yyscan_t scanner); /* Copy the second part of user declarations. */ -#line 378 "bison_parser.cpp" /* yacc.c:358 */ +#line 379 "bison_parser.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -618,16 +619,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 52 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 574 +#define YYLAST 552 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 151 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 86 +#define YYNNTS 87 /* YYNRULES -- Number of rules. */ -#define YYNRULES 199 +#define YYNRULES 201 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 367 +#define YYNSTATES 371 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -686,26 +687,27 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 242, 242, 263, 264, 268, 272, 276, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 300, 301, 306, - 307, 311, 315, 327, 334, 337, 341, 353, 361, 365, - 375, 378, 391, 397, 403, 413, 414, 418, 419, 423, - 430, 431, 432, 433, 443, 447, 451, 463, 471, 483, - 489, 499, 500, 510, 519, 520, 524, 536, 537, 538, - 555, 556, 560, 561, 565, 575, 592, 596, 597, 598, - 602, 603, 607, 619, 620, 624, 628, 633, 634, 638, - 643, 647, 648, 651, 652, 656, 657, 661, 665, 666, - 667, 673, 674, 678, 679, 680, 687, 688, 692, 693, - 697, 704, 705, 706, 707, 708, 712, 713, 714, 715, - 716, 717, 718, 719, 720, 724, 725, 729, 730, 731, - 732, 733, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 751, 752, 756, 757, 758, 759, 764, - 766, 770, 771, 775, 776, 777, 778, 779, 780, 784, - 785, 789, 793, 797, 801, 802, 803, 804, 808, 809, - 810, 811, 815, 820, 821, 825, 829, 833, 845, 846, - 856, 857, 861, 862, 871, 872, 877, 887, 895, 896, - 901, 902, 906, 907, 915, 923, 933, 952, 953, 954, - 955, 956, 957, 958, 959, 964, 973, 974, 979, 980 + 0, 245, 245, 266, 267, 271, 275, 279, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 303, 304, 309, + 310, 314, 318, 330, 337, 340, 344, 356, 365, 369, + 379, 382, 396, 403, 410, 421, 422, 426, 427, 431, + 438, 439, 440, 441, 451, 457, 463, 471, 472, 481, + 490, 503, 510, 521, 522, 532, 541, 542, 546, 558, + 559, 560, 577, 578, 582, 583, 587, 597, 614, 618, + 619, 620, 624, 625, 629, 641, 642, 646, 650, 655, + 656, 660, 665, 669, 670, 673, 674, 678, 679, 683, + 687, 688, 689, 695, 696, 700, 701, 702, 709, 710, + 714, 715, 719, 726, 727, 728, 729, 730, 734, 735, + 736, 737, 738, 739, 740, 741, 742, 746, 747, 751, + 752, 753, 754, 755, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 773, 774, 778, 779, 780, + 781, 786, 788, 792, 793, 797, 798, 799, 800, 801, + 802, 806, 807, 811, 815, 819, 823, 824, 825, 826, + 830, 831, 832, 833, 837, 842, 843, 847, 851, 855, + 867, 868, 878, 879, 883, 884, 893, 894, 899, 910, + 919, 920, 925, 926, 930, 931, 939, 947, 957, 976, + 977, 978, 979, 980, 981, 982, 983, 988, 997, 998, + 1003, 1004 }; #endif @@ -738,12 +740,12 @@ static const char *const yytname[] = "prepare_statement", "prepare_target_query", "execute_statement", "import_statement", "import_file_type", "file_path", "show_statement", "create_statement", "opt_not_exists", "column_def_commalist", - "column_def", "column_type", "drop_statement", "delete_statement", - "truncate_statement", "insert_statement", "opt_column_list", - "update_statement", "update_clause_commalist", "update_clause", - "select_statement", "select_with_paren", "select_paren_or_clause", - "select_no_paren", "set_operator", "set_type", "opt_all", - "select_clause", "opt_distinct", "select_list", "from_clause", + "column_def", "column_type", "drop_statement", "opt_exists", + "delete_statement", "truncate_statement", "insert_statement", + "opt_column_list", "update_statement", "update_clause_commalist", + "update_clause", "select_statement", "select_with_paren", + "select_paren_or_clause", "select_no_paren", "set_operator", "set_type", + "opt_all", "select_clause", "opt_distinct", "select_list", "from_clause", "opt_where", "opt_group", "opt_having", "opt_order", "order_list", "order_desc", "opt_order_type", "opt_top", "opt_limit", "expr_list", "literal_list", "expr_alias", "expr", "operand", "scalar_expr", @@ -782,57 +784,58 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -231 +#define YYPACT_NINF -232 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-231))) + (!!((Yystate) == (-232))) -#define YYTABLE_NINF -195 +#define YYTABLE_NINF -197 #define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-195))) + (!!((Yytable_value) == (-197))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - 231, -3, 32, 33, 50, -30, 15, 22, 10, 34, - 32, -28, 9, -34, 115, 16, -231, 66, 66, -231, - -231, -231, -231, -231, -231, -231, -231, -231, -231, 20, - -231, 12, 160, 23, -231, 24, 96, 68, 68, 32, - 94, 32, 206, 205, 112, -231, 32, 32, 32, -231, - 78, 83, -231, 231, -231, 150, -231, -231, -231, -231, - -231, -34, 134, 125, -34, 178, -231, 242, 7, 245, - 141, 32, 32, 184, -231, 179, 123, -231, -231, -231, - 81, 257, -231, -231, -231, -231, -231, -231, 126, -231, - 210, -231, -231, -231, 81, 210, 206, -231, -231, -231, - -231, -231, -231, 29, -231, -231, -231, -231, -231, -231, - -231, -231, 232, -64, 123, 81, -231, 275, 278, -17, - 8, 133, 195, 146, 139, 177, -231, 70, 213, 148, - -231, 74, 211, -231, -231, -231, -231, -231, -231, -231, - -231, -231, -231, -231, -231, -231, -231, 169, -50, -231, - 295, 178, 152, -231, -59, 178, 259, -231, 7, -231, - 191, 304, 194, -53, 225, -231, -231, 48, 166, -231, - 2, 4, 268, 81, 173, 177, 377, 81, 149, 180, - -76, 13, 184, 81, -231, 81, 320, 81, -231, -231, - 177, -231, 177, -63, 176, 14, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 206, 81, 257, -231, 185, 54, -231, -231, 81, -231, - -231, -231, -231, 206, -231, 252, -6, 56, -231, -34, - 32, -231, 322, 7, -231, 81, -231, -231, 187, -39, - 268, 246, -32, -231, -231, -34, -231, 40, -231, -231, - 6, -231, 282, -231, -231, -231, 236, 318, 405, 177, - 198, 70, -231, 256, 212, 405, 405, 405, 431, 431, - 431, 431, 149, 149, -91, -91, -91, 30, 214, -53, - -231, 7, -231, 295, -231, -231, 275, -231, -231, -231, - -231, -231, -231, 304, -231, -231, -231, 60, 64, -231, - 177, 215, -231, 219, 270, -231, -231, -231, 289, 291, - 13, 280, -231, 253, -231, 177, 405, 70, 221, 65, - -231, -231, 76, -231, -231, -231, -231, -231, 274, -231, - 6, 13, -231, -231, 175, 220, 13, 81, 377, 224, - 93, -231, -231, -231, 177, -231, -231, -231, 13, 244, - -5, -231, -231, 344, 175, 226, 81, 81, -231, -231, - 5, -53, -231, -53, 227, 229, -231 + 268, 42, 35, 73, 110, -43, -30, 39, 41, 32, + 35, 30, 11, -39, 147, 3, -232, 82, 82, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, 28, + -232, 27, 169, 49, -232, 56, 126, 100, 100, 35, + 117, 35, 226, 205, 123, -232, 128, 128, 35, -232, + 101, 103, -232, 268, -232, 170, -232, -232, -232, -232, + -232, -39, 152, 144, -39, 194, -232, 258, 14, 261, + 159, 35, 35, 196, -232, 190, 127, -232, -232, -232, + 151, 270, 231, 35, 35, -232, -232, -232, -232, 131, + -232, 212, -232, -232, -232, 151, 212, 226, -232, -232, + -232, -232, -232, -232, -44, -232, -232, -232, -232, -232, + -232, -232, -232, 241, -56, 127, 151, -232, 280, 279, + -16, -84, 140, 188, 155, 161, 75, -232, 113, 213, + 157, -232, 65, 211, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, 181, -61, + -232, -232, -232, -232, 306, 194, 164, -232, -46, 194, + 264, -232, 14, -232, 202, 315, 207, -78, 234, -232, + -232, -37, 179, -232, 2, 5, 276, 151, 185, 75, + 381, 151, 99, 180, -86, 4, 196, 151, -232, 151, + 324, 151, -232, -232, 75, -232, 75, -47, 186, -62, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 226, 151, 270, -232, 187, 34, + -232, -232, 151, -232, -232, -232, -232, 226, -232, 253, + 7, 48, -232, -39, 35, -232, 331, 14, -232, 151, + -232, -232, 192, -50, 276, 254, 26, -232, -232, -39, + -232, 24, -232, -232, 10, -232, 283, -232, -232, -232, + 256, 322, 409, 75, 210, 113, -232, 266, 217, 409, + 409, 409, 235, 235, 235, 235, 99, 99, -95, -95, + -95, 50, 218, -78, -232, 14, -232, 306, -232, -232, + 280, -232, -232, -232, -232, -232, -232, 315, -232, -232, + -232, 53, 59, -232, 75, 224, -232, 233, 277, -232, + -232, -232, 309, 312, 4, 295, -232, 267, -232, 75, + 409, 113, 238, 60, -232, -232, 69, -232, -232, -232, + -232, -232, 278, -232, 10, 4, -232, -232, 229, 236, + 4, 151, 381, 240, 78, -232, -232, -232, 75, -232, + -232, -232, 4, 142, -27, -232, -232, 348, 229, 243, + 151, 151, -232, -232, 6, -78, -232, -78, 242, 244, + -232 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -840,71 +843,72 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 0, 0, 0, 0, 0, 197, 3, 18, 18, 16, - 9, 7, 10, 15, 12, 13, 11, 14, 8, 57, - 58, 84, 0, 178, 48, 25, 0, 36, 36, 0, - 0, 0, 0, 74, 0, 177, 0, 0, 0, 30, - 0, 0, 1, 196, 2, 0, 6, 5, 68, 69, - 67, 0, 71, 0, 0, 95, 46, 0, 0, 0, - 0, 0, 0, 78, 28, 0, 52, 165, 91, 73, - 0, 0, 44, 45, 31, 61, 60, 4, 0, 62, - 84, 63, 70, 66, 0, 84, 0, 64, 179, 162, - 163, 166, 167, 0, 98, 158, 159, 164, 160, 161, - 24, 23, 0, 0, 52, 0, 47, 0, 0, 0, - 154, 0, 0, 0, 0, 0, 156, 0, 0, 75, - 96, 183, 101, 108, 109, 110, 103, 105, 111, 104, - 122, 112, 113, 107, 102, 115, 116, 0, 78, 54, - 0, 95, 83, 85, 90, 95, 93, 26, 0, 35, - 0, 0, 0, 77, 0, 29, 198, 0, 0, 50, - 74, 0, 0, 0, 0, 0, 118, 0, 117, 0, - 0, 0, 78, 0, 181, 0, 0, 0, 182, 100, - 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, + 0, 0, 0, 0, 0, 199, 3, 18, 18, 16, + 9, 7, 10, 15, 12, 13, 11, 14, 8, 59, + 60, 86, 0, 180, 50, 25, 0, 36, 36, 0, + 0, 0, 0, 76, 0, 179, 48, 48, 0, 30, + 0, 0, 1, 198, 2, 0, 6, 5, 70, 71, + 69, 0, 73, 0, 0, 97, 46, 0, 0, 0, + 0, 0, 0, 80, 28, 0, 54, 167, 93, 75, + 0, 0, 0, 0, 0, 31, 63, 62, 4, 0, + 64, 86, 65, 72, 68, 0, 86, 0, 66, 181, + 164, 165, 168, 169, 0, 100, 160, 161, 166, 162, + 163, 24, 23, 0, 0, 54, 0, 49, 0, 0, + 0, 156, 0, 0, 0, 0, 0, 158, 0, 0, + 77, 98, 185, 103, 110, 111, 112, 105, 107, 113, + 106, 124, 114, 115, 109, 104, 117, 118, 0, 80, + 56, 47, 44, 45, 0, 97, 85, 87, 92, 97, + 95, 26, 0, 35, 0, 0, 0, 79, 0, 29, + 200, 0, 0, 52, 76, 0, 0, 0, 0, 0, + 120, 0, 119, 0, 0, 0, 80, 0, 183, 0, + 0, 0, 184, 102, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 53, 21, 0, 19, 59, 0, 89, - 88, 87, 65, 0, 99, 0, 0, 0, 37, 0, - 0, 51, 0, 0, 149, 0, 155, 157, 0, 0, - 0, 0, 0, 114, 106, 0, 76, 168, 170, 172, - 183, 171, 80, 97, 133, 180, 134, 0, 129, 0, - 0, 0, 120, 0, 132, 131, 143, 144, 145, 146, - 147, 148, 124, 123, 126, 125, 127, 128, 0, 56, - 55, 0, 17, 0, 86, 94, 0, 41, 42, 43, - 40, 39, 33, 0, 34, 27, 199, 0, 0, 141, - 0, 0, 151, 0, 0, 193, 187, 188, 192, 191, - 0, 0, 176, 0, 72, 0, 130, 0, 0, 0, - 121, 152, 0, 20, 32, 38, 49, 150, 0, 142, - 183, 0, 190, 189, 174, 169, 0, 0, 153, 0, - 0, 137, 135, 22, 0, 139, 173, 184, 0, 194, - 82, 138, 136, 0, 175, 0, 0, 0, 79, 140, - 0, 195, 185, 81, 154, 0, 186 + 0, 0, 0, 0, 0, 0, 0, 55, 21, 0, + 19, 61, 0, 91, 90, 89, 67, 0, 101, 0, + 0, 0, 37, 0, 0, 53, 0, 0, 151, 0, + 157, 159, 0, 0, 0, 0, 0, 116, 108, 0, + 78, 170, 172, 174, 185, 173, 82, 99, 135, 182, + 136, 0, 131, 0, 0, 0, 122, 0, 134, 133, + 145, 146, 147, 148, 149, 150, 126, 125, 128, 127, + 129, 130, 0, 58, 57, 0, 17, 0, 88, 96, + 0, 41, 42, 43, 40, 39, 33, 0, 34, 27, + 201, 0, 0, 143, 0, 0, 153, 0, 0, 195, + 189, 190, 194, 193, 0, 0, 178, 0, 74, 0, + 132, 0, 0, 0, 123, 154, 0, 20, 32, 38, + 51, 152, 0, 144, 185, 0, 192, 191, 176, 171, + 0, 0, 155, 0, 0, 139, 137, 22, 0, 141, + 175, 186, 0, 196, 84, 140, 138, 0, 177, 0, + 0, 0, 81, 142, 0, 197, 187, 83, 156, 0, + 188 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -231, -231, -231, 307, -231, 354, -231, 90, -231, -231, - -231, -231, -231, 91, -231, -231, 340, -231, 87, -231, - -231, -231, -231, -231, 267, -231, -231, 170, -140, 52, - 321, -13, 353, -231, -231, 190, 216, -231, -231, -121, - -231, -231, 72, -231, 172, -231, -231, 41, -171, -203, - 204, -93, -68, -231, -231, -231, -231, -231, -231, -231, - -231, -231, -231, -231, -231, 28, -65, -112, -231, -38, - -231, -231, -231, -149, 62, -231, -231, -231, 0, -231, - -230, -231, -231, -231, -231, -231 + -232, -232, -232, 338, -232, 374, -232, 107, -232, -232, + -232, -232, -232, 105, -232, -232, 359, -232, 102, -232, + -232, 351, -232, -232, -232, 285, -232, -232, 189, -64, + 13, 337, -13, 378, -232, -232, 182, 246, -232, -232, + -128, -232, -232, 91, -232, 200, -232, -232, -68, -175, + -220, 245, -94, -71, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, 61, -66, -113, -232, + -38, -232, -232, -232, -162, 88, -232, -232, -232, 1, + -232, -231, -232, -232, -232, -232, -232 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 14, 15, 16, 17, 56, 215, 216, 18, 111, - 19, 20, 75, 164, 21, 22, 71, 227, 228, 291, - 23, 24, 25, 26, 119, 27, 148, 149, 28, 29, - 90, 30, 61, 62, 93, 31, 80, 128, 182, 116, - 314, 358, 65, 152, 153, 221, 43, 97, 129, 103, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 105, 106, 107, - 108, 109, 246, 247, 248, 335, 249, 44, 250, 188, - 189, 251, 311, 362, 54, 167 + -1, 14, 15, 16, 17, 56, 219, 220, 18, 112, + 19, 20, 75, 168, 21, 22, 71, 231, 232, 295, + 23, 83, 24, 25, 26, 120, 27, 149, 150, 28, + 29, 91, 30, 61, 62, 94, 31, 80, 129, 186, + 117, 318, 362, 65, 156, 157, 225, 43, 98, 130, + 104, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 106, 107, + 108, 109, 110, 250, 251, 252, 339, 253, 44, 254, + 192, 193, 255, 315, 366, 54, 171 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -912,126 +916,122 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 51, 154, 34, 104, 78, 165, 242, 236, 364, 184, - 45, 99, 100, 77, 79, 9, 33, 160, 219, 287, - 312, 58, 163, 115, 32, 259, 185, 213, 48, 58, - 297, 288, 9, 196, 180, 33, 35, 357, 168, 73, - 37, 76, 46, 185, 220, 187, 82, 83, 84, 185, - 209, 59, 210, 36, 260, 176, 300, 178, 156, 59, - 49, 252, 187, 185, 298, 50, 304, 38, 187, 47, - 244, 113, 114, 120, 99, 100, 77, 184, 322, 63, - 239, 161, 187, 60, 120, 99, 100, 77, 289, 294, - 319, 60, 254, 224, 256, 41, 39, 101, 305, 212, - 346, 290, 306, 40, 262, 303, 169, 176, 307, 308, - 121, 13, 302, 89, 179, 52, 89, 183, 279, 9, - 186, 121, 257, 263, 258, 154, -194, 309, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 237, 126, 183, 122, 340, 42, 234, 120, - 99, 100, 77, 170, 196, 171, 122, 102, 245, 238, - 101, 334, 151, 66, 53, 55, 350, 155, 104, 68, - 67, 101, 278, 210, 165, 157, 185, 69, 158, 123, - 120, 99, 100, 77, 70, 285, 174, 349, 186, 310, - 123, 316, 217, 124, 231, 187, 222, 232, 74, 354, - 282, 304, 292, 283, 124, 293, 326, 125, 126, 158, - 327, 342, 77, 183, 183, 127, 104, 79, 125, 126, - 102, 122, 343, 81, 85, 158, 127, 301, 190, 86, - 295, 102, 328, 305, 88, 92, 101, 306, 1, 352, - 94, 96, 183, 307, 308, 98, 2, 338, 318, 110, - 112, 91, 122, 3, 91, 175, 191, 115, 4, 117, - 147, -194, 309, 361, 363, 5, 6, 101, 118, 124, - 304, 150, 159, 196, 7, 8, 353, 63, 172, 99, - 9, 166, 177, 125, 126, 10, 175, 206, 207, 208, - 209, 127, 210, 173, 181, 211, 102, 183, 214, 192, - 124, 218, 305, 225, 339, 223, 306, 226, 229, 11, - 230, 233, 307, 308, 125, 126, 355, 9, 240, 191, - 193, 261, 127, 255, 12, 296, 243, 102, 194, 195, - 281, 309, 286, 299, 259, 196, 197, 198, 185, 199, - 200, 201, 313, 317, 202, 203, 320, 204, 205, 206, - 207, 208, 209, 344, 210, 210, 331, 332, 321, 333, - 87, 329, 192, 191, 356, 330, 336, 341, 337, 348, - 351, 360, 57, 323, 171, 366, 13, 324, 72, 345, - 325, 162, 280, 241, 64, 95, 235, 253, 365, 191, - 284, 0, 195, 347, 0, 0, 0, 0, 196, 197, - 198, 0, 199, 200, 201, 0, 192, 202, 203, 0, - 204, 205, 206, 207, 208, 209, 0, 210, 0, 0, - 315, 0, 191, 0, 0, 0, 0, 241, 0, 0, - 0, 0, 192, 0, 0, 0, 195, 0, 0, 0, - 0, 0, 196, 197, 198, 0, 199, 200, 201, 359, - 191, 202, 203, 241, 204, 205, 206, 207, 208, 209, - 0, 210, 195, 0, 0, 192, 0, 0, 196, 197, - 198, 0, 199, 200, 201, 0, 191, 202, 203, 0, - 204, 205, 206, 207, 208, 209, 241, 210, 0, 0, - 0, 0, 0, -195, 0, 195, 0, 0, 0, 0, - 0, 196, 197, 198, 0, 199, 200, 201, 0, 0, - 202, 203, 0, 204, 205, 206, 207, 208, 209, 0, - 210, 0, 0, 195, 0, 0, 0, 0, 0, 196, - -195, -195, 0, -195, 200, 201, 0, 0, 202, 203, - 0, 204, 205, 206, 207, 208, 209, 0, 210, 195, - 0, 0, 0, 0, 0, 196, 0, 0, 0, 0, - -195, -195, 0, 0, -195, -195, 0, 204, 205, 206, - 207, 208, 209, 0, 210 + 51, 158, 105, 34, 78, 169, 246, 33, 240, 368, + 9, 45, 116, 188, 79, 361, 189, 301, 100, 101, + 77, 217, 167, 316, 189, 164, 50, 37, 266, 200, + 48, 223, 291, 9, 184, 191, 58, 58, 33, 172, + 73, 263, 76, 191, 292, 304, 213, 267, 214, 85, + 308, 39, 189, 180, 38, 182, 189, 224, 256, 160, + 248, 174, 49, 175, 302, 326, 59, 59, 188, 32, + 264, 191, 114, 115, 90, 191, 35, 90, 121, 100, + 101, 77, 309, 243, 152, 153, 310, 221, 216, 165, + 323, 226, 311, 312, 63, 258, 228, 260, 60, 60, + 46, 293, 161, 350, 102, 162, 13, 173, 180, 235, + -196, 313, 236, 36, 294, 183, 121, 100, 101, 77, + 40, 283, 187, 261, 190, 262, 41, 47, 158, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 241, 127, 42, 344, 52, 238, 249, + 123, 53, 338, 122, 121, 100, 101, 77, 121, 100, + 101, 77, 9, 242, 103, 102, 354, 189, 308, 298, + 306, 105, 66, 314, 200, 187, 282, 169, 353, 190, + 286, 55, 155, 287, 179, 307, 191, 159, 123, 289, + 358, 122, 320, 214, 296, 178, 67, 297, 125, 330, + 309, 68, 162, 102, 310, 331, 346, 69, 187, 187, + 311, 312, 126, 127, 359, 347, 70, 79, 162, 105, + 128, 74, 124, 200, 356, 103, 123, 187, 194, 313, + 123, 305, 77, 332, 81, 299, 125, 210, 211, 212, + 213, 102, 214, 92, 82, 102, 92, 86, 342, 87, + 126, 127, 322, 93, 89, 308, 195, 97, 128, 95, + 124, 99, 360, 103, 179, 111, 365, 367, 113, 116, + 118, 151, 119, 148, 125, 1, 154, 357, 125, 63, + 195, 163, 170, 2, 100, 176, 177, 309, 126, 127, + 3, 310, 126, 127, 185, 4, 128, 311, 312, 196, + 128, 103, 5, 6, 181, 103, 187, 215, 343, 218, + 227, 7, 8, 222, 229, -196, 313, 9, 230, 234, + 197, 233, 10, 195, 237, 9, 247, 259, 198, 199, + 244, 265, 285, 290, 300, 200, 201, 202, 303, 203, + 204, 205, 263, 317, 206, 207, 11, 208, 209, 210, + 211, 212, 213, 199, 214, 321, 324, 348, 189, 200, + 214, 12, 325, 335, -197, -197, 196, 195, -197, -197, + 333, 208, 209, 210, 211, 212, 213, 336, 214, 334, + 337, 340, 341, 349, 345, 352, 355, 245, 364, 175, + 370, 88, 57, 195, 327, 328, 199, 72, 84, 329, + 166, 96, 200, 201, 202, 284, 203, 204, 205, 64, + 196, 206, 207, 13, 208, 209, 210, 211, 212, 213, + 239, 214, 288, 351, 319, 369, 195, 0, 0, 0, + 0, 245, 257, 0, 0, 0, 196, 0, 0, 0, + 199, 0, 0, 0, 0, 0, 200, 201, 202, 0, + 203, 204, 205, 363, 195, 206, 207, 245, 208, 209, + 210, 211, 212, 213, 0, 214, 199, 0, 0, 196, + 0, 0, 200, 201, 202, 0, 203, 204, 205, 0, + 0, 206, 207, 0, 208, 209, 210, 211, 212, 213, + 245, 214, 0, 0, 0, 0, 0, -197, 0, 199, + 0, 0, 0, 0, 0, 200, 201, 202, 0, 203, + 204, 205, 0, 0, 206, 207, 0, 208, 209, 210, + 211, 212, 213, 0, 214, 0, 0, 199, 0, 0, + 0, 0, 0, 200, -197, -197, 0, -197, 204, 205, + 0, 0, 206, 207, 0, 208, 209, 210, 211, 212, + 213, 0, 214 }; static const yytype_int16 yycheck[] = { - 13, 94, 2, 68, 42, 117, 177, 3, 3, 3, - 10, 4, 5, 6, 12, 49, 3, 81, 77, 25, - 250, 9, 115, 73, 27, 88, 102, 148, 19, 9, - 233, 37, 49, 124, 127, 3, 3, 42, 55, 39, - 70, 41, 70, 102, 103, 121, 46, 47, 48, 102, - 141, 39, 143, 3, 117, 123, 95, 125, 96, 39, - 51, 182, 121, 102, 235, 13, 26, 97, 121, 97, - 146, 71, 72, 3, 4, 5, 6, 3, 281, 67, - 173, 145, 121, 71, 3, 4, 5, 6, 94, 229, - 261, 71, 185, 158, 187, 85, 81, 90, 58, 149, - 330, 107, 62, 81, 90, 245, 119, 175, 68, 69, - 40, 145, 144, 61, 127, 0, 64, 149, 211, 49, - 114, 40, 190, 109, 192, 218, 86, 87, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 138, 138, 149, 75, 317, 113, 146, 3, - 4, 5, 6, 145, 124, 147, 75, 150, 145, 172, - 90, 310, 90, 3, 148, 99, 337, 95, 233, 145, - 147, 90, 210, 143, 286, 146, 102, 81, 149, 109, - 3, 4, 5, 6, 116, 223, 40, 336, 114, 149, - 109, 259, 151, 123, 146, 121, 155, 149, 104, 348, - 146, 26, 146, 149, 123, 149, 146, 137, 138, 149, - 146, 146, 6, 149, 149, 145, 281, 12, 137, 138, - 150, 75, 146, 111, 146, 149, 145, 240, 17, 146, - 230, 150, 300, 58, 84, 101, 90, 62, 7, 146, - 115, 63, 149, 68, 69, 3, 15, 315, 261, 4, - 109, 61, 75, 22, 64, 109, 45, 73, 27, 80, - 3, 86, 87, 356, 357, 34, 35, 90, 145, 123, - 26, 145, 40, 124, 43, 44, 344, 67, 145, 4, - 49, 3, 143, 137, 138, 54, 109, 138, 139, 140, - 141, 145, 143, 98, 81, 126, 150, 149, 3, 88, - 123, 149, 58, 112, 317, 46, 62, 3, 114, 78, - 85, 145, 68, 69, 137, 138, 72, 49, 145, 45, - 109, 145, 145, 3, 93, 3, 146, 150, 117, 118, - 145, 87, 80, 146, 88, 124, 125, 126, 102, 128, - 129, 130, 60, 145, 133, 134, 90, 136, 137, 138, - 139, 140, 141, 79, 143, 143, 86, 68, 144, 68, - 53, 146, 88, 45, 120, 146, 86, 146, 115, 149, - 146, 145, 18, 283, 147, 146, 145, 286, 38, 105, - 293, 114, 212, 109, 31, 64, 170, 183, 360, 45, - 218, -1, 118, 331, -1, -1, -1, -1, 124, 125, - 126, -1, 128, 129, 130, -1, 88, 133, 134, -1, - 136, 137, 138, 139, 140, 141, -1, 143, -1, -1, - 102, -1, 45, -1, -1, -1, -1, 109, -1, -1, - -1, -1, 88, -1, -1, -1, 118, -1, -1, -1, - -1, -1, 124, 125, 126, -1, 128, 129, 130, 105, - 45, 133, 134, 109, 136, 137, 138, 139, 140, 141, - -1, 143, 118, -1, -1, 88, -1, -1, 124, 125, - 126, -1, 128, 129, 130, -1, 45, 133, 134, -1, - 136, 137, 138, 139, 140, 141, 109, 143, -1, -1, - -1, -1, -1, 88, -1, 118, -1, -1, -1, -1, - -1, 124, 125, 126, -1, 128, 129, 130, -1, -1, - 133, 134, -1, 136, 137, 138, 139, 140, 141, -1, - 143, -1, -1, 118, -1, -1, -1, -1, -1, 124, - 125, 126, -1, 128, 129, 130, -1, -1, 133, 134, - -1, 136, 137, 138, 139, 140, 141, -1, 143, 118, - -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, + 13, 95, 68, 2, 42, 118, 181, 3, 3, 3, + 49, 10, 73, 3, 12, 42, 102, 237, 4, 5, + 6, 149, 116, 254, 102, 81, 13, 70, 90, 124, + 19, 77, 25, 49, 128, 121, 9, 9, 3, 55, + 39, 88, 41, 121, 37, 95, 141, 109, 143, 48, + 26, 81, 102, 124, 97, 126, 102, 103, 186, 97, + 146, 145, 51, 147, 239, 285, 39, 39, 3, 27, + 117, 121, 71, 72, 61, 121, 3, 64, 3, 4, + 5, 6, 58, 177, 83, 84, 62, 155, 149, 145, + 265, 159, 68, 69, 67, 189, 162, 191, 71, 71, + 70, 94, 146, 334, 90, 149, 145, 120, 179, 146, + 86, 87, 149, 3, 107, 128, 3, 4, 5, 6, + 81, 215, 149, 194, 114, 196, 85, 97, 222, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 138, 138, 113, 321, 0, 146, 145, + 75, 148, 314, 40, 3, 4, 5, 6, 3, 4, + 5, 6, 49, 176, 150, 90, 341, 102, 26, 233, + 144, 237, 3, 149, 124, 149, 214, 290, 340, 114, + 146, 99, 91, 149, 109, 249, 121, 96, 75, 227, + 352, 40, 263, 143, 146, 40, 147, 149, 123, 146, + 58, 145, 149, 90, 62, 146, 146, 81, 149, 149, + 68, 69, 137, 138, 72, 146, 116, 12, 149, 285, + 145, 104, 109, 124, 146, 150, 75, 149, 17, 87, + 75, 244, 6, 304, 111, 234, 123, 138, 139, 140, + 141, 90, 143, 61, 116, 90, 64, 146, 319, 146, + 137, 138, 265, 101, 84, 26, 45, 63, 145, 115, + 109, 3, 120, 150, 109, 4, 360, 361, 109, 73, + 80, 40, 145, 3, 123, 7, 145, 348, 123, 67, + 45, 40, 3, 15, 4, 145, 98, 58, 137, 138, + 22, 62, 137, 138, 81, 27, 145, 68, 69, 88, + 145, 150, 34, 35, 143, 150, 149, 126, 321, 3, + 46, 43, 44, 149, 112, 86, 87, 49, 3, 85, + 109, 114, 54, 45, 145, 49, 146, 3, 117, 118, + 145, 145, 145, 80, 3, 124, 125, 126, 146, 128, + 129, 130, 88, 60, 133, 134, 78, 136, 137, 138, + 139, 140, 141, 118, 143, 145, 90, 79, 102, 124, + 143, 93, 144, 86, 129, 130, 88, 45, 133, 134, + 146, 136, 137, 138, 139, 140, 141, 68, 143, 146, + 68, 86, 115, 105, 146, 149, 146, 109, 145, 147, + 146, 53, 18, 45, 287, 290, 118, 38, 47, 297, + 115, 64, 124, 125, 126, 216, 128, 129, 130, 31, + 88, 133, 134, 145, 136, 137, 138, 139, 140, 141, + 174, 143, 222, 335, 102, 364, 45, -1, -1, -1, + -1, 109, 187, -1, -1, -1, 88, -1, -1, -1, + 118, -1, -1, -1, -1, -1, 124, 125, 126, -1, + 128, 129, 130, 105, 45, 133, 134, 109, 136, 137, + 138, 139, 140, 141, -1, 143, 118, -1, -1, 88, + -1, -1, 124, 125, 126, -1, 128, 129, 130, -1, + -1, 133, 134, -1, 136, 137, 138, 139, 140, 141, + 109, 143, -1, -1, -1, -1, -1, 88, -1, 118, + -1, -1, -1, -1, -1, 124, 125, 126, -1, 128, 129, 130, -1, -1, 133, 134, -1, 136, 137, 138, - 139, 140, 141, -1, 143 + 139, 140, 141, -1, 143, -1, -1, 118, -1, -1, + -1, -1, -1, 124, 125, 126, -1, 128, 129, 130, + -1, -1, 133, 134, -1, 136, 137, 138, 139, 140, + 141, -1, 143 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1040,41 +1040,42 @@ static const yytype_uint8 yystos[] = { 0, 7, 15, 22, 27, 34, 35, 43, 44, 49, 54, 78, 93, 145, 152, 153, 154, 155, 159, 161, - 162, 165, 166, 171, 172, 173, 174, 176, 179, 180, - 182, 186, 27, 3, 229, 3, 3, 70, 97, 81, - 81, 85, 113, 197, 228, 229, 70, 97, 19, 51, - 180, 182, 0, 148, 235, 99, 156, 156, 9, 39, - 71, 183, 184, 67, 183, 193, 3, 147, 145, 81, - 116, 167, 167, 229, 104, 163, 229, 6, 220, 12, - 187, 111, 229, 229, 229, 146, 146, 154, 84, 180, - 181, 186, 101, 185, 115, 181, 63, 198, 3, 4, - 5, 90, 150, 200, 217, 218, 219, 220, 221, 222, - 4, 160, 109, 229, 229, 73, 190, 80, 145, 175, - 3, 40, 75, 109, 123, 137, 138, 145, 188, 199, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 3, 177, 178, - 145, 193, 194, 195, 202, 193, 220, 146, 149, 40, - 81, 145, 175, 202, 164, 218, 3, 236, 55, 182, - 145, 147, 145, 98, 40, 109, 203, 143, 203, 182, - 202, 81, 189, 149, 3, 102, 114, 121, 230, 231, - 17, 45, 88, 109, 117, 118, 124, 125, 126, 128, - 129, 130, 133, 134, 136, 137, 138, 139, 140, 141, - 143, 126, 149, 190, 3, 157, 158, 198, 149, 77, - 103, 196, 198, 46, 217, 112, 3, 168, 169, 114, - 85, 146, 149, 145, 146, 187, 3, 138, 182, 202, - 145, 109, 199, 146, 146, 145, 223, 224, 225, 227, - 229, 232, 190, 201, 202, 3, 202, 203, 203, 88, - 117, 145, 90, 109, 203, 203, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 203, 203, 220, 202, - 178, 145, 146, 149, 195, 220, 80, 25, 37, 94, - 107, 170, 146, 149, 179, 229, 3, 200, 199, 146, - 95, 182, 144, 179, 26, 58, 62, 68, 69, 87, - 149, 233, 231, 60, 191, 102, 203, 145, 182, 199, - 90, 144, 200, 158, 164, 169, 146, 146, 203, 146, - 146, 86, 68, 68, 224, 226, 86, 115, 203, 182, - 199, 146, 146, 146, 79, 105, 231, 225, 149, 224, - 199, 146, 146, 203, 224, 72, 120, 42, 192, 105, - 145, 202, 234, 202, 3, 216, 146 + 162, 165, 166, 171, 173, 174, 175, 177, 180, 181, + 183, 187, 27, 3, 230, 3, 3, 70, 97, 81, + 81, 85, 113, 198, 229, 230, 70, 97, 19, 51, + 181, 183, 0, 148, 236, 99, 156, 156, 9, 39, + 71, 184, 185, 67, 184, 194, 3, 147, 145, 81, + 116, 167, 167, 230, 104, 163, 230, 6, 221, 12, + 188, 111, 116, 172, 172, 230, 146, 146, 154, 84, + 181, 182, 187, 101, 186, 115, 182, 63, 199, 3, + 4, 5, 90, 150, 201, 218, 219, 220, 221, 222, + 223, 4, 160, 109, 230, 230, 73, 191, 80, 145, + 176, 3, 40, 75, 109, 123, 137, 138, 145, 189, + 200, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 3, 178, + 179, 40, 230, 230, 145, 194, 195, 196, 203, 194, + 221, 146, 149, 40, 81, 145, 176, 203, 164, 219, + 3, 237, 55, 183, 145, 147, 145, 98, 40, 109, + 204, 143, 204, 183, 203, 81, 190, 149, 3, 102, + 114, 121, 231, 232, 17, 45, 88, 109, 117, 118, + 124, 125, 126, 128, 129, 130, 133, 134, 136, 137, + 138, 139, 140, 141, 143, 126, 149, 191, 3, 157, + 158, 199, 149, 77, 103, 197, 199, 46, 218, 112, + 3, 168, 169, 114, 85, 146, 149, 145, 146, 188, + 3, 138, 183, 203, 145, 109, 200, 146, 146, 145, + 224, 225, 226, 228, 230, 233, 191, 202, 203, 3, + 203, 204, 204, 88, 117, 145, 90, 109, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, + 204, 204, 221, 203, 179, 145, 146, 149, 196, 221, + 80, 25, 37, 94, 107, 170, 146, 149, 180, 230, + 3, 201, 200, 146, 95, 183, 144, 180, 26, 58, + 62, 68, 69, 87, 149, 234, 232, 60, 192, 102, + 204, 145, 183, 200, 90, 144, 201, 158, 164, 169, + 146, 146, 204, 146, 146, 86, 68, 68, 225, 227, + 86, 115, 204, 183, 200, 146, 146, 146, 79, 105, + 232, 226, 149, 225, 200, 146, 146, 204, 225, 72, + 120, 42, 193, 105, 145, 203, 235, 203, 3, 217, + 146 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -1084,22 +1085,23 @@ static const yytype_uint8 yyr1[] = 155, 155, 155, 155, 155, 155, 155, 156, 156, 157, 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, 165, 165, 166, 166, 166, 167, 167, 168, 168, 169, - 170, 170, 170, 170, 171, 171, 171, 172, 173, 174, - 174, 175, 175, 176, 177, 177, 178, 179, 179, 179, - 180, 180, 181, 181, 182, 182, 183, 184, 184, 184, - 185, 185, 186, 187, 187, 188, 189, 190, 190, 191, - 191, 192, 192, 193, 193, 194, 194, 195, 196, 196, - 196, 197, 197, 198, 198, 198, 199, 199, 200, 200, - 201, 202, 202, 202, 202, 202, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 204, 204, 205, 205, 205, - 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 207, 207, 208, 208, 208, 208, 209, - 209, 210, 210, 211, 211, 211, 211, 211, 211, 212, - 212, 213, 214, 215, 216, 216, 216, 216, 217, 217, - 217, 217, 218, 219, 219, 220, 221, 222, 223, 223, - 224, 224, 225, 225, 226, 226, 227, 228, 229, 229, - 230, 230, 231, 231, 232, 232, 232, 233, 233, 233, - 233, 233, 233, 233, 233, 234, 235, 235, 236, 236 + 170, 170, 170, 170, 171, 171, 171, 172, 172, 173, + 174, 175, 175, 176, 176, 177, 178, 178, 179, 180, + 180, 180, 181, 181, 182, 182, 183, 183, 184, 185, + 185, 185, 186, 186, 187, 188, 188, 189, 190, 191, + 191, 192, 192, 193, 193, 194, 194, 195, 195, 196, + 197, 197, 197, 198, 198, 199, 199, 199, 200, 200, + 201, 201, 202, 203, 203, 203, 203, 203, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 205, 205, 206, + 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 208, 208, 209, 209, 209, + 209, 210, 210, 211, 211, 212, 212, 212, 212, 212, + 212, 213, 213, 214, 215, 216, 217, 217, 217, 217, + 218, 218, 218, 218, 219, 220, 220, 221, 222, 223, + 224, 224, 225, 225, 226, 226, 227, 227, 228, 229, + 230, 230, 231, 231, 232, 232, 233, 233, 233, 234, + 234, 234, 234, 234, 234, 234, 234, 235, 236, 236, + 237, 237 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1109,22 +1111,23 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 5, 0, 1, 3, 1, 4, 4, 1, 2, 5, 7, 1, 1, 2, 3, 8, 7, 7, 3, 0, 1, 3, 2, - 1, 1, 1, 1, 3, 3, 3, 4, 2, 8, - 5, 3, 0, 5, 1, 3, 3, 1, 1, 5, - 3, 3, 1, 1, 3, 5, 2, 1, 1, 1, - 1, 0, 7, 1, 0, 1, 2, 2, 0, 4, - 0, 2, 0, 3, 0, 1, 3, 2, 1, 1, - 0, 2, 0, 2, 4, 0, 1, 3, 1, 3, - 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 1, 2, 2, 2, - 3, 4, 1, 3, 3, 3, 3, 3, 3, 3, - 4, 3, 3, 3, 3, 5, 6, 5, 6, 6, - 8, 4, 5, 3, 3, 3, 3, 3, 3, 3, - 5, 4, 4, 5, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 1, 1, 4, 1, 3, 2, 1, 1, 3, - 2, 1, 1, 0, 4, 6, 8, 1, 1, 2, - 2, 1, 1, 1, 0, 1, 1, 0, 1, 3 + 1, 1, 1, 1, 4, 4, 3, 2, 0, 4, + 2, 8, 5, 3, 0, 5, 1, 3, 3, 1, + 1, 5, 3, 3, 1, 1, 3, 5, 2, 1, + 1, 1, 1, 0, 7, 1, 0, 1, 2, 2, + 0, 4, 0, 2, 0, 3, 0, 1, 3, 2, + 1, 1, 0, 2, 0, 2, 4, 0, 1, 3, + 1, 3, 2, 1, 1, 1, 1, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, + 2, 2, 3, 4, 1, 3, 3, 3, 3, 3, + 3, 3, 4, 3, 3, 3, 3, 5, 6, 5, + 6, 6, 8, 4, 5, 3, 3, 3, 3, 3, + 3, 3, 5, 4, 4, 5, 1, 3, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 1, 4, 1, 3, 2, 1, + 1, 3, 2, 1, 1, 0, 4, 6, 8, 1, + 1, 2, 2, 1, 1, 1, 0, 1, 1, 0, + 1, 3 }; @@ -1621,31 +1624,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio switch (yytype) { case 3: /* IDENTIFIER */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1627 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1630 "bison_parser.cpp" /* yacc.c:1257 */ break; case 4: /* STRING */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1633 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1636 "bison_parser.cpp" /* yacc.c:1257 */ break; case 5: /* FLOATVAL */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1639 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1642 "bison_parser.cpp" /* yacc.c:1257 */ break; case 6: /* INTVAL */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1645 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1648 "bison_parser.cpp" /* yacc.c:1257 */ break; case 153: /* statement_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).stmt_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { @@ -1654,23 +1657,23 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).stmt_vec)); } -#line 1658 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1661 "bison_parser.cpp" /* yacc.c:1257 */ break; case 154: /* statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1664 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1667 "bison_parser.cpp" /* yacc.c:1257 */ break; case 155: /* preparable_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1670 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1673 "bison_parser.cpp" /* yacc.c:1257 */ break; case 156: /* opt_hints */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1679,11 +1682,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1683 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1686 "bison_parser.cpp" /* yacc.c:1257 */ break; case 157: /* hint_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1692,71 +1695,71 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1696 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1699 "bison_parser.cpp" /* yacc.c:1257 */ break; case 158: /* hint */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1702 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1705 "bison_parser.cpp" /* yacc.c:1257 */ break; case 159: /* prepare_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).prep_stmt)); } -#line 1708 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1711 "bison_parser.cpp" /* yacc.c:1257 */ break; case 160: /* prepare_target_query */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1714 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1717 "bison_parser.cpp" /* yacc.c:1257 */ break; case 161: /* execute_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).exec_stmt)); } -#line 1720 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1723 "bison_parser.cpp" /* yacc.c:1257 */ break; case 162: /* import_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).import_stmt)); } -#line 1726 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1729 "bison_parser.cpp" /* yacc.c:1257 */ break; case 163: /* import_file_type */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1732 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1735 "bison_parser.cpp" /* yacc.c:1257 */ break; case 164: /* file_path */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1738 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1741 "bison_parser.cpp" /* yacc.c:1257 */ break; case 165: /* show_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).show_stmt)); } -#line 1744 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1747 "bison_parser.cpp" /* yacc.c:1257 */ break; case 166: /* create_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).create_stmt)); } -#line 1750 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1753 "bison_parser.cpp" /* yacc.c:1257 */ break; case 167: /* opt_not_exists */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1756 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1759 "bison_parser.cpp" /* yacc.c:1257 */ break; case 168: /* column_def_commalist */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).column_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).column_vec))) { @@ -1765,47 +1768,53 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).column_vec)); } -#line 1769 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1772 "bison_parser.cpp" /* yacc.c:1257 */ break; case 169: /* column_def */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).column_t)); } -#line 1775 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1778 "bison_parser.cpp" /* yacc.c:1257 */ break; case 170: /* column_type */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1781 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1784 "bison_parser.cpp" /* yacc.c:1257 */ break; case 171: /* drop_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).drop_stmt)); } -#line 1787 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1790 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 172: /* delete_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 172: /* opt_exists */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ + { } +#line 1796 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 173: /* delete_statement */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1793 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1802 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 173: /* truncate_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 174: /* truncate_statement */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1799 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1808 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 174: /* insert_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 175: /* insert_statement */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).insert_stmt)); } -#line 1805 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1814 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 175: /* opt_column_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 176: /* opt_column_list */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -1814,17 +1823,17 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 1818 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1827 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 176: /* update_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 177: /* update_statement */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_stmt)); } -#line 1824 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1833 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 177: /* update_clause_commalist */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 178: /* update_clause_commalist */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).update_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).update_vec))) { @@ -1833,53 +1842,53 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).update_vec)); } -#line 1837 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1846 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 178: /* update_clause */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 179: /* update_clause */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_t)); } -#line 1843 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1852 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 179: /* select_statement */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 180: /* select_statement */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1849 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1858 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 180: /* select_with_paren */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 181: /* select_with_paren */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1855 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1864 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 181: /* select_paren_or_clause */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 182: /* select_paren_or_clause */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1861 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1870 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 182: /* select_no_paren */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 183: /* select_no_paren */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1867 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1876 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 186: /* select_clause */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 187: /* select_clause */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1873 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1882 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 187: /* opt_distinct */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ + case 188: /* opt_distinct */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1879 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1888 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 188: /* select_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 189: /* select_list */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1888,35 +1897,35 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1892 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1901 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 189: /* from_clause */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 190: /* from_clause */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 1898 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1907 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 190: /* opt_where */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 191: /* opt_where */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1904 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1913 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 191: /* opt_group */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 192: /* opt_group */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).group_t)); } -#line 1910 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1919 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 192: /* opt_having */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 193: /* opt_having */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1916 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1925 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 193: /* opt_order */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 194: /* opt_order */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -1925,11 +1934,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1929 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1938 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 194: /* order_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 195: /* order_list */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -1938,35 +1947,35 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1942 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1951 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 195: /* order_desc */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 196: /* order_desc */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).order)); } -#line 1948 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1957 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 196: /* opt_order_type */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ + case 197: /* opt_order_type */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1954 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1963 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 197: /* opt_top */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 198: /* opt_top */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1960 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1969 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 198: /* opt_limit */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 199: /* opt_limit */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1966 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1975 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 199: /* expr_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 200: /* expr_list */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1975,11 +1984,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1979 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1988 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 200: /* literal_list */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 201: /* literal_list */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1988,161 +1997,161 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1992 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2001 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 201: /* expr_alias */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 202: /* expr_alias */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1998 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2007 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 202: /* expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 203: /* expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2004 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2013 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 203: /* operand */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 204: /* operand */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2010 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2019 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 204: /* scalar_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 205: /* scalar_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2016 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2025 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 205: /* unary_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 206: /* unary_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2022 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2031 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 206: /* binary_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 207: /* binary_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2028 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2037 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 207: /* logic_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 208: /* logic_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2034 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2043 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 208: /* in_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 209: /* in_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2040 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2049 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 209: /* case_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 210: /* case_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2046 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2055 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 210: /* exists_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 211: /* exists_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2052 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2061 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 211: /* comp_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 212: /* comp_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2058 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2067 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 212: /* function_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 213: /* function_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2064 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2073 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 213: /* array_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 214: /* array_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2070 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2079 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 214: /* array_index */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 215: /* array_index */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2076 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2085 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 215: /* between_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 216: /* between_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2082 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2091 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 216: /* column_name */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 217: /* column_name */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2088 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2097 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 217: /* literal */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 218: /* literal */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2094 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2103 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 218: /* string_literal */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 219: /* string_literal */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2100 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2109 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 219: /* num_literal */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 220: /* num_literal */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2106 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2115 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 220: /* int_literal */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 221: /* int_literal */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2112 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2121 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 221: /* null_literal */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 222: /* null_literal */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2118 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2127 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 222: /* param_expr */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 223: /* param_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2124 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2133 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 223: /* table_ref */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 224: /* table_ref */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2130 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2139 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 224: /* table_ref_atomic */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 225: /* table_ref_atomic */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2136 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2145 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 225: /* nonjoin_table_ref_atomic */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 226: /* nonjoin_table_ref_atomic */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2142 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2151 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 226: /* table_ref_commalist */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ + case 227: /* table_ref_commalist */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).table_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).table_vec))) { @@ -2151,59 +2160,59 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).table_vec)); } -#line 2155 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2164 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 227: /* table_ref_name */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 228: /* table_ref_name */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2161 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2170 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 228: /* table_ref_name_no_alias */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ + case 229: /* table_ref_name_no_alias */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2167 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2176 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 229: /* table_name */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 2173 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 230: /* alias */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 2179 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 231: /* opt_alias */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ - { free( (((*yyvaluep).sval)) ); } -#line 2185 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 232: /* join_clause */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ - { delete (((*yyvaluep).table)); } -#line 2191 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 233: /* opt_join_type */ -#line 135 "bison_parser.y" /* yacc.c:1257 */ - { } -#line 2197 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 234: /* join_condition */ -#line 145 "bison_parser.y" /* yacc.c:1257 */ - { delete (((*yyvaluep).expr)); } -#line 2203 "bison_parser.cpp" /* yacc.c:1257 */ - break; - - case 236: /* ident_commalist */ + case 230: /* table_name */ #line 137 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).table_name).name) ); free( (((*yyvaluep).table_name).schema) ); } +#line 2182 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 231: /* alias */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).sval)) ); } +#line 2188 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 232: /* opt_alias */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ + { free( (((*yyvaluep).sval)) ); } +#line 2194 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 233: /* join_clause */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).table)); } +#line 2200 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 234: /* opt_join_type */ +#line 136 "bison_parser.y" /* yacc.c:1257 */ + { } +#line 2206 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 235: /* join_condition */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).expr)); } +#line 2212 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 237: /* ident_commalist */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2212,7 +2221,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 2216 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2225 "bison_parser.cpp" /* yacc.c:1257 */ break; @@ -2330,7 +2339,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.total_column = 0; } -#line 2334 "bison_parser.cpp" /* yacc.c:1429 */ +#line 2343 "bison_parser.cpp" /* yacc.c:1429 */ yylsp[0] = yylloc; goto yysetstate; @@ -2517,7 +2526,7 @@ yyreduce: switch (yyn) { case 2: -#line 242 "bison_parser.y" /* yacc.c:1646 */ +#line 245 "bison_parser.y" /* yacc.c:1646 */ { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. @@ -2535,417 +2544,443 @@ yyreduce: } delete (yyvsp[-1].stmt_vec); } -#line 2539 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2548 "bison_parser.cpp" /* yacc.c:1646 */ break; case 3: -#line 263 "bison_parser.y" /* yacc.c:1646 */ +#line 266 "bison_parser.y" /* yacc.c:1646 */ { (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } -#line 2545 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2554 "bison_parser.cpp" /* yacc.c:1646 */ break; case 4: -#line 264 "bison_parser.y" /* yacc.c:1646 */ +#line 267 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } -#line 2551 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 5: -#line 268 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.statement) = (yyvsp[-1].prep_stmt); - (yyval.statement)->hints = (yyvsp[0].expr_vec); - } #line 2560 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 6: -#line 272 "bison_parser.y" /* yacc.c:1646 */ + case 5: +#line 271 "bison_parser.y" /* yacc.c:1646 */ { - (yyval.statement) = (yyvsp[-1].statement); + (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } #line 2569 "bison_parser.cpp" /* yacc.c:1646 */ break; + case 6: +#line 275 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.statement) = (yyvsp[-1].statement); + (yyval.statement)->hints = (yyvsp[0].expr_vec); + } +#line 2578 "bison_parser.cpp" /* yacc.c:1646 */ + break; + case 7: -#line 276 "bison_parser.y" /* yacc.c:1646 */ +#line 279 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 2577 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2586 "bison_parser.cpp" /* yacc.c:1646 */ break; case 8: -#line 283 "bison_parser.y" /* yacc.c:1646 */ +#line 286 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 2583 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2592 "bison_parser.cpp" /* yacc.c:1646 */ break; case 9: -#line 284 "bison_parser.y" /* yacc.c:1646 */ +#line 287 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 2589 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2598 "bison_parser.cpp" /* yacc.c:1646 */ break; case 10: -#line 285 "bison_parser.y" /* yacc.c:1646 */ +#line 288 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 2595 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2604 "bison_parser.cpp" /* yacc.c:1646 */ break; case 11: -#line 286 "bison_parser.y" /* yacc.c:1646 */ +#line 289 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 2601 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2610 "bison_parser.cpp" /* yacc.c:1646 */ break; case 12: -#line 287 "bison_parser.y" /* yacc.c:1646 */ +#line 290 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2607 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2616 "bison_parser.cpp" /* yacc.c:1646 */ break; case 13: -#line 288 "bison_parser.y" /* yacc.c:1646 */ +#line 291 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2613 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2622 "bison_parser.cpp" /* yacc.c:1646 */ break; case 14: -#line 289 "bison_parser.y" /* yacc.c:1646 */ +#line 292 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 2619 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2628 "bison_parser.cpp" /* yacc.c:1646 */ break; case 15: -#line 290 "bison_parser.y" /* yacc.c:1646 */ +#line 293 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 2625 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2634 "bison_parser.cpp" /* yacc.c:1646 */ break; case 16: -#line 291 "bison_parser.y" /* yacc.c:1646 */ +#line 294 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 2631 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2640 "bison_parser.cpp" /* yacc.c:1646 */ break; case 17: -#line 300 "bison_parser.y" /* yacc.c:1646 */ +#line 303 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 2637 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2646 "bison_parser.cpp" /* yacc.c:1646 */ break; case 18: -#line 301 "bison_parser.y" /* yacc.c:1646 */ +#line 304 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = nullptr; } -#line 2643 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2652 "bison_parser.cpp" /* yacc.c:1646 */ break; case 19: -#line 306 "bison_parser.y" /* yacc.c:1646 */ +#line 309 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 2649 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2658 "bison_parser.cpp" /* yacc.c:1646 */ break; case 20: -#line 307 "bison_parser.y" /* yacc.c:1646 */ +#line 310 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 2655 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2664 "bison_parser.cpp" /* yacc.c:1646 */ break; case 21: -#line 311 "bison_parser.y" /* yacc.c:1646 */ +#line 314 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 2664 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2673 "bison_parser.cpp" /* yacc.c:1646 */ break; case 22: -#line 315 "bison_parser.y" /* yacc.c:1646 */ +#line 318 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 2674 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2683 "bison_parser.cpp" /* yacc.c:1646 */ break; case 23: -#line 327 "bison_parser.y" /* yacc.c:1646 */ +#line 330 "bison_parser.y" /* yacc.c:1646 */ { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 2684 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2693 "bison_parser.cpp" /* yacc.c:1646 */ break; case 25: -#line 337 "bison_parser.y" /* yacc.c:1646 */ +#line 340 "bison_parser.y" /* yacc.c:1646 */ { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 2693 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2702 "bison_parser.cpp" /* yacc.c:1646 */ break; case 26: -#line 341 "bison_parser.y" /* yacc.c:1646 */ +#line 344 "bison_parser.y" /* yacc.c:1646 */ { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 2703 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2712 "bison_parser.cpp" /* yacc.c:1646 */ break; case 27: -#line 353 "bison_parser.y" /* yacc.c:1646 */ +#line 356 "bison_parser.y" /* yacc.c:1646 */ { (yyval.import_stmt) = new ImportStatement((ImportType) (yyvsp[-4].uval)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); - (yyval.import_stmt)->tableName = (yyvsp[0].sval); + (yyval.import_stmt)->schema = (yyvsp[0].table_name).schema; + (yyval.import_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2713 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2723 "bison_parser.cpp" /* yacc.c:1646 */ break; case 28: -#line 361 "bison_parser.y" /* yacc.c:1646 */ +#line 365 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = kImportCSV; } -#line 2719 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2729 "bison_parser.cpp" /* yacc.c:1646 */ break; case 29: -#line 365 "bison_parser.y" /* yacc.c:1646 */ +#line 369 "bison_parser.y" /* yacc.c:1646 */ { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } -#line 2725 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2735 "bison_parser.cpp" /* yacc.c:1646 */ break; case 30: -#line 375 "bison_parser.y" /* yacc.c:1646 */ +#line 379 "bison_parser.y" /* yacc.c:1646 */ { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 2733 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2743 "bison_parser.cpp" /* yacc.c:1646 */ break; case 31: -#line 378 "bison_parser.y" /* yacc.c:1646 */ +#line 382 "bison_parser.y" /* yacc.c:1646 */ { (yyval.show_stmt) = new ShowStatement(kShowColumns); - (yyval.show_stmt)->name = (yyvsp[0].sval); - } -#line 2742 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 32: -#line 391 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); - (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); - (yyval.create_stmt)->tableName = (yyvsp[-4].sval); - (yyval.create_stmt)->filePath = (yyvsp[0].sval); + (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; + (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } #line 2753 "bison_parser.cpp" /* yacc.c:1646 */ break; + case 32: +#line 396 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); + (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); + (yyval.create_stmt)->schema = (yyvsp[-4].table_name).schema; + (yyval.create_stmt)->tableName = (yyvsp[-4].table_name).name; + (yyval.create_stmt)->filePath = (yyvsp[0].sval); + } +#line 2765 "bison_parser.cpp" /* yacc.c:1646 */ + break; + case 33: -#line 397 "bison_parser.y" /* yacc.c:1646 */ +#line 403 "bison_parser.y" /* yacc.c:1646 */ { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); - (yyval.create_stmt)->tableName = (yyvsp[-3].sval); + (yyval.create_stmt)->schema = (yyvsp[-3].table_name).schema; + (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); } -#line 2764 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2777 "bison_parser.cpp" /* yacc.c:1646 */ break; case 34: -#line 403 "bison_parser.y" /* yacc.c:1646 */ +#line 410 "bison_parser.y" /* yacc.c:1646 */ { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); - (yyval.create_stmt)->tableName = (yyvsp[-3].sval); + (yyval.create_stmt)->schema = (yyvsp[-3].table_name).schema; + (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 2776 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2790 "bison_parser.cpp" /* yacc.c:1646 */ break; case 35: -#line 413 "bison_parser.y" /* yacc.c:1646 */ +#line 421 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = true; } -#line 2782 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2796 "bison_parser.cpp" /* yacc.c:1646 */ break; case 36: -#line 414 "bison_parser.y" /* yacc.c:1646 */ +#line 422 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = false; } -#line 2788 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2802 "bison_parser.cpp" /* yacc.c:1646 */ break; case 37: -#line 418 "bison_parser.y" /* yacc.c:1646 */ +#line 426 "bison_parser.y" /* yacc.c:1646 */ { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } -#line 2794 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 38: -#line 419 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } -#line 2800 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 39: -#line 423 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); - } #line 2808 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 40: -#line 430 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = ColumnDefinition::INT; } + case 38: +#line 427 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } #line 2814 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 41: + case 39: #line 431 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); + } +#line 2822 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 40: +#line 438 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2820 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2828 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 41: +#line 439 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = ColumnDefinition::INT; } +#line 2834 "bison_parser.cpp" /* yacc.c:1646 */ break; case 42: -#line 432 "bison_parser.y" /* yacc.c:1646 */ +#line 440 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::DOUBLE; } -#line 2826 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2840 "bison_parser.cpp" /* yacc.c:1646 */ break; case 43: -#line 433 "bison_parser.y" /* yacc.c:1646 */ +#line 441 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::TEXT; } -#line 2832 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2846 "bison_parser.cpp" /* yacc.c:1646 */ break; case 44: -#line 443 "bison_parser.y" /* yacc.c:1646 */ +#line 451 "bison_parser.y" /* yacc.c:1646 */ { (yyval.drop_stmt) = new DropStatement(kDropTable); - (yyval.drop_stmt)->name = (yyvsp[0].sval); + (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); + (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; + (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } -#line 2841 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2857 "bison_parser.cpp" /* yacc.c:1646 */ break; case 45: -#line 447 "bison_parser.y" /* yacc.c:1646 */ +#line 457 "bison_parser.y" /* yacc.c:1646 */ { (yyval.drop_stmt) = new DropStatement(kDropView); - (yyval.drop_stmt)->name = (yyvsp[0].sval); + (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); + (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; + (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } -#line 2850 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2868 "bison_parser.cpp" /* yacc.c:1646 */ break; case 46: -#line 451 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); - (yyval.drop_stmt)->name = (yyvsp[0].sval); - } -#line 2859 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 47: #line 463 "bison_parser.y" /* yacc.c:1646 */ { - (yyval.delete_stmt) = new DeleteStatement(); - (yyval.delete_stmt)->tableName = (yyvsp[-1].sval); - (yyval.delete_stmt)->expr = (yyvsp[0].expr); - } -#line 2869 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 48: -#line 471 "bison_parser.y" /* yacc.c:1646 */ - { - (yyval.delete_stmt) = new DeleteStatement(); - (yyval.delete_stmt)->tableName = (yyvsp[0].sval); + (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); + (yyval.drop_stmt)->ifExists = false; + (yyval.drop_stmt)->name = (yyvsp[0].sval); } #line 2878 "bison_parser.cpp" /* yacc.c:1646 */ break; + case 47: +#line 471 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = true; } +#line 2884 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 48: +#line 472 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = false; } +#line 2890 "bison_parser.cpp" /* yacc.c:1646 */ + break; + case 49: -#line 483 "bison_parser.y" /* yacc.c:1646 */ +#line 481 "bison_parser.y" /* yacc.c:1646 */ { - (yyval.insert_stmt) = new InsertStatement(kInsertValues); - (yyval.insert_stmt)->tableName = (yyvsp[-5].sval); - (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); - (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); + (yyval.delete_stmt) = new DeleteStatement(); + (yyval.delete_stmt)->schema = (yyvsp[-1].table_name).schema; + (yyval.delete_stmt)->tableName = (yyvsp[-1].table_name).name; + (yyval.delete_stmt)->expr = (yyvsp[0].expr); } -#line 2889 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2901 "bison_parser.cpp" /* yacc.c:1646 */ break; case 50: -#line 489 "bison_parser.y" /* yacc.c:1646 */ +#line 490 "bison_parser.y" /* yacc.c:1646 */ { - (yyval.insert_stmt) = new InsertStatement(kInsertSelect); - (yyval.insert_stmt)->tableName = (yyvsp[-2].sval); - (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); - (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); + (yyval.delete_stmt) = new DeleteStatement(); + (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; + (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2900 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2911 "bison_parser.cpp" /* yacc.c:1646 */ break; case 51: -#line 499 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 2906 "bison_parser.cpp" /* yacc.c:1646 */ +#line 503 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.insert_stmt) = new InsertStatement(kInsertValues); + (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; + (yyval.insert_stmt)->tableName = (yyvsp[-5].table_name).name; + (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); + (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); + } +#line 2923 "bison_parser.cpp" /* yacc.c:1646 */ break; case 52: -#line 500 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.str_vec) = nullptr; } -#line 2912 "bison_parser.cpp" /* yacc.c:1646 */ +#line 510 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.insert_stmt) = new InsertStatement(kInsertSelect); + (yyval.insert_stmt)->schema = (yyvsp[-2].table_name).schema; + (yyval.insert_stmt)->tableName = (yyvsp[-2].table_name).name; + (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); + (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); + } +#line 2935 "bison_parser.cpp" /* yacc.c:1646 */ break; case 53: -#line 510 "bison_parser.y" /* yacc.c:1646 */ +#line 521 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.str_vec) = (yyvsp[-1].str_vec); } +#line 2941 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 54: +#line 522 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.str_vec) = nullptr; } +#line 2947 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 55: +#line 532 "bison_parser.y" /* yacc.c:1646 */ { (yyval.update_stmt) = new UpdateStatement(); (yyval.update_stmt)->table = (yyvsp[-3].table); (yyval.update_stmt)->updates = (yyvsp[-1].update_vec); (yyval.update_stmt)->where = (yyvsp[0].expr); } -#line 2923 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 54: -#line 519 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 2929 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 55: -#line 520 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 2935 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2958 "bison_parser.cpp" /* yacc.c:1646 */ break; case 56: -#line 524 "bison_parser.y" /* yacc.c:1646 */ +#line 541 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } +#line 2964 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 57: +#line 542 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } +#line 2970 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 58: +#line 546 "bison_parser.y" /* yacc.c:1646 */ { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 2945 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2980 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 59: -#line 538 "bison_parser.y" /* yacc.c:1646 */ + case 61: +#line 560 "bison_parser.y" /* yacc.c:1646 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator @@ -2960,23 +2995,23 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2964 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2999 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 60: -#line 555 "bison_parser.y" /* yacc.c:1646 */ + case 62: +#line 577 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 2970 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3005 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 61: -#line 556 "bison_parser.y" /* yacc.c:1646 */ + case 63: +#line 578 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 2976 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3011 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 64: -#line 565 "bison_parser.y" /* yacc.c:1646 */ + case 66: +#line 587 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-2].select_stmt); (yyval.select_stmt)->order = (yyvsp[-1].order_vec); @@ -2987,11 +3022,11 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2991 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3026 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 65: -#line 575 "bison_parser.y" /* yacc.c:1646 */ + case 67: +#line 597 "bison_parser.y" /* yacc.c:1646 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator @@ -3006,11 +3041,11 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3010 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3045 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 72: -#line 607 "bison_parser.y" /* yacc.c:1646 */ + case 74: +#line 629 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); @@ -3020,538 +3055,546 @@ yyreduce: (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 3024 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3059 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 73: -#line 619 "bison_parser.y" /* yacc.c:1646 */ + case 75: +#line 641 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = true; } -#line 3030 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 74: -#line 620 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.bval) = false; } -#line 3036 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3065 "bison_parser.cpp" /* yacc.c:1646 */ break; case 76: -#line 628 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.table) = (yyvsp[0].table); } -#line 3042 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 77: -#line 633 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[0].expr); } -#line 3048 "bison_parser.cpp" /* yacc.c:1646 */ +#line 642 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.bval) = false; } +#line 3071 "bison_parser.cpp" /* yacc.c:1646 */ break; case 78: -#line 634 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = nullptr; } -#line 3054 "bison_parser.cpp" /* yacc.c:1646 */ +#line 650 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table) = (yyvsp[0].table); } +#line 3077 "bison_parser.cpp" /* yacc.c:1646 */ break; case 79: -#line 638 "bison_parser.y" /* yacc.c:1646 */ +#line 655 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[0].expr); } +#line 3083 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 80: +#line 656 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = nullptr; } +#line 3089 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 81: +#line 660 "bison_parser.y" /* yacc.c:1646 */ { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 3064 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 80: -#line 643 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.group_t) = nullptr; } -#line 3070 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 81: -#line 647 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[0].expr); } -#line 3076 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3099 "bison_parser.cpp" /* yacc.c:1646 */ break; case 82: -#line 648 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = nullptr; } -#line 3082 "bison_parser.cpp" /* yacc.c:1646 */ +#line 665 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.group_t) = nullptr; } +#line 3105 "bison_parser.cpp" /* yacc.c:1646 */ break; case 83: -#line 651 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 3088 "bison_parser.cpp" /* yacc.c:1646 */ +#line 669 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = (yyvsp[0].expr); } +#line 3111 "bison_parser.cpp" /* yacc.c:1646 */ break; case 84: -#line 652 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_vec) = nullptr; } -#line 3094 "bison_parser.cpp" /* yacc.c:1646 */ +#line 670 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = nullptr; } +#line 3117 "bison_parser.cpp" /* yacc.c:1646 */ break; case 85: -#line 656 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 3100 "bison_parser.cpp" /* yacc.c:1646 */ +#line 673 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_vec) = (yyvsp[0].order_vec); } +#line 3123 "bison_parser.cpp" /* yacc.c:1646 */ break; case 86: -#line 657 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 3106 "bison_parser.cpp" /* yacc.c:1646 */ +#line 674 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_vec) = nullptr; } +#line 3129 "bison_parser.cpp" /* yacc.c:1646 */ break; case 87: -#line 661 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 3112 "bison_parser.cpp" /* yacc.c:1646 */ +#line 678 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } +#line 3135 "bison_parser.cpp" /* yacc.c:1646 */ break; case 88: -#line 665 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_type) = kOrderAsc; } -#line 3118 "bison_parser.cpp" /* yacc.c:1646 */ +#line 679 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } +#line 3141 "bison_parser.cpp" /* yacc.c:1646 */ break; case 89: -#line 666 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.order_type) = kOrderDesc; } -#line 3124 "bison_parser.cpp" /* yacc.c:1646 */ +#line 683 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } +#line 3147 "bison_parser.cpp" /* yacc.c:1646 */ break; case 90: -#line 667 "bison_parser.y" /* yacc.c:1646 */ +#line 687 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_type) = kOrderAsc; } -#line 3130 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3153 "bison_parser.cpp" /* yacc.c:1646 */ break; case 91: -#line 673 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3136 "bison_parser.cpp" /* yacc.c:1646 */ +#line 688 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderDesc; } +#line 3159 "bison_parser.cpp" /* yacc.c:1646 */ break; case 92: -#line 674 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = nullptr; } -#line 3142 "bison_parser.cpp" /* yacc.c:1646 */ +#line 689 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.order_type) = kOrderAsc; } +#line 3165 "bison_parser.cpp" /* yacc.c:1646 */ break; case 93: -#line 678 "bison_parser.y" /* yacc.c:1646 */ +#line 695 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3148 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3171 "bison_parser.cpp" /* yacc.c:1646 */ break; case 94: -#line 679 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } -#line 3154 "bison_parser.cpp" /* yacc.c:1646 */ +#line 696 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = nullptr; } +#line 3177 "bison_parser.cpp" /* yacc.c:1646 */ break; case 95: -#line 680 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.limit) = nullptr; } -#line 3160 "bison_parser.cpp" /* yacc.c:1646 */ +#line 700 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } +#line 3183 "bison_parser.cpp" /* yacc.c:1646 */ break; case 96: -#line 687 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3166 "bison_parser.cpp" /* yacc.c:1646 */ +#line 701 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } +#line 3189 "bison_parser.cpp" /* yacc.c:1646 */ break; case 97: -#line 688 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3172 "bison_parser.cpp" /* yacc.c:1646 */ +#line 702 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.limit) = nullptr; } +#line 3195 "bison_parser.cpp" /* yacc.c:1646 */ break; case 98: -#line 692 "bison_parser.y" /* yacc.c:1646 */ +#line 709 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3178 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3201 "bison_parser.cpp" /* yacc.c:1646 */ break; case 99: -#line 693 "bison_parser.y" /* yacc.c:1646 */ +#line 710 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3184 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3207 "bison_parser.cpp" /* yacc.c:1646 */ break; case 100: -#line 697 "bison_parser.y" /* yacc.c:1646 */ +#line 714 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } +#line 3213 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 101: +#line 715 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } +#line 3219 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 102: +#line 719 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->alias = (yyvsp[0].sval); } -#line 3193 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3228 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 106: -#line 712 "bison_parser.y" /* yacc.c:1646 */ + case 108: +#line 734 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); } -#line 3199 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3234 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 114: -#line 720 "bison_parser.y" /* yacc.c:1646 */ + case 116: +#line 742 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 3205 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 117: -#line 729 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 3211 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 118: -#line 730 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 3217 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3240 "bison_parser.cpp" /* yacc.c:1646 */ break; case 119: -#line 731 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 3223 "bison_parser.cpp" /* yacc.c:1646 */ +#line 751 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } +#line 3246 "bison_parser.cpp" /* yacc.c:1646 */ break; case 120: -#line 732 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 3229 "bison_parser.cpp" /* yacc.c:1646 */ +#line 752 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } +#line 3252 "bison_parser.cpp" /* yacc.c:1646 */ break; case 121: -#line 733 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 3235 "bison_parser.cpp" /* yacc.c:1646 */ +#line 753 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } +#line 3258 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 122: +#line 754 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } +#line 3264 "bison_parser.cpp" /* yacc.c:1646 */ break; case 123: -#line 738 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 3241 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 124: -#line 739 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 3247 "bison_parser.cpp" /* yacc.c:1646 */ +#line 755 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } +#line 3270 "bison_parser.cpp" /* yacc.c:1646 */ break; case 125: -#line 740 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 3253 "bison_parser.cpp" /* yacc.c:1646 */ +#line 760 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } +#line 3276 "bison_parser.cpp" /* yacc.c:1646 */ break; case 126: -#line 741 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 3259 "bison_parser.cpp" /* yacc.c:1646 */ +#line 761 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } +#line 3282 "bison_parser.cpp" /* yacc.c:1646 */ break; case 127: -#line 742 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 3265 "bison_parser.cpp" /* yacc.c:1646 */ +#line 762 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } +#line 3288 "bison_parser.cpp" /* yacc.c:1646 */ break; case 128: -#line 743 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 3271 "bison_parser.cpp" /* yacc.c:1646 */ +#line 763 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } +#line 3294 "bison_parser.cpp" /* yacc.c:1646 */ break; case 129: -#line 744 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 3277 "bison_parser.cpp" /* yacc.c:1646 */ +#line 764 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } +#line 3300 "bison_parser.cpp" /* yacc.c:1646 */ break; case 130: -#line 745 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 3283 "bison_parser.cpp" /* yacc.c:1646 */ +#line 765 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } +#line 3306 "bison_parser.cpp" /* yacc.c:1646 */ break; case 131: -#line 746 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 3289 "bison_parser.cpp" /* yacc.c:1646 */ +#line 766 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } +#line 3312 "bison_parser.cpp" /* yacc.c:1646 */ break; case 132: -#line 747 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 3295 "bison_parser.cpp" /* yacc.c:1646 */ +#line 767 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } +#line 3318 "bison_parser.cpp" /* yacc.c:1646 */ break; case 133: -#line 751 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 3301 "bison_parser.cpp" /* yacc.c:1646 */ +#line 768 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } +#line 3324 "bison_parser.cpp" /* yacc.c:1646 */ break; case 134: -#line 752 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 3307 "bison_parser.cpp" /* yacc.c:1646 */ +#line 769 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } +#line 3330 "bison_parser.cpp" /* yacc.c:1646 */ break; case 135: -#line 756 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 3313 "bison_parser.cpp" /* yacc.c:1646 */ +#line 773 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } +#line 3336 "bison_parser.cpp" /* yacc.c:1646 */ break; case 136: -#line 757 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 3319 "bison_parser.cpp" /* yacc.c:1646 */ +#line 774 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } +#line 3342 "bison_parser.cpp" /* yacc.c:1646 */ break; case 137: -#line 758 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 3325 "bison_parser.cpp" /* yacc.c:1646 */ +#line 778 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } +#line 3348 "bison_parser.cpp" /* yacc.c:1646 */ break; case 138: -#line 759 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 3331 "bison_parser.cpp" /* yacc.c:1646 */ +#line 779 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } +#line 3354 "bison_parser.cpp" /* yacc.c:1646 */ break; case 139: -#line 764 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeCase((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3337 "bison_parser.cpp" /* yacc.c:1646 */ +#line 780 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } +#line 3360 "bison_parser.cpp" /* yacc.c:1646 */ break; case 140: -#line 766 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeCase((yyvsp[-5].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3343 "bison_parser.cpp" /* yacc.c:1646 */ +#line 781 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } +#line 3366 "bison_parser.cpp" /* yacc.c:1646 */ break; case 141: -#line 770 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 3349 "bison_parser.cpp" /* yacc.c:1646 */ +#line 786 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase((yyvsp[-3].expr), (yyvsp[-1].expr)); } +#line 3372 "bison_parser.cpp" /* yacc.c:1646 */ break; case 142: -#line 771 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 3355 "bison_parser.cpp" /* yacc.c:1646 */ +#line 788 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase((yyvsp[-5].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } +#line 3378 "bison_parser.cpp" /* yacc.c:1646 */ break; case 143: -#line 775 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 3361 "bison_parser.cpp" /* yacc.c:1646 */ +#line 792 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } +#line 3384 "bison_parser.cpp" /* yacc.c:1646 */ break; case 144: -#line 776 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 3367 "bison_parser.cpp" /* yacc.c:1646 */ +#line 793 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } +#line 3390 "bison_parser.cpp" /* yacc.c:1646 */ break; case 145: -#line 777 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 3373 "bison_parser.cpp" /* yacc.c:1646 */ +#line 797 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } +#line 3396 "bison_parser.cpp" /* yacc.c:1646 */ break; case 146: -#line 778 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 3379 "bison_parser.cpp" /* yacc.c:1646 */ +#line 798 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } +#line 3402 "bison_parser.cpp" /* yacc.c:1646 */ break; case 147: -#line 779 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 3385 "bison_parser.cpp" /* yacc.c:1646 */ +#line 799 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } +#line 3408 "bison_parser.cpp" /* yacc.c:1646 */ break; case 148: -#line 780 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 3391 "bison_parser.cpp" /* yacc.c:1646 */ +#line 800 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } +#line 3414 "bison_parser.cpp" /* yacc.c:1646 */ break; case 149: -#line 784 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } -#line 3397 "bison_parser.cpp" /* yacc.c:1646 */ +#line 801 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } +#line 3420 "bison_parser.cpp" /* yacc.c:1646 */ break; case 150: -#line 785 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } -#line 3403 "bison_parser.cpp" /* yacc.c:1646 */ +#line 802 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } +#line 3426 "bison_parser.cpp" /* yacc.c:1646 */ break; case 151: -#line 789 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 3409 "bison_parser.cpp" /* yacc.c:1646 */ +#line 806 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } +#line 3432 "bison_parser.cpp" /* yacc.c:1646 */ break; case 152: -#line 793 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 3415 "bison_parser.cpp" /* yacc.c:1646 */ +#line 807 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } +#line 3438 "bison_parser.cpp" /* yacc.c:1646 */ break; case 153: -#line 797 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3421 "bison_parser.cpp" /* yacc.c:1646 */ +#line 811 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } +#line 3444 "bison_parser.cpp" /* yacc.c:1646 */ break; case 154: -#line 801 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 3427 "bison_parser.cpp" /* yacc.c:1646 */ +#line 815 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } +#line 3450 "bison_parser.cpp" /* yacc.c:1646 */ break; case 155: -#line 802 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 3433 "bison_parser.cpp" /* yacc.c:1646 */ +#line 819 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } +#line 3456 "bison_parser.cpp" /* yacc.c:1646 */ break; case 156: -#line 803 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeStar(); } -#line 3439 "bison_parser.cpp" /* yacc.c:1646 */ +#line 823 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } +#line 3462 "bison_parser.cpp" /* yacc.c:1646 */ break; case 157: -#line 804 "bison_parser.y" /* yacc.c:1646 */ +#line 824 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } +#line 3468 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 158: +#line 825 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeStar(); } +#line 3474 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 159: +#line 826 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 3445 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3480 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 162: -#line 815 "bison_parser.y" /* yacc.c:1646 */ + case 164: +#line 837 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 3451 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 163: -#line 820 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 3457 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3486 "bison_parser.cpp" /* yacc.c:1646 */ break; case 165: -#line 825 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 3463 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 166: -#line 829 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeNullLiteral(); } -#line 3469 "bison_parser.cpp" /* yacc.c:1646 */ +#line 842 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } +#line 3492 "bison_parser.cpp" /* yacc.c:1646 */ break; case 167: -#line 833 "bison_parser.y" /* yacc.c:1646 */ +#line 847 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } +#line 3498 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 168: +#line 851 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeNullLiteral(); } +#line 3504 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 169: +#line 855 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } -#line 3479 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3514 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 169: -#line 846 "bison_parser.y" /* yacc.c:1646 */ + case 171: +#line 868 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[0].table_vec)->push_back((yyvsp[-2].table)); auto tbl = new TableRef(kTableCrossProduct); tbl->list = (yyvsp[0].table_vec); (yyval.table) = tbl; } -#line 3490 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3525 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 173: -#line 862 "bison_parser.y" /* yacc.c:1646 */ + case 175: +#line 884 "bison_parser.y" /* yacc.c:1646 */ { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3501 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 174: -#line 871 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 3507 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 175: -#line 872 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 3513 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3536 "bison_parser.cpp" /* yacc.c:1646 */ break; case 176: -#line 877 "bison_parser.y" /* yacc.c:1646 */ - { - auto tbl = new TableRef(kTableName); - tbl->name = (yyvsp[-1].sval); - tbl->alias = (yyvsp[0].sval); - (yyval.table) = tbl; - } -#line 3524 "bison_parser.cpp" /* yacc.c:1646 */ +#line 893 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } +#line 3542 "bison_parser.cpp" /* yacc.c:1646 */ break; case 177: -#line 887 "bison_parser.y" /* yacc.c:1646 */ +#line 894 "bison_parser.y" /* yacc.c:1646 */ + { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } +#line 3548 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 178: +#line 899 "bison_parser.y" /* yacc.c:1646 */ { - (yyval.table) = new TableRef(kTableName); - (yyval.table)->name = (yyvsp[0].sval); + auto tbl = new TableRef(kTableName); + tbl->schema = (yyvsp[-1].table_name).schema; + tbl->name = (yyvsp[-1].table_name).name; + tbl->alias = (yyvsp[0].sval); + (yyval.table) = tbl; } -#line 3533 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3560 "bison_parser.cpp" /* yacc.c:1646 */ break; case 179: -#line 896 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.sval) = (yyvsp[0].sval); } -#line 3539 "bison_parser.cpp" /* yacc.c:1646 */ +#line 910 "bison_parser.y" /* yacc.c:1646 */ + { + (yyval.table) = new TableRef(kTableName); + (yyval.table)->schema = (yyvsp[0].table_name).schema; + (yyval.table)->name = (yyvsp[0].table_name).name; + } +#line 3570 "bison_parser.cpp" /* yacc.c:1646 */ break; case 180: -#line 901 "bison_parser.y" /* yacc.c:1646 */ +#line 919 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval);} +#line 3576 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 181: +#line 920 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } +#line 3582 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 182: +#line 925 "bison_parser.y" /* yacc.c:1646 */ { (yyval.sval) = (yyvsp[0].sval); } -#line 3545 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3588 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 183: -#line 907 "bison_parser.y" /* yacc.c:1646 */ + case 185: +#line 931 "bison_parser.y" /* yacc.c:1646 */ { (yyval.sval) = nullptr; } -#line 3551 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3594 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 184: -#line 916 "bison_parser.y" /* yacc.c:1646 */ + case 186: +#line 940 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3559,11 +3602,11 @@ yyreduce: (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 3563 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3606 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 185: -#line 924 "bison_parser.y" /* yacc.c:1646 */ + case 187: +#line 948 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3572,11 +3615,11 @@ yyreduce: (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 3576 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3619 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 186: -#line 934 "bison_parser.y" /* yacc.c:1646 */ + case 188: +#line 958 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3592,71 +3635,71 @@ yyreduce: (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } -#line 3596 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 187: -#line 952 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinInner; } -#line 3602 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 188: -#line 953 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinOuter; } -#line 3608 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3639 "bison_parser.cpp" /* yacc.c:1646 */ break; case 189: -#line 954 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinLeftOuter; } -#line 3614 "bison_parser.cpp" /* yacc.c:1646 */ +#line 976 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 3645 "bison_parser.cpp" /* yacc.c:1646 */ break; case 190: -#line 955 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinRightOuter; } -#line 3620 "bison_parser.cpp" /* yacc.c:1646 */ +#line 977 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinOuter; } +#line 3651 "bison_parser.cpp" /* yacc.c:1646 */ break; case 191: -#line 956 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinLeft; } -#line 3626 "bison_parser.cpp" /* yacc.c:1646 */ +#line 978 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeftOuter; } +#line 3657 "bison_parser.cpp" /* yacc.c:1646 */ break; case 192: -#line 957 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinRight; } -#line 3632 "bison_parser.cpp" /* yacc.c:1646 */ +#line 979 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRightOuter; } +#line 3663 "bison_parser.cpp" /* yacc.c:1646 */ break; case 193: -#line 958 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinCross; } -#line 3638 "bison_parser.cpp" /* yacc.c:1646 */ +#line 980 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeft; } +#line 3669 "bison_parser.cpp" /* yacc.c:1646 */ break; case 194: -#line 959 "bison_parser.y" /* yacc.c:1646 */ +#line 981 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRight; } +#line 3675 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 195: +#line 982 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinCross; } +#line 3681 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 196: +#line 983 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = kJoinInner; } -#line 3644 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3687 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 198: -#line 979 "bison_parser.y" /* yacc.c:1646 */ + case 200: +#line 1003 "bison_parser.y" /* yacc.c:1646 */ { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 3650 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3693 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 199: -#line 980 "bison_parser.y" /* yacc.c:1646 */ + case 201: +#line 1004 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 3656 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3699 "bison_parser.cpp" /* yacc.c:1646 */ break; -#line 3660 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3703 "bison_parser.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3891,7 +3934,7 @@ yyreturn: #endif return yyresult; } -#line 983 "bison_parser.y" /* yacc.c:1906 */ +#line 1007 "bison_parser.y" /* yacc.c:1906 */ /********************************* ** Section 4: Additional C code diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h index c2a852d..314283e 100644 --- a/src/parser/bison_parser.h +++ b/src/parser/bison_parser.h @@ -236,7 +236,8 @@ union HSQL_STYPE hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; - + + hsql::TableName table_name; hsql::TableRef* table; hsql::Expr* expr; hsql::OrderDescription* order; @@ -255,7 +256,7 @@ union HSQL_STYPE std::vector* expr_vec; std::vector* order_vec; -#line 259 "bison_parser.h" /* yacc.c:1909 */ +#line 260 "bison_parser.h" /* yacc.c:1909 */ }; typedef union HSQL_STYPE HSQL_STYPE; diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index b18ac19..7d280a9 100755 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -186,7 +186,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha %type update_statement %type drop_statement %type show_statement -%type table_name +%type table_name %type opt_alias alias file_path prepare_target_query %type opt_not_exists opt_exists opt_distinct %type import_file_type opt_join_type column_type diff --git a/test/queries/queries-good.sql b/test/queries/queries-good.sql index 0c24d87..d91715a 100755 --- a/test/queries/queries-good.sql +++ b/test/queries/queries-good.sql @@ -3,6 +3,7 @@ # SELECT statement SELECT * FROM orders; SELECT a FROM foo WHERE a > 12 OR b > 3 AND NOT c LIMIT 10 +SELECT a FROM some_schema.foo WHERE a > 12 OR b > 3 AND NOT c LIMIT 10 SELECT col1 AS myname, col2, 'test' FROM "table", foo AS t WHERE age > 12 AND zipcode = 12345 GROUP BY col1; SELECT * from "table" JOIN table2 ON a = b WHERE (b OR NOT a) AND a = 12.5 (SELECT a FROM foo WHERE a > 12 OR b > 3 AND c NOT LIKE 's%' LIMIT 10); @@ -29,6 +30,7 @@ CREATE TABLE "table" FROM TBL FILE 'students.tbl'; SELECT * FROM "table"; INSERT INTO test_table VALUES (1, 2, 'test'); INSERT INTO test_table (id, value, name) VALUES (1, 2, 'test'); INSERT INTO test_table SELECT * FROM students; +INSERT INTO some_schema.test_table SELECT * FROM another_schema.students; # DELETE DELETE FROM students WHERE grade > 3.0 DELETE FROM students @@ -37,6 +39,7 @@ TRUNCATE students UPDATE students SET grade = 1.3 WHERE name = 'Max Mustermann'; UPDATE students SET grade = 1.3, name='Felix Fürstenberg' WHERE name = 'Max Mustermann'; UPDATE students SET grade = 1.0; +UPDATE some_schema.students SET grade = 1.0; # DROP DROP TABLE students; DROP TABLE IF EXISTS students;