diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index d74eff65..3a4f14cd 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -373,86 +373,86 @@ enum yysymbol_kind_t YYSYMBOL_update_clause_commalist = 237, /* update_clause_commalist */ YYSYMBOL_update_clause = 238, /* update_clause */ YYSYMBOL_select_statement = 239, /* select_statement */ - YYSYMBOL_select_within_set_operation = 240, /* select_within_set_operation */ - YYSYMBOL_select_within_set_operation_no_parentheses = 241, /* select_within_set_operation_no_parentheses */ - YYSYMBOL_select_with_paren = 242, /* select_with_paren */ - YYSYMBOL_select_no_paren = 243, /* select_no_paren */ - YYSYMBOL_set_operator = 244, /* set_operator */ - YYSYMBOL_set_type = 245, /* set_type */ - YYSYMBOL_opt_all = 246, /* opt_all */ - YYSYMBOL_select_clause = 247, /* select_clause */ - YYSYMBOL_opt_distinct = 248, /* opt_distinct */ - YYSYMBOL_select_list = 249, /* select_list */ - YYSYMBOL_opt_from_clause = 250, /* opt_from_clause */ - YYSYMBOL_from_clause = 251, /* from_clause */ - YYSYMBOL_opt_where = 252, /* opt_where */ - YYSYMBOL_opt_group = 253, /* opt_group */ - YYSYMBOL_opt_having = 254, /* opt_having */ - YYSYMBOL_opt_order = 255, /* opt_order */ - YYSYMBOL_order_list = 256, /* order_list */ - YYSYMBOL_order_desc = 257, /* order_desc */ - YYSYMBOL_opt_order_type = 258, /* opt_order_type */ - YYSYMBOL_opt_top = 259, /* opt_top */ - YYSYMBOL_opt_limit = 260, /* opt_limit */ - YYSYMBOL_expr_list = 261, /* expr_list */ - YYSYMBOL_opt_extended_literal_list = 262, /* opt_extended_literal_list */ - YYSYMBOL_extended_literal_list = 263, /* extended_literal_list */ - YYSYMBOL_casted_extended_literal = 264, /* casted_extended_literal */ - YYSYMBOL_extended_literal = 265, /* extended_literal */ - YYSYMBOL_expr_alias = 266, /* expr_alias */ - YYSYMBOL_expr = 267, /* expr */ - YYSYMBOL_operand = 268, /* operand */ - YYSYMBOL_scalar_expr = 269, /* scalar_expr */ - YYSYMBOL_unary_expr = 270, /* unary_expr */ - YYSYMBOL_binary_expr = 271, /* binary_expr */ - YYSYMBOL_logic_expr = 272, /* logic_expr */ - YYSYMBOL_in_expr = 273, /* in_expr */ - YYSYMBOL_case_expr = 274, /* case_expr */ - YYSYMBOL_case_list = 275, /* case_list */ - YYSYMBOL_exists_expr = 276, /* exists_expr */ - YYSYMBOL_comp_expr = 277, /* comp_expr */ - YYSYMBOL_function_expr = 278, /* function_expr */ - YYSYMBOL_opt_window = 279, /* opt_window */ - YYSYMBOL_opt_partition = 280, /* opt_partition */ - YYSYMBOL_opt_frame_clause = 281, /* opt_frame_clause */ - YYSYMBOL_frame_type = 282, /* frame_type */ - YYSYMBOL_frame_bound = 283, /* frame_bound */ - YYSYMBOL_extract_expr = 284, /* extract_expr */ - YYSYMBOL_cast_expr = 285, /* cast_expr */ - YYSYMBOL_datetime_field = 286, /* datetime_field */ - YYSYMBOL_datetime_field_plural = 287, /* datetime_field_plural */ - YYSYMBOL_duration_field = 288, /* duration_field */ - YYSYMBOL_array_expr = 289, /* array_expr */ - YYSYMBOL_array_index = 290, /* array_index */ - YYSYMBOL_between_expr = 291, /* between_expr */ - YYSYMBOL_column_name = 292, /* column_name */ - YYSYMBOL_literal = 293, /* literal */ - YYSYMBOL_string_literal = 294, /* string_literal */ - YYSYMBOL_bool_literal = 295, /* bool_literal */ - YYSYMBOL_num_literal = 296, /* num_literal */ - YYSYMBOL_int_literal = 297, /* int_literal */ - YYSYMBOL_null_literal = 298, /* null_literal */ - YYSYMBOL_date_literal = 299, /* date_literal */ - YYSYMBOL_interval_literal = 300, /* interval_literal */ - YYSYMBOL_param_expr = 301, /* param_expr */ - YYSYMBOL_table_ref = 302, /* table_ref */ - YYSYMBOL_table_ref_atomic = 303, /* table_ref_atomic */ - YYSYMBOL_nonjoin_table_ref_atomic = 304, /* nonjoin_table_ref_atomic */ - YYSYMBOL_table_ref_commalist = 305, /* table_ref_commalist */ - YYSYMBOL_table_ref_name = 306, /* table_ref_name */ - YYSYMBOL_table_ref_name_no_alias = 307, /* table_ref_name_no_alias */ - YYSYMBOL_table_name = 308, /* table_name */ - YYSYMBOL_opt_index_name = 309, /* opt_index_name */ - YYSYMBOL_table_alias = 310, /* table_alias */ - YYSYMBOL_opt_table_alias = 311, /* opt_table_alias */ - YYSYMBOL_alias = 312, /* alias */ - YYSYMBOL_opt_alias = 313, /* opt_alias */ - YYSYMBOL_opt_locking_clause = 314, /* opt_locking_clause */ - YYSYMBOL_opt_locking_clause_list = 315, /* opt_locking_clause_list */ - YYSYMBOL_locking_clause = 316, /* locking_clause */ - YYSYMBOL_row_lock_mode = 317, /* row_lock_mode */ - YYSYMBOL_opt_row_lock_policy = 318, /* opt_row_lock_policy */ - YYSYMBOL_opt_with_clause = 319, /* opt_with_clause */ + YYSYMBOL_query_expression = 240, /* query_expression */ + YYSYMBOL_query_expression_body = 241, /* query_expression_body */ + YYSYMBOL_query_expression_parens = 242, /* query_expression_parens */ + YYSYMBOL_query_term = 243, /* query_term */ + YYSYMBOL_subquery = 244, /* subquery */ + YYSYMBOL_set_operator = 245, /* set_operator */ + YYSYMBOL_set_type = 246, /* set_type */ + YYSYMBOL_opt_all = 247, /* opt_all */ + YYSYMBOL_query_primary = 248, /* query_primary */ + YYSYMBOL_opt_distinct = 249, /* opt_distinct */ + YYSYMBOL_select_list = 250, /* select_list */ + YYSYMBOL_opt_from_clause = 251, /* opt_from_clause */ + YYSYMBOL_from_clause = 252, /* from_clause */ + YYSYMBOL_opt_where = 253, /* opt_where */ + YYSYMBOL_opt_group = 254, /* opt_group */ + YYSYMBOL_opt_having = 255, /* opt_having */ + YYSYMBOL_opt_order = 256, /* opt_order */ + YYSYMBOL_order_list = 257, /* order_list */ + YYSYMBOL_order_desc = 258, /* order_desc */ + YYSYMBOL_opt_order_type = 259, /* opt_order_type */ + YYSYMBOL_opt_top = 260, /* opt_top */ + YYSYMBOL_opt_limit = 261, /* opt_limit */ + YYSYMBOL_expr_list = 262, /* expr_list */ + YYSYMBOL_opt_extended_literal_list = 263, /* opt_extended_literal_list */ + YYSYMBOL_extended_literal_list = 264, /* extended_literal_list */ + YYSYMBOL_casted_extended_literal = 265, /* casted_extended_literal */ + YYSYMBOL_extended_literal = 266, /* extended_literal */ + YYSYMBOL_expr_alias = 267, /* expr_alias */ + YYSYMBOL_expr = 268, /* expr */ + YYSYMBOL_operand = 269, /* operand */ + YYSYMBOL_scalar_expr = 270, /* scalar_expr */ + YYSYMBOL_unary_expr = 271, /* unary_expr */ + YYSYMBOL_binary_expr = 272, /* binary_expr */ + YYSYMBOL_logic_expr = 273, /* logic_expr */ + YYSYMBOL_in_expr = 274, /* in_expr */ + YYSYMBOL_case_expr = 275, /* case_expr */ + YYSYMBOL_case_list = 276, /* case_list */ + YYSYMBOL_exists_expr = 277, /* exists_expr */ + YYSYMBOL_comp_expr = 278, /* comp_expr */ + YYSYMBOL_function_expr = 279, /* function_expr */ + YYSYMBOL_opt_window = 280, /* opt_window */ + YYSYMBOL_opt_partition = 281, /* opt_partition */ + YYSYMBOL_opt_frame_clause = 282, /* opt_frame_clause */ + YYSYMBOL_frame_type = 283, /* frame_type */ + YYSYMBOL_frame_bound = 284, /* frame_bound */ + YYSYMBOL_extract_expr = 285, /* extract_expr */ + YYSYMBOL_cast_expr = 286, /* cast_expr */ + YYSYMBOL_datetime_field = 287, /* datetime_field */ + YYSYMBOL_datetime_field_plural = 288, /* datetime_field_plural */ + YYSYMBOL_duration_field = 289, /* duration_field */ + YYSYMBOL_array_expr = 290, /* array_expr */ + YYSYMBOL_array_index = 291, /* array_index */ + YYSYMBOL_between_expr = 292, /* between_expr */ + YYSYMBOL_column_name = 293, /* column_name */ + YYSYMBOL_literal = 294, /* literal */ + YYSYMBOL_string_literal = 295, /* string_literal */ + YYSYMBOL_bool_literal = 296, /* bool_literal */ + YYSYMBOL_num_literal = 297, /* num_literal */ + YYSYMBOL_int_literal = 298, /* int_literal */ + YYSYMBOL_null_literal = 299, /* null_literal */ + YYSYMBOL_date_literal = 300, /* date_literal */ + YYSYMBOL_interval_literal = 301, /* interval_literal */ + YYSYMBOL_param_expr = 302, /* param_expr */ + YYSYMBOL_table_ref = 303, /* table_ref */ + YYSYMBOL_table_ref_atomic = 304, /* table_ref_atomic */ + YYSYMBOL_nonjoin_table_ref_atomic = 305, /* nonjoin_table_ref_atomic */ + YYSYMBOL_table_ref_commalist = 306, /* table_ref_commalist */ + YYSYMBOL_table_ref_name = 307, /* table_ref_name */ + YYSYMBOL_table_ref_name_no_alias = 308, /* table_ref_name_no_alias */ + YYSYMBOL_table_name = 309, /* table_name */ + YYSYMBOL_opt_index_name = 310, /* opt_index_name */ + YYSYMBOL_table_alias = 311, /* table_alias */ + YYSYMBOL_opt_table_alias = 312, /* opt_table_alias */ + YYSYMBOL_alias = 313, /* alias */ + YYSYMBOL_opt_alias = 314, /* opt_alias */ + YYSYMBOL_opt_locking_clause = 315, /* opt_locking_clause */ + YYSYMBOL_opt_locking_clause_list = 316, /* opt_locking_clause_list */ + YYSYMBOL_locking_clause = 317, /* locking_clause */ + YYSYMBOL_row_lock_mode = 318, /* row_lock_mode */ + YYSYMBOL_opt_row_lock_policy = 319, /* opt_row_lock_policy */ YYSYMBOL_with_clause = 320, /* with_clause */ YYSYMBOL_with_description_list = 321, /* with_description_list */ YYSYMBOL_with_description = 322, /* with_description */ @@ -789,16 +789,16 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 69 +#define YYFINAL 79 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 868 +#define YYLAST 852 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 196 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 132 /* YYNRULES -- Number of rules. */ -#define YYNRULES 340 +#define YYNRULES 339 /* YYNSTATES -- Number of states. */ #define YYNSTATES 616 @@ -867,41 +867,40 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 325, 325, 344, 350, 357, 361, 365, 366, 367, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 384, 385, 387, 391, 396, 400, 410, 411, 412, 414, - 414, 420, 426, 428, 432, 443, 449, 457, 472, 477, - 478, 484, 490, 501, 502, 507, 518, 531, 543, 550, - 557, 566, 567, 569, 573, 578, 579, 581, 588, 589, - 590, 591, 592, 593, 594, 598, 599, 600, 601, 602, - 603, 604, 605, 606, 607, 608, 610, 611, 613, 614, - 615, 617, 618, 620, 624, 629, 630, 631, 632, 634, - 635, 643, 649, 655, 661, 667, 668, 675, 681, 683, - 693, 700, 711, 718, 726, 727, 734, 741, 745, 750, - 760, 764, 768, 780, 780, 782, 783, 792, 793, 795, - 809, 821, 826, 830, 834, 839, 840, 842, 852, 853, - 855, 857, 858, 860, 862, 863, 865, 870, 872, 873, - 875, 876, 878, 882, 887, 889, 890, 891, 895, 896, - 898, 899, 900, 901, 902, 903, 908, 912, 918, 919, - 921, 925, 930, 930, 934, 942, 943, 945, 953, 953, - 953, 953, 953, 955, 956, 956, 956, 956, 956, 956, - 956, 956, 957, 957, 961, 961, 963, 964, 965, 966, - 967, 969, 969, 970, 971, 972, 973, 974, 975, 976, - 977, 978, 980, 981, 983, 984, 985, 986, 990, 991, - 992, 993, 995, 996, 998, 999, 1001, 1002, 1003, 1004, - 1005, 1006, 1007, 1011, 1012, 1016, 1017, 1019, 1020, 1025, - 1026, 1027, 1031, 1032, 1033, 1035, 1036, 1037, 1038, 1039, - 1041, 1043, 1045, 1046, 1047, 1048, 1049, 1050, 1052, 1053, - 1054, 1055, 1056, 1057, 1059, 1059, 1061, 1063, 1065, 1067, - 1068, 1069, 1070, 1072, 1072, 1072, 1072, 1072, 1072, 1072, - 1074, 1076, 1077, 1079, 1080, 1082, 1084, 1086, 1097, 1098, - 1109, 1141, 1150, 1150, 1157, 1157, 1159, 1159, 1166, 1170, - 1175, 1183, 1189, 1193, 1198, 1199, 1201, 1201, 1203, 1203, - 1205, 1206, 1208, 1208, 1214, 1215, 1217, 1221, 1226, 1232, - 1239, 1240, 1241, 1242, 1244, 1245, 1246, 1252, 1252, 1254, - 1256, 1260, 1265, 1275, 1282, 1290, 1299, 1300, 1301, 1302, - 1303, 1304, 1305, 1306, 1307, 1308, 1310, 1316, 1316, 1319, - 1323 + 0, 328, 328, 347, 353, 360, 364, 368, 369, 370, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 387, 388, 390, 394, 399, 403, 413, 414, 415, 417, + 417, 423, 429, 431, 435, 446, 452, 460, 475, 480, + 481, 487, 493, 504, 505, 510, 521, 534, 546, 553, + 560, 569, 570, 572, 576, 581, 582, 584, 591, 592, + 593, 594, 595, 596, 597, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 613, 614, 616, 617, + 618, 620, 621, 623, 627, 632, 633, 634, 635, 637, + 638, 646, 652, 658, 664, 670, 671, 678, 684, 686, + 696, 703, 714, 721, 729, 730, 737, 744, 748, 753, + 763, 764, 768, 790, 821, 822, 834, 846, 861, 865, + 872, 876, 882, 887, 891, 895, 900, 901, 903, 913, + 914, 916, 918, 919, 921, 923, 924, 926, 931, 933, + 934, 936, 937, 939, 943, 948, 950, 951, 952, 956, + 957, 959, 960, 961, 962, 963, 964, 969, 973, 979, + 980, 982, 986, 991, 991, 995, 1003, 1004, 1006, 1014, + 1014, 1014, 1014, 1014, 1016, 1017, 1017, 1017, 1017, 1017, + 1017, 1017, 1017, 1018, 1018, 1022, 1022, 1024, 1025, 1026, + 1027, 1028, 1030, 1030, 1031, 1032, 1033, 1034, 1035, 1036, + 1037, 1038, 1039, 1041, 1042, 1044, 1045, 1046, 1047, 1051, + 1052, 1053, 1054, 1056, 1057, 1059, 1060, 1062, 1063, 1064, + 1065, 1066, 1067, 1068, 1072, 1073, 1077, 1078, 1080, 1081, + 1086, 1087, 1088, 1092, 1093, 1094, 1096, 1097, 1098, 1099, + 1100, 1102, 1104, 1106, 1107, 1108, 1109, 1110, 1111, 1113, + 1114, 1115, 1116, 1117, 1118, 1120, 1120, 1122, 1124, 1126, + 1128, 1129, 1130, 1131, 1133, 1133, 1133, 1133, 1133, 1133, + 1133, 1135, 1137, 1138, 1140, 1141, 1143, 1145, 1147, 1158, + 1159, 1170, 1202, 1211, 1211, 1218, 1218, 1220, 1220, 1227, + 1231, 1236, 1244, 1250, 1254, 1259, 1260, 1262, 1262, 1264, + 1264, 1266, 1267, 1269, 1269, 1275, 1276, 1278, 1282, 1287, + 1293, 1300, 1301, 1302, 1303, 1305, 1306, 1307, 1313, 1315, + 1319, 1324, 1340, 1347, 1355, 1364, 1365, 1366, 1367, 1368, + 1369, 1370, 1371, 1372, 1373, 1375, 1381, 1381, 1384, 1388 }; #endif @@ -956,10 +955,9 @@ static const char *const yytname[] = "alter_action", "drop_action", "delete_statement", "truncate_statement", "insert_statement", "opt_column_list", "update_statement", "update_clause_commalist", "update_clause", "select_statement", - "select_within_set_operation", - "select_within_set_operation_no_parentheses", "select_with_paren", - "select_no_paren", "set_operator", "set_type", "opt_all", - "select_clause", "opt_distinct", "select_list", "opt_from_clause", + "query_expression", "query_expression_body", "query_expression_parens", + "query_term", "subquery", "set_operator", "set_type", "opt_all", + "query_primary", "opt_distinct", "select_list", "opt_from_clause", "from_clause", "opt_where", "opt_group", "opt_having", "opt_order", "order_list", "order_desc", "opt_order_type", "opt_top", "opt_limit", "expr_list", "opt_extended_literal_list", "extended_literal_list", @@ -976,10 +974,9 @@ static const char *const yytname[] = "table_ref_commalist", "table_ref_name", "table_ref_name_no_alias", "table_name", "opt_index_name", "table_alias", "opt_table_alias", "alias", "opt_alias", "opt_locking_clause", "opt_locking_clause_list", - "locking_clause", "row_lock_mode", "opt_row_lock_policy", - "opt_with_clause", "with_clause", "with_description_list", - "with_description", "join_clause", "opt_join_type", "join_condition", - "opt_semicolon", "ident_commalist", YY_NULLPTR + "locking_clause", "row_lock_mode", "opt_row_lock_policy", "with_clause", + "with_description_list", "with_description", "join_clause", + "opt_join_type", "join_condition", "opt_semicolon", "ident_commalist", YY_NULLPTR }; static const char * @@ -989,12 +986,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-537) +#define YYPACT_NINF (-439) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-338) +#define YYTABLE_NINF (-335) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) @@ -1003,68 +1000,68 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 595, 27, 59, 63, 80, 59, -20, -2, 67, 33, - 59, 74, 12, -6, 83, 181, 38, 38, 38, 186, - 6, -537, 93, -537, 93, -537, -537, -537, -537, -537, - -537, -537, -537, -537, -537, -537, -537, -17, -537, 212, - 51, -537, 29, 154, -537, 148, 148, 148, 59, 276, - 59, 166, -537, 204, -17, 160, -51, 204, 204, 204, - 59, -537, 216, 153, -537, -537, -537, -537, -537, -537, - 563, -537, 259, -537, -537, 247, 92, -537, 169, -537, - 380, 227, 382, 268, 390, 59, 59, 313, -537, 312, - 220, 413, 385, 59, 237, 239, 428, 428, 428, 433, - 59, 59, -537, 249, 181, -537, 252, 431, 434, -537, - -537, -537, -17, 331, 320, -17, 0, -537, -537, -537, - 679, 263, 445, -537, 450, -537, -537, 25, -537, 265, - 266, -537, -537, -537, -537, -537, -537, -537, -537, -537, - -537, -537, -537, -537, 411, -537, 329, -45, 220, 318, - -537, 428, 475, 99, 308, -38, -537, -537, 391, -537, - -537, 368, -537, 368, 368, -537, -537, -537, -537, -537, - 481, -537, -537, -537, 318, 408, -537, -537, 92, -537, - -537, 318, 408, 318, 104, 367, -537, -537, -537, -537, - -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, - -537, 384, -537, 324, -537, -537, -537, 227, -537, 59, - 487, 378, 53, 369, 60, 304, 307, 317, 177, 322, - 314, 372, -537, 298, 101, 409, -537, -537, -537, -537, - -537, -537, -537, -537, -537, -537, -537, -537, -537, -537, - -537, -537, 404, -537, 90, 326, -537, 318, 413, -537, - 467, -537, -537, 461, -537, 313, -537, 328, 116, -537, - 426, 334, -537, 37, 0, -17, 335, -537, 130, 0, - 101, 459, 24, 81, -537, 367, -537, 395, -537, -537, - 340, 429, -537, 661, 412, 341, 126, -537, -537, -537, - 378, 13, 23, 477, 324, 318, 318, 202, 192, 343, - 372, 624, 318, 84, 350, -57, 318, 318, 372, -537, - 372, 70, 352, -42, 372, 372, 372, 372, 372, 372, - 372, 372, 372, 372, 372, 372, 372, 372, 372, 431, - 59, -537, 540, 227, 101, -537, 204, 276, -537, 227, - -537, 481, 18, 313, -537, 318, -537, 541, -537, -537, - -537, -537, 318, -537, -537, -537, 367, 318, 318, -537, - 383, 423, -537, -73, -537, 661, 475, 428, -537, -537, - 359, -537, 360, -537, -537, 361, -537, -537, 362, -537, - -537, -537, -537, 363, -537, -537, 30, 366, 475, -537, - 53, -537, 479, 318, -537, -537, 370, 463, 179, 128, - 199, 318, 318, -537, 477, 457, -120, -537, -537, -537, - 443, 606, 662, 372, 374, 298, -537, 460, 381, 662, - 662, 662, 662, 680, 680, 680, 680, 84, 84, -90, - -90, -90, 8, 379, -537, -537, 144, 568, -537, 146, - -537, 378, -537, 333, -537, 392, -537, 39, -537, 502, - -537, -537, -537, -537, 101, 101, -537, 510, 475, -537, - 414, -537, 386, 157, -537, 569, 590, -537, 593, 599, - 600, -537, 452, -537, -537, 496, -537, 30, -537, 475, - 158, -537, 417, -537, 180, -537, 318, 661, 318, 318, - -537, 78, 163, 418, -537, 372, 662, 298, 420, 191, - -537, -537, -537, -537, -537, 421, 508, -537, -537, -537, - 535, 539, 543, 519, 18, 617, -537, -537, -537, 495, - -537, -537, 7, -537, -537, -537, 436, 201, 437, 439, - 440, -537, -537, -537, 207, -537, 518, 479, -49, 442, - 101, 159, -537, 318, -537, 624, 446, 208, -537, -537, - 39, 18, -537, -537, -537, 18, 419, 435, 318, -537, - -537, -537, 628, -537, -537, -537, -537, 511, 408, -537, - -537, -537, -537, 101, -537, -537, -537, -537, 573, 475, - -18, 447, 318, 189, 451, 318, 223, 318, -537, -537, - 334, -537, -537, -537, 453, 22, 475, 101, -537, -537, - 101, -537, 61, 21, 140, -537, -537, 224, -537, -537, - 525, -537, -537, -537, 21, -537 + 465, 109, 134, 158, 193, 134, 166, 148, 162, 71, + 149, 134, 199, 32, 177, 73, 267, 126, 126, 126, + -36, 291, 131, -439, 214, -439, 214, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + 30, 86, -439, -439, -34, 327, 140, -439, 171, 246, + -439, 220, 220, 220, 134, 365, 134, 367, 394, 261, + -439, 284, -36, 281, 44, 284, 284, 284, 134, -439, + 290, 227, -439, -439, -439, -439, -439, 231, 35, -439, + 465, -439, 325, -439, -439, -439, -439, 296, -439, -34, + 316, 8, 375, 30, 86, -439, 431, 92, 434, 312, + 436, 134, 134, 368, -439, 351, 259, -439, -439, -439, + 361, 443, 405, 134, 263, 451, 451, 451, 453, 134, + 134, -439, 272, 267, -439, -439, -439, 273, 361, -439, + -439, -439, -439, 361, 144, 347, -439, 8, -439, -439, + -439, 701, 283, 467, -439, 470, -439, -439, 21, -439, + 285, 287, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, 432, -439, 346, -62, 259, + 361, -439, 451, 479, 250, -107, 293, 295, 298, 247, + 372, 301, 422, -439, 258, 391, 300, -439, 25, 458, + -439, -439, -439, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, 319, -53, -439, -439, + 400, -439, 382, -439, 382, 382, -439, -439, -439, -439, + -439, 494, 305, -439, 151, 137, 445, -23, 103, -439, + 347, -439, 347, -439, -439, -439, -439, -439, -439, -439, + -439, -439, -439, -439, -439, -439, -439, -439, 41, -439, + 442, -439, -439, -439, 92, -439, 134, 498, -36, 39, + 376, 137, 408, -439, 128, 314, -439, 11, 16, 375, + 442, 361, 361, 54, 64, 320, 422, 625, 361, 127, + 328, -64, 34, 368, -439, 361, -439, 361, 513, 361, + -439, -439, 422, -439, 422, 125, 330, 75, 422, 422, + 422, 422, 422, 422, 422, 422, 422, 422, 422, 422, + 422, 422, 422, 367, 361, 443, -439, 482, -439, -439, + 473, -439, 368, -439, 339, 129, -439, 361, -439, -439, + -439, 361, 361, -439, 369, 411, -439, -74, -439, -439, + 403, -439, -439, 344, 444, -439, 634, 414, 349, 152, + -439, -439, -439, -36, 134, -439, 534, 92, 463, 361, + -439, -439, 355, 447, 175, 167, 65, 361, 361, -439, + 375, 448, -112, -439, -439, -36, -439, 364, -439, 358, + -439, 26, -439, 491, -439, -439, -439, 446, 594, 652, + 422, 359, 258, -439, 460, 378, 652, 652, 652, 652, + 516, 516, 516, 516, 127, 127, -14, -14, -14, -54, + 383, 137, -439, 284, 365, -439, 92, -439, 494, -439, + 137, 137, -439, 508, 479, -439, 415, -439, 634, 479, + 451, -439, -439, 388, -439, 390, -439, -439, 401, -439, + -439, 402, -439, -439, -439, -439, 404, -439, -439, 3, + 409, 479, -439, 39, -439, -439, -439, 157, 410, -439, + 159, -439, 361, 634, 361, 361, -439, 169, 173, 399, + -439, 407, 493, -439, -439, -439, 522, 523, 524, 495, + 34, 603, -439, -439, -439, 480, -439, 422, 652, 258, + 416, 164, -439, -439, 606, -439, 168, -439, -439, -88, + -439, 419, 178, -439, 605, 607, -439, 608, 609, 610, + -439, 496, -439, -439, 514, -439, 3, -439, 479, 180, + -439, -439, 515, 463, -55, 429, 137, 223, -439, 361, + -439, 26, 34, -439, -439, -439, 34, 468, 435, 361, + 625, 437, 188, -439, -439, -439, -439, -439, -439, -439, + 459, 189, 461, 462, 466, -439, -439, -439, 194, -439, + 499, 549, -439, -439, -439, -439, 137, -439, -439, 42, + 479, -30, -439, -439, -439, -439, 628, -439, -439, -439, + -439, 361, 239, 469, 361, 196, 361, -439, 477, 300, + -439, -439, -439, 481, 19, 479, 137, -439, -439, 137, + -439, -439, -108, 68, 63, -439, -439, 200, -439, -439, + 518, -439, -439, -439, 68, -439 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1072,106 +1069,106 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 30, 30, 0, - 338, 3, 21, 19, 21, 18, 8, 9, 7, 11, - 16, 17, 13, 14, 12, 15, 10, 0, 317, 0, - 292, 101, 33, 0, 45, 52, 52, 52, 0, 0, - 0, 0, 291, 96, 0, 0, 0, 96, 96, 96, - 0, 43, 0, 319, 320, 29, 26, 28, 27, 1, - 318, 2, 0, 6, 5, 149, 110, 111, 141, 93, - 0, 159, 0, 0, 295, 0, 0, 135, 37, 0, - 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 44, 0, 0, 4, 0, 0, 129, 123, - 124, 122, 0, 126, 0, 0, 155, 293, 270, 273, - 275, 0, 0, 276, 0, 271, 272, 0, 281, 0, - 158, 160, 162, 164, 263, 264, 265, 274, 266, 267, - 268, 269, 32, 31, 0, 294, 0, 0, 105, 0, - 100, 0, 0, 0, 0, 135, 107, 95, 0, 118, - 117, 40, 38, 40, 40, 94, 91, 92, 322, 321, - 0, 275, 148, 128, 0, 141, 114, 113, 115, 125, - 121, 0, 141, 0, 0, 305, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 278, 0, 277, 280, 165, 166, 34, 0, 51, 0, - 0, 318, 0, 0, 259, 0, 0, 0, 0, 0, - 0, 0, 261, 0, 134, 168, 175, 176, 177, 170, - 172, 178, 171, 191, 179, 180, 181, 182, 174, 169, - 184, 185, 0, 339, 0, 0, 103, 0, 0, 106, - 0, 97, 98, 0, 42, 135, 41, 24, 0, 22, - 132, 130, 156, 303, 155, 0, 140, 142, 147, 155, - 151, 153, 150, 0, 119, 304, 306, 0, 279, 161, - 0, 0, 48, 0, 0, 0, 0, 53, 55, 56, - 318, 129, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 187, 0, 186, 0, 0, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 150, 0, 0, 0, 0, 0, 0, 30, 30, 30, + 0, 0, 337, 3, 21, 19, 21, 18, 8, 9, + 7, 11, 16, 17, 13, 14, 12, 15, 10, 110, + 142, 111, 114, 120, 0, 0, 293, 101, 33, 0, + 45, 52, 52, 52, 0, 0, 0, 0, 130, 0, + 292, 96, 0, 0, 0, 96, 96, 96, 0, 43, + 0, 318, 319, 29, 26, 28, 27, 0, 0, 1, + 336, 2, 0, 6, 5, 124, 125, 0, 123, 0, + 127, 156, 0, 142, 0, 93, 0, 160, 0, 0, + 296, 0, 0, 136, 37, 0, 105, 276, 149, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 104, 0, 0, 109, 108, 96, 0, 36, 0, - 20, 0, 0, 135, 131, 0, 301, 0, 302, 167, - 112, 116, 0, 146, 145, 144, 305, 0, 0, 310, - 0, 0, 312, 316, 307, 0, 0, 0, 74, 68, - 0, 70, 80, 71, 58, 0, 65, 66, 0, 62, - 63, 69, 72, 77, 67, 59, 82, 0, 0, 47, - 0, 50, 226, 0, 260, 262, 0, 0, 0, 0, - 0, 0, 0, 210, 0, 0, 0, 183, 173, 202, - 203, 0, 198, 0, 0, 0, 189, 0, 201, 200, - 216, 217, 218, 219, 220, 221, 222, 193, 192, 195, - 194, 196, 197, 0, 35, 340, 0, 0, 39, 0, - 23, 318, 133, 282, 284, 0, 286, 299, 285, 137, - 157, 300, 143, 120, 154, 152, 313, 0, 0, 315, - 0, 308, 0, 0, 46, 0, 0, 64, 0, 0, - 0, 73, 0, 86, 87, 0, 57, 81, 83, 0, - 0, 54, 0, 223, 0, 214, 0, 0, 0, 0, - 208, 0, 0, 0, 256, 0, 199, 0, 0, 0, - 190, 257, 102, 99, 25, 0, 0, 334, 326, 332, - 330, 333, 328, 0, 0, 0, 298, 290, 296, 0, - 127, 311, 316, 314, 163, 49, 0, 0, 0, 0, - 0, 85, 88, 84, 0, 90, 228, 226, 0, 0, - 212, 0, 211, 0, 215, 258, 0, 0, 206, 204, - 299, 0, 329, 331, 327, 0, 283, 300, 0, 309, - 61, 79, 0, 75, 60, 76, 89, 0, 141, 224, - 240, 241, 209, 213, 207, 205, 287, 323, 335, 0, - 139, 0, 0, 231, 0, 0, 0, 0, 136, 78, - 227, 232, 233, 234, 0, 0, 0, 336, 324, 297, - 138, 225, 0, 0, 0, 239, 229, 0, 238, 236, - 0, 237, 235, 325, 0, 230 + 0, 44, 0, 0, 119, 118, 4, 0, 0, 117, + 115, 126, 122, 0, 0, 306, 116, 156, 294, 271, + 274, 276, 0, 0, 277, 0, 272, 273, 0, 282, + 0, 159, 161, 163, 165, 264, 265, 266, 275, 267, + 268, 269, 270, 32, 31, 0, 295, 0, 0, 105, + 0, 100, 0, 0, 0, 260, 0, 0, 0, 0, + 0, 0, 0, 262, 0, 133, 131, 157, 304, 169, + 176, 177, 178, 171, 173, 179, 172, 192, 180, 181, + 182, 183, 175, 170, 185, 186, 0, 136, 107, 95, + 0, 121, 40, 38, 40, 40, 94, 91, 92, 321, + 320, 0, 141, 143, 148, 152, 154, 151, 0, 112, + 305, 307, 306, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 279, 0, 278, + 281, 166, 167, 34, 0, 51, 0, 0, 0, 0, + 0, 135, 0, 338, 0, 0, 103, 130, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 188, 0, 187, + 0, 0, 0, 136, 132, 0, 302, 0, 0, 0, + 303, 168, 0, 189, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 106, 0, 97, 98, + 0, 42, 136, 41, 24, 0, 22, 0, 147, 146, + 145, 0, 0, 311, 0, 0, 313, 317, 308, 113, + 0, 280, 162, 0, 0, 48, 0, 0, 0, 0, + 53, 55, 56, 0, 0, 104, 0, 0, 227, 0, + 261, 263, 0, 0, 0, 0, 0, 0, 0, 211, + 0, 0, 0, 184, 174, 0, 134, 283, 285, 0, + 287, 300, 286, 138, 158, 203, 301, 204, 0, 199, + 0, 0, 0, 190, 0, 202, 201, 217, 218, 219, + 220, 221, 222, 223, 194, 193, 196, 195, 197, 198, + 0, 109, 108, 96, 0, 36, 0, 20, 0, 144, + 155, 153, 314, 0, 0, 316, 0, 309, 0, 0, + 0, 74, 68, 0, 70, 80, 71, 58, 0, 65, + 66, 0, 62, 63, 69, 72, 77, 67, 59, 82, + 0, 0, 47, 0, 50, 35, 339, 0, 0, 224, + 0, 215, 0, 0, 0, 0, 209, 0, 0, 0, + 257, 0, 0, 333, 325, 331, 329, 332, 327, 0, + 0, 0, 299, 291, 297, 0, 128, 0, 200, 0, + 0, 0, 191, 258, 0, 39, 0, 23, 312, 317, + 315, 0, 0, 46, 0, 0, 64, 0, 0, 0, + 73, 0, 86, 87, 0, 57, 81, 83, 0, 0, + 54, 102, 229, 227, 0, 0, 213, 0, 212, 0, + 216, 300, 0, 328, 330, 326, 0, 284, 301, 0, + 259, 0, 0, 207, 205, 99, 25, 310, 164, 49, + 0, 0, 0, 0, 0, 85, 88, 84, 0, 90, + 0, 142, 225, 241, 242, 210, 214, 288, 322, 334, + 0, 140, 208, 206, 61, 79, 0, 75, 60, 76, + 89, 0, 232, 0, 0, 0, 0, 137, 0, 228, + 233, 234, 235, 0, 0, 0, 335, 323, 298, 139, + 78, 226, 0, 0, 0, 240, 230, 0, 239, 237, + 0, 238, 236, 324, 0, 231 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -537, -537, -537, 576, -537, 619, -537, 309, -537, 243, - -537, -537, -537, -537, 325, -93, 261, -537, -537, -537, - 316, -537, 264, -537, -322, -537, -537, -537, -537, 172, - -537, -537, -47, -537, -537, -537, -537, -537, -537, 509, - -537, -537, 415, -204, -86, -537, 58, -54, -31, -537, - -537, -80, 373, -537, -537, -537, -117, -537, -537, -174, - -537, 315, -537, -537, -94, -299, -537, -99, 458, 465, - 323, -147, -197, -537, -537, -537, -537, -537, -537, 376, - -537, -537, -537, 122, -537, -537, -537, -536, -537, -537, - -154, -537, -537, -537, -537, -537, -537, -68, -79, -537, - 548, -87, -537, -537, 549, -537, -537, -327, 119, -537, - -537, -537, 4, -537, -537, 129, 425, -537, 330, -537, - 405, -537, 162, -537, -537, -537, 577, -537, -537, -537, - -537, -343 + -439, -439, -439, 558, -439, 623, -439, 233, -439, 374, + -439, -439, -439, -439, 242, -113, 183, -439, -439, -439, + 362, -439, 207, -439, -373, -439, -439, -439, -439, 145, + -439, -439, -57, -439, -439, -439, -439, -439, -439, 501, + -439, -439, 356, -224, 56, 629, 256, -51, 552, 10, + -439, -439, -164, 413, -439, -439, -439, -167, -439, -439, + -93, -439, 348, -439, -439, 539, -260, -439, -306, 424, + 433, 397, -127, -91, -439, -439, -439, -439, -439, -439, + 412, -439, -439, -439, 160, -439, -439, -439, -438, -439, + -439, -201, -439, -439, -439, -439, -439, -439, -85, -101, + -439, 536, -40, -439, -439, 538, -439, -439, -432, 155, + -439, -439, -439, 0, -439, -439, 161, 500, -439, 457, + -439, 475, -439, 208, -439, -439, 570, -439, -439, -439, + -439, -336 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 19, 20, 21, 22, 73, 258, 259, 23, 66, - 24, 143, 25, 26, 89, 161, 254, 27, 28, 29, - 84, 286, 287, 288, 386, 471, 467, 476, 477, 478, - 289, 30, 93, 31, 251, 252, 32, 33, 34, 153, - 35, 155, 156, 36, 175, 176, 177, 77, 112, 113, - 180, 78, 174, 260, 343, 344, 150, 520, 588, 116, - 266, 267, 355, 108, 185, 261, 129, 130, 131, 132, - 262, 263, 225, 226, 227, 228, 229, 230, 231, 298, - 232, 233, 234, 483, 568, 594, 595, 606, 235, 236, - 198, 199, 200, 237, 238, 239, 240, 241, 134, 135, - 136, 137, 138, 139, 140, 141, 442, 443, 444, 445, - 446, 51, 447, 146, 516, 517, 518, 349, 274, 275, - 276, 363, 461, 37, 38, 63, 64, 448, 513, 598, - 71, 244 + 0, 21, 22, 23, 24, 83, 325, 326, 25, 74, + 26, 164, 27, 28, 105, 212, 321, 29, 30, 31, + 100, 349, 350, 351, 449, 510, 506, 515, 516, 517, + 352, 32, 113, 33, 318, 319, 34, 35, 36, 174, + 37, 207, 208, 38, 39, 40, 41, 42, 63, 92, + 90, 132, 43, 110, 185, 283, 284, 171, 486, 587, + 91, 222, 223, 330, 58, 135, 186, 150, 151, 152, + 153, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 274, 196, 197, 198, 459, 561, 593, 594, 606, 199, + 200, 245, 246, 247, 201, 202, 203, 204, 205, 155, + 156, 157, 158, 159, 160, 161, 162, 376, 377, 378, + 379, 380, 59, 381, 167, 482, 483, 484, 291, 229, + 230, 231, 337, 427, 44, 71, 72, 382, 479, 597, + 81, 264 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1179,184 +1176,182 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 95, 264, 224, 406, 163, 164, 41, 282, 269, 44, - 99, 100, 101, 133, 52, 40, 56, 162, 162, 162, - 172, 40, 301, 463, 303, 173, 394, 602, 602, 182, - 119, 120, 178, 587, 268, 178, 270, 272, 249, 603, - 346, 75, 346, 462, 97, 480, 149, 115, 314, 278, - 210, 45, 87, 39, 90, 183, 283, 472, 242, 458, - 306, 46, 40, 416, 102, 57, 42, 610, 306, 494, - 55, 297, 162, 184, 345, 58, 305, 307, 615, 358, - 284, 417, 211, 43, 98, 307, 391, 459, 460, 147, - 148, 473, 47, 48, 484, 76, 328, 158, 329, 246, - 334, 109, 60, 301, 166, 167, 59, 214, 118, 119, - 120, 411, 94, 412, 285, 522, 499, 418, 419, 420, - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, - 431, 432, 50, 133, 408, 474, 534, 110, 338, 133, - 397, 306, 570, 61, 359, 212, 314, 265, 398, 399, - 215, 216, 217, 475, 306, 53, 248, 75, 307, 409, - 410, 168, 49, 245, 347, 539, 515, 459, 460, 304, - 350, 307, 413, 54, 111, 356, 345, 124, 109, 351, - 214, 118, 119, 120, 62, 178, 69, 556, 604, 604, - 218, 605, 605, 122, 65, 306, 329, 542, 547, 70, - 414, 332, 54, 360, 392, 268, 395, 72, 441, 123, - 454, 455, 307, 280, 110, 79, 496, 361, 306, 81, - 271, 353, 314, 215, 216, 217, 449, 219, 578, 608, - 609, 118, 119, 120, 436, 307, 586, 505, 488, 396, - 439, 220, 433, 80, 362, 306, 114, 306, 354, 82, - 291, 111, 292, 607, 491, 492, 124, 125, 126, 580, - 67, 68, 307, 218, 307, 133, 122, 325, 326, 327, - 328, 133, 329, 543, 464, 121, 306, 83, 572, 88, - 306, 331, 123, 590, 332, 401, 221, 222, 162, 437, - 296, 91, 489, 307, 223, 96, 306, 307, 545, 128, - 219, 214, 118, 119, 120, 402, 487, 340, 611, 612, - 341, 403, 402, 307, 220, 296, 122, 389, 490, 306, - 390, 214, 118, 119, 120, 214, 118, 119, 120, 124, - 125, 126, 123, 92, 434, 502, 307, 504, 207, 538, - 207, 540, 541, 103, 215, 216, 217, 104, 525, 535, - 493, 332, 332, 591, 592, 593, 75, 106, 506, 221, - 222, 498, 85, 86, 215, 216, 217, 223, 299, 216, - 217, 537, 128, 107, 345, 214, 118, 119, 120, 124, - 125, 126, 549, 117, 218, 345, 142, 122, 118, 119, - 120, 144, 561, 145, 583, 562, 573, 149, 566, 575, - 507, 332, 345, 123, 218, 508, 151, 122, 218, 127, - 152, 122, 509, 510, 599, 613, 154, 332, 332, 216, - 217, 219, 128, 123, 255, 256, 308, 123, 159, 511, - 160, 157, 118, -335, 512, 220, 165, 171, 597, 54, - 600, 219, 170, 546, 506, 300, 173, 179, 181, 202, - 124, 125, 126, 201, 203, 220, 206, 208, 218, 220, - 207, 122, 209, 309, 186, 187, 188, 189, 190, 191, - 124, 125, 126, 122, 124, 125, 126, 123, 243, 247, - 221, 222, 253, 250, 257, 114, 507, 273, 223, 123, - 281, 508, 15, 128, 293, 300, 290, 294, 509, 510, - 221, 222, 302, 330, 221, 222, 336, 295, 223, 220, - 337, 310, 223, 128, 357, 511, 333, 128, 339, -335, - 512, 342, 365, 367, 124, 125, 126, -288, 345, 352, - 366, 388, 311, 404, 387, 75, 124, 125, 126, 312, - 313, 407, 415, 435, 451, 457, 456, 314, 315, 465, - 466, 468, 469, 470, 221, 222, 479, 482, 486, 413, - 306, 485, 223, -337, 497, 500, 127, 128, 501, 329, - 1, 503, 519, 521, 531, 526, 523, 524, 2, 128, - 316, 317, 318, 319, 320, 3, 514, 321, 322, 4, - 323, 324, 325, 326, 327, 328, 527, 329, 506, 528, - 5, 532, 1, 6, 7, 529, 530, 536, 551, 544, - 2, 548, 550, -289, 552, 8, 9, 3, 553, 555, - 557, 4, 554, 558, 567, 579, 10, 560, 563, 11, - 564, 565, 5, 571, 581, 6, 7, 574, 589, 582, - 507, 596, 614, 74, 601, 508, 105, 8, 9, 533, - 440, 12, 509, 510, 481, 13, 584, 213, 10, 569, - 309, 11, 438, 335, 393, 279, 277, 452, 450, 511, - 577, 14, 368, 400, 512, 204, 205, 15, 309, 576, - 364, 169, 0, 12, 559, 369, 453, 13, 348, 0, - 370, 371, 372, 373, 374, 0, 375, 0, 0, 0, - 0, 0, 0, 14, 376, 0, 585, 0, 310, 15, - 0, 0, 0, 0, 0, 0, 309, 0, 0, 0, - 16, 17, 18, 495, 0, 0, 310, 0, 0, 405, - 377, 0, 0, 0, 309, 0, 0, 313, 0, 0, - 0, 0, 0, 0, 314, 315, 0, 405, 378, 0, - 379, 380, 16, 17, 18, 313, 0, 0, 0, 0, - 0, 0, 314, 315, -338, 381, 0, 0, 0, 0, - 382, 0, 383, 0, 0, 0, 0, 316, 317, 318, - 319, 320, 384, 0, 321, 322, 0, 323, 324, 325, - 326, 327, 328, 313, 329, 316, 317, 318, 319, 320, - 314, -338, 321, 322, 0, 323, 324, 325, 326, 327, - 328, 313, 329, 0, 0, 0, 385, 0, 314, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 0, 0, -338, -338, -338, 319, 320, 0, 0, - 321, 322, 0, 323, 324, 325, 326, 327, 328, 0, - 329, 0, 0, 0, -338, -338, 0, 0, -338, -338, - 0, 323, 324, 325, 326, 327, 328, 0, 329 + 137, 224, 47, 214, 215, 50, 225, 227, 118, 119, + 120, 60, 154, 64, 213, 213, 213, 108, 372, 360, + 280, 586, 10, 109, 10, 602, 140, 141, 286, 286, + 511, 170, 332, 257, 345, 46, 603, 46, 130, 85, + 316, 136, 346, 261, 85, 139, 140, 141, 537, 341, + 89, 457, 273, 287, 103, 501, 106, 281, 424, 262, + 608, 609, 287, 133, 512, 258, 347, 472, 121, 363, + 289, 213, 425, 426, 602, 86, 77, 470, 16, 289, + 86, 134, 285, 267, 298, 268, 425, 426, 499, 277, + 525, 279, 68, 502, 287, 85, 139, 140, 141, 460, + 348, 168, 169, 89, 569, 362, 356, 87, 513, 473, + 496, 289, 88, 210, 474, 519, 383, 88, 114, 217, + 218, 475, 476, 266, 298, 583, 514, 374, 259, 454, + 143, 86, 491, 69, 313, 45, 563, 46, 477, 116, + 142, 315, 287, 478, 364, 365, 144, 175, 139, 140, + 141, 471, 288, 481, 20, 415, 20, 367, 465, 289, + 385, 48, 387, 154, 285, 610, 333, 272, 88, 154, + 56, 287, 312, 145, 313, 584, 615, 368, 368, 117, + 393, 143, 558, 369, 466, 277, 604, 411, 289, 605, + 176, 177, 178, 145, 146, 147, 49, 144, 394, 361, + 224, 388, 358, 389, 420, 421, 469, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 62, 148, 375, 334, 125, 390, 490, 542, + 179, 611, 612, 143, 585, 604, 149, 51, 605, 335, + 467, 468, 328, 54, 145, 146, 147, 52, 65, 144, + 175, 139, 140, 141, 287, 391, 343, 55, 66, 607, + 226, 175, 139, 140, 141, 298, 336, 180, 287, 329, + 70, 289, 154, 410, 148, 57, 78, 464, 53, 571, + 61, 181, 73, 529, 287, 289, 287, 149, 528, 67, + 287, 79, 287, 176, 177, 178, 145, 146, 147, 488, + 94, 289, 463, 289, 176, 177, 178, 289, 10, 289, + 309, 310, 311, 312, 265, 313, 10, 503, 94, 355, + 417, 589, 356, 418, 80, 541, 182, 183, 82, 213, + 95, 154, 96, 179, 184, 524, 143, 526, 527, 149, + 287, 98, 565, 452, 179, 129, 453, 143, 521, 99, + 523, 254, 144, 285, 455, 544, 494, 289, 285, 546, + 272, 97, 254, 144, 175, 139, 140, 141, 104, 549, + 180, 559, 356, 107, 356, 175, 139, 140, 141, 573, + 575, 180, 285, 576, 181, 580, 111, 598, 356, 472, + 356, 613, 75, 76, 356, 181, 540, 322, 323, 145, + 146, 147, 566, 590, 591, 592, 109, 176, 177, 178, + 145, 146, 147, 112, 101, 102, 115, 122, 275, 177, + 178, 123, 124, 127, 128, 175, 139, 140, 141, 182, + 183, 473, 131, 10, 138, 165, 474, 184, 163, 166, + 182, 183, 149, 475, 476, 172, 206, 179, 184, 173, + 143, 209, 170, 149, 211, 139, 216, 596, 179, 599, + 477, 143, 62, 221, -334, 478, 144, 228, 582, 177, + 178, 249, 1, 248, 250, 292, 253, 144, 255, 256, + 2, 254, 263, 269, 180, 270, 282, 3, 271, 278, + 314, 4, 317, 472, 285, 276, 320, 324, 181, 327, + 331, 344, 5, 353, 357, 6, 7, 354, 179, 181, + 370, 143, 293, 145, 146, 147, 386, 8, 9, 373, + 392, 413, 414, 10, 145, 146, 147, 144, 11, 416, + 428, 12, 422, 423, 429, 473, 450, 456, 430, 451, + 474, 458, 462, 182, 183, 276, 461, 475, 476, 489, + 390, 184, 480, 13, 182, 183, 149, 14, -289, 181, + 294, 485, 184, 287, 477, 492, 313, 149, -334, 478, + 293, 498, 493, 15, 145, 146, 147, 500, 504, 16, + 505, 295, 233, 234, 235, 236, 237, 238, 296, 297, + 530, 507, 508, 532, 509, 536, 298, 299, 531, 518, + 522, 533, 534, 535, 182, 183, 538, 543, 539, 545, + 548, 550, 184, 551, 552, 553, 554, 149, 555, 556, + 564, 560, 17, 18, 19, 570, 87, 581, 572, 300, + 301, 302, 303, 304, 588, 614, 305, 306, 126, 307, + 308, 309, 310, 311, 312, 431, 313, 297, 293, 84, + 574, 497, 577, 578, 298, 20, 495, 579, 432, 595, + 520, 557, -290, 433, 434, 435, 436, 437, 600, 438, + 260, 412, 601, 93, 219, 419, 232, 439, 342, 293, + 359, 340, 384, 562, 251, 366, 252, 568, 290, 339, + -335, -335, 567, 220, -335, -335, 294, 307, 308, 309, + 310, 311, 312, 440, 313, 338, 293, 547, 0, 0, + 0, 487, 0, 0, 0, 0, 0, 371, 0, 0, + 0, 441, 0, 442, 443, 297, 0, 294, 0, 0, + 0, 0, 298, 299, 0, 0, 0, 0, 444, 0, + 0, 0, 0, 445, 0, 446, 0, 0, 371, 0, + 0, 0, 0, 0, -335, 447, 297, 0, 0, 0, + 0, 0, 0, 298, 299, 300, 301, 302, 303, 304, + 0, 0, 305, 306, 0, 307, 308, 309, 310, 311, + 312, 0, 313, 297, 0, 0, 0, 0, 0, 448, + 298, -335, 0, 0, 0, 0, 300, 301, 302, 303, + 304, 0, 0, 305, 306, 0, 307, 308, 309, 310, + 311, 312, 0, 313, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -335, -335, -335, 303, 304, 0, 0, + 305, 306, 0, 307, 308, 309, 310, 311, 312, 0, + 313, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244 }; static const yytype_int16 yycheck[] = { - 54, 175, 149, 302, 97, 98, 2, 211, 182, 5, - 57, 58, 59, 81, 10, 3, 12, 96, 97, 98, - 107, 3, 219, 366, 221, 12, 3, 6, 6, 115, - 5, 6, 112, 51, 181, 115, 183, 184, 155, 17, - 3, 58, 3, 365, 95, 388, 84, 78, 138, 203, - 95, 71, 48, 26, 50, 55, 3, 27, 151, 132, - 117, 81, 3, 105, 60, 71, 3, 603, 117, 189, - 12, 218, 151, 73, 194, 81, 223, 134, 614, 55, - 27, 123, 127, 3, 135, 134, 290, 160, 161, 85, - 86, 61, 112, 95, 393, 37, 186, 93, 188, 153, - 247, 9, 19, 300, 100, 101, 112, 3, 4, 5, - 6, 308, 54, 310, 61, 458, 415, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 99, 201, 191, 105, 479, 45, 255, 207, - 294, 117, 191, 60, 63, 190, 138, 178, 295, 296, - 46, 47, 48, 123, 117, 81, 194, 58, 134, 306, - 307, 103, 95, 64, 127, 487, 127, 160, 161, 223, - 264, 134, 102, 190, 82, 269, 194, 152, 9, 265, - 3, 4, 5, 6, 3, 265, 0, 514, 167, 167, - 86, 170, 170, 89, 156, 117, 188, 119, 497, 193, - 130, 194, 190, 122, 191, 352, 183, 114, 190, 105, - 357, 358, 134, 209, 45, 3, 413, 136, 117, 190, - 116, 91, 138, 46, 47, 48, 343, 123, 555, 168, - 169, 4, 5, 6, 333, 134, 579, 441, 110, 293, - 339, 137, 329, 192, 163, 117, 77, 117, 118, 95, - 190, 82, 192, 596, 401, 402, 152, 153, 154, 558, - 17, 18, 134, 86, 134, 333, 89, 183, 184, 185, - 186, 339, 188, 110, 367, 48, 117, 129, 119, 3, - 117, 191, 105, 582, 194, 93, 182, 183, 367, 336, - 113, 125, 93, 134, 190, 135, 117, 134, 495, 195, - 123, 3, 4, 5, 6, 113, 127, 191, 168, 169, - 194, 119, 113, 134, 137, 113, 89, 191, 119, 117, - 194, 3, 4, 5, 6, 3, 4, 5, 6, 152, - 153, 154, 105, 129, 330, 191, 134, 191, 194, 486, - 194, 488, 489, 127, 46, 47, 48, 194, 191, 191, - 404, 194, 194, 164, 165, 166, 58, 98, 25, 182, - 183, 415, 46, 47, 46, 47, 48, 190, 46, 47, - 48, 191, 195, 126, 194, 3, 4, 5, 6, 152, - 153, 154, 191, 3, 86, 194, 4, 89, 4, 5, - 6, 123, 191, 3, 568, 194, 543, 84, 191, 191, - 67, 194, 194, 105, 86, 72, 94, 89, 86, 182, - 190, 89, 79, 80, 191, 191, 3, 194, 194, 47, - 48, 123, 195, 105, 163, 164, 17, 105, 191, 96, - 191, 46, 4, 100, 101, 137, 3, 6, 585, 190, - 587, 123, 190, 497, 25, 123, 12, 116, 128, 4, - 152, 153, 154, 190, 4, 137, 191, 46, 86, 137, - 194, 89, 133, 54, 140, 141, 142, 143, 144, 145, - 152, 153, 154, 89, 152, 153, 154, 105, 3, 171, - 182, 183, 114, 92, 3, 77, 67, 120, 190, 105, - 3, 72, 114, 195, 190, 123, 127, 190, 79, 80, - 182, 183, 188, 99, 182, 183, 39, 190, 190, 137, - 49, 102, 190, 195, 55, 96, 190, 195, 190, 100, - 101, 95, 127, 94, 152, 153, 154, 194, 194, 194, - 190, 190, 123, 190, 122, 58, 152, 153, 154, 130, - 131, 191, 190, 3, 3, 122, 163, 138, 139, 190, - 190, 190, 190, 190, 182, 183, 190, 78, 95, 102, - 117, 191, 190, 0, 190, 105, 182, 195, 189, 188, - 7, 3, 70, 63, 122, 6, 162, 191, 15, 195, - 171, 172, 173, 174, 175, 22, 194, 178, 179, 26, - 181, 182, 183, 184, 185, 186, 6, 188, 25, 6, - 37, 105, 7, 40, 41, 6, 6, 190, 100, 191, - 15, 191, 191, 194, 79, 52, 53, 22, 79, 100, - 3, 26, 79, 128, 106, 190, 63, 191, 191, 66, - 191, 191, 37, 191, 6, 40, 41, 191, 191, 128, - 67, 190, 117, 24, 191, 72, 70, 52, 53, 477, - 341, 88, 79, 80, 390, 92, 83, 148, 63, 537, - 54, 66, 337, 248, 291, 207, 201, 352, 345, 96, - 551, 108, 11, 297, 101, 127, 127, 114, 54, 550, - 275, 104, -1, 88, 522, 24, 356, 92, 263, -1, - 29, 30, 31, 32, 33, -1, 35, -1, -1, -1, - -1, -1, -1, 108, 43, -1, 133, -1, 102, 114, - -1, -1, -1, -1, -1, -1, 54, -1, -1, -1, - 157, 158, 159, 117, -1, -1, 102, -1, -1, 123, - 69, -1, -1, -1, 54, -1, -1, 131, -1, -1, - -1, -1, -1, -1, 138, 139, -1, 123, 87, -1, - 89, 90, 157, 158, 159, 131, -1, -1, -1, -1, - -1, -1, 138, 139, 102, 104, -1, -1, -1, -1, - 109, -1, 111, -1, -1, -1, -1, 171, 172, 173, - 174, 175, 121, -1, 178, 179, -1, 181, 182, 183, - 184, 185, 186, 131, 188, 171, 172, 173, 174, 175, - 138, 139, 178, 179, -1, 181, 182, 183, 184, 185, - 186, 131, 188, -1, -1, -1, 155, -1, 138, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, -1, -1, 171, 172, 173, 174, 175, -1, -1, + 93, 128, 2, 116, 117, 5, 133, 134, 65, 66, + 67, 11, 97, 13, 115, 116, 117, 57, 278, 3, + 184, 51, 58, 12, 58, 6, 5, 6, 3, 3, + 27, 84, 55, 95, 258, 3, 17, 3, 89, 9, + 207, 92, 3, 170, 9, 4, 5, 6, 480, 250, + 40, 357, 179, 117, 54, 428, 56, 184, 132, 172, + 168, 169, 117, 55, 61, 127, 27, 25, 68, 270, + 134, 172, 160, 161, 6, 45, 20, 189, 114, 134, + 45, 73, 194, 190, 138, 192, 160, 161, 424, 180, + 463, 182, 19, 429, 117, 9, 4, 5, 6, 359, + 61, 101, 102, 93, 536, 269, 194, 77, 105, 67, + 416, 134, 82, 113, 72, 451, 283, 82, 62, 119, + 120, 79, 80, 174, 138, 83, 123, 191, 190, 353, + 89, 45, 392, 60, 188, 26, 191, 3, 96, 95, + 48, 194, 117, 101, 271, 272, 105, 3, 4, 5, + 6, 375, 127, 127, 190, 322, 190, 93, 93, 134, + 287, 3, 289, 248, 194, 603, 63, 113, 82, 254, + 99, 117, 186, 152, 188, 133, 614, 113, 113, 135, + 105, 89, 518, 119, 119, 276, 167, 314, 134, 170, + 46, 47, 48, 152, 153, 154, 3, 105, 123, 183, + 327, 292, 191, 294, 331, 332, 370, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 190, 182, 190, 122, 191, 102, 392, 489, + 86, 168, 169, 89, 570, 167, 195, 71, 170, 136, + 367, 368, 91, 95, 152, 153, 154, 81, 71, 105, + 3, 4, 5, 6, 117, 130, 256, 95, 81, 595, + 116, 3, 4, 5, 6, 138, 163, 123, 117, 118, + 3, 134, 357, 313, 182, 126, 20, 110, 112, 539, + 81, 137, 156, 110, 117, 134, 117, 195, 119, 112, + 117, 0, 117, 46, 47, 48, 152, 153, 154, 390, + 44, 134, 127, 134, 46, 47, 48, 134, 58, 134, + 183, 184, 185, 186, 64, 188, 58, 430, 62, 191, + 191, 581, 194, 194, 193, 489, 182, 183, 114, 430, + 3, 416, 192, 86, 190, 462, 89, 464, 465, 195, + 117, 95, 119, 191, 86, 89, 194, 89, 191, 129, + 191, 194, 105, 194, 354, 191, 413, 134, 194, 191, + 113, 190, 194, 105, 3, 4, 5, 6, 3, 191, + 123, 191, 194, 6, 194, 3, 4, 5, 6, 191, + 191, 123, 194, 194, 137, 191, 125, 191, 194, 25, + 194, 191, 18, 19, 194, 137, 487, 214, 215, 152, + 153, 154, 529, 164, 165, 166, 12, 46, 47, 48, + 152, 153, 154, 129, 52, 53, 135, 127, 46, 47, + 48, 194, 191, 98, 128, 3, 4, 5, 6, 182, + 183, 67, 116, 58, 3, 123, 72, 190, 4, 3, + 182, 183, 195, 79, 80, 94, 3, 86, 190, 190, + 89, 46, 84, 195, 191, 4, 3, 584, 86, 586, + 96, 89, 190, 190, 100, 101, 105, 120, 561, 47, + 48, 4, 7, 190, 4, 17, 191, 105, 46, 133, + 15, 194, 3, 190, 123, 190, 95, 22, 190, 188, + 171, 26, 92, 25, 194, 123, 114, 3, 137, 194, + 55, 3, 37, 127, 190, 40, 41, 99, 86, 137, + 190, 89, 54, 152, 153, 154, 3, 52, 53, 191, + 190, 39, 49, 58, 152, 153, 154, 105, 63, 190, + 127, 66, 163, 122, 190, 67, 122, 3, 94, 190, + 72, 78, 95, 182, 183, 123, 191, 79, 80, 190, + 102, 190, 194, 88, 182, 183, 195, 92, 194, 137, + 102, 70, 190, 117, 96, 105, 188, 195, 100, 101, + 54, 63, 189, 108, 152, 153, 154, 162, 190, 114, + 190, 123, 140, 141, 142, 143, 144, 145, 130, 131, + 191, 190, 190, 100, 190, 100, 138, 139, 191, 190, + 190, 79, 79, 79, 182, 183, 3, 191, 128, 3, + 191, 6, 190, 6, 6, 6, 6, 195, 122, 105, + 191, 106, 157, 158, 159, 190, 77, 128, 191, 171, + 172, 173, 174, 175, 6, 117, 178, 179, 80, 181, + 182, 183, 184, 185, 186, 11, 188, 131, 54, 26, + 191, 418, 191, 191, 138, 190, 414, 191, 24, 190, + 453, 516, 194, 29, 30, 31, 32, 33, 191, 35, + 169, 315, 191, 44, 122, 327, 137, 43, 254, 54, + 267, 248, 285, 523, 148, 273, 148, 532, 188, 232, + 174, 175, 531, 123, 178, 179, 102, 181, 182, 183, + 184, 185, 186, 69, 188, 230, 54, 499, -1, -1, + -1, 117, -1, -1, -1, -1, -1, 123, -1, -1, + -1, 87, -1, 89, 90, 131, -1, 102, -1, -1, + -1, -1, 138, 139, -1, -1, -1, -1, 104, -1, + -1, -1, -1, 109, -1, 111, -1, -1, 123, -1, + -1, -1, -1, -1, 102, 121, 131, -1, -1, -1, + -1, -1, -1, 138, 139, 171, 172, 173, 174, 175, + -1, -1, 178, 179, -1, 181, 182, 183, 184, 185, + 186, -1, 188, 131, -1, -1, -1, -1, -1, 155, + 138, 139, -1, -1, -1, -1, 171, 172, 173, 174, + 175, -1, -1, 178, 179, -1, 181, 182, 183, 184, + 185, 186, -1, 188, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 171, 172, 173, 174, 175, -1, -1, 178, 179, -1, 181, 182, 183, 184, 185, 186, -1, - 188, -1, -1, -1, 174, 175, -1, -1, 178, 179, - -1, 181, 182, 183, 184, 185, 186, -1, 188 + 188, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1364,67 +1359,67 @@ static const yytype_int16 yycheck[] = static const yytype_int16 yystos[] = { 0, 7, 15, 22, 26, 37, 40, 41, 52, 53, - 63, 66, 88, 92, 108, 114, 157, 158, 159, 197, - 198, 199, 200, 204, 206, 208, 209, 213, 214, 215, - 227, 229, 232, 233, 234, 236, 239, 319, 320, 26, - 3, 308, 3, 3, 308, 71, 81, 112, 95, 95, - 99, 307, 308, 81, 190, 242, 308, 71, 81, 112, - 19, 60, 3, 321, 322, 156, 205, 205, 205, 0, - 193, 326, 114, 201, 201, 58, 242, 243, 247, 3, - 192, 190, 95, 129, 216, 216, 216, 308, 3, 210, - 308, 125, 129, 228, 242, 243, 135, 95, 135, 228, - 228, 228, 308, 127, 194, 199, 98, 126, 259, 9, - 45, 82, 244, 245, 77, 244, 255, 3, 4, 5, - 6, 48, 89, 105, 152, 153, 154, 182, 195, 262, - 263, 264, 265, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 4, 207, 123, 3, 309, 308, 308, 84, - 252, 94, 190, 235, 3, 237, 238, 46, 308, 191, - 191, 211, 294, 211, 211, 3, 308, 308, 242, 322, - 190, 6, 297, 12, 248, 240, 241, 242, 247, 116, - 246, 128, 240, 55, 73, 260, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 286, 287, - 288, 190, 4, 4, 296, 300, 191, 194, 46, 133, - 95, 127, 190, 235, 3, 46, 47, 48, 86, 123, - 137, 182, 183, 190, 267, 268, 269, 270, 271, 272, - 273, 274, 276, 277, 278, 284, 285, 289, 290, 291, - 292, 293, 211, 3, 327, 64, 243, 171, 194, 252, - 92, 230, 231, 114, 212, 212, 212, 3, 202, 203, - 249, 261, 266, 267, 255, 244, 256, 257, 267, 255, - 267, 116, 267, 120, 314, 315, 316, 265, 286, 264, - 308, 3, 239, 3, 27, 61, 217, 218, 219, 226, - 127, 190, 192, 190, 190, 190, 113, 267, 275, 46, - 123, 268, 188, 268, 243, 267, 117, 134, 17, 54, - 102, 123, 130, 131, 138, 139, 171, 172, 173, 174, - 175, 178, 179, 181, 182, 183, 184, 185, 186, 188, - 99, 191, 194, 190, 267, 238, 39, 49, 252, 190, - 191, 194, 95, 250, 251, 194, 3, 127, 312, 313, - 260, 240, 194, 91, 118, 258, 260, 55, 55, 63, - 122, 136, 163, 317, 316, 127, 190, 94, 11, 24, - 29, 30, 31, 32, 33, 35, 43, 69, 87, 89, - 90, 104, 109, 111, 121, 155, 220, 122, 190, 191, - 194, 239, 191, 248, 3, 183, 243, 286, 267, 267, - 275, 93, 113, 119, 190, 123, 261, 191, 191, 267, - 267, 268, 268, 102, 130, 190, 105, 123, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 297, 308, 3, 263, 228, 210, 263, - 203, 190, 302, 303, 304, 305, 306, 308, 323, 252, - 266, 3, 257, 314, 267, 267, 163, 122, 132, 160, - 161, 318, 220, 327, 211, 190, 190, 222, 190, 190, - 190, 221, 27, 61, 105, 123, 223, 224, 225, 190, - 327, 218, 78, 279, 261, 191, 95, 127, 110, 93, - 119, 267, 267, 243, 189, 117, 268, 190, 243, 261, - 105, 189, 191, 3, 191, 239, 25, 67, 72, 79, - 80, 96, 101, 324, 194, 127, 310, 311, 312, 70, - 253, 63, 327, 162, 191, 191, 6, 6, 6, 6, - 6, 122, 105, 225, 327, 191, 190, 191, 267, 220, - 267, 267, 119, 110, 191, 268, 243, 261, 191, 191, - 191, 100, 79, 79, 79, 100, 303, 3, 128, 318, - 191, 191, 194, 191, 191, 191, 191, 106, 280, 279, - 191, 191, 119, 267, 191, 191, 311, 304, 303, 190, - 261, 6, 128, 255, 83, 133, 327, 51, 254, 191, - 261, 164, 165, 166, 281, 282, 190, 267, 325, 191, - 267, 191, 6, 17, 167, 170, 283, 327, 168, 169, - 283, 168, 169, 191, 117, 283 + 58, 63, 66, 88, 92, 108, 114, 157, 158, 159, + 190, 197, 198, 199, 200, 204, 206, 208, 209, 213, + 214, 215, 227, 229, 232, 233, 234, 236, 239, 240, + 241, 242, 243, 248, 320, 26, 3, 309, 3, 3, + 309, 71, 81, 112, 95, 95, 99, 126, 260, 308, + 309, 81, 190, 244, 309, 71, 81, 112, 19, 60, + 3, 321, 322, 156, 205, 205, 205, 240, 242, 0, + 193, 326, 114, 201, 201, 9, 45, 77, 82, 245, + 246, 256, 245, 241, 242, 3, 192, 190, 95, 129, + 216, 216, 216, 309, 3, 210, 309, 6, 298, 12, + 249, 125, 129, 228, 240, 135, 95, 135, 228, 228, + 228, 309, 127, 194, 191, 191, 199, 98, 128, 242, + 243, 116, 247, 55, 73, 261, 243, 256, 3, 4, + 5, 6, 48, 89, 105, 152, 153, 154, 182, 195, + 263, 264, 265, 266, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 4, 207, 123, 3, 310, 309, 309, + 84, 253, 94, 190, 235, 3, 46, 47, 48, 86, + 123, 137, 182, 183, 190, 250, 262, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 277, 278, 279, 285, + 286, 290, 291, 292, 293, 294, 3, 237, 238, 46, + 309, 191, 211, 295, 211, 211, 3, 309, 309, 244, + 322, 190, 257, 258, 268, 268, 116, 268, 120, 315, + 316, 317, 261, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 287, 288, 289, 190, 4, + 4, 297, 301, 191, 194, 46, 133, 95, 127, 190, + 235, 268, 211, 3, 327, 64, 243, 190, 192, 190, + 190, 190, 113, 268, 276, 46, 123, 269, 188, 269, + 248, 268, 95, 251, 252, 194, 3, 117, 127, 134, + 313, 314, 17, 54, 102, 123, 130, 131, 138, 139, + 171, 172, 173, 174, 175, 178, 179, 181, 182, 183, + 184, 185, 186, 188, 171, 194, 253, 92, 230, 231, + 114, 212, 212, 212, 3, 202, 203, 194, 91, 118, + 259, 55, 55, 63, 122, 136, 163, 318, 317, 315, + 266, 287, 265, 309, 3, 239, 3, 27, 61, 217, + 218, 219, 226, 127, 99, 191, 194, 190, 191, 249, + 3, 183, 248, 287, 268, 268, 276, 93, 113, 119, + 190, 123, 262, 191, 191, 190, 303, 304, 305, 306, + 307, 309, 323, 253, 267, 268, 3, 268, 269, 269, + 102, 130, 190, 105, 123, 269, 269, 269, 269, 269, + 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, + 298, 268, 238, 39, 49, 253, 190, 191, 194, 258, + 268, 268, 163, 122, 132, 160, 161, 319, 127, 190, + 94, 11, 24, 29, 30, 31, 32, 33, 35, 43, + 69, 87, 89, 90, 104, 109, 111, 121, 155, 220, + 122, 190, 191, 194, 239, 309, 3, 264, 78, 280, + 262, 191, 95, 127, 110, 93, 119, 268, 268, 248, + 189, 239, 25, 67, 72, 79, 80, 96, 101, 324, + 194, 127, 311, 312, 313, 70, 254, 117, 269, 190, + 248, 262, 105, 189, 228, 210, 264, 203, 63, 327, + 162, 220, 327, 211, 190, 190, 222, 190, 190, 190, + 221, 27, 61, 105, 123, 223, 224, 225, 190, 327, + 218, 191, 190, 191, 268, 220, 268, 268, 119, 110, + 191, 191, 100, 79, 79, 79, 100, 304, 3, 128, + 269, 248, 262, 191, 191, 3, 191, 319, 191, 191, + 6, 6, 6, 6, 6, 122, 105, 225, 327, 191, + 106, 281, 280, 191, 191, 119, 268, 312, 305, 304, + 190, 262, 191, 191, 191, 191, 194, 191, 191, 191, + 191, 128, 256, 83, 133, 327, 51, 255, 6, 262, + 164, 165, 166, 282, 283, 190, 268, 325, 191, 268, + 191, 191, 6, 17, 167, 170, 284, 327, 168, 169, + 284, 168, 169, 191, 117, 284 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1441,30 +1436,29 @@ static const yytype_int16 yyr1[] = 222, 223, 223, 224, 224, 225, 225, 225, 225, 226, 226, 227, 227, 227, 227, 228, 228, 229, 230, 231, 232, 233, 234, 234, 235, 235, 236, 237, 237, 238, - 239, 239, 239, 240, 240, 241, 241, 242, 242, 243, - 243, 244, 245, 245, 245, 246, 246, 247, 248, 248, - 249, 250, 250, 251, 252, 252, 253, 253, 254, 254, - 255, 255, 256, 256, 257, 258, 258, 258, 259, 259, - 260, 260, 260, 260, 260, 260, 261, 261, 262, 262, - 263, 263, 264, 264, 265, 265, 265, 266, 267, 267, - 267, 267, 267, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 269, 269, 270, 270, 270, 270, - 270, 271, 271, 271, 271, 271, 271, 271, 271, 271, - 271, 271, 272, 272, 273, 273, 273, 273, 274, 274, - 274, 274, 275, 275, 276, 276, 277, 277, 277, 277, - 277, 277, 277, 278, 278, 279, 279, 280, 280, 281, - 281, 281, 282, 282, 282, 283, 283, 283, 283, 283, - 284, 285, 286, 286, 286, 286, 286, 286, 287, 287, - 287, 287, 287, 287, 288, 288, 289, 290, 291, 292, - 292, 292, 292, 293, 293, 293, 293, 293, 293, 293, - 294, 295, 295, 296, 296, 297, 298, 299, 300, 300, - 300, 301, 302, 302, 303, 303, 304, 304, 305, 305, - 306, 307, 308, 308, 309, 309, 310, 310, 311, 311, - 312, 312, 313, 313, 314, 314, 315, 315, 316, 316, - 317, 317, 317, 317, 318, 318, 318, 319, 319, 320, - 321, 321, 322, 323, 323, 323, 324, 324, 324, 324, - 324, 324, 324, 324, 324, 324, 325, 326, 326, 327, - 327 + 239, 239, 240, 240, 241, 241, 241, 241, 242, 242, + 243, 244, 245, 246, 246, 246, 247, 247, 248, 249, + 249, 250, 251, 251, 252, 253, 253, 254, 254, 255, + 255, 256, 256, 257, 257, 258, 259, 259, 259, 260, + 260, 261, 261, 261, 261, 261, 261, 262, 262, 263, + 263, 264, 264, 265, 265, 266, 266, 266, 267, 268, + 268, 268, 268, 268, 269, 269, 269, 269, 269, 269, + 269, 269, 269, 269, 269, 270, 270, 271, 271, 271, + 271, 271, 272, 272, 272, 272, 272, 272, 272, 272, + 272, 272, 272, 273, 273, 274, 274, 274, 274, 275, + 275, 275, 275, 276, 276, 277, 277, 278, 278, 278, + 278, 278, 278, 278, 279, 279, 280, 280, 281, 281, + 282, 282, 282, 283, 283, 283, 284, 284, 284, 284, + 284, 285, 286, 287, 287, 287, 287, 287, 287, 288, + 288, 288, 288, 288, 288, 289, 289, 290, 291, 292, + 293, 293, 293, 293, 294, 294, 294, 294, 294, 294, + 294, 295, 296, 296, 297, 297, 298, 299, 300, 301, + 301, 301, 302, 303, 303, 304, 304, 305, 305, 306, + 306, 307, 308, 309, 309, 310, 310, 311, 311, 312, + 312, 313, 313, 314, 314, 315, 315, 316, 316, 317, + 317, 318, 318, 318, 318, 319, 319, 319, 320, 321, + 321, 322, 323, 323, 323, 324, 324, 324, 324, 324, + 324, 324, 324, 324, 324, 325, 326, 326, 327, 327 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1481,30 +1475,29 @@ static const yytype_int8 yyr2[] = 0, 1, 0, 1, 2, 2, 1, 1, 2, 5, 4, 4, 4, 3, 4, 2, 0, 5, 1, 4, 4, 2, 8, 5, 3, 0, 5, 1, 3, 3, - 2, 2, 6, 1, 1, 1, 3, 3, 3, 4, - 6, 2, 1, 1, 1, 1, 0, 7, 1, 0, - 1, 1, 0, 2, 2, 0, 4, 0, 2, 0, - 3, 0, 1, 3, 2, 1, 1, 0, 2, 0, - 2, 2, 4, 2, 4, 0, 1, 3, 1, 0, - 1, 3, 1, 6, 1, 2, 2, 2, 1, 1, - 1, 1, 1, 3, 1, 1, 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, 4, 6, - 3, 5, 4, 5, 4, 5, 3, 3, 3, 3, - 3, 3, 3, 4, 6, 6, 0, 3, 0, 2, - 5, 0, 1, 1, 1, 2, 2, 2, 2, 1, - 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 5, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, - 2, 1, 1, 3, 1, 1, 1, 4, 1, 3, - 2, 1, 1, 3, 1, 0, 1, 5, 1, 0, - 2, 1, 1, 0, 1, 0, 1, 2, 3, 5, - 1, 3, 1, 2, 2, 1, 0, 1, 0, 2, - 1, 3, 3, 4, 6, 8, 1, 2, 1, 2, - 1, 2, 1, 1, 1, 0, 1, 1, 0, 1, - 3 + 1, 1, 4, 5, 1, 3, 3, 3, 3, 3, + 1, 3, 2, 1, 1, 1, 1, 0, 7, 1, + 0, 1, 1, 0, 2, 2, 0, 4, 0, 2, + 0, 3, 0, 1, 3, 2, 1, 1, 0, 2, + 0, 2, 2, 4, 2, 4, 0, 1, 3, 1, + 0, 1, 3, 1, 6, 1, 2, 2, 2, 1, + 1, 1, 1, 1, 3, 1, 1, 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, 4, + 6, 3, 5, 4, 5, 4, 5, 3, 3, 3, + 3, 3, 3, 3, 4, 6, 6, 0, 3, 0, + 2, 5, 0, 1, 1, 1, 2, 2, 2, 2, + 1, 6, 6, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 4, 5, + 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 3, 2, 1, 1, 3, 1, 1, 1, 4, 1, + 3, 2, 1, 1, 3, 1, 0, 1, 5, 1, + 0, 2, 1, 1, 0, 1, 0, 1, 2, 3, + 5, 1, 3, 1, 2, 2, 1, 0, 2, 1, + 3, 3, 4, 6, 8, 1, 2, 1, 2, 1, + 2, 1, 1, 1, 0, 1, 1, 0, 1, 3 }; @@ -2068,31 +2061,31 @@ yydestruct (const char *yymsg, switch (yykind) { case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ -#line 184 "bison_parser.y" +#line 186 "bison_parser.y" { free( (((*yyvaluep).sval)) ); } -#line 2074 "bison_parser.cpp" +#line 2067 "bison_parser.cpp" break; case YYSYMBOL_STRING: /* STRING */ -#line 184 "bison_parser.y" +#line 186 "bison_parser.y" { free( (((*yyvaluep).sval)) ); } -#line 2080 "bison_parser.cpp" +#line 2073 "bison_parser.cpp" break; case YYSYMBOL_FLOATVAL: /* FLOATVAL */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2086 "bison_parser.cpp" +#line 2079 "bison_parser.cpp" break; case YYSYMBOL_INTVAL: /* INTVAL */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2092 "bison_parser.cpp" +#line 2085 "bison_parser.cpp" break; case YYSYMBOL_statement_list: /* statement_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).stmt_vec)) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { @@ -2101,23 +2094,23 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).stmt_vec)); } -#line 2105 "bison_parser.cpp" +#line 2098 "bison_parser.cpp" break; case YYSYMBOL_statement: /* statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).statement)); } -#line 2111 "bison_parser.cpp" +#line 2104 "bison_parser.cpp" break; case YYSYMBOL_preparable_statement: /* preparable_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).statement)); } -#line 2117 "bison_parser.cpp" +#line 2110 "bison_parser.cpp" break; case YYSYMBOL_opt_hints: /* opt_hints */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2126,11 +2119,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2130 "bison_parser.cpp" +#line 2123 "bison_parser.cpp" break; case YYSYMBOL_hint_list: /* hint_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2139,89 +2132,89 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2143 "bison_parser.cpp" +#line 2136 "bison_parser.cpp" break; case YYSYMBOL_hint: /* hint */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2149 "bison_parser.cpp" +#line 2142 "bison_parser.cpp" break; case YYSYMBOL_transaction_statement: /* transaction_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).transaction_stmt)); } -#line 2155 "bison_parser.cpp" +#line 2148 "bison_parser.cpp" break; case YYSYMBOL_prepare_statement: /* prepare_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).prep_stmt)); } -#line 2161 "bison_parser.cpp" +#line 2154 "bison_parser.cpp" break; case YYSYMBOL_prepare_target_query: /* prepare_target_query */ -#line 184 "bison_parser.y" +#line 186 "bison_parser.y" { free( (((*yyvaluep).sval)) ); } -#line 2167 "bison_parser.cpp" +#line 2160 "bison_parser.cpp" break; case YYSYMBOL_execute_statement: /* execute_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).exec_stmt)); } -#line 2173 "bison_parser.cpp" +#line 2166 "bison_parser.cpp" break; case YYSYMBOL_import_statement: /* import_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).import_stmt)); } -#line 2179 "bison_parser.cpp" +#line 2172 "bison_parser.cpp" break; case YYSYMBOL_file_type: /* file_type */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2185 "bison_parser.cpp" +#line 2178 "bison_parser.cpp" break; case YYSYMBOL_file_path: /* file_path */ -#line 184 "bison_parser.y" +#line 186 "bison_parser.y" { free( (((*yyvaluep).sval)) ); } -#line 2191 "bison_parser.cpp" +#line 2184 "bison_parser.cpp" break; case YYSYMBOL_opt_file_type: /* opt_file_type */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2197 "bison_parser.cpp" +#line 2190 "bison_parser.cpp" break; case YYSYMBOL_export_statement: /* export_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).export_stmt)); } -#line 2203 "bison_parser.cpp" +#line 2196 "bison_parser.cpp" break; case YYSYMBOL_show_statement: /* show_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).show_stmt)); } -#line 2209 "bison_parser.cpp" +#line 2202 "bison_parser.cpp" break; case YYSYMBOL_create_statement: /* create_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).create_stmt)); } -#line 2215 "bison_parser.cpp" +#line 2208 "bison_parser.cpp" break; case YYSYMBOL_opt_not_exists: /* opt_not_exists */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2221 "bison_parser.cpp" +#line 2214 "bison_parser.cpp" break; case YYSYMBOL_table_elem_commalist: /* table_elem_commalist */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).table_element_vec)) { for (auto ptr : *(((*yyvaluep).table_element_vec))) { @@ -2230,113 +2223,113 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).table_element_vec)); } -#line 2234 "bison_parser.cpp" +#line 2227 "bison_parser.cpp" break; case YYSYMBOL_table_elem: /* table_elem */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table_element_t)); } -#line 2240 "bison_parser.cpp" +#line 2233 "bison_parser.cpp" break; case YYSYMBOL_column_def: /* column_def */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).column_t)); } -#line 2246 "bison_parser.cpp" +#line 2239 "bison_parser.cpp" break; case YYSYMBOL_column_type: /* column_type */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2252 "bison_parser.cpp" +#line 2245 "bison_parser.cpp" break; case YYSYMBOL_opt_time_precision: /* opt_time_precision */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2258 "bison_parser.cpp" +#line 2251 "bison_parser.cpp" break; case YYSYMBOL_opt_decimal_specification: /* opt_decimal_specification */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).ival_pair)); } -#line 2264 "bison_parser.cpp" +#line 2257 "bison_parser.cpp" break; case YYSYMBOL_opt_column_constraints: /* opt_column_constraints */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2270 "bison_parser.cpp" +#line 2263 "bison_parser.cpp" break; case YYSYMBOL_column_constraint_set: /* column_constraint_set */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2276 "bison_parser.cpp" +#line 2269 "bison_parser.cpp" break; case YYSYMBOL_column_constraint: /* column_constraint */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2282 "bison_parser.cpp" +#line 2275 "bison_parser.cpp" break; case YYSYMBOL_table_constraint: /* table_constraint */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table_constraint_t)); } -#line 2288 "bison_parser.cpp" +#line 2281 "bison_parser.cpp" break; case YYSYMBOL_drop_statement: /* drop_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).drop_stmt)); } -#line 2294 "bison_parser.cpp" +#line 2287 "bison_parser.cpp" break; case YYSYMBOL_opt_exists: /* opt_exists */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2300 "bison_parser.cpp" +#line 2293 "bison_parser.cpp" break; case YYSYMBOL_alter_statement: /* alter_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).alter_stmt)); } -#line 2306 "bison_parser.cpp" +#line 2299 "bison_parser.cpp" break; case YYSYMBOL_alter_action: /* alter_action */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).alter_action_t)); } -#line 2312 "bison_parser.cpp" +#line 2305 "bison_parser.cpp" break; case YYSYMBOL_drop_action: /* drop_action */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).drop_action_t)); } -#line 2318 "bison_parser.cpp" +#line 2311 "bison_parser.cpp" break; case YYSYMBOL_delete_statement: /* delete_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).delete_stmt)); } -#line 2324 "bison_parser.cpp" +#line 2317 "bison_parser.cpp" break; case YYSYMBOL_truncate_statement: /* truncate_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).delete_stmt)); } -#line 2330 "bison_parser.cpp" +#line 2323 "bison_parser.cpp" break; case YYSYMBOL_insert_statement: /* insert_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).insert_stmt)); } -#line 2336 "bison_parser.cpp" +#line 2329 "bison_parser.cpp" break; case YYSYMBOL_opt_column_list: /* opt_column_list */ -#line 176 "bison_parser.y" +#line 178 "bison_parser.y" { if (((*yyvaluep).str_vec)) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2345,17 +2338,17 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).str_vec)); } -#line 2349 "bison_parser.cpp" +#line 2342 "bison_parser.cpp" break; case YYSYMBOL_update_statement: /* update_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).update_stmt)); } -#line 2355 "bison_parser.cpp" +#line 2348 "bison_parser.cpp" break; case YYSYMBOL_update_clause_commalist: /* update_clause_commalist */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).update_vec)) { for (auto ptr : *(((*yyvaluep).update_vec))) { @@ -2364,77 +2357,83 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).update_vec)); } -#line 2368 "bison_parser.cpp" +#line 2361 "bison_parser.cpp" break; case YYSYMBOL_update_clause: /* update_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).update_t)); } -#line 2374 "bison_parser.cpp" +#line 2367 "bison_parser.cpp" break; case YYSYMBOL_select_statement: /* select_statement */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" + { delete (((*yyvaluep).select_stmt)); } +#line 2373 "bison_parser.cpp" + break; + + case YYSYMBOL_query_expression: /* query_expression */ +#line 195 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2380 "bison_parser.cpp" +#line 2379 "bison_parser.cpp" break; - case YYSYMBOL_select_within_set_operation: /* select_within_set_operation */ -#line 193 "bison_parser.y" + case YYSYMBOL_query_expression_body: /* query_expression_body */ +#line 195 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2386 "bison_parser.cpp" +#line 2385 "bison_parser.cpp" break; - case YYSYMBOL_select_within_set_operation_no_parentheses: /* select_within_set_operation_no_parentheses */ -#line 193 "bison_parser.y" + case YYSYMBOL_query_expression_parens: /* query_expression_parens */ +#line 195 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2392 "bison_parser.cpp" +#line 2391 "bison_parser.cpp" break; - case YYSYMBOL_select_with_paren: /* select_with_paren */ -#line 193 "bison_parser.y" + case YYSYMBOL_query_term: /* query_term */ +#line 195 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2398 "bison_parser.cpp" +#line 2397 "bison_parser.cpp" break; - case YYSYMBOL_select_no_paren: /* select_no_paren */ -#line 193 "bison_parser.y" + case YYSYMBOL_subquery: /* subquery */ +#line 195 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2404 "bison_parser.cpp" +#line 2403 "bison_parser.cpp" break; case YYSYMBOL_set_operator: /* set_operator */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).set_operator_t)); } -#line 2410 "bison_parser.cpp" +#line 2409 "bison_parser.cpp" break; case YYSYMBOL_set_type: /* set_type */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).set_operator_t)); } -#line 2416 "bison_parser.cpp" +#line 2415 "bison_parser.cpp" break; case YYSYMBOL_opt_all: /* opt_all */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2422 "bison_parser.cpp" +#line 2421 "bison_parser.cpp" break; - case YYSYMBOL_select_clause: /* select_clause */ -#line 193 "bison_parser.y" + case YYSYMBOL_query_primary: /* query_primary */ +#line 195 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2428 "bison_parser.cpp" +#line 2427 "bison_parser.cpp" break; case YYSYMBOL_opt_distinct: /* opt_distinct */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2434 "bison_parser.cpp" +#line 2433 "bison_parser.cpp" break; case YYSYMBOL_select_list: /* select_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2443,41 +2442,41 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2447 "bison_parser.cpp" +#line 2446 "bison_parser.cpp" break; case YYSYMBOL_opt_from_clause: /* opt_from_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2453 "bison_parser.cpp" +#line 2452 "bison_parser.cpp" break; case YYSYMBOL_from_clause: /* from_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2459 "bison_parser.cpp" +#line 2458 "bison_parser.cpp" break; case YYSYMBOL_opt_where: /* opt_where */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2465 "bison_parser.cpp" +#line 2464 "bison_parser.cpp" break; case YYSYMBOL_opt_group: /* opt_group */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).group_t)); } -#line 2471 "bison_parser.cpp" +#line 2470 "bison_parser.cpp" break; case YYSYMBOL_opt_having: /* opt_having */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2477 "bison_parser.cpp" +#line 2476 "bison_parser.cpp" break; case YYSYMBOL_opt_order: /* opt_order */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).order_vec)) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -2486,11 +2485,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).order_vec)); } -#line 2490 "bison_parser.cpp" +#line 2489 "bison_parser.cpp" break; case YYSYMBOL_order_list: /* order_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).order_vec)) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -2499,35 +2498,35 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).order_vec)); } -#line 2503 "bison_parser.cpp" +#line 2502 "bison_parser.cpp" break; case YYSYMBOL_order_desc: /* order_desc */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).order)); } -#line 2509 "bison_parser.cpp" +#line 2508 "bison_parser.cpp" break; case YYSYMBOL_opt_order_type: /* opt_order_type */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2515 "bison_parser.cpp" +#line 2514 "bison_parser.cpp" break; case YYSYMBOL_opt_top: /* opt_top */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).limit)); } -#line 2521 "bison_parser.cpp" +#line 2520 "bison_parser.cpp" break; case YYSYMBOL_opt_limit: /* opt_limit */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).limit)); } -#line 2527 "bison_parser.cpp" +#line 2526 "bison_parser.cpp" break; case YYSYMBOL_expr_list: /* expr_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2536,11 +2535,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2540 "bison_parser.cpp" +#line 2539 "bison_parser.cpp" break; case YYSYMBOL_opt_extended_literal_list: /* opt_extended_literal_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2549,11 +2548,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2553 "bison_parser.cpp" +#line 2552 "bison_parser.cpp" break; case YYSYMBOL_extended_literal_list: /* extended_literal_list */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2562,107 +2561,107 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2566 "bison_parser.cpp" +#line 2565 "bison_parser.cpp" break; case YYSYMBOL_casted_extended_literal: /* casted_extended_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2572 "bison_parser.cpp" +#line 2571 "bison_parser.cpp" break; case YYSYMBOL_extended_literal: /* extended_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2578 "bison_parser.cpp" +#line 2577 "bison_parser.cpp" break; case YYSYMBOL_expr_alias: /* expr_alias */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2584 "bison_parser.cpp" +#line 2583 "bison_parser.cpp" break; case YYSYMBOL_expr: /* expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2590 "bison_parser.cpp" +#line 2589 "bison_parser.cpp" break; case YYSYMBOL_operand: /* operand */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2596 "bison_parser.cpp" +#line 2595 "bison_parser.cpp" break; case YYSYMBOL_scalar_expr: /* scalar_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2602 "bison_parser.cpp" +#line 2601 "bison_parser.cpp" break; case YYSYMBOL_unary_expr: /* unary_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2608 "bison_parser.cpp" +#line 2607 "bison_parser.cpp" break; case YYSYMBOL_binary_expr: /* binary_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2614 "bison_parser.cpp" +#line 2613 "bison_parser.cpp" break; case YYSYMBOL_logic_expr: /* logic_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2620 "bison_parser.cpp" +#line 2619 "bison_parser.cpp" break; case YYSYMBOL_in_expr: /* in_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2626 "bison_parser.cpp" +#line 2625 "bison_parser.cpp" break; case YYSYMBOL_case_expr: /* case_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2632 "bison_parser.cpp" +#line 2631 "bison_parser.cpp" break; case YYSYMBOL_case_list: /* case_list */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2638 "bison_parser.cpp" +#line 2637 "bison_parser.cpp" break; case YYSYMBOL_exists_expr: /* exists_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2644 "bison_parser.cpp" +#line 2643 "bison_parser.cpp" break; case YYSYMBOL_comp_expr: /* comp_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2650 "bison_parser.cpp" +#line 2649 "bison_parser.cpp" break; case YYSYMBOL_function_expr: /* function_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2656 "bison_parser.cpp" +#line 2655 "bison_parser.cpp" break; case YYSYMBOL_opt_window: /* opt_window */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).window_description)); } -#line 2662 "bison_parser.cpp" +#line 2661 "bison_parser.cpp" break; case YYSYMBOL_opt_partition: /* opt_partition */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2671,155 +2670,155 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2675 "bison_parser.cpp" +#line 2674 "bison_parser.cpp" break; case YYSYMBOL_opt_frame_clause: /* opt_frame_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).frame_description)); } -#line 2681 "bison_parser.cpp" +#line 2680 "bison_parser.cpp" break; case YYSYMBOL_frame_type: /* frame_type */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2687 "bison_parser.cpp" +#line 2686 "bison_parser.cpp" break; case YYSYMBOL_frame_bound: /* frame_bound */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).frame_bound)); } -#line 2693 "bison_parser.cpp" +#line 2692 "bison_parser.cpp" break; case YYSYMBOL_extract_expr: /* extract_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2699 "bison_parser.cpp" +#line 2698 "bison_parser.cpp" break; case YYSYMBOL_cast_expr: /* cast_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2705 "bison_parser.cpp" +#line 2704 "bison_parser.cpp" break; case YYSYMBOL_datetime_field: /* datetime_field */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2711 "bison_parser.cpp" +#line 2710 "bison_parser.cpp" break; case YYSYMBOL_datetime_field_plural: /* datetime_field_plural */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2717 "bison_parser.cpp" +#line 2716 "bison_parser.cpp" break; case YYSYMBOL_duration_field: /* duration_field */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2723 "bison_parser.cpp" +#line 2722 "bison_parser.cpp" break; case YYSYMBOL_array_expr: /* array_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2729 "bison_parser.cpp" +#line 2728 "bison_parser.cpp" break; case YYSYMBOL_array_index: /* array_index */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2735 "bison_parser.cpp" +#line 2734 "bison_parser.cpp" break; case YYSYMBOL_between_expr: /* between_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2741 "bison_parser.cpp" +#line 2740 "bison_parser.cpp" break; case YYSYMBOL_column_name: /* column_name */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2747 "bison_parser.cpp" +#line 2746 "bison_parser.cpp" break; case YYSYMBOL_literal: /* literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2753 "bison_parser.cpp" +#line 2752 "bison_parser.cpp" break; case YYSYMBOL_string_literal: /* string_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2759 "bison_parser.cpp" +#line 2758 "bison_parser.cpp" break; case YYSYMBOL_bool_literal: /* bool_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2765 "bison_parser.cpp" +#line 2764 "bison_parser.cpp" break; case YYSYMBOL_num_literal: /* num_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2771 "bison_parser.cpp" +#line 2770 "bison_parser.cpp" break; case YYSYMBOL_int_literal: /* int_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2777 "bison_parser.cpp" +#line 2776 "bison_parser.cpp" break; case YYSYMBOL_null_literal: /* null_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2783 "bison_parser.cpp" +#line 2782 "bison_parser.cpp" break; case YYSYMBOL_date_literal: /* date_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2789 "bison_parser.cpp" +#line 2788 "bison_parser.cpp" break; case YYSYMBOL_interval_literal: /* interval_literal */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2795 "bison_parser.cpp" +#line 2794 "bison_parser.cpp" break; case YYSYMBOL_param_expr: /* param_expr */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2801 "bison_parser.cpp" +#line 2800 "bison_parser.cpp" break; case YYSYMBOL_table_ref: /* table_ref */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2807 "bison_parser.cpp" +#line 2806 "bison_parser.cpp" break; case YYSYMBOL_table_ref_atomic: /* table_ref_atomic */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2813 "bison_parser.cpp" +#line 2812 "bison_parser.cpp" break; case YYSYMBOL_nonjoin_table_ref_atomic: /* nonjoin_table_ref_atomic */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2819 "bison_parser.cpp" +#line 2818 "bison_parser.cpp" break; case YYSYMBOL_table_ref_commalist: /* table_ref_commalist */ -#line 185 "bison_parser.y" +#line 187 "bison_parser.y" { if (((*yyvaluep).table_vec)) { for (auto ptr : *(((*yyvaluep).table_vec))) { @@ -2828,134 +2827,128 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).table_vec)); } -#line 2832 "bison_parser.cpp" +#line 2831 "bison_parser.cpp" break; case YYSYMBOL_table_ref_name: /* table_ref_name */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2838 "bison_parser.cpp" +#line 2837 "bison_parser.cpp" break; case YYSYMBOL_table_ref_name_no_alias: /* table_ref_name_no_alias */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2844 "bison_parser.cpp" +#line 2843 "bison_parser.cpp" break; case YYSYMBOL_table_name: /* table_name */ -#line 172 "bison_parser.y" +#line 174 "bison_parser.y" { free( (((*yyvaluep).table_name).name) ); free( (((*yyvaluep).table_name).schema) ); } -#line 2853 "bison_parser.cpp" +#line 2852 "bison_parser.cpp" break; case YYSYMBOL_opt_index_name: /* opt_index_name */ -#line 184 "bison_parser.y" +#line 186 "bison_parser.y" { free( (((*yyvaluep).sval)) ); } -#line 2859 "bison_parser.cpp" +#line 2858 "bison_parser.cpp" break; case YYSYMBOL_table_alias: /* table_alias */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2865 "bison_parser.cpp" +#line 2864 "bison_parser.cpp" break; case YYSYMBOL_opt_table_alias: /* opt_table_alias */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2871 "bison_parser.cpp" +#line 2870 "bison_parser.cpp" break; case YYSYMBOL_alias: /* alias */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2877 "bison_parser.cpp" +#line 2876 "bison_parser.cpp" break; case YYSYMBOL_opt_alias: /* opt_alias */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2883 "bison_parser.cpp" +#line 2882 "bison_parser.cpp" break; case YYSYMBOL_opt_locking_clause: /* opt_locking_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).locking_clause_vec)); } -#line 2889 "bison_parser.cpp" +#line 2888 "bison_parser.cpp" break; case YYSYMBOL_opt_locking_clause_list: /* opt_locking_clause_list */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).locking_clause_vec)); } -#line 2895 "bison_parser.cpp" +#line 2894 "bison_parser.cpp" break; case YYSYMBOL_locking_clause: /* locking_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).locking_t)); } -#line 2901 "bison_parser.cpp" +#line 2900 "bison_parser.cpp" break; case YYSYMBOL_row_lock_mode: /* row_lock_mode */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2907 "bison_parser.cpp" +#line 2906 "bison_parser.cpp" break; case YYSYMBOL_opt_row_lock_policy: /* opt_row_lock_policy */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2913 "bison_parser.cpp" - break; - - case YYSYMBOL_opt_with_clause: /* opt_with_clause */ -#line 193 "bison_parser.y" - { delete (((*yyvaluep).with_description_vec)); } -#line 2919 "bison_parser.cpp" +#line 2912 "bison_parser.cpp" break; case YYSYMBOL_with_clause: /* with_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2925 "bison_parser.cpp" +#line 2918 "bison_parser.cpp" break; case YYSYMBOL_with_description_list: /* with_description_list */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2931 "bison_parser.cpp" +#line 2924 "bison_parser.cpp" break; case YYSYMBOL_with_description: /* with_description */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).with_description_t)); } -#line 2937 "bison_parser.cpp" +#line 2930 "bison_parser.cpp" break; case YYSYMBOL_join_clause: /* join_clause */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2943 "bison_parser.cpp" +#line 2936 "bison_parser.cpp" break; case YYSYMBOL_opt_join_type: /* opt_join_type */ -#line 171 "bison_parser.y" +#line 173 "bison_parser.y" { } -#line 2949 "bison_parser.cpp" +#line 2942 "bison_parser.cpp" break; case YYSYMBOL_join_condition: /* join_condition */ -#line 193 "bison_parser.y" +#line 195 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2955 "bison_parser.cpp" +#line 2948 "bison_parser.cpp" break; case YYSYMBOL_ident_commalist: /* ident_commalist */ -#line 176 "bison_parser.y" +#line 178 "bison_parser.y" { if (((*yyvaluep).str_vec)) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2964,7 +2957,7 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).str_vec)); } -#line 2968 "bison_parser.cpp" +#line 2961 "bison_parser.cpp" break; default: @@ -3061,7 +3054,7 @@ YYLTYPE yylloc = yyloc_default; /* User initialization code. */ -#line 76 "bison_parser.y" +#line 78 "bison_parser.y" { // Initialize yylloc.first_column = 0; @@ -3072,7 +3065,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.string_length = 0; } -#line 3076 "bison_parser.cpp" +#line 3069 "bison_parser.cpp" yylsp[0] = yylloc; goto yysetstate; @@ -3283,7 +3276,7 @@ YYLTYPE yylloc = yyloc_default; switch (yyn) { case 2: /* input: statement_list opt_semicolon */ -#line 325 "bison_parser.y" +#line 328 "bison_parser.y" { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. @@ -3301,236 +3294,236 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].stmt_vec); } -#line 3305 "bison_parser.cpp" +#line 3298 "bison_parser.cpp" break; case 3: /* statement_list: statement */ -#line 344 "bison_parser.y" +#line 347 "bison_parser.y" { (yyvsp[0].statement)->stringLength = yylloc.string_length; yylloc.string_length = 0; (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } -#line 3316 "bison_parser.cpp" +#line 3309 "bison_parser.cpp" break; case 4: /* statement_list: statement_list ';' statement */ -#line 350 "bison_parser.y" +#line 353 "bison_parser.y" { (yyvsp[0].statement)->stringLength = yylloc.string_length; yylloc.string_length = 0; (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } -#line 3327 "bison_parser.cpp" +#line 3320 "bison_parser.cpp" break; case 5: /* statement: prepare_statement opt_hints */ -#line 357 "bison_parser.y" +#line 360 "bison_parser.y" { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 3336 "bison_parser.cpp" +#line 3329 "bison_parser.cpp" break; case 6: /* statement: preparable_statement opt_hints */ -#line 361 "bison_parser.y" +#line 364 "bison_parser.y" { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 3345 "bison_parser.cpp" +#line 3338 "bison_parser.cpp" break; case 7: /* statement: show_statement */ -#line 365 "bison_parser.y" +#line 368 "bison_parser.y" { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 3351 "bison_parser.cpp" +#line 3344 "bison_parser.cpp" break; case 8: /* statement: import_statement */ -#line 366 "bison_parser.y" +#line 369 "bison_parser.y" { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 3357 "bison_parser.cpp" +#line 3350 "bison_parser.cpp" break; case 9: /* statement: export_statement */ -#line 367 "bison_parser.y" +#line 370 "bison_parser.y" { (yyval.statement) = (yyvsp[0].export_stmt); } -#line 3363 "bison_parser.cpp" +#line 3356 "bison_parser.cpp" break; case 10: /* preparable_statement: select_statement */ -#line 369 "bison_parser.y" +#line 372 "bison_parser.y" { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 3369 "bison_parser.cpp" +#line 3362 "bison_parser.cpp" break; case 11: /* preparable_statement: create_statement */ -#line 370 "bison_parser.y" +#line 373 "bison_parser.y" { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 3375 "bison_parser.cpp" +#line 3368 "bison_parser.cpp" break; case 12: /* preparable_statement: insert_statement */ -#line 371 "bison_parser.y" +#line 374 "bison_parser.y" { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 3381 "bison_parser.cpp" +#line 3374 "bison_parser.cpp" break; case 13: /* preparable_statement: delete_statement */ -#line 372 "bison_parser.y" +#line 375 "bison_parser.y" { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 3387 "bison_parser.cpp" +#line 3380 "bison_parser.cpp" break; case 14: /* preparable_statement: truncate_statement */ -#line 373 "bison_parser.y" +#line 376 "bison_parser.y" { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 3393 "bison_parser.cpp" +#line 3386 "bison_parser.cpp" break; case 15: /* preparable_statement: update_statement */ -#line 374 "bison_parser.y" +#line 377 "bison_parser.y" { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 3399 "bison_parser.cpp" +#line 3392 "bison_parser.cpp" break; case 16: /* preparable_statement: drop_statement */ -#line 375 "bison_parser.y" +#line 378 "bison_parser.y" { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 3405 "bison_parser.cpp" +#line 3398 "bison_parser.cpp" break; case 17: /* preparable_statement: alter_statement */ -#line 376 "bison_parser.y" +#line 379 "bison_parser.y" { (yyval.statement) = (yyvsp[0].alter_stmt); } -#line 3411 "bison_parser.cpp" +#line 3404 "bison_parser.cpp" break; case 18: /* preparable_statement: execute_statement */ -#line 377 "bison_parser.y" +#line 380 "bison_parser.y" { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 3417 "bison_parser.cpp" +#line 3410 "bison_parser.cpp" break; case 19: /* preparable_statement: transaction_statement */ -#line 378 "bison_parser.y" +#line 381 "bison_parser.y" { (yyval.statement) = (yyvsp[0].transaction_stmt); } -#line 3423 "bison_parser.cpp" +#line 3416 "bison_parser.cpp" break; case 20: /* opt_hints: WITH HINT '(' hint_list ')' */ -#line 384 "bison_parser.y" +#line 387 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 3429 "bison_parser.cpp" +#line 3422 "bison_parser.cpp" break; case 21: /* opt_hints: %empty */ -#line 385 "bison_parser.y" +#line 388 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 3435 "bison_parser.cpp" +#line 3428 "bison_parser.cpp" break; case 22: /* hint_list: hint */ -#line 387 "bison_parser.y" +#line 390 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3444 "bison_parser.cpp" +#line 3437 "bison_parser.cpp" break; case 23: /* hint_list: hint_list ',' hint */ -#line 391 "bison_parser.y" +#line 394 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3453 "bison_parser.cpp" +#line 3446 "bison_parser.cpp" break; case 24: /* hint: IDENTIFIER */ -#line 396 "bison_parser.y" +#line 399 "bison_parser.y" { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 3462 "bison_parser.cpp" +#line 3455 "bison_parser.cpp" break; case 25: /* hint: IDENTIFIER '(' extended_literal_list ')' */ -#line 400 "bison_parser.y" +#line 403 "bison_parser.y" { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 3472 "bison_parser.cpp" +#line 3465 "bison_parser.cpp" break; case 26: /* transaction_statement: BEGIN opt_transaction_keyword */ -#line 410 "bison_parser.y" +#line 413 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kBeginTransaction); } -#line 3478 "bison_parser.cpp" +#line 3471 "bison_parser.cpp" break; case 27: /* transaction_statement: ROLLBACK opt_transaction_keyword */ -#line 411 "bison_parser.y" +#line 414 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kRollbackTransaction); } -#line 3484 "bison_parser.cpp" +#line 3477 "bison_parser.cpp" break; case 28: /* transaction_statement: COMMIT opt_transaction_keyword */ -#line 412 "bison_parser.y" +#line 415 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kCommitTransaction); } -#line 3490 "bison_parser.cpp" +#line 3483 "bison_parser.cpp" break; case 31: /* prepare_statement: PREPARE IDENTIFIER FROM prepare_target_query */ -#line 420 "bison_parser.y" +#line 423 "bison_parser.y" { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 3500 "bison_parser.cpp" +#line 3493 "bison_parser.cpp" break; case 33: /* execute_statement: EXECUTE IDENTIFIER */ -#line 428 "bison_parser.y" +#line 431 "bison_parser.y" { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 3509 "bison_parser.cpp" +#line 3502 "bison_parser.cpp" break; case 34: /* execute_statement: EXECUTE IDENTIFIER '(' opt_extended_literal_list ')' */ -#line 432 "bison_parser.y" +#line 435 "bison_parser.y" { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 3519 "bison_parser.cpp" +#line 3512 "bison_parser.cpp" break; case 35: /* import_statement: IMPORT FROM file_type FILE file_path INTO table_name */ -#line 443 "bison_parser.y" +#line 446 "bison_parser.y" { (yyval.import_stmt) = new ImportStatement((yyvsp[-4].import_type_t)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); (yyval.import_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.import_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 3530 "bison_parser.cpp" +#line 3523 "bison_parser.cpp" break; case 36: /* import_statement: COPY table_name FROM file_path opt_file_type opt_where */ -#line 449 "bison_parser.y" +#line 452 "bison_parser.y" { (yyval.import_stmt) = new ImportStatement((yyvsp[-1].import_type_t)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); @@ -3538,11 +3531,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.import_stmt)->tableName = (yyvsp[-4].table_name).name; (yyval.import_stmt)->whereClause = (yyvsp[0].expr); } -#line 3542 "bison_parser.cpp" +#line 3535 "bison_parser.cpp" break; case 37: /* file_type: IDENTIFIER */ -#line 457 "bison_parser.y" +#line 460 "bison_parser.y" { if (strcasecmp((yyvsp[0].sval), "csv") == 0) { (yyval.import_type_t) = kImportCSV; @@ -3557,79 +3550,79 @@ YYLTYPE yylloc = yyloc_default; } free((yyvsp[0].sval)); } -#line 3561 "bison_parser.cpp" +#line 3554 "bison_parser.cpp" break; case 38: /* file_path: string_literal */ -#line 472 "bison_parser.y" +#line 475 "bison_parser.y" { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } -#line 3570 "bison_parser.cpp" +#line 3563 "bison_parser.cpp" break; case 39: /* opt_file_type: WITH FORMAT file_type */ -#line 477 "bison_parser.y" +#line 480 "bison_parser.y" { (yyval.import_type_t) = (yyvsp[0].import_type_t); } -#line 3576 "bison_parser.cpp" +#line 3569 "bison_parser.cpp" break; case 40: /* opt_file_type: %empty */ -#line 478 "bison_parser.y" +#line 481 "bison_parser.y" { (yyval.import_type_t) = kImportAuto; } -#line 3582 "bison_parser.cpp" +#line 3575 "bison_parser.cpp" break; case 41: /* export_statement: COPY table_name TO file_path opt_file_type */ -#line 484 "bison_parser.y" +#line 487 "bison_parser.y" { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_type_t)); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); (yyval.export_stmt)->schema = (yyvsp[-3].table_name).schema; (yyval.export_stmt)->tableName = (yyvsp[-3].table_name).name; } -#line 3593 "bison_parser.cpp" +#line 3586 "bison_parser.cpp" break; - case 42: /* export_statement: COPY select_with_paren TO file_path opt_file_type */ -#line 490 "bison_parser.y" - { + case 42: /* export_statement: COPY subquery TO file_path opt_file_type */ +#line 493 "bison_parser.y" + { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_type_t)); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); (yyval.export_stmt)->select = (yyvsp[-3].select_stmt); } -#line 3603 "bison_parser.cpp" +#line 3596 "bison_parser.cpp" break; case 43: /* show_statement: SHOW TABLES */ -#line 501 "bison_parser.y" +#line 504 "bison_parser.y" { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 3609 "bison_parser.cpp" +#line 3602 "bison_parser.cpp" break; case 44: /* show_statement: SHOW COLUMNS table_name */ -#line 502 "bison_parser.y" +#line 505 "bison_parser.y" { (yyval.show_stmt) = new ShowStatement(kShowColumns); (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } -#line 3619 "bison_parser.cpp" +#line 3612 "bison_parser.cpp" break; case 45: /* show_statement: DESCRIBE table_name */ -#line 507 "bison_parser.y" +#line 510 "bison_parser.y" { (yyval.show_stmt) = new ShowStatement(kShowColumns); (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } -#line 3629 "bison_parser.cpp" +#line 3622 "bison_parser.cpp" break; case 46: /* create_statement: CREATE TABLE opt_not_exists table_name FROM IDENTIFIER FILE file_path */ -#line 518 "bison_parser.y" +#line 521 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); @@ -3643,11 +3636,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].sval)); (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 3647 "bison_parser.cpp" +#line 3640 "bison_parser.cpp" break; case 47: /* create_statement: CREATE TABLE opt_not_exists table_name '(' table_elem_commalist ')' */ -#line 531 "bison_parser.y" +#line 534 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -3660,11 +3653,11 @@ YYLTYPE yylloc = yyloc_default; YYERROR; } } -#line 3664 "bison_parser.cpp" +#line 3657 "bison_parser.cpp" break; case 48: /* create_statement: CREATE TABLE opt_not_exists table_name AS select_statement */ -#line 543 "bison_parser.y" +#line 546 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-3].bval); @@ -3672,11 +3665,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->tableName = (yyvsp[-2].table_name).name; (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 3676 "bison_parser.cpp" +#line 3669 "bison_parser.cpp" break; case 49: /* create_statement: CREATE INDEX opt_not_exists opt_index_name ON table_name '(' ident_commalist ')' */ -#line 550 "bison_parser.y" +#line 553 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateIndex); (yyval.create_stmt)->indexName = (yyvsp[-5].sval); @@ -3684,11 +3677,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->indexColumns = (yyvsp[-1].str_vec); } -#line 3688 "bison_parser.cpp" +#line 3681 "bison_parser.cpp" break; case 50: /* create_statement: CREATE VIEW opt_not_exists table_name opt_column_list AS select_statement */ -#line 557 "bison_parser.y" +#line 560 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -3697,371 +3690,371 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 3701 "bison_parser.cpp" +#line 3694 "bison_parser.cpp" break; case 51: /* opt_not_exists: IF NOT EXISTS */ -#line 566 "bison_parser.y" +#line 569 "bison_parser.y" { (yyval.bval) = true; } -#line 3707 "bison_parser.cpp" +#line 3700 "bison_parser.cpp" break; case 52: /* opt_not_exists: %empty */ -#line 567 "bison_parser.y" +#line 570 "bison_parser.y" { (yyval.bval) = false; } -#line 3713 "bison_parser.cpp" +#line 3706 "bison_parser.cpp" break; case 53: /* table_elem_commalist: table_elem */ -#line 569 "bison_parser.y" +#line 572 "bison_parser.y" { (yyval.table_element_vec) = new std::vector(); (yyval.table_element_vec)->push_back((yyvsp[0].table_element_t)); } -#line 3722 "bison_parser.cpp" +#line 3715 "bison_parser.cpp" break; case 54: /* table_elem_commalist: table_elem_commalist ',' table_elem */ -#line 573 "bison_parser.y" +#line 576 "bison_parser.y" { (yyvsp[-2].table_element_vec)->push_back((yyvsp[0].table_element_t)); (yyval.table_element_vec) = (yyvsp[-2].table_element_vec); } -#line 3731 "bison_parser.cpp" +#line 3724 "bison_parser.cpp" break; case 55: /* table_elem: column_def */ -#line 578 "bison_parser.y" +#line 581 "bison_parser.y" { (yyval.table_element_t) = (yyvsp[0].column_t); } -#line 3737 "bison_parser.cpp" +#line 3730 "bison_parser.cpp" break; case 56: /* table_elem: table_constraint */ -#line 579 "bison_parser.y" +#line 582 "bison_parser.y" { (yyval.table_element_t) = (yyvsp[0].table_constraint_t); } -#line 3743 "bison_parser.cpp" +#line 3736 "bison_parser.cpp" break; case 57: /* column_def: IDENTIFIER column_type opt_column_constraints */ -#line 581 "bison_parser.y" +#line 584 "bison_parser.y" { (yyval.column_t) = new ColumnDefinition((yyvsp[-2].sval), (yyvsp[-1].column_type_t), (yyvsp[0].column_constraint_set)); if (!(yyval.column_t)->trySetNullableExplicit()) { yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{(yyvsp[-2].sval)}).c_str()); } } -#line 3754 "bison_parser.cpp" +#line 3747 "bison_parser.cpp" break; case 58: /* column_type: BIGINT */ -#line 588 "bison_parser.y" +#line 591 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::BIGINT}; } -#line 3760 "bison_parser.cpp" +#line 3753 "bison_parser.cpp" break; case 59: /* column_type: BOOLEAN */ -#line 589 "bison_parser.y" +#line 592 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::BOOLEAN}; } -#line 3766 "bison_parser.cpp" +#line 3759 "bison_parser.cpp" break; case 60: /* column_type: CHAR '(' INTVAL ')' */ -#line 590 "bison_parser.y" +#line 593 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::CHAR, (yyvsp[-1].ival)}; } -#line 3772 "bison_parser.cpp" +#line 3765 "bison_parser.cpp" break; case 61: /* column_type: CHARACTER_VARYING '(' INTVAL ')' */ -#line 591 "bison_parser.y" +#line 594 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } -#line 3778 "bison_parser.cpp" +#line 3771 "bison_parser.cpp" break; case 62: /* column_type: DATE */ -#line 592 "bison_parser.y" +#line 595 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATE}; } -#line 3784 "bison_parser.cpp" +#line 3777 "bison_parser.cpp" break; case 63: /* column_type: DATETIME */ -#line 593 "bison_parser.y" +#line 596 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } -#line 3790 "bison_parser.cpp" +#line 3783 "bison_parser.cpp" break; case 64: /* column_type: DECIMAL opt_decimal_specification */ -#line 594 "bison_parser.y" +#line 597 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DECIMAL, 0, (yyvsp[0].ival_pair)->first, (yyvsp[0].ival_pair)->second}; delete (yyvsp[0].ival_pair); } -#line 3799 "bison_parser.cpp" +#line 3792 "bison_parser.cpp" break; case 65: /* column_type: DOUBLE */ -#line 598 "bison_parser.y" +#line 601 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DOUBLE}; } -#line 3805 "bison_parser.cpp" +#line 3798 "bison_parser.cpp" break; case 66: /* column_type: FLOAT */ -#line 599 "bison_parser.y" +#line 602 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::FLOAT}; } -#line 3811 "bison_parser.cpp" +#line 3804 "bison_parser.cpp" break; case 67: /* column_type: INT */ -#line 600 "bison_parser.y" +#line 603 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::INT}; } -#line 3817 "bison_parser.cpp" +#line 3810 "bison_parser.cpp" break; case 68: /* column_type: INTEGER */ -#line 601 "bison_parser.y" +#line 604 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::INT}; } -#line 3823 "bison_parser.cpp" +#line 3816 "bison_parser.cpp" break; case 69: /* column_type: LONG */ -#line 602 "bison_parser.y" +#line 605 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::LONG}; } -#line 3829 "bison_parser.cpp" +#line 3822 "bison_parser.cpp" break; case 70: /* column_type: REAL */ -#line 603 "bison_parser.y" +#line 606 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::REAL}; } -#line 3835 "bison_parser.cpp" +#line 3828 "bison_parser.cpp" break; case 71: /* column_type: SMALLINT */ -#line 604 "bison_parser.y" +#line 607 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::SMALLINT}; } -#line 3841 "bison_parser.cpp" +#line 3834 "bison_parser.cpp" break; case 72: /* column_type: TEXT */ -#line 605 "bison_parser.y" +#line 608 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::TEXT}; } -#line 3847 "bison_parser.cpp" +#line 3840 "bison_parser.cpp" break; case 73: /* column_type: TIME opt_time_precision */ -#line 606 "bison_parser.y" +#line 609 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::TIME, 0, (yyvsp[0].ival)}; } -#line 3853 "bison_parser.cpp" +#line 3846 "bison_parser.cpp" break; case 74: /* column_type: TIMESTAMP */ -#line 607 "bison_parser.y" +#line 610 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } -#line 3859 "bison_parser.cpp" +#line 3852 "bison_parser.cpp" break; case 75: /* column_type: VARCHAR '(' INTVAL ')' */ -#line 608 "bison_parser.y" +#line 611 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } -#line 3865 "bison_parser.cpp" +#line 3858 "bison_parser.cpp" break; case 76: /* opt_time_precision: '(' INTVAL ')' */ -#line 610 "bison_parser.y" +#line 613 "bison_parser.y" { (yyval.ival) = (yyvsp[-1].ival); } -#line 3871 "bison_parser.cpp" +#line 3864 "bison_parser.cpp" break; case 77: /* opt_time_precision: %empty */ -#line 611 "bison_parser.y" +#line 614 "bison_parser.y" { (yyval.ival) = 0; } -#line 3877 "bison_parser.cpp" +#line 3870 "bison_parser.cpp" break; case 78: /* opt_decimal_specification: '(' INTVAL ',' INTVAL ')' */ -#line 613 "bison_parser.y" +#line 616 "bison_parser.y" { (yyval.ival_pair) = new std::pair{(yyvsp[-3].ival), (yyvsp[-1].ival)}; } -#line 3883 "bison_parser.cpp" +#line 3876 "bison_parser.cpp" break; case 79: /* opt_decimal_specification: '(' INTVAL ')' */ -#line 614 "bison_parser.y" +#line 617 "bison_parser.y" { (yyval.ival_pair) = new std::pair{(yyvsp[-1].ival), 0}; } -#line 3889 "bison_parser.cpp" +#line 3882 "bison_parser.cpp" break; case 80: /* opt_decimal_specification: %empty */ -#line 615 "bison_parser.y" +#line 618 "bison_parser.y" { (yyval.ival_pair) = new std::pair{0, 0}; } -#line 3895 "bison_parser.cpp" +#line 3888 "bison_parser.cpp" break; case 81: /* opt_column_constraints: column_constraint_set */ -#line 617 "bison_parser.y" +#line 620 "bison_parser.y" { (yyval.column_constraint_set) = (yyvsp[0].column_constraint_set); } -#line 3901 "bison_parser.cpp" +#line 3894 "bison_parser.cpp" break; case 82: /* opt_column_constraints: %empty */ -#line 618 "bison_parser.y" +#line 621 "bison_parser.y" { (yyval.column_constraint_set) = new std::unordered_set(); } -#line 3907 "bison_parser.cpp" +#line 3900 "bison_parser.cpp" break; case 83: /* column_constraint_set: column_constraint */ -#line 620 "bison_parser.y" +#line 623 "bison_parser.y" { (yyval.column_constraint_set) = new std::unordered_set(); (yyval.column_constraint_set)->insert((yyvsp[0].column_constraint_t)); } -#line 3916 "bison_parser.cpp" +#line 3909 "bison_parser.cpp" break; case 84: /* column_constraint_set: column_constraint_set column_constraint */ -#line 624 "bison_parser.y" +#line 627 "bison_parser.y" { (yyvsp[-1].column_constraint_set)->insert((yyvsp[0].column_constraint_t)); (yyval.column_constraint_set) = (yyvsp[-1].column_constraint_set); } -#line 3925 "bison_parser.cpp" +#line 3918 "bison_parser.cpp" break; case 85: /* column_constraint: PRIMARY KEY */ -#line 629 "bison_parser.y" +#line 632 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::PrimaryKey; } -#line 3931 "bison_parser.cpp" +#line 3924 "bison_parser.cpp" break; case 86: /* column_constraint: UNIQUE */ -#line 630 "bison_parser.y" +#line 633 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::Unique; } -#line 3937 "bison_parser.cpp" +#line 3930 "bison_parser.cpp" break; case 87: /* column_constraint: NULL */ -#line 631 "bison_parser.y" +#line 634 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::Null; } -#line 3943 "bison_parser.cpp" +#line 3936 "bison_parser.cpp" break; case 88: /* column_constraint: NOT NULL */ -#line 632 "bison_parser.y" +#line 635 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::NotNull; } -#line 3949 "bison_parser.cpp" +#line 3942 "bison_parser.cpp" break; case 89: /* table_constraint: PRIMARY KEY '(' ident_commalist ')' */ -#line 634 "bison_parser.y" +#line 637 "bison_parser.y" { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::PrimaryKey, (yyvsp[-1].str_vec)); } -#line 3955 "bison_parser.cpp" +#line 3948 "bison_parser.cpp" break; case 90: /* table_constraint: UNIQUE '(' ident_commalist ')' */ -#line 635 "bison_parser.y" +#line 638 "bison_parser.y" { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::Unique, (yyvsp[-1].str_vec)); } -#line 3961 "bison_parser.cpp" +#line 3954 "bison_parser.cpp" break; case 91: /* drop_statement: DROP TABLE opt_exists table_name */ -#line 643 "bison_parser.y" +#line 646 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropTable); (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 3972 "bison_parser.cpp" +#line 3965 "bison_parser.cpp" break; case 92: /* drop_statement: DROP VIEW opt_exists table_name */ -#line 649 "bison_parser.y" +#line 652 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropView); (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 3983 "bison_parser.cpp" +#line 3976 "bison_parser.cpp" break; case 93: /* drop_statement: DEALLOCATE PREPARE IDENTIFIER */ -#line 655 "bison_parser.y" +#line 658 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 3993 "bison_parser.cpp" +#line 3986 "bison_parser.cpp" break; case 94: /* drop_statement: DROP INDEX opt_exists IDENTIFIER */ -#line 661 "bison_parser.y" +#line 664 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropIndex); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->indexName = (yyvsp[0].sval); } -#line 4003 "bison_parser.cpp" +#line 3996 "bison_parser.cpp" break; case 95: /* opt_exists: IF EXISTS */ -#line 667 "bison_parser.y" +#line 670 "bison_parser.y" { (yyval.bval) = true; } -#line 4009 "bison_parser.cpp" +#line 4002 "bison_parser.cpp" break; case 96: /* opt_exists: %empty */ -#line 668 "bison_parser.y" +#line 671 "bison_parser.y" { (yyval.bval) = false; } -#line 4015 "bison_parser.cpp" +#line 4008 "bison_parser.cpp" break; case 97: /* alter_statement: ALTER TABLE opt_exists table_name alter_action */ -#line 675 "bison_parser.y" +#line 678 "bison_parser.y" { (yyval.alter_stmt) = new AlterStatement((yyvsp[-1].table_name).name, (yyvsp[0].alter_action_t)); (yyval.alter_stmt)->ifTableExists = (yyvsp[-2].bval); (yyval.alter_stmt)->schema = (yyvsp[-1].table_name).schema; } -#line 4025 "bison_parser.cpp" +#line 4018 "bison_parser.cpp" break; case 98: /* alter_action: drop_action */ -#line 681 "bison_parser.y" +#line 684 "bison_parser.y" { (yyval.alter_action_t) = (yyvsp[0].drop_action_t); } -#line 4031 "bison_parser.cpp" +#line 4024 "bison_parser.cpp" break; case 99: /* drop_action: DROP COLUMN opt_exists IDENTIFIER */ -#line 683 "bison_parser.y" +#line 686 "bison_parser.y" { (yyval.drop_action_t) = new DropColumnAction((yyvsp[0].sval)); (yyval.drop_action_t)->ifExists = (yyvsp[-1].bval); } -#line 4040 "bison_parser.cpp" +#line 4033 "bison_parser.cpp" break; case 100: /* delete_statement: DELETE FROM table_name opt_where */ -#line 693 "bison_parser.y" +#line 696 "bison_parser.y" { (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 4051 "bison_parser.cpp" +#line 4044 "bison_parser.cpp" break; case 101: /* truncate_statement: TRUNCATE table_name */ -#line 700 "bison_parser.y" +#line 703 "bison_parser.y" { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 4061 "bison_parser.cpp" +#line 4054 "bison_parser.cpp" break; case 102: /* insert_statement: INSERT INTO table_name opt_column_list VALUES '(' extended_literal_list ')' */ -#line 711 "bison_parser.y" +#line 714 "bison_parser.y" { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; @@ -4069,222 +4062,247 @@ YYLTYPE yylloc = yyloc_default; (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 4073 "bison_parser.cpp" +#line 4066 "bison_parser.cpp" break; - case 103: /* insert_statement: INSERT INTO table_name opt_column_list select_no_paren */ -#line 718 "bison_parser.y" - { + case 103: /* insert_statement: INSERT INTO table_name opt_column_list query_term */ +#line 721 "bison_parser.y" + { (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 4085 "bison_parser.cpp" +#line 4078 "bison_parser.cpp" break; case 104: /* opt_column_list: '(' ident_commalist ')' */ -#line 726 "bison_parser.y" +#line 729 "bison_parser.y" { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 4091 "bison_parser.cpp" +#line 4084 "bison_parser.cpp" break; case 105: /* opt_column_list: %empty */ -#line 727 "bison_parser.y" +#line 730 "bison_parser.y" { (yyval.str_vec) = nullptr; } -#line 4097 "bison_parser.cpp" +#line 4090 "bison_parser.cpp" break; case 106: /* update_statement: UPDATE table_ref_name_no_alias SET update_clause_commalist opt_where */ -#line 734 "bison_parser.y" +#line 737 "bison_parser.y" { (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 4108 "bison_parser.cpp" +#line 4101 "bison_parser.cpp" break; case 107: /* update_clause_commalist: update_clause */ -#line 741 "bison_parser.y" +#line 744 "bison_parser.y" { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 4117 "bison_parser.cpp" +#line 4110 "bison_parser.cpp" break; case 108: /* update_clause_commalist: update_clause_commalist ',' update_clause */ -#line 745 "bison_parser.y" +#line 748 "bison_parser.y" { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 4126 "bison_parser.cpp" +#line 4119 "bison_parser.cpp" break; case 109: /* update_clause: IDENTIFIER '=' expr */ -#line 750 "bison_parser.y" +#line 753 "bison_parser.y" { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 4136 "bison_parser.cpp" +#line 4129 "bison_parser.cpp" break; - case 110: /* select_statement: opt_with_clause select_with_paren */ -#line 760 "bison_parser.y" - { - (yyval.select_stmt) = (yyvsp[0].select_stmt); - (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); -} -#line 4145 "bison_parser.cpp" - break; + case 112: /* query_expression: query_expression_body opt_order opt_limit opt_locking_clause */ +#line 769 "bison_parser.y" + { + if ((yyvsp[-3].select_stmt)->setOperations == nullptr) { + (yyvsp[-3].select_stmt)->order = (yyvsp[-2].order_vec); - case 111: /* select_statement: opt_with_clause select_no_paren */ -#line 764 "bison_parser.y" - { - (yyval.select_stmt) = (yyvsp[0].select_stmt); - (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); -} -#line 4154 "bison_parser.cpp" - break; + // Limit could have been set by TOP. + if ((yyvsp[-1].limit) != nullptr) { + delete (yyvsp[-3].select_stmt)->limit; + (yyvsp[-3].select_stmt)->limit = (yyvsp[-1].limit); + } - case 112: /* select_statement: opt_with_clause select_with_paren set_operator select_within_set_operation opt_order opt_limit */ -#line 768 "bison_parser.y" - { - (yyval.select_stmt) = (yyvsp[-4].select_stmt); - if ((yyval.select_stmt)->setOperations == nullptr) { - (yyval.select_stmt)->setOperations = new std::vector(); - } - (yyval.select_stmt)->setOperations->push_back((yyvsp[-3].set_operator_t)); - (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[-2].select_stmt); - (yyval.select_stmt)->setOperations->back()->resultOrder = (yyvsp[-1].order_vec); - (yyval.select_stmt)->setOperations->back()->resultLimit = (yyvsp[0].limit); - (yyval.select_stmt)->withDescriptions = (yyvsp[-5].with_description_vec); -} -#line 4170 "bison_parser.cpp" - break; + if ((yyvsp[0].locking_clause_vec) != nullptr) { + (yyvsp[-3].select_stmt)->lockings = (yyvsp[0].locking_clause_vec); + } + } + else { + (yyvsp[-3].select_stmt)->setOperations->back()->resultOrder = (yyvsp[-2].order_vec); + (yyvsp[-3].select_stmt)->setOperations->back()->resultLimit = (yyvsp[-1].limit); + } - case 115: /* select_within_set_operation_no_parentheses: select_clause */ -#line 782 "bison_parser.y" - { (yyval.select_stmt) = (yyvsp[0].select_stmt); } -#line 4176 "bison_parser.cpp" + (yyval.select_stmt) = (yyvsp[-3].select_stmt); + } +#line 4155 "bison_parser.cpp" break; - case 116: /* select_within_set_operation_no_parentheses: select_clause set_operator select_within_set_operation */ -#line 783 "bison_parser.y" - { - (yyval.select_stmt) = (yyvsp[-2].select_stmt); - if ((yyval.select_stmt)->setOperations == nullptr) { - (yyval.select_stmt)->setOperations = new std::vector(); - } - (yyval.select_stmt)->setOperations->push_back((yyvsp[-1].set_operator_t)); - (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[0].select_stmt); -} -#line 4189 "bison_parser.cpp" + case 113: /* query_expression: with_clause query_expression_body opt_order opt_limit opt_locking_clause */ +#line 791 "bison_parser.y" + { + (yyvsp[-3].select_stmt)->withDescriptions = (yyvsp[-4].with_description_vec); + if ((yyvsp[-3].select_stmt)->setOperations == nullptr) { + (yyvsp[-3].select_stmt)->order = (yyvsp[-2].order_vec); + + // Limit could have been set by TOP. + if ((yyvsp[-1].limit) != nullptr) { + delete (yyvsp[-3].select_stmt)->limit; + (yyvsp[-3].select_stmt)->limit = (yyvsp[-1].limit); + } + + if ((yyvsp[0].locking_clause_vec) != nullptr) { + (yyvsp[-3].select_stmt)->lockings = (yyvsp[0].locking_clause_vec); + } + } + else { + (yyvsp[-3].select_stmt)->setOperations->back()->resultOrder = (yyvsp[-2].order_vec); + (yyvsp[-3].select_stmt)->setOperations->back()->resultLimit = (yyvsp[-1].limit); + } + + (yyval.select_stmt) = (yyvsp[-3].select_stmt); + } +#line 4182 "bison_parser.cpp" break; - case 117: /* select_with_paren: '(' select_no_paren ')' */ -#line 792 "bison_parser.y" - { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 4195 "bison_parser.cpp" + case 115: /* query_expression_body: query_expression_body set_operator query_term */ +#line 823 "bison_parser.y" + { + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + auto *setOperations = &(yyvsp[-2].select_stmt)->setOperations; + while (*setOperations != nullptr) { + setOperations = &(*setOperations)->back()->nestedSelectStatement->setOperations; + } + (yyvsp[-1].set_operator_t)->nestedSelectStatement = (yyvsp[0].select_stmt); + *setOperations = new std::vector({(yyvsp[-1].set_operator_t)}); + + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + } +#line 4198 "bison_parser.cpp" break; - case 118: /* select_with_paren: '(' select_with_paren ')' */ -#line 793 "bison_parser.y" - { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 4201 "bison_parser.cpp" + case 116: /* query_expression_body: query_expression_parens set_operator query_term */ +#line 835 "bison_parser.y" + { + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + auto *setOperations = &(yyvsp[-2].select_stmt)->setOperations; + while (*setOperations != nullptr) { + setOperations = &(*setOperations)->back()->nestedSelectStatement->setOperations; + } + (yyvsp[-1].set_operator_t)->nestedSelectStatement = (yyvsp[0].select_stmt); + *setOperations = new std::vector({(yyvsp[-1].set_operator_t)}); + + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + } +#line 4214 "bison_parser.cpp" break; - case 119: /* select_no_paren: select_clause opt_order opt_limit opt_locking_clause */ -#line 795 "bison_parser.y" - { - (yyval.select_stmt) = (yyvsp[-3].select_stmt); - (yyval.select_stmt)->order = (yyvsp[-2].order_vec); + case 117: /* query_expression_body: query_expression_body set_operator query_expression_parens */ +#line 847 "bison_parser.y" + { + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + auto *setOperations = &(yyvsp[-2].select_stmt)->setOperations; + while (*setOperations != nullptr) { + setOperations = &(*setOperations)->back()->nestedSelectStatement->setOperations; + } + (yyvsp[-1].set_operator_t)->nestedSelectStatement = (yyvsp[0].select_stmt); + *setOperations = new std::vector({(yyvsp[-1].set_operator_t)}); - // Limit could have been set by TOP. - if ((yyvsp[-1].limit)) { - delete (yyval.select_stmt)->limit; - (yyval.select_stmt)->limit = (yyvsp[-1].limit); - } + (yyval.select_stmt) = (yyvsp[-2].select_stmt); + } +#line 4230 "bison_parser.cpp" + break; - if ((yyvsp[0].locking_clause_vec)) { - (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); - } -} -#line 4220 "bison_parser.cpp" + case 118: /* query_expression_parens: '(' query_expression_parens ')' */ +#line 862 "bison_parser.y" + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); + } +#line 4238 "bison_parser.cpp" break; - case 120: /* select_no_paren: select_clause set_operator select_within_set_operation opt_order opt_limit opt_locking_clause */ -#line 809 "bison_parser.y" - { - (yyval.select_stmt) = (yyvsp[-5].select_stmt); - if ((yyval.select_stmt)->setOperations == nullptr) { - (yyval.select_stmt)->setOperations = new std::vector(); - } - (yyval.select_stmt)->setOperations->push_back((yyvsp[-4].set_operator_t)); - (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[-3].select_stmt); - (yyval.select_stmt)->setOperations->back()->resultOrder = (yyvsp[-2].order_vec); - (yyval.select_stmt)->setOperations->back()->resultLimit = (yyvsp[-1].limit); - (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); -} -#line 4236 "bison_parser.cpp" + case 119: /* query_expression_parens: '(' query_expression ')' */ +#line 866 "bison_parser.y" + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); + } +#line 4246 "bison_parser.cpp" + break; + + case 121: /* subquery: '(' query_expression ')' */ +#line 877 "bison_parser.y" + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); + } +#line 4254 "bison_parser.cpp" break; - case 121: /* set_operator: set_type opt_all */ -#line 821 "bison_parser.y" + case 122: /* set_operator: set_type opt_all */ +#line 882 "bison_parser.y" { (yyval.set_operator_t) = (yyvsp[-1].set_operator_t); (yyval.set_operator_t)->isAll = (yyvsp[0].bval); } -#line 4245 "bison_parser.cpp" +#line 4263 "bison_parser.cpp" break; - case 122: /* set_type: UNION */ -#line 826 "bison_parser.y" + case 123: /* set_type: UNION */ +#line 887 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetUnion; } -#line 4254 "bison_parser.cpp" +#line 4272 "bison_parser.cpp" break; - case 123: /* set_type: INTERSECT */ -#line 830 "bison_parser.y" + case 124: /* set_type: INTERSECT */ +#line 891 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetIntersect; } -#line 4263 "bison_parser.cpp" +#line 4281 "bison_parser.cpp" break; - case 124: /* set_type: EXCEPT */ -#line 834 "bison_parser.y" + case 125: /* set_type: EXCEPT */ +#line 895 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetExcept; } -#line 4272 "bison_parser.cpp" +#line 4290 "bison_parser.cpp" break; - case 125: /* opt_all: ALL */ -#line 839 "bison_parser.y" + case 126: /* opt_all: ALL */ +#line 900 "bison_parser.y" { (yyval.bval) = true; } -#line 4278 "bison_parser.cpp" +#line 4296 "bison_parser.cpp" break; - case 126: /* opt_all: %empty */ -#line 840 "bison_parser.y" + case 127: /* opt_all: %empty */ +#line 901 "bison_parser.y" { (yyval.bval) = false; } -#line 4284 "bison_parser.cpp" +#line 4302 "bison_parser.cpp" break; - case 127: /* select_clause: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group */ -#line 842 "bison_parser.y" + case 128: /* query_primary: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group */ +#line 903 "bison_parser.y" { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); @@ -4294,239 +4312,239 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 4298 "bison_parser.cpp" +#line 4316 "bison_parser.cpp" break; - case 128: /* opt_distinct: DISTINCT */ -#line 852 "bison_parser.y" + case 129: /* opt_distinct: DISTINCT */ +#line 913 "bison_parser.y" { (yyval.bval) = true; } -#line 4304 "bison_parser.cpp" +#line 4322 "bison_parser.cpp" break; - case 129: /* opt_distinct: %empty */ -#line 853 "bison_parser.y" + case 130: /* opt_distinct: %empty */ +#line 914 "bison_parser.y" { (yyval.bval) = false; } -#line 4310 "bison_parser.cpp" +#line 4328 "bison_parser.cpp" break; - case 131: /* opt_from_clause: from_clause */ -#line 857 "bison_parser.y" + case 132: /* opt_from_clause: from_clause */ +#line 918 "bison_parser.y" { (yyval.table) = (yyvsp[0].table); } -#line 4316 "bison_parser.cpp" +#line 4334 "bison_parser.cpp" break; - case 132: /* opt_from_clause: %empty */ -#line 858 "bison_parser.y" + case 133: /* opt_from_clause: %empty */ +#line 919 "bison_parser.y" { (yyval.table) = nullptr; } -#line 4322 "bison_parser.cpp" +#line 4340 "bison_parser.cpp" break; - case 133: /* from_clause: FROM table_ref */ -#line 860 "bison_parser.y" + case 134: /* from_clause: FROM table_ref */ +#line 921 "bison_parser.y" { (yyval.table) = (yyvsp[0].table); } -#line 4328 "bison_parser.cpp" +#line 4346 "bison_parser.cpp" break; - case 134: /* opt_where: WHERE expr */ -#line 862 "bison_parser.y" + case 135: /* opt_where: WHERE expr */ +#line 923 "bison_parser.y" { (yyval.expr) = (yyvsp[0].expr); } -#line 4334 "bison_parser.cpp" +#line 4352 "bison_parser.cpp" break; - case 135: /* opt_where: %empty */ -#line 863 "bison_parser.y" + case 136: /* opt_where: %empty */ +#line 924 "bison_parser.y" { (yyval.expr) = nullptr; } -#line 4340 "bison_parser.cpp" +#line 4358 "bison_parser.cpp" break; - case 136: /* opt_group: GROUP BY expr_list opt_having */ -#line 865 "bison_parser.y" + case 137: /* opt_group: GROUP BY expr_list opt_having */ +#line 926 "bison_parser.y" { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 4350 "bison_parser.cpp" +#line 4368 "bison_parser.cpp" break; - case 137: /* opt_group: %empty */ -#line 870 "bison_parser.y" + case 138: /* opt_group: %empty */ +#line 931 "bison_parser.y" { (yyval.group_t) = nullptr; } -#line 4356 "bison_parser.cpp" +#line 4374 "bison_parser.cpp" break; - case 138: /* opt_having: HAVING expr */ -#line 872 "bison_parser.y" + case 139: /* opt_having: HAVING expr */ +#line 933 "bison_parser.y" { (yyval.expr) = (yyvsp[0].expr); } -#line 4362 "bison_parser.cpp" +#line 4380 "bison_parser.cpp" break; - case 139: /* opt_having: %empty */ -#line 873 "bison_parser.y" + case 140: /* opt_having: %empty */ +#line 934 "bison_parser.y" { (yyval.expr) = nullptr; } -#line 4368 "bison_parser.cpp" +#line 4386 "bison_parser.cpp" break; - case 140: /* opt_order: ORDER BY order_list */ -#line 875 "bison_parser.y" + case 141: /* opt_order: ORDER BY order_list */ +#line 936 "bison_parser.y" { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 4374 "bison_parser.cpp" +#line 4392 "bison_parser.cpp" break; - case 141: /* opt_order: %empty */ -#line 876 "bison_parser.y" + case 142: /* opt_order: %empty */ +#line 937 "bison_parser.y" { (yyval.order_vec) = nullptr; } -#line 4380 "bison_parser.cpp" +#line 4398 "bison_parser.cpp" break; - case 142: /* order_list: order_desc */ -#line 878 "bison_parser.y" + case 143: /* order_list: order_desc */ +#line 939 "bison_parser.y" { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 4389 "bison_parser.cpp" +#line 4407 "bison_parser.cpp" break; - case 143: /* order_list: order_list ',' order_desc */ -#line 882 "bison_parser.y" + case 144: /* order_list: order_list ',' order_desc */ +#line 943 "bison_parser.y" { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 4398 "bison_parser.cpp" +#line 4416 "bison_parser.cpp" break; - case 144: /* order_desc: expr opt_order_type */ -#line 887 "bison_parser.y" + case 145: /* order_desc: expr opt_order_type */ +#line 948 "bison_parser.y" { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 4404 "bison_parser.cpp" +#line 4422 "bison_parser.cpp" break; - case 145: /* opt_order_type: ASC */ -#line 889 "bison_parser.y" + case 146: /* opt_order_type: ASC */ +#line 950 "bison_parser.y" { (yyval.order_type) = kOrderAsc; } -#line 4410 "bison_parser.cpp" +#line 4428 "bison_parser.cpp" break; - case 146: /* opt_order_type: DESC */ -#line 890 "bison_parser.y" + case 147: /* opt_order_type: DESC */ +#line 951 "bison_parser.y" { (yyval.order_type) = kOrderDesc; } -#line 4416 "bison_parser.cpp" +#line 4434 "bison_parser.cpp" break; - case 147: /* opt_order_type: %empty */ -#line 891 "bison_parser.y" + case 148: /* opt_order_type: %empty */ +#line 952 "bison_parser.y" { (yyval.order_type) = kOrderAsc; } -#line 4422 "bison_parser.cpp" +#line 4440 "bison_parser.cpp" break; - case 148: /* opt_top: TOP int_literal */ -#line 895 "bison_parser.y" + case 149: /* opt_top: TOP int_literal */ +#line 956 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } -#line 4428 "bison_parser.cpp" +#line 4446 "bison_parser.cpp" break; - case 149: /* opt_top: %empty */ -#line 896 "bison_parser.y" + case 150: /* opt_top: %empty */ +#line 957 "bison_parser.y" { (yyval.limit) = nullptr; } -#line 4434 "bison_parser.cpp" +#line 4452 "bison_parser.cpp" break; - case 150: /* opt_limit: LIMIT expr */ -#line 898 "bison_parser.y" + case 151: /* opt_limit: LIMIT expr */ +#line 959 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } -#line 4440 "bison_parser.cpp" +#line 4458 "bison_parser.cpp" break; - case 151: /* opt_limit: OFFSET expr */ -#line 899 "bison_parser.y" + case 152: /* opt_limit: OFFSET expr */ +#line 960 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } -#line 4446 "bison_parser.cpp" +#line 4464 "bison_parser.cpp" break; - case 152: /* opt_limit: LIMIT expr OFFSET expr */ -#line 900 "bison_parser.y" + case 153: /* opt_limit: LIMIT expr OFFSET expr */ +#line 961 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4452 "bison_parser.cpp" +#line 4470 "bison_parser.cpp" break; - case 153: /* opt_limit: LIMIT ALL */ -#line 901 "bison_parser.y" + case 154: /* opt_limit: LIMIT ALL */ +#line 962 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, nullptr); } -#line 4458 "bison_parser.cpp" +#line 4476 "bison_parser.cpp" break; - case 154: /* opt_limit: LIMIT ALL OFFSET expr */ -#line 902 "bison_parser.y" + case 155: /* opt_limit: LIMIT ALL OFFSET expr */ +#line 963 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } -#line 4464 "bison_parser.cpp" +#line 4482 "bison_parser.cpp" break; - case 155: /* opt_limit: %empty */ -#line 903 "bison_parser.y" + case 156: /* opt_limit: %empty */ +#line 964 "bison_parser.y" { (yyval.limit) = nullptr; } -#line 4470 "bison_parser.cpp" +#line 4488 "bison_parser.cpp" break; - case 156: /* expr_list: expr_alias */ -#line 908 "bison_parser.y" + case 157: /* expr_list: expr_alias */ +#line 969 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 4479 "bison_parser.cpp" +#line 4497 "bison_parser.cpp" break; - case 157: /* expr_list: expr_list ',' expr_alias */ -#line 912 "bison_parser.y" + case 158: /* expr_list: expr_list ',' expr_alias */ +#line 973 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 4488 "bison_parser.cpp" +#line 4506 "bison_parser.cpp" break; - case 158: /* opt_extended_literal_list: extended_literal_list */ -#line 918 "bison_parser.y" + case 159: /* opt_extended_literal_list: extended_literal_list */ +#line 979 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[0].expr_vec); } -#line 4494 "bison_parser.cpp" +#line 4512 "bison_parser.cpp" break; - case 159: /* opt_extended_literal_list: %empty */ -#line 919 "bison_parser.y" + case 160: /* opt_extended_literal_list: %empty */ +#line 980 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 4500 "bison_parser.cpp" +#line 4518 "bison_parser.cpp" break; - case 160: /* extended_literal_list: casted_extended_literal */ -#line 921 "bison_parser.y" + case 161: /* extended_literal_list: casted_extended_literal */ +#line 982 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 4509 "bison_parser.cpp" +#line 4527 "bison_parser.cpp" break; - case 161: /* extended_literal_list: extended_literal_list ',' casted_extended_literal */ -#line 925 "bison_parser.y" + case 162: /* extended_literal_list: extended_literal_list ',' casted_extended_literal */ +#line 986 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 4518 "bison_parser.cpp" +#line 4536 "bison_parser.cpp" break; - case 163: /* casted_extended_literal: CAST '(' extended_literal AS column_type ')' */ -#line 930 "bison_parser.y" + case 164: /* casted_extended_literal: CAST '(' extended_literal AS column_type ')' */ +#line 991 "bison_parser.y" { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } -#line 4526 "bison_parser.cpp" +#line 4544 "bison_parser.cpp" break; - case 164: /* extended_literal: literal */ -#line 934 "bison_parser.y" + case 165: /* extended_literal: literal */ +#line 995 "bison_parser.y" { if ((yyvsp[0].expr)->type == ExprType::kExprParameter) { delete (yyvsp[0].expr); @@ -4535,23 +4553,23 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = (yyvsp[0].expr); } -#line 4539 "bison_parser.cpp" +#line 4557 "bison_parser.cpp" break; - case 165: /* extended_literal: '-' num_literal */ -#line 942 "bison_parser.y" + case 166: /* extended_literal: '-' num_literal */ +#line 1003 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4545 "bison_parser.cpp" +#line 4563 "bison_parser.cpp" break; - case 166: /* extended_literal: '-' interval_literal */ -#line 943 "bison_parser.y" + case 167: /* extended_literal: '-' interval_literal */ +#line 1004 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4551 "bison_parser.cpp" +#line 4569 "bison_parser.cpp" break; - case 167: /* expr_alias: expr opt_alias */ -#line 945 "bison_parser.y" + case 168: /* expr_alias: expr opt_alias */ +#line 1006 "bison_parser.y" { (yyval.expr) = (yyvsp[-1].expr); if ((yyvsp[0].alias_t)) { @@ -4559,507 +4577,507 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[0].alias_t); } } -#line 4563 "bison_parser.cpp" +#line 4581 "bison_parser.cpp" break; - case 173: /* operand: '(' expr ')' */ -#line 955 "bison_parser.y" + case 174: /* operand: '(' expr ')' */ +#line 1016 "bison_parser.y" { (yyval.expr) = (yyvsp[-1].expr); } -#line 4569 "bison_parser.cpp" +#line 4587 "bison_parser.cpp" break; - case 183: /* operand: '(' select_no_paren ')' */ -#line 957 "bison_parser.y" - { + case 184: /* operand: '(' query_primary ')' */ +#line 1018 "bison_parser.y" + { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 4577 "bison_parser.cpp" +#line 4595 "bison_parser.cpp" break; - case 186: /* unary_expr: '-' operand */ -#line 963 "bison_parser.y" + case 187: /* unary_expr: '-' operand */ +#line 1024 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4583 "bison_parser.cpp" +#line 4601 "bison_parser.cpp" break; - case 187: /* unary_expr: NOT operand */ -#line 964 "bison_parser.y" + case 188: /* unary_expr: NOT operand */ +#line 1025 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 4589 "bison_parser.cpp" +#line 4607 "bison_parser.cpp" break; - case 188: /* unary_expr: operand ISNULL */ -#line 965 "bison_parser.y" + case 189: /* unary_expr: operand ISNULL */ +#line 1026 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 4595 "bison_parser.cpp" +#line 4613 "bison_parser.cpp" break; - case 189: /* unary_expr: operand IS NULL */ -#line 966 "bison_parser.y" + case 190: /* unary_expr: operand IS NULL */ +#line 1027 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 4601 "bison_parser.cpp" +#line 4619 "bison_parser.cpp" break; - case 190: /* unary_expr: operand IS NOT NULL */ -#line 967 "bison_parser.y" + case 191: /* unary_expr: operand IS NOT NULL */ +#line 1028 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 4607 "bison_parser.cpp" +#line 4625 "bison_parser.cpp" break; - case 192: /* binary_expr: operand '-' operand */ -#line 969 "bison_parser.y" + case 193: /* binary_expr: operand '-' operand */ +#line 1030 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 4613 "bison_parser.cpp" +#line 4631 "bison_parser.cpp" break; - case 193: /* binary_expr: operand '+' operand */ -#line 970 "bison_parser.y" + case 194: /* binary_expr: operand '+' operand */ +#line 1031 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 4619 "bison_parser.cpp" +#line 4637 "bison_parser.cpp" break; - case 194: /* binary_expr: operand '/' operand */ -#line 971 "bison_parser.y" + case 195: /* binary_expr: operand '/' operand */ +#line 1032 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 4625 "bison_parser.cpp" +#line 4643 "bison_parser.cpp" break; - case 195: /* binary_expr: operand '*' operand */ -#line 972 "bison_parser.y" + case 196: /* binary_expr: operand '*' operand */ +#line 1033 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 4631 "bison_parser.cpp" +#line 4649 "bison_parser.cpp" break; - case 196: /* binary_expr: operand '%' operand */ -#line 973 "bison_parser.y" + case 197: /* binary_expr: operand '%' operand */ +#line 1034 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 4637 "bison_parser.cpp" +#line 4655 "bison_parser.cpp" break; - case 197: /* binary_expr: operand '^' operand */ -#line 974 "bison_parser.y" + case 198: /* binary_expr: operand '^' operand */ +#line 1035 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 4643 "bison_parser.cpp" +#line 4661 "bison_parser.cpp" break; - case 198: /* binary_expr: operand LIKE operand */ -#line 975 "bison_parser.y" + case 199: /* binary_expr: operand LIKE operand */ +#line 1036 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 4649 "bison_parser.cpp" +#line 4667 "bison_parser.cpp" break; - case 199: /* binary_expr: operand NOT LIKE operand */ -#line 976 "bison_parser.y" + case 200: /* binary_expr: operand NOT LIKE operand */ +#line 1037 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 4655 "bison_parser.cpp" +#line 4673 "bison_parser.cpp" break; - case 200: /* binary_expr: operand ILIKE operand */ -#line 977 "bison_parser.y" + case 201: /* binary_expr: operand ILIKE operand */ +#line 1038 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 4661 "bison_parser.cpp" +#line 4679 "bison_parser.cpp" break; - case 201: /* binary_expr: operand CONCAT operand */ -#line 978 "bison_parser.y" + case 202: /* binary_expr: operand CONCAT operand */ +#line 1039 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 4667 "bison_parser.cpp" +#line 4685 "bison_parser.cpp" break; - case 202: /* logic_expr: expr AND expr */ -#line 980 "bison_parser.y" + case 203: /* logic_expr: expr AND expr */ +#line 1041 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 4673 "bison_parser.cpp" +#line 4691 "bison_parser.cpp" break; - case 203: /* logic_expr: expr OR expr */ -#line 981 "bison_parser.y" + case 204: /* logic_expr: expr OR expr */ +#line 1042 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 4679 "bison_parser.cpp" +#line 4697 "bison_parser.cpp" break; - case 204: /* in_expr: operand IN '(' expr_list ')' */ -#line 983 "bison_parser.y" + case 205: /* in_expr: operand IN '(' expr_list ')' */ +#line 1044 "bison_parser.y" { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 4685 "bison_parser.cpp" +#line 4703 "bison_parser.cpp" break; - case 205: /* in_expr: operand NOT IN '(' expr_list ')' */ -#line 984 "bison_parser.y" + case 206: /* in_expr: operand NOT IN '(' expr_list ')' */ +#line 1045 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 4691 "bison_parser.cpp" +#line 4709 "bison_parser.cpp" break; - case 206: /* in_expr: operand IN '(' select_no_paren ')' */ -#line 985 "bison_parser.y" - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 4697 "bison_parser.cpp" + case 207: /* in_expr: operand IN '(' query_primary ')' */ +#line 1046 "bison_parser.y" + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } +#line 4715 "bison_parser.cpp" break; - case 207: /* in_expr: operand NOT IN '(' select_no_paren ')' */ -#line 986 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 4703 "bison_parser.cpp" + case 208: /* in_expr: operand NOT IN '(' query_primary ')' */ +#line 1047 "bison_parser.y" + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } +#line 4721 "bison_parser.cpp" break; - case 208: /* case_expr: CASE expr case_list END */ -#line 990 "bison_parser.y" + case 209: /* case_expr: CASE expr case_list END */ +#line 1051 "bison_parser.y" { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } -#line 4709 "bison_parser.cpp" +#line 4727 "bison_parser.cpp" break; - case 209: /* case_expr: CASE expr case_list ELSE expr END */ -#line 991 "bison_parser.y" + case 210: /* case_expr: CASE expr case_list ELSE expr END */ +#line 1052 "bison_parser.y" { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4715 "bison_parser.cpp" +#line 4733 "bison_parser.cpp" break; - case 210: /* case_expr: CASE case_list END */ -#line 992 "bison_parser.y" + case 211: /* case_expr: CASE case_list END */ +#line 1053 "bison_parser.y" { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } -#line 4721 "bison_parser.cpp" +#line 4739 "bison_parser.cpp" break; - case 211: /* case_expr: CASE case_list ELSE expr END */ -#line 993 "bison_parser.y" + case 212: /* case_expr: CASE case_list ELSE expr END */ +#line 1054 "bison_parser.y" { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4727 "bison_parser.cpp" +#line 4745 "bison_parser.cpp" break; - case 212: /* case_list: WHEN expr THEN expr */ -#line 995 "bison_parser.y" + case 213: /* case_list: WHEN expr THEN expr */ +#line 1056 "bison_parser.y" { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 4733 "bison_parser.cpp" +#line 4751 "bison_parser.cpp" break; - case 213: /* case_list: case_list WHEN expr THEN expr */ -#line 996 "bison_parser.y" + case 214: /* case_list: case_list WHEN expr THEN expr */ +#line 1057 "bison_parser.y" { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 4739 "bison_parser.cpp" +#line 4757 "bison_parser.cpp" break; - case 214: /* exists_expr: EXISTS '(' select_no_paren ')' */ -#line 998 "bison_parser.y" - { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 4745 "bison_parser.cpp" + case 215: /* exists_expr: EXISTS '(' query_primary ')' */ +#line 1059 "bison_parser.y" + { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } +#line 4763 "bison_parser.cpp" break; - case 215: /* exists_expr: NOT EXISTS '(' select_no_paren ')' */ -#line 999 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 4751 "bison_parser.cpp" + case 216: /* exists_expr: NOT EXISTS '(' query_primary ')' */ +#line 1060 "bison_parser.y" + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } +#line 4769 "bison_parser.cpp" break; - case 216: /* comp_expr: operand '=' operand */ -#line 1001 "bison_parser.y" + case 217: /* comp_expr: operand '=' operand */ +#line 1062 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 4757 "bison_parser.cpp" +#line 4775 "bison_parser.cpp" break; - case 217: /* comp_expr: operand EQUALS operand */ -#line 1002 "bison_parser.y" + case 218: /* comp_expr: operand EQUALS operand */ +#line 1063 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 4763 "bison_parser.cpp" +#line 4781 "bison_parser.cpp" break; - case 218: /* comp_expr: operand NOTEQUALS operand */ -#line 1003 "bison_parser.y" + case 219: /* comp_expr: operand NOTEQUALS operand */ +#line 1064 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 4769 "bison_parser.cpp" +#line 4787 "bison_parser.cpp" break; - case 219: /* comp_expr: operand '<' operand */ -#line 1004 "bison_parser.y" + case 220: /* comp_expr: operand '<' operand */ +#line 1065 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 4775 "bison_parser.cpp" +#line 4793 "bison_parser.cpp" break; - case 220: /* comp_expr: operand '>' operand */ -#line 1005 "bison_parser.y" + case 221: /* comp_expr: operand '>' operand */ +#line 1066 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 4781 "bison_parser.cpp" +#line 4799 "bison_parser.cpp" break; - case 221: /* comp_expr: operand LESSEQ operand */ -#line 1006 "bison_parser.y" + case 222: /* comp_expr: operand LESSEQ operand */ +#line 1067 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 4787 "bison_parser.cpp" +#line 4805 "bison_parser.cpp" break; - case 222: /* comp_expr: operand GREATEREQ operand */ -#line 1007 "bison_parser.y" + case 223: /* comp_expr: operand GREATEREQ operand */ +#line 1068 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 4793 "bison_parser.cpp" +#line 4811 "bison_parser.cpp" break; - case 223: /* function_expr: IDENTIFIER '(' ')' opt_window */ -#line 1011 "bison_parser.y" + case 224: /* function_expr: IDENTIFIER '(' ')' opt_window */ +#line 1072 "bison_parser.y" { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-3].sval), new std::vector(), false, (yyvsp[0].window_description)); } -#line 4799 "bison_parser.cpp" +#line 4817 "bison_parser.cpp" break; - case 224: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ -#line 1012 "bison_parser.y" + case 225: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ +#line 1073 "bison_parser.y" { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-5].sval), (yyvsp[-2].expr_vec), (yyvsp[-3].bval), (yyvsp[0].window_description)); } -#line 4805 "bison_parser.cpp" +#line 4823 "bison_parser.cpp" break; - case 225: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ -#line 1016 "bison_parser.y" + case 226: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ +#line 1077 "bison_parser.y" { (yyval.window_description) = new WindowDescription((yyvsp[-3].expr_vec), (yyvsp[-2].order_vec), (yyvsp[-1].frame_description)); } -#line 4811 "bison_parser.cpp" +#line 4829 "bison_parser.cpp" break; - case 226: /* opt_window: %empty */ -#line 1017 "bison_parser.y" + case 227: /* opt_window: %empty */ +#line 1078 "bison_parser.y" { (yyval.window_description) = nullptr; } -#line 4817 "bison_parser.cpp" +#line 4835 "bison_parser.cpp" break; - case 227: /* opt_partition: PARTITION BY expr_list */ -#line 1019 "bison_parser.y" + case 228: /* opt_partition: PARTITION BY expr_list */ +#line 1080 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[0].expr_vec); } -#line 4823 "bison_parser.cpp" +#line 4841 "bison_parser.cpp" break; - case 228: /* opt_partition: %empty */ -#line 1020 "bison_parser.y" + case 229: /* opt_partition: %empty */ +#line 1081 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 4829 "bison_parser.cpp" +#line 4847 "bison_parser.cpp" break; - case 229: /* opt_frame_clause: frame_type frame_bound */ -#line 1025 "bison_parser.y" + case 230: /* opt_frame_clause: frame_type frame_bound */ +#line 1086 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{(yyvsp[-1].frame_type), (yyvsp[0].frame_bound), new FrameBound{0, kCurrentRow, false}}; } -#line 4835 "bison_parser.cpp" +#line 4853 "bison_parser.cpp" break; - case 230: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ -#line 1026 "bison_parser.y" + case 231: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ +#line 1087 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{(yyvsp[-4].frame_type), (yyvsp[-2].frame_bound), (yyvsp[0].frame_bound)}; } -#line 4841 "bison_parser.cpp" +#line 4859 "bison_parser.cpp" break; - case 231: /* opt_frame_clause: %empty */ -#line 1027 "bison_parser.y" + case 232: /* opt_frame_clause: %empty */ +#line 1088 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{kRange, new FrameBound{0, kPreceding, true}, new FrameBound{0, kCurrentRow, false}}; } -#line 4849 "bison_parser.cpp" +#line 4867 "bison_parser.cpp" break; - case 232: /* frame_type: RANGE */ -#line 1031 "bison_parser.y" + case 233: /* frame_type: RANGE */ +#line 1092 "bison_parser.y" { (yyval.frame_type) = kRange; } -#line 4855 "bison_parser.cpp" +#line 4873 "bison_parser.cpp" break; - case 233: /* frame_type: ROWS */ -#line 1032 "bison_parser.y" + case 234: /* frame_type: ROWS */ +#line 1093 "bison_parser.y" { (yyval.frame_type) = kRows; } -#line 4861 "bison_parser.cpp" +#line 4879 "bison_parser.cpp" break; - case 234: /* frame_type: GROUPS */ -#line 1033 "bison_parser.y" + case 235: /* frame_type: GROUPS */ +#line 1094 "bison_parser.y" { (yyval.frame_type) = kGroups; } -#line 4867 "bison_parser.cpp" +#line 4885 "bison_parser.cpp" break; - case 235: /* frame_bound: UNBOUNDED PRECEDING */ -#line 1035 "bison_parser.y" + case 236: /* frame_bound: UNBOUNDED PRECEDING */ +#line 1096 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kPreceding, true}; } -#line 4873 "bison_parser.cpp" +#line 4891 "bison_parser.cpp" break; - case 236: /* frame_bound: INTVAL PRECEDING */ -#line 1036 "bison_parser.y" + case 237: /* frame_bound: INTVAL PRECEDING */ +#line 1097 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kPreceding, false}; } -#line 4879 "bison_parser.cpp" +#line 4897 "bison_parser.cpp" break; - case 237: /* frame_bound: UNBOUNDED FOLLOWING */ -#line 1037 "bison_parser.y" + case 238: /* frame_bound: UNBOUNDED FOLLOWING */ +#line 1098 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kFollowing, true}; } -#line 4885 "bison_parser.cpp" +#line 4903 "bison_parser.cpp" break; - case 238: /* frame_bound: INTVAL FOLLOWING */ -#line 1038 "bison_parser.y" + case 239: /* frame_bound: INTVAL FOLLOWING */ +#line 1099 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kFollowing, false}; } -#line 4891 "bison_parser.cpp" +#line 4909 "bison_parser.cpp" break; - case 239: /* frame_bound: CURRENT_ROW */ -#line 1039 "bison_parser.y" + case 240: /* frame_bound: CURRENT_ROW */ +#line 1100 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kCurrentRow, false}; } -#line 4897 "bison_parser.cpp" +#line 4915 "bison_parser.cpp" break; - case 240: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ -#line 1041 "bison_parser.y" + case 241: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ +#line 1102 "bison_parser.y" { (yyval.expr) = Expr::makeExtract((yyvsp[-3].datetime_field), (yyvsp[-1].expr)); } -#line 4903 "bison_parser.cpp" +#line 4921 "bison_parser.cpp" break; - case 241: /* cast_expr: CAST '(' expr AS column_type ')' */ -#line 1043 "bison_parser.y" + case 242: /* cast_expr: CAST '(' expr AS column_type ')' */ +#line 1104 "bison_parser.y" { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } -#line 4909 "bison_parser.cpp" +#line 4927 "bison_parser.cpp" break; - case 242: /* datetime_field: SECOND */ -#line 1045 "bison_parser.y" + case 243: /* datetime_field: SECOND */ +#line 1106 "bison_parser.y" { (yyval.datetime_field) = kDatetimeSecond; } -#line 4915 "bison_parser.cpp" +#line 4933 "bison_parser.cpp" break; - case 243: /* datetime_field: MINUTE */ -#line 1046 "bison_parser.y" + case 244: /* datetime_field: MINUTE */ +#line 1107 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMinute; } -#line 4921 "bison_parser.cpp" +#line 4939 "bison_parser.cpp" break; - case 244: /* datetime_field: HOUR */ -#line 1047 "bison_parser.y" + case 245: /* datetime_field: HOUR */ +#line 1108 "bison_parser.y" { (yyval.datetime_field) = kDatetimeHour; } -#line 4927 "bison_parser.cpp" +#line 4945 "bison_parser.cpp" break; - case 245: /* datetime_field: DAY */ -#line 1048 "bison_parser.y" + case 246: /* datetime_field: DAY */ +#line 1109 "bison_parser.y" { (yyval.datetime_field) = kDatetimeDay; } -#line 4933 "bison_parser.cpp" +#line 4951 "bison_parser.cpp" break; - case 246: /* datetime_field: MONTH */ -#line 1049 "bison_parser.y" + case 247: /* datetime_field: MONTH */ +#line 1110 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMonth; } -#line 4939 "bison_parser.cpp" +#line 4957 "bison_parser.cpp" break; - case 247: /* datetime_field: YEAR */ -#line 1050 "bison_parser.y" + case 248: /* datetime_field: YEAR */ +#line 1111 "bison_parser.y" { (yyval.datetime_field) = kDatetimeYear; } -#line 4945 "bison_parser.cpp" +#line 4963 "bison_parser.cpp" break; - case 248: /* datetime_field_plural: SECONDS */ -#line 1052 "bison_parser.y" + case 249: /* datetime_field_plural: SECONDS */ +#line 1113 "bison_parser.y" { (yyval.datetime_field) = kDatetimeSecond; } -#line 4951 "bison_parser.cpp" +#line 4969 "bison_parser.cpp" break; - case 249: /* datetime_field_plural: MINUTES */ -#line 1053 "bison_parser.y" + case 250: /* datetime_field_plural: MINUTES */ +#line 1114 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMinute; } -#line 4957 "bison_parser.cpp" +#line 4975 "bison_parser.cpp" break; - case 250: /* datetime_field_plural: HOURS */ -#line 1054 "bison_parser.y" + case 251: /* datetime_field_plural: HOURS */ +#line 1115 "bison_parser.y" { (yyval.datetime_field) = kDatetimeHour; } -#line 4963 "bison_parser.cpp" +#line 4981 "bison_parser.cpp" break; - case 251: /* datetime_field_plural: DAYS */ -#line 1055 "bison_parser.y" + case 252: /* datetime_field_plural: DAYS */ +#line 1116 "bison_parser.y" { (yyval.datetime_field) = kDatetimeDay; } -#line 4969 "bison_parser.cpp" +#line 4987 "bison_parser.cpp" break; - case 252: /* datetime_field_plural: MONTHS */ -#line 1056 "bison_parser.y" + case 253: /* datetime_field_plural: MONTHS */ +#line 1117 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMonth; } -#line 4975 "bison_parser.cpp" +#line 4993 "bison_parser.cpp" break; - case 253: /* datetime_field_plural: YEARS */ -#line 1057 "bison_parser.y" + case 254: /* datetime_field_plural: YEARS */ +#line 1118 "bison_parser.y" { (yyval.datetime_field) = kDatetimeYear; } -#line 4981 "bison_parser.cpp" +#line 4999 "bison_parser.cpp" break; - case 256: /* array_expr: ARRAY '[' expr_list ']' */ -#line 1061 "bison_parser.y" + case 257: /* array_expr: ARRAY '[' expr_list ']' */ +#line 1122 "bison_parser.y" { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 4987 "bison_parser.cpp" +#line 5005 "bison_parser.cpp" break; - case 257: /* array_index: operand '[' int_literal ']' */ -#line 1063 "bison_parser.y" + case 258: /* array_index: operand '[' int_literal ']' */ +#line 1124 "bison_parser.y" { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 4993 "bison_parser.cpp" +#line 5011 "bison_parser.cpp" break; - case 258: /* between_expr: operand BETWEEN operand AND operand */ -#line 1065 "bison_parser.y" + case 259: /* between_expr: operand BETWEEN operand AND operand */ +#line 1126 "bison_parser.y" { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4999 "bison_parser.cpp" +#line 5017 "bison_parser.cpp" break; - case 259: /* column_name: IDENTIFIER */ -#line 1067 "bison_parser.y" + case 260: /* column_name: IDENTIFIER */ +#line 1128 "bison_parser.y" { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 5005 "bison_parser.cpp" +#line 5023 "bison_parser.cpp" break; - case 260: /* column_name: IDENTIFIER '.' IDENTIFIER */ -#line 1068 "bison_parser.y" + case 261: /* column_name: IDENTIFIER '.' IDENTIFIER */ +#line 1129 "bison_parser.y" { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 5011 "bison_parser.cpp" +#line 5029 "bison_parser.cpp" break; - case 261: /* column_name: '*' */ -#line 1069 "bison_parser.y" + case 262: /* column_name: '*' */ +#line 1130 "bison_parser.y" { (yyval.expr) = Expr::makeStar(); } -#line 5017 "bison_parser.cpp" +#line 5035 "bison_parser.cpp" break; - case 262: /* column_name: IDENTIFIER '.' '*' */ -#line 1070 "bison_parser.y" + case 263: /* column_name: IDENTIFIER '.' '*' */ +#line 1131 "bison_parser.y" { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 5023 "bison_parser.cpp" +#line 5041 "bison_parser.cpp" break; - case 270: /* string_literal: STRING */ -#line 1074 "bison_parser.y" + case 271: /* string_literal: STRING */ +#line 1135 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 5029 "bison_parser.cpp" +#line 5047 "bison_parser.cpp" break; - case 271: /* bool_literal: TRUE */ -#line 1076 "bison_parser.y" + case 272: /* bool_literal: TRUE */ +#line 1137 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral(true); } -#line 5035 "bison_parser.cpp" +#line 5053 "bison_parser.cpp" break; - case 272: /* bool_literal: FALSE */ -#line 1077 "bison_parser.y" + case 273: /* bool_literal: FALSE */ +#line 1138 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral(false); } -#line 5041 "bison_parser.cpp" +#line 5059 "bison_parser.cpp" break; - case 273: /* num_literal: FLOATVAL */ -#line 1079 "bison_parser.y" + case 274: /* num_literal: FLOATVAL */ +#line 1140 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 5047 "bison_parser.cpp" +#line 5065 "bison_parser.cpp" break; - case 275: /* int_literal: INTVAL */ -#line 1082 "bison_parser.y" + case 276: /* int_literal: INTVAL */ +#line 1143 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 5053 "bison_parser.cpp" +#line 5071 "bison_parser.cpp" break; - case 276: /* null_literal: NULL */ -#line 1084 "bison_parser.y" + case 277: /* null_literal: NULL */ +#line 1145 "bison_parser.y" { (yyval.expr) = Expr::makeNullLiteral(); } -#line 5059 "bison_parser.cpp" +#line 5077 "bison_parser.cpp" break; - case 277: /* date_literal: DATE STRING */ -#line 1086 "bison_parser.y" + case 278: /* date_literal: DATE STRING */ +#line 1147 "bison_parser.y" { int day{0}, month{0}, year{0}, chars_parsed{0}; // If the whole string is parsed, chars_parsed points to the terminating null byte after the last character @@ -5070,17 +5088,17 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = Expr::makeDateLiteral((yyvsp[0].sval)); } -#line 5074 "bison_parser.cpp" +#line 5092 "bison_parser.cpp" break; - case 278: /* interval_literal: INTVAL duration_field */ -#line 1097 "bison_parser.y" + case 279: /* interval_literal: INTVAL duration_field */ +#line 1158 "bison_parser.y" { (yyval.expr) = Expr::makeIntervalLiteral((yyvsp[-1].ival), (yyvsp[0].datetime_field)); } -#line 5080 "bison_parser.cpp" +#line 5098 "bison_parser.cpp" break; - case 279: /* interval_literal: INTERVAL STRING datetime_field */ -#line 1098 "bison_parser.y" + case 280: /* interval_literal: INTERVAL STRING datetime_field */ +#line 1159 "bison_parser.y" { int duration{0}, chars_parsed{0}; // If the whole string is parsed, chars_parsed points to the terminating null byte after the last character @@ -5092,11 +5110,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].sval)); (yyval.expr) = Expr::makeIntervalLiteral(duration, (yyvsp[0].datetime_field)); } -#line 5096 "bison_parser.cpp" +#line 5114 "bison_parser.cpp" break; - case 280: /* interval_literal: INTERVAL STRING */ -#line 1109 "bison_parser.y" + case 281: /* interval_literal: INTERVAL STRING */ +#line 1170 "bison_parser.y" { int duration{0}, chars_parsed{0}; // 'seconds' and 'minutes' are the longest accepted interval qualifiers (7 chars) + null byte @@ -5128,61 +5146,61 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = Expr::makeIntervalLiteral(duration, unit); } -#line 5132 "bison_parser.cpp" +#line 5150 "bison_parser.cpp" break; - case 281: /* param_expr: '?' */ -#line 1141 "bison_parser.y" + case 282: /* param_expr: '?' */ +#line 1202 "bison_parser.y" { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } -#line 5142 "bison_parser.cpp" +#line 5160 "bison_parser.cpp" break; - case 283: /* table_ref: table_ref_commalist ',' table_ref_atomic */ -#line 1150 "bison_parser.y" + case 284: /* table_ref: table_ref_commalist ',' table_ref_atomic */ +#line 1211 "bison_parser.y" { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); auto tbl = new TableRef(kTableCrossProduct); tbl->list = (yyvsp[-2].table_vec); (yyval.table) = tbl; } -#line 5153 "bison_parser.cpp" +#line 5171 "bison_parser.cpp" break; - case 287: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ -#line 1159 "bison_parser.y" + case 288: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ +#line 1220 "bison_parser.y" { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } -#line 5164 "bison_parser.cpp" +#line 5182 "bison_parser.cpp" break; - case 288: /* table_ref_commalist: table_ref_atomic */ -#line 1166 "bison_parser.y" + case 289: /* table_ref_commalist: table_ref_atomic */ +#line 1227 "bison_parser.y" { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 5173 "bison_parser.cpp" +#line 5191 "bison_parser.cpp" break; - case 289: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ -#line 1170 "bison_parser.y" + case 290: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ +#line 1231 "bison_parser.y" { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 5182 "bison_parser.cpp" +#line 5200 "bison_parser.cpp" break; - case 290: /* table_ref_name: table_name opt_table_alias */ -#line 1175 "bison_parser.y" + case 291: /* table_ref_name: table_name opt_table_alias */ +#line 1236 "bison_parser.y" { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; @@ -5190,215 +5208,215 @@ YYLTYPE yylloc = yyloc_default; tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } -#line 5194 "bison_parser.cpp" +#line 5212 "bison_parser.cpp" break; - case 291: /* table_ref_name_no_alias: table_name */ -#line 1183 "bison_parser.y" + case 292: /* table_ref_name_no_alias: table_name */ +#line 1244 "bison_parser.y" { (yyval.table) = new TableRef(kTableName); (yyval.table)->schema = (yyvsp[0].table_name).schema; (yyval.table)->name = (yyvsp[0].table_name).name; } -#line 5204 "bison_parser.cpp" +#line 5222 "bison_parser.cpp" break; - case 292: /* table_name: IDENTIFIER */ -#line 1189 "bison_parser.y" + case 293: /* table_name: IDENTIFIER */ +#line 1250 "bison_parser.y" { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval); } -#line 5213 "bison_parser.cpp" +#line 5231 "bison_parser.cpp" break; - case 293: /* table_name: IDENTIFIER '.' IDENTIFIER */ -#line 1193 "bison_parser.y" + case 294: /* table_name: IDENTIFIER '.' IDENTIFIER */ +#line 1254 "bison_parser.y" { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } -#line 5222 "bison_parser.cpp" +#line 5240 "bison_parser.cpp" break; - case 294: /* opt_index_name: IDENTIFIER */ -#line 1198 "bison_parser.y" + case 295: /* opt_index_name: IDENTIFIER */ +#line 1259 "bison_parser.y" { (yyval.sval) = (yyvsp[0].sval); } -#line 5228 "bison_parser.cpp" +#line 5246 "bison_parser.cpp" break; - case 295: /* opt_index_name: %empty */ -#line 1199 "bison_parser.y" + case 296: /* opt_index_name: %empty */ +#line 1260 "bison_parser.y" { (yyval.sval) = nullptr; } -#line 5234 "bison_parser.cpp" +#line 5252 "bison_parser.cpp" break; - case 297: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ -#line 1201 "bison_parser.y" + case 298: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ +#line 1262 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[-3].sval), (yyvsp[-1].str_vec)); } -#line 5240 "bison_parser.cpp" +#line 5258 "bison_parser.cpp" break; - case 299: /* opt_table_alias: %empty */ -#line 1203 "bison_parser.y" + case 300: /* opt_table_alias: %empty */ +#line 1264 "bison_parser.y" { (yyval.alias_t) = nullptr; } -#line 5246 "bison_parser.cpp" +#line 5264 "bison_parser.cpp" break; - case 300: /* alias: AS IDENTIFIER */ -#line 1205 "bison_parser.y" + case 301: /* alias: AS IDENTIFIER */ +#line 1266 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } -#line 5252 "bison_parser.cpp" +#line 5270 "bison_parser.cpp" break; - case 301: /* alias: IDENTIFIER */ -#line 1206 "bison_parser.y" + case 302: /* alias: IDENTIFIER */ +#line 1267 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } -#line 5258 "bison_parser.cpp" +#line 5276 "bison_parser.cpp" break; - case 303: /* opt_alias: %empty */ -#line 1208 "bison_parser.y" + case 304: /* opt_alias: %empty */ +#line 1269 "bison_parser.y" { (yyval.alias_t) = nullptr; } -#line 5264 "bison_parser.cpp" +#line 5282 "bison_parser.cpp" break; - case 304: /* opt_locking_clause: opt_locking_clause_list */ -#line 1214 "bison_parser.y" + case 305: /* opt_locking_clause: opt_locking_clause_list */ +#line 1275 "bison_parser.y" { (yyval.locking_clause_vec) = (yyvsp[0].locking_clause_vec); } -#line 5270 "bison_parser.cpp" +#line 5288 "bison_parser.cpp" break; - case 305: /* opt_locking_clause: %empty */ -#line 1215 "bison_parser.y" + case 306: /* opt_locking_clause: %empty */ +#line 1276 "bison_parser.y" { (yyval.locking_clause_vec) = nullptr; } -#line 5276 "bison_parser.cpp" +#line 5294 "bison_parser.cpp" break; - case 306: /* opt_locking_clause_list: locking_clause */ -#line 1217 "bison_parser.y" + case 307: /* opt_locking_clause_list: locking_clause */ +#line 1278 "bison_parser.y" { (yyval.locking_clause_vec) = new std::vector(); (yyval.locking_clause_vec)->push_back((yyvsp[0].locking_t)); } -#line 5285 "bison_parser.cpp" +#line 5303 "bison_parser.cpp" break; - case 307: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ -#line 1221 "bison_parser.y" + case 308: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ +#line 1282 "bison_parser.y" { (yyvsp[-1].locking_clause_vec)->push_back((yyvsp[0].locking_t)); (yyval.locking_clause_vec) = (yyvsp[-1].locking_clause_vec); } -#line 5294 "bison_parser.cpp" +#line 5312 "bison_parser.cpp" break; - case 308: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ -#line 1226 "bison_parser.y" + case 309: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ +#line 1287 "bison_parser.y" { (yyval.locking_t) = new LockingClause(); (yyval.locking_t)->rowLockMode = (yyvsp[-1].lock_mode_t); (yyval.locking_t)->rowLockWaitPolicy = (yyvsp[0].lock_wait_policy_t); (yyval.locking_t)->tables = nullptr; } -#line 5305 "bison_parser.cpp" +#line 5323 "bison_parser.cpp" break; - case 309: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ -#line 1232 "bison_parser.y" + case 310: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ +#line 1293 "bison_parser.y" { (yyval.locking_t) = new LockingClause(); (yyval.locking_t)->rowLockMode = (yyvsp[-3].lock_mode_t); (yyval.locking_t)->tables = (yyvsp[-1].str_vec); (yyval.locking_t)->rowLockWaitPolicy = (yyvsp[0].lock_wait_policy_t); } -#line 5316 "bison_parser.cpp" +#line 5334 "bison_parser.cpp" break; - case 310: /* row_lock_mode: UPDATE */ -#line 1239 "bison_parser.y" + case 311: /* row_lock_mode: UPDATE */ +#line 1300 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForUpdate; } -#line 5322 "bison_parser.cpp" +#line 5340 "bison_parser.cpp" break; - case 311: /* row_lock_mode: NO KEY UPDATE */ -#line 1240 "bison_parser.y" + case 312: /* row_lock_mode: NO KEY UPDATE */ +#line 1301 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForNoKeyUpdate; } -#line 5328 "bison_parser.cpp" +#line 5346 "bison_parser.cpp" break; - case 312: /* row_lock_mode: SHARE */ -#line 1241 "bison_parser.y" + case 313: /* row_lock_mode: SHARE */ +#line 1302 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForShare; } -#line 5334 "bison_parser.cpp" +#line 5352 "bison_parser.cpp" break; - case 313: /* row_lock_mode: KEY SHARE */ -#line 1242 "bison_parser.y" + case 314: /* row_lock_mode: KEY SHARE */ +#line 1303 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForKeyShare; } -#line 5340 "bison_parser.cpp" +#line 5358 "bison_parser.cpp" break; - case 314: /* opt_row_lock_policy: SKIP LOCKED */ -#line 1244 "bison_parser.y" + case 315: /* opt_row_lock_policy: SKIP LOCKED */ +#line 1305 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::SkipLocked; } -#line 5346 "bison_parser.cpp" +#line 5364 "bison_parser.cpp" break; - case 315: /* opt_row_lock_policy: NOWAIT */ -#line 1245 "bison_parser.y" + case 316: /* opt_row_lock_policy: NOWAIT */ +#line 1306 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::NoWait; } -#line 5352 "bison_parser.cpp" +#line 5370 "bison_parser.cpp" break; - case 316: /* opt_row_lock_policy: %empty */ -#line 1246 "bison_parser.y" + case 317: /* opt_row_lock_policy: %empty */ +#line 1307 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::None; } -#line 5358 "bison_parser.cpp" - break; - - case 318: /* opt_with_clause: %empty */ -#line 1252 "bison_parser.y" - { (yyval.with_description_vec) = nullptr; } -#line 5364 "bison_parser.cpp" +#line 5376 "bison_parser.cpp" break; - case 319: /* with_clause: WITH with_description_list */ -#line 1254 "bison_parser.y" + case 318: /* with_clause: WITH with_description_list */ +#line 1313 "bison_parser.y" { (yyval.with_description_vec) = (yyvsp[0].with_description_vec); } -#line 5370 "bison_parser.cpp" +#line 5382 "bison_parser.cpp" break; - case 320: /* with_description_list: with_description */ -#line 1256 "bison_parser.y" + case 319: /* with_description_list: with_description */ +#line 1315 "bison_parser.y" { (yyval.with_description_vec) = new std::vector(); (yyval.with_description_vec)->push_back((yyvsp[0].with_description_t)); } -#line 5379 "bison_parser.cpp" +#line 5391 "bison_parser.cpp" break; - case 321: /* with_description_list: with_description_list ',' with_description */ -#line 1260 "bison_parser.y" + case 320: /* with_description_list: with_description_list ',' with_description */ +#line 1319 "bison_parser.y" { (yyvsp[-2].with_description_vec)->push_back((yyvsp[0].with_description_t)); (yyval.with_description_vec) = (yyvsp[-2].with_description_vec); } -#line 5388 "bison_parser.cpp" +#line 5400 "bison_parser.cpp" break; - case 322: /* with_description: IDENTIFIER AS select_with_paren */ -#line 1265 "bison_parser.y" - { + case 321: /* with_description: IDENTIFIER AS subquery */ +#line 1324 "bison_parser.y" + { + if ((yyvsp[0].select_stmt)->withDescriptions != nullptr) { + free((yyvsp[-2].sval)); + delete (yyvsp[0].select_stmt); + yyerror(&yyloc, result, scanner, "Nested CTE is not allowed."); + YYERROR; + } (yyval.with_description_t) = new WithDescription(); (yyval.with_description_t)->alias = (yyvsp[-2].sval); (yyval.with_description_t)->select = (yyvsp[0].select_stmt); } -#line 5398 "bison_parser.cpp" +#line 5416 "bison_parser.cpp" break; - case 323: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ -#line 1275 "bison_parser.y" + case 322: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ +#line 1340 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5406,11 +5424,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 5410 "bison_parser.cpp" +#line 5428 "bison_parser.cpp" break; - case 324: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ -#line 1282 "bison_parser.y" + case 323: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ +#line 1347 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5419,11 +5437,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 5423 "bison_parser.cpp" +#line 5441 "bison_parser.cpp" break; - case 325: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' ident_commalist ')' */ -#line 1290 "bison_parser.y" + case 324: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' ident_commalist ')' */ +#line 1355 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5432,89 +5450,89 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->right = (yyvsp[-4].table); (yyval.table)->join->namedColumns = (yyvsp[-1].str_vec); } -#line 5436 "bison_parser.cpp" +#line 5454 "bison_parser.cpp" break; - case 326: /* opt_join_type: INNER */ -#line 1299 "bison_parser.y" + case 325: /* opt_join_type: INNER */ +#line 1364 "bison_parser.y" { (yyval.join_type) = kJoinInner; } -#line 5442 "bison_parser.cpp" +#line 5460 "bison_parser.cpp" break; - case 327: /* opt_join_type: LEFT OUTER */ -#line 1300 "bison_parser.y" + case 326: /* opt_join_type: LEFT OUTER */ +#line 1365 "bison_parser.y" { (yyval.join_type) = kJoinLeft; } -#line 5448 "bison_parser.cpp" +#line 5466 "bison_parser.cpp" break; - case 328: /* opt_join_type: LEFT */ -#line 1301 "bison_parser.y" + case 327: /* opt_join_type: LEFT */ +#line 1366 "bison_parser.y" { (yyval.join_type) = kJoinLeft; } -#line 5454 "bison_parser.cpp" +#line 5472 "bison_parser.cpp" break; - case 329: /* opt_join_type: RIGHT OUTER */ -#line 1302 "bison_parser.y" + case 328: /* opt_join_type: RIGHT OUTER */ +#line 1367 "bison_parser.y" { (yyval.join_type) = kJoinRight; } -#line 5460 "bison_parser.cpp" +#line 5478 "bison_parser.cpp" break; - case 330: /* opt_join_type: RIGHT */ -#line 1303 "bison_parser.y" + case 329: /* opt_join_type: RIGHT */ +#line 1368 "bison_parser.y" { (yyval.join_type) = kJoinRight; } -#line 5466 "bison_parser.cpp" +#line 5484 "bison_parser.cpp" break; - case 331: /* opt_join_type: FULL OUTER */ -#line 1304 "bison_parser.y" + case 330: /* opt_join_type: FULL OUTER */ +#line 1369 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5472 "bison_parser.cpp" +#line 5490 "bison_parser.cpp" break; - case 332: /* opt_join_type: OUTER */ -#line 1305 "bison_parser.y" + case 331: /* opt_join_type: OUTER */ +#line 1370 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5478 "bison_parser.cpp" +#line 5496 "bison_parser.cpp" break; - case 333: /* opt_join_type: FULL */ -#line 1306 "bison_parser.y" + case 332: /* opt_join_type: FULL */ +#line 1371 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5484 "bison_parser.cpp" +#line 5502 "bison_parser.cpp" break; - case 334: /* opt_join_type: CROSS */ -#line 1307 "bison_parser.y" + case 333: /* opt_join_type: CROSS */ +#line 1372 "bison_parser.y" { (yyval.join_type) = kJoinCross; } -#line 5490 "bison_parser.cpp" +#line 5508 "bison_parser.cpp" break; - case 335: /* opt_join_type: %empty */ -#line 1308 "bison_parser.y" + case 334: /* opt_join_type: %empty */ +#line 1373 "bison_parser.y" { (yyval.join_type) = kJoinInner; } -#line 5496 "bison_parser.cpp" +#line 5514 "bison_parser.cpp" break; - case 339: /* ident_commalist: IDENTIFIER */ -#line 1319 "bison_parser.y" + case 338: /* ident_commalist: IDENTIFIER */ +#line 1384 "bison_parser.y" { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 5505 "bison_parser.cpp" +#line 5523 "bison_parser.cpp" break; - case 340: /* ident_commalist: ident_commalist ',' IDENTIFIER */ -#line 1323 "bison_parser.y" + case 339: /* ident_commalist: ident_commalist ',' IDENTIFIER */ +#line 1388 "bison_parser.y" { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 5514 "bison_parser.cpp" +#line 5532 "bison_parser.cpp" break; -#line 5518 "bison_parser.cpp" +#line 5536 "bison_parser.cpp" default: break; } @@ -5743,7 +5761,7 @@ YYLTYPE yylloc = yyloc_default; return yyresult; } -#line 1329 "bison_parser.y" +#line 1394 "bison_parser.y" /********************************* diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h index 0e002d81..448847c9 100644 --- a/src/parser/bison_parser.h +++ b/src/parser/bison_parser.h @@ -271,7 +271,7 @@ extern int hsql_debug; #if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED union HSQL_STYPE { -#line 97 "bison_parser.y" +#line 99 "bison_parser.y" // clang-format on bool bval; diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index 20f8750d..8b9ac9f6 100644 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -63,6 +63,8 @@ // %output "bison_parser.cpp" // %defines "bison_parser.h" +%expect 0 + // Tell bison to create a reentrant parser %define api.pure full @@ -230,7 +232,8 @@ %type execute_statement %type transaction_statement %type prepare_statement -%type select_statement select_with_paren select_no_paren select_clause select_within_set_operation select_within_set_operation_no_parentheses +%type query_expression query_expression_body query_expression_parens query_term + query_primary select_statement subquery %type import_statement %type export_statement %type create_statement @@ -287,7 +290,7 @@ %type expr_list select_list opt_extended_literal_list extended_literal_list hint_list opt_hints opt_partition %type table_ref_commalist %type opt_order order_list -%type opt_with_clause with_clause with_description_list +%type with_clause with_description_list %type update_clause_commalist %type table_elem_commalist %type opt_locking_clause_list opt_locking_clause @@ -487,7 +490,7 @@ export_statement : COPY table_name TO file_path opt_file_type { $$->schema = $2.schema; $$->tableName = $2.name; } -| COPY select_with_paren TO file_path opt_file_type { +| COPY subquery TO file_path opt_file_type { $$ = new ExportStatement($5); $$->filePath = $4; $$->select = $2; @@ -715,7 +718,7 @@ insert_statement : INSERT INTO table_name opt_column_list VALUES '(' extended_li $$->columns = $4; $$->values = $7; } -| INSERT INTO table_name opt_column_list select_no_paren { +| INSERT INTO table_name opt_column_list query_term { $$ = new InsertStatement(kInsertSelect); $$->schema = $3.schema; $$->tableName = $3.name; @@ -756,67 +759,125 @@ update_clause : IDENTIFIER '=' expr { /****************************** * Select Statement ******************************/ - -select_statement : opt_with_clause select_with_paren { - $$ = $2; - $$->withDescriptions = $1; -} -| opt_with_clause select_no_paren { - $$ = $2; - $$->withDescriptions = $1; -} -| opt_with_clause select_with_paren set_operator select_within_set_operation opt_order opt_limit { - $$ = $2; - if ($$->setOperations == nullptr) { - $$->setOperations = new std::vector(); - } - $$->setOperations->push_back($3); - $$->setOperations->back()->nestedSelectStatement = $4; - $$->setOperations->back()->resultOrder = $5; - $$->setOperations->back()->resultLimit = $6; - $$->withDescriptions = $1; -}; - -select_within_set_operation : select_with_paren | select_within_set_operation_no_parentheses; - -select_within_set_operation_no_parentheses : select_clause { $$ = $1; } -| select_clause set_operator select_within_set_operation { - $$ = $1; - if ($$->setOperations == nullptr) { - $$->setOperations = new std::vector(); - } - $$->setOperations->push_back($2); - $$->setOperations->back()->nestedSelectStatement = $3; -}; - -select_with_paren : '(' select_no_paren ')' { $$ = $2; } -| '(' select_with_paren ')' { $$ = $2; }; - -select_no_paren : select_clause opt_order opt_limit opt_locking_clause { - $$ = $1; - $$->order = $2; - - // Limit could have been set by TOP. - if ($3) { - delete $$->limit; - $$->limit = $3; - } - - if ($4) { - $$->lockings = $4; - } -} -| select_clause set_operator select_within_set_operation opt_order opt_limit opt_locking_clause { - $$ = $1; - if ($$->setOperations == nullptr) { - $$->setOperations = new std::vector(); - } - $$->setOperations->push_back($2); - $$->setOperations->back()->nestedSelectStatement = $3; - $$->setOperations->back()->resultOrder = $4; - $$->setOperations->back()->resultLimit = $5; - $$->lockings = $6; -}; +select_statement: + query_expression + | query_expression_parens + ; + +query_expression: + query_expression_body opt_order opt_limit opt_locking_clause + { + if ($1->setOperations == nullptr) { + $1->order = $2; + + // Limit could have been set by TOP. + if ($3 != nullptr) { + delete $1->limit; + $1->limit = $3; + } + + if ($4 != nullptr) { + $1->lockings = $4; + } + } + else { + $1->setOperations->back()->resultOrder = $2; + $1->setOperations->back()->resultLimit = $3; + } + + $$ = $1; + } + | with_clause query_expression_body opt_order opt_limit opt_locking_clause + { + $2->withDescriptions = $1; + if ($2->setOperations == nullptr) { + $2->order = $3; + + // Limit could have been set by TOP. + if ($4 != nullptr) { + delete $2->limit; + $2->limit = $4; + } + + if ($5 != nullptr) { + $2->lockings = $5; + } + } + else { + $2->setOperations->back()->resultOrder = $3; + $2->setOperations->back()->resultLimit = $4; + } + + $$ = $2; + } + +/* + The SQL standard defines this rule as left-recursive, however, the parser + tree structure is right-recursive. To overcome this impedance mismatch, we + have to build the parse tree top-down, by running down the tree to the + deepest node and adding the set operation there. +*/ +query_expression_body: + query_term + | query_expression_body set_operator query_term + { + $$ = $1; + auto *setOperations = &$1->setOperations; + while (*setOperations != nullptr) { + setOperations = &(*setOperations)->back()->nestedSelectStatement->setOperations; + } + $2->nestedSelectStatement = $3; + *setOperations = new std::vector({$2}); + + $$ = $1; + } + | query_expression_parens set_operator query_term + { + $$ = $1; + auto *setOperations = &$1->setOperations; + while (*setOperations != nullptr) { + setOperations = &(*setOperations)->back()->nestedSelectStatement->setOperations; + } + $2->nestedSelectStatement = $3; + *setOperations = new std::vector({$2}); + + $$ = $1; + } + | query_expression_body set_operator query_expression_parens + { + $$ = $1; + auto *setOperations = &$1->setOperations; + while (*setOperations != nullptr) { + setOperations = &(*setOperations)->back()->nestedSelectStatement->setOperations; + } + $2->nestedSelectStatement = $3; + *setOperations = new std::vector({$2}); + + $$ = $1; + } + ; + +query_expression_parens: + '(' query_expression_parens ')' + { + $$ = $2; + } + | '('query_expression ')' + { + $$ = $2; + } + ; + +query_term: + query_primary + ; + +subquery: + '(' query_expression ')' + { + $$ = $2; + } + ; set_operator : set_type opt_all { $$ = $1; @@ -839,7 +900,7 @@ set_type : UNION { opt_all : ALL { $$ = true; } | /* empty */ { $$ = false; }; -select_clause : SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group { +query_primary : SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group { $$ = new SelectStatement(); $$->limit = $2; $$->selectDistinct = $3; @@ -954,7 +1015,7 @@ expr : operand | between_expr | logic_expr | exists_expr | in_expr; operand : '(' expr ')' { $$ = $2; } | array_index | scalar_expr | unary_expr | binary_expr | case_expr | function_expr | extract_expr | cast_expr | - array_expr | '(' select_no_paren ')' { + array_expr | '(' query_primary ')' { $$ = Expr::makeSelect($2); }; @@ -982,8 +1043,8 @@ logic_expr : expr AND expr { $$ = Expr::makeOpBinary($1, kOpAnd, $3); } in_expr : operand IN '(' expr_list ')' { $$ = Expr::makeInOperator($1, $4); } | operand NOT IN '(' expr_list ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); } -| operand IN '(' select_no_paren ')' { $$ = Expr::makeInOperator($1, $4); } -| operand NOT IN '(' select_no_paren ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); }; +| operand IN '(' query_primary ')' { $$ = Expr::makeInOperator($1, $4); } +| operand NOT IN '(' query_primary ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); }; // CASE grammar based on: flex & bison by John Levine // https://www.safaribooksonline.com/library/view/flex-bison/9780596805418/ch04.html#id352665 @@ -995,8 +1056,8 @@ case_expr : CASE expr case_list END { $$ = Expr::makeCase($2, $3, nullptr); } case_list : WHEN expr THEN expr { $$ = Expr::makeCaseList(Expr::makeCaseListElement($2, $4)); } | case_list WHEN expr THEN expr { $$ = Expr::caseListAppend($1, Expr::makeCaseListElement($3, $5)); }; -exists_expr : EXISTS '(' select_no_paren ')' { $$ = Expr::makeExists($3); } -| NOT EXISTS '(' select_no_paren ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeExists($4)); }; +exists_expr : EXISTS '(' query_primary ')' { $$ = Expr::makeExists($3); } +| NOT EXISTS '(' query_primary ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeExists($4)); }; comp_expr : operand '=' operand { $$ = Expr::makeOpBinary($1, kOpEquals, $3); } | operand EQUALS operand { $$ = Expr::makeOpBinary($1, kOpEquals, $3); } @@ -1249,8 +1310,6 @@ opt_row_lock_policy : SKIP LOCKED { $$ = RowLockWaitPolicy::SkipLocked; } * With Descriptions ******************************/ -opt_with_clause : with_clause | /* empty */ { $$ = nullptr; }; - with_clause : WITH with_description_list { $$ = $2; }; with_description_list : with_description { @@ -1262,7 +1321,13 @@ with_description_list : with_description { $$ = $1; }; -with_description : IDENTIFIER AS select_with_paren { +with_description : IDENTIFIER AS subquery { + if ($3->withDescriptions != nullptr) { + free($1); + delete $3; + yyerror(&yyloc, result, scanner, "Nested CTE is not allowed."); + YYERROR; + } $$ = new WithDescription(); $$->alias = $1; $$->select = $3; diff --git a/src/parser/flex_lexer.cpp b/src/parser/flex_lexer.cpp index 7845ebad..97849078 100644 --- a/src/parser/flex_lexer.cpp +++ b/src/parser/flex_lexer.cpp @@ -1,6 +1,6 @@ -#line 1 "flex_lexer.cpp" +#line 2 "flex_lexer.cpp" -#line 3 "flex_lexer.cpp" +#line 4 "flex_lexer.cpp" #define YY_INT_ALIGNED short int @@ -3061,7 +3061,7 @@ static const flex_int16_t yy_chk[8848] = static thread_local std::stringstream strbuf; -#line 3064 "flex_lexer.cpp" +#line 3065 "flex_lexer.cpp" /*************************** ** Section 2: Rules @@ -3075,7 +3075,7 @@ static thread_local std::stringstream strbuf; /*************************** ** Section 3: Rules ***************************/ -#line 3078 "flex_lexer.cpp" +#line 3079 "flex_lexer.cpp" #define INITIAL 0 #define singlequotedstring 1 @@ -3362,7 +3362,7 @@ YY_DECL #line 57 "flex_lexer.l" -#line 3365 "flex_lexer.cpp" +#line 3366 "flex_lexer.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -4378,7 +4378,7 @@ YY_RULE_SETUP #line 285 "flex_lexer.l" ECHO; YY_BREAK -#line 4381 "flex_lexer.cpp" +#line 4382 "flex_lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): yyterminate(); diff --git a/src/parser/flex_lexer.h b/src/parser/flex_lexer.h index f392a3cf..fc800723 100644 --- a/src/parser/flex_lexer.h +++ b/src/parser/flex_lexer.h @@ -2,9 +2,9 @@ #define hsql_HEADER_H 1 #define hsql_IN_HEADER 1 -#line 5 "flex_lexer.h" +#line 6 "flex_lexer.h" -#line 7 "flex_lexer.h" +#line 8 "flex_lexer.h" #define YY_INT_ALIGNED short int @@ -733,6 +733,6 @@ extern int yylex \ #line 285 "flex_lexer.l" -#line 736 "flex_lexer.h" +#line 737 "flex_lexer.h" #undef hsql_IN_HEADER #endif /* hsql_HEADER_H */