diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 719b2b1b..9dcbe936 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -397,75 +397,76 @@ enum yysymbol_kind_t YYSYMBOL_order_list = 261, /* order_list */ YYSYMBOL_order_desc = 262, /* order_desc */ YYSYMBOL_opt_order_type = 263, /* opt_order_type */ - YYSYMBOL_opt_top = 264, /* opt_top */ - YYSYMBOL_opt_limit = 265, /* opt_limit */ - YYSYMBOL_expr_list = 266, /* expr_list */ - YYSYMBOL_opt_extended_literal_list = 267, /* opt_extended_literal_list */ - YYSYMBOL_extended_literal_list = 268, /* extended_literal_list */ - YYSYMBOL_casted_extended_literal = 269, /* casted_extended_literal */ - YYSYMBOL_extended_literal = 270, /* extended_literal */ - YYSYMBOL_expr_alias = 271, /* expr_alias */ - YYSYMBOL_expr = 272, /* expr */ - YYSYMBOL_operand = 273, /* operand */ - YYSYMBOL_scalar_expr = 274, /* scalar_expr */ - YYSYMBOL_unary_expr = 275, /* unary_expr */ - YYSYMBOL_binary_expr = 276, /* binary_expr */ - YYSYMBOL_logic_expr = 277, /* logic_expr */ - YYSYMBOL_in_expr = 278, /* in_expr */ - YYSYMBOL_case_expr = 279, /* case_expr */ - YYSYMBOL_case_list = 280, /* case_list */ - YYSYMBOL_exists_expr = 281, /* exists_expr */ - YYSYMBOL_comp_expr = 282, /* comp_expr */ - YYSYMBOL_function_expr = 283, /* function_expr */ - YYSYMBOL_opt_window = 284, /* opt_window */ - YYSYMBOL_opt_partition = 285, /* opt_partition */ - YYSYMBOL_opt_frame_clause = 286, /* opt_frame_clause */ - YYSYMBOL_frame_type = 287, /* frame_type */ - YYSYMBOL_frame_bound = 288, /* frame_bound */ - YYSYMBOL_extract_expr = 289, /* extract_expr */ - YYSYMBOL_cast_expr = 290, /* cast_expr */ - YYSYMBOL_datetime_field = 291, /* datetime_field */ - YYSYMBOL_datetime_field_plural = 292, /* datetime_field_plural */ - YYSYMBOL_duration_field = 293, /* duration_field */ - YYSYMBOL_array_expr = 294, /* array_expr */ - YYSYMBOL_array_index = 295, /* array_index */ - YYSYMBOL_between_expr = 296, /* between_expr */ - YYSYMBOL_column_name = 297, /* column_name */ - YYSYMBOL_literal = 298, /* literal */ - YYSYMBOL_string_literal = 299, /* string_literal */ - YYSYMBOL_bool_literal = 300, /* bool_literal */ - YYSYMBOL_num_literal = 301, /* num_literal */ - YYSYMBOL_int_literal = 302, /* int_literal */ - YYSYMBOL_null_literal = 303, /* null_literal */ - YYSYMBOL_date_literal = 304, /* date_literal */ - YYSYMBOL_interval_literal = 305, /* interval_literal */ - YYSYMBOL_param_expr = 306, /* param_expr */ - YYSYMBOL_table_ref = 307, /* table_ref */ - YYSYMBOL_table_ref_atomic = 308, /* table_ref_atomic */ - YYSYMBOL_nonjoin_table_ref_atomic = 309, /* nonjoin_table_ref_atomic */ - YYSYMBOL_table_ref_commalist = 310, /* table_ref_commalist */ - YYSYMBOL_table_ref_name = 311, /* table_ref_name */ - YYSYMBOL_table_ref_name_no_alias = 312, /* table_ref_name_no_alias */ - YYSYMBOL_table_name = 313, /* table_name */ - YYSYMBOL_opt_index_name = 314, /* opt_index_name */ - YYSYMBOL_table_alias = 315, /* table_alias */ - YYSYMBOL_opt_table_alias = 316, /* opt_table_alias */ - YYSYMBOL_alias = 317, /* alias */ - YYSYMBOL_opt_alias = 318, /* opt_alias */ - YYSYMBOL_opt_locking_clause = 319, /* opt_locking_clause */ - YYSYMBOL_opt_locking_clause_list = 320, /* opt_locking_clause_list */ - YYSYMBOL_locking_clause = 321, /* locking_clause */ - YYSYMBOL_row_lock_mode = 322, /* row_lock_mode */ - YYSYMBOL_opt_row_lock_policy = 323, /* opt_row_lock_policy */ - YYSYMBOL_opt_with_clause = 324, /* opt_with_clause */ - YYSYMBOL_with_clause = 325, /* with_clause */ - YYSYMBOL_with_description_list = 326, /* with_description_list */ - YYSYMBOL_with_description = 327, /* with_description */ - YYSYMBOL_join_clause = 328, /* join_clause */ - YYSYMBOL_opt_join_type = 329, /* opt_join_type */ - YYSYMBOL_join_condition = 330, /* join_condition */ - YYSYMBOL_opt_semicolon = 331, /* opt_semicolon */ - YYSYMBOL_ident_commalist = 332 /* ident_commalist */ + YYSYMBOL_opt_null_ordering = 264, /* opt_null_ordering */ + YYSYMBOL_opt_top = 265, /* opt_top */ + YYSYMBOL_opt_limit = 266, /* opt_limit */ + YYSYMBOL_expr_list = 267, /* expr_list */ + YYSYMBOL_opt_extended_literal_list = 268, /* opt_extended_literal_list */ + YYSYMBOL_extended_literal_list = 269, /* extended_literal_list */ + YYSYMBOL_casted_extended_literal = 270, /* casted_extended_literal */ + YYSYMBOL_extended_literal = 271, /* extended_literal */ + YYSYMBOL_expr_alias = 272, /* expr_alias */ + YYSYMBOL_expr = 273, /* expr */ + YYSYMBOL_operand = 274, /* operand */ + YYSYMBOL_scalar_expr = 275, /* scalar_expr */ + YYSYMBOL_unary_expr = 276, /* unary_expr */ + YYSYMBOL_binary_expr = 277, /* binary_expr */ + YYSYMBOL_logic_expr = 278, /* logic_expr */ + YYSYMBOL_in_expr = 279, /* in_expr */ + YYSYMBOL_case_expr = 280, /* case_expr */ + YYSYMBOL_case_list = 281, /* case_list */ + YYSYMBOL_exists_expr = 282, /* exists_expr */ + YYSYMBOL_comp_expr = 283, /* comp_expr */ + YYSYMBOL_function_expr = 284, /* function_expr */ + YYSYMBOL_opt_window = 285, /* opt_window */ + YYSYMBOL_opt_partition = 286, /* opt_partition */ + YYSYMBOL_opt_frame_clause = 287, /* opt_frame_clause */ + YYSYMBOL_frame_type = 288, /* frame_type */ + YYSYMBOL_frame_bound = 289, /* frame_bound */ + YYSYMBOL_extract_expr = 290, /* extract_expr */ + YYSYMBOL_cast_expr = 291, /* cast_expr */ + YYSYMBOL_datetime_field = 292, /* datetime_field */ + YYSYMBOL_datetime_field_plural = 293, /* datetime_field_plural */ + YYSYMBOL_duration_field = 294, /* duration_field */ + YYSYMBOL_array_expr = 295, /* array_expr */ + YYSYMBOL_array_index = 296, /* array_index */ + YYSYMBOL_between_expr = 297, /* between_expr */ + YYSYMBOL_column_name = 298, /* column_name */ + YYSYMBOL_literal = 299, /* literal */ + YYSYMBOL_string_literal = 300, /* string_literal */ + YYSYMBOL_bool_literal = 301, /* bool_literal */ + YYSYMBOL_num_literal = 302, /* num_literal */ + YYSYMBOL_int_literal = 303, /* int_literal */ + YYSYMBOL_null_literal = 304, /* null_literal */ + YYSYMBOL_date_literal = 305, /* date_literal */ + YYSYMBOL_interval_literal = 306, /* interval_literal */ + YYSYMBOL_param_expr = 307, /* param_expr */ + YYSYMBOL_table_ref = 308, /* table_ref */ + YYSYMBOL_table_ref_atomic = 309, /* table_ref_atomic */ + YYSYMBOL_nonjoin_table_ref_atomic = 310, /* nonjoin_table_ref_atomic */ + YYSYMBOL_table_ref_commalist = 311, /* table_ref_commalist */ + YYSYMBOL_table_ref_name = 312, /* table_ref_name */ + YYSYMBOL_table_ref_name_no_alias = 313, /* table_ref_name_no_alias */ + YYSYMBOL_table_name = 314, /* table_name */ + YYSYMBOL_opt_index_name = 315, /* opt_index_name */ + YYSYMBOL_table_alias = 316, /* table_alias */ + YYSYMBOL_opt_table_alias = 317, /* opt_table_alias */ + YYSYMBOL_alias = 318, /* alias */ + YYSYMBOL_opt_alias = 319, /* opt_alias */ + YYSYMBOL_opt_locking_clause = 320, /* opt_locking_clause */ + YYSYMBOL_opt_locking_clause_list = 321, /* opt_locking_clause_list */ + YYSYMBOL_locking_clause = 322, /* locking_clause */ + YYSYMBOL_row_lock_mode = 323, /* row_lock_mode */ + YYSYMBOL_opt_row_lock_policy = 324, /* opt_row_lock_policy */ + YYSYMBOL_opt_with_clause = 325, /* opt_with_clause */ + YYSYMBOL_with_clause = 326, /* with_clause */ + YYSYMBOL_with_description_list = 327, /* with_description_list */ + YYSYMBOL_with_description = 328, /* with_description */ + YYSYMBOL_join_clause = 329, /* join_clause */ + YYSYMBOL_opt_join_type = 330, /* opt_join_type */ + YYSYMBOL_join_condition = 331, /* join_condition */ + YYSYMBOL_opt_semicolon = 332, /* opt_semicolon */ + YYSYMBOL_ident_commalist = 333 /* ident_commalist */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -796,16 +797,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 69 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 905 +#define YYLAST 914 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 199 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 134 +#define YYNNTS 135 /* YYNRULES -- Number of rules. */ -#define YYNRULES 349 +#define YYNRULES 351 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 640 +#define YYNSTATES 643 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 436 @@ -872,41 +873,42 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 335, 335, 354, 360, 367, 371, 375, 376, 377, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 394, 395, 397, 401, 406, 410, 420, 421, 422, 424, - 424, 430, 436, 438, 442, 454, 460, 473, 488, 490, - 491, 492, 494, 503, 507, 517, 527, 538, 554, 555, - 560, 571, 584, 596, 603, 610, 619, 620, 622, 626, - 631, 632, 634, 642, 643, 644, 645, 646, 647, 648, - 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, - 662, 664, 665, 667, 668, 669, 671, 672, 674, 678, - 682, 687, 695, 696, 697, 698, 700, 701, 702, 704, - 712, 718, 724, 730, 736, 737, 744, 750, 752, 762, - 769, 780, 787, 795, 796, 803, 810, 814, 819, 829, - 833, 837, 849, 849, 851, 852, 861, 862, 864, 878, - 890, 895, 899, 903, 908, 909, 911, 921, 922, 924, - 926, 927, 929, 931, 932, 934, 939, 941, 942, 944, - 945, 947, 951, 956, 958, 959, 960, 964, 965, 967, - 968, 969, 970, 971, 972, 977, 981, 987, 988, 990, - 994, 999, 999, 1003, 1011, 1012, 1014, 1023, 1023, 1023, - 1023, 1023, 1025, 1026, 1026, 1026, 1026, 1026, 1026, 1026, - 1026, 1027, 1027, 1031, 1031, 1033, 1034, 1035, 1036, 1037, - 1039, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, - 1048, 1050, 1051, 1053, 1054, 1055, 1056, 1060, 1061, 1062, - 1063, 1065, 1066, 1068, 1069, 1071, 1072, 1073, 1074, 1075, - 1076, 1077, 1081, 1082, 1086, 1087, 1089, 1090, 1095, 1096, - 1097, 1101, 1102, 1103, 1105, 1106, 1107, 1108, 1109, 1111, - 1113, 1115, 1116, 1117, 1118, 1119, 1120, 1122, 1123, 1124, - 1125, 1126, 1127, 1129, 1129, 1131, 1133, 1135, 1137, 1138, - 1139, 1140, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1144, - 1146, 1147, 1149, 1150, 1152, 1154, 1156, 1167, 1168, 1179, - 1211, 1220, 1220, 1227, 1227, 1229, 1229, 1236, 1240, 1245, - 1253, 1259, 1263, 1268, 1269, 1271, 1271, 1273, 1273, 1275, - 1276, 1278, 1278, 1284, 1285, 1287, 1291, 1296, 1302, 1309, - 1310, 1311, 1312, 1314, 1315, 1316, 1322, 1322, 1324, 1326, - 1330, 1335, 1345, 1352, 1360, 1369, 1370, 1371, 1372, 1373, - 1374, 1375, 1376, 1377, 1378, 1380, 1386, 1386, 1389, 1393 + 0, 337, 337, 356, 362, 369, 373, 377, 378, 379, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 396, 397, 399, 403, 408, 412, 422, 423, 424, 426, + 426, 432, 438, 440, 444, 456, 462, 475, 490, 492, + 493, 494, 496, 505, 509, 519, 529, 540, 556, 557, + 562, 573, 586, 598, 605, 612, 621, 622, 624, 628, + 633, 634, 636, 644, 645, 646, 647, 648, 649, 650, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 666, 667, 669, 670, 671, 673, 674, 676, 680, + 684, 689, 697, 698, 699, 700, 702, 703, 704, 706, + 714, 720, 726, 732, 738, 739, 746, 752, 754, 764, + 771, 782, 789, 797, 798, 805, 812, 816, 821, 831, + 835, 839, 851, 851, 853, 854, 863, 864, 866, 880, + 892, 897, 901, 905, 910, 911, 913, 923, 924, 926, + 928, 929, 931, 933, 934, 936, 941, 943, 944, 946, + 947, 949, 953, 958, 960, 961, 962, 964, 965, 987, + 988, 990, 991, 992, 993, 994, 995, 1000, 1004, 1010, + 1011, 1013, 1017, 1022, 1022, 1026, 1034, 1035, 1037, 1046, + 1046, 1046, 1046, 1046, 1048, 1049, 1049, 1049, 1049, 1049, + 1049, 1049, 1049, 1050, 1050, 1054, 1054, 1056, 1057, 1058, + 1059, 1060, 1062, 1062, 1063, 1064, 1065, 1066, 1067, 1068, + 1069, 1070, 1071, 1073, 1074, 1076, 1077, 1078, 1079, 1083, + 1084, 1085, 1086, 1088, 1089, 1091, 1092, 1094, 1095, 1096, + 1097, 1098, 1099, 1100, 1104, 1105, 1109, 1110, 1112, 1113, + 1118, 1119, 1120, 1124, 1125, 1126, 1128, 1129, 1130, 1131, + 1132, 1134, 1136, 1138, 1139, 1140, 1141, 1142, 1143, 1145, + 1146, 1147, 1148, 1149, 1150, 1152, 1152, 1154, 1156, 1158, + 1160, 1161, 1162, 1163, 1165, 1165, 1165, 1165, 1165, 1165, + 1165, 1167, 1169, 1170, 1172, 1173, 1175, 1177, 1179, 1190, + 1191, 1202, 1234, 1243, 1243, 1250, 1250, 1252, 1252, 1259, + 1263, 1268, 1276, 1282, 1286, 1291, 1292, 1294, 1294, 1296, + 1296, 1298, 1299, 1301, 1301, 1307, 1308, 1310, 1314, 1319, + 1325, 1332, 1333, 1334, 1335, 1337, 1338, 1339, 1345, 1345, + 1347, 1349, 1353, 1358, 1368, 1375, 1383, 1392, 1393, 1394, + 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1403, 1409, 1409, + 1412, 1416 }; #endif @@ -968,25 +970,25 @@ static const char *const yytname[] = "select_no_paren", "set_operator", "set_type", "opt_all", "select_clause", "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", - "casted_extended_literal", "extended_literal", "expr_alias", "expr", - "operand", "scalar_expr", "unary_expr", "binary_expr", "logic_expr", - "in_expr", "case_expr", "case_list", "exists_expr", "comp_expr", - "function_expr", "opt_window", "opt_partition", "opt_frame_clause", - "frame_type", "frame_bound", "extract_expr", "cast_expr", - "datetime_field", "datetime_field_plural", "duration_field", - "array_expr", "array_index", "between_expr", "column_name", "literal", - "string_literal", "bool_literal", "num_literal", "int_literal", - "null_literal", "date_literal", "interval_literal", "param_expr", - "table_ref", "table_ref_atomic", "nonjoin_table_ref_atomic", - "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 + "order_list", "order_desc", "opt_order_type", "opt_null_ordering", + "opt_top", "opt_limit", "expr_list", "opt_extended_literal_list", + "extended_literal_list", "casted_extended_literal", "extended_literal", + "expr_alias", "expr", "operand", "scalar_expr", "unary_expr", + "binary_expr", "logic_expr", "in_expr", "case_expr", "case_list", + "exists_expr", "comp_expr", "function_expr", "opt_window", + "opt_partition", "opt_frame_clause", "frame_type", "frame_bound", + "extract_expr", "cast_expr", "datetime_field", "datetime_field_plural", + "duration_field", "array_expr", "array_index", "between_expr", + "column_name", "literal", "string_literal", "bool_literal", + "num_literal", "int_literal", "null_literal", "date_literal", + "interval_literal", "param_expr", "table_ref", "table_ref_atomic", + "nonjoin_table_ref_atomic", "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 }; static const char * @@ -996,12 +998,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-463) +#define YYPACT_NINF (-500) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-347) +#define YYTABLE_NINF (-349) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) @@ -1010,70 +1012,71 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 659, 58, 86, 102, 234, 86, -14, 95, 181, 146, - 86, 227, 8, 36, 145, 277, 141, 141, 141, 323, - 161, -463, 224, -463, 224, -463, -463, -463, -463, -463, - -463, -463, -463, -463, -463, -463, -463, -25, -463, 361, - 189, -463, 193, 280, -463, 264, 264, 264, 86, 403, - 86, 286, -463, 295, -25, 294, -32, 295, 295, 295, - 86, -463, 288, 229, -463, -463, -463, -463, -463, -463, - 642, -463, 332, -463, -463, 309, 77, -463, 158, -463, - 431, 19, 436, 314, 439, 86, 86, 365, -463, 357, - 258, 444, 409, 86, 262, 267, 461, 461, 461, 460, - 86, 86, -463, 274, 277, -463, 281, 467, 471, -463, - -463, -463, -25, 372, 363, -25, 191, -463, -463, -463, - 756, 297, 496, -463, 497, -463, -463, 38, -463, 308, - 306, -463, -463, -463, -463, -463, -463, -463, -463, -463, - -463, -463, -463, -463, 458, -463, 376, -33, 258, 364, - -463, 461, 505, 123, 335, -31, -463, -463, 419, -463, - -463, -463, -48, -48, -48, -463, -463, -463, -463, -463, - 508, -463, -463, -463, 364, 441, -463, -463, 77, -463, - -463, 364, 441, 364, 150, 393, -463, -463, -463, -463, - -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, - -463, 394, -463, 354, -463, -463, -463, 19, -463, 86, - 517, 410, 24, 397, 149, 331, 333, 334, 273, 384, - 337, 433, -463, 293, -42, 459, -463, -463, -463, -463, - -463, -463, -463, -463, -463, -463, -463, -463, -463, -463, - -463, -463, 427, -463, -17, 336, -463, 364, 444, -463, - 491, -463, -463, 338, 45, -463, 365, -463, 339, -7, - -463, 445, 341, -463, 47, 191, -25, 343, -463, 140, - 191, -42, 478, 104, 90, -463, 393, -463, 416, -463, - -463, 349, 450, -463, 732, 355, 379, 381, 87, -463, - -463, -463, 410, 17, 23, 489, 354, 364, 364, -39, - 73, 362, 433, 673, 364, 117, 367, -77, 364, 364, - 433, -463, 433, 131, 370, -8, 433, 433, 433, 433, + 665, 27, 70, 105, 183, 70, 151, 98, 112, 12, + 70, 188, 24, 160, 26, 229, 129, 129, 129, 250, + 60, -500, 198, -500, 198, -500, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -26, -500, 304, + 124, -500, 122, 227, -500, 210, 210, 210, 70, 360, + 70, 245, -500, 243, -26, 246, -43, 243, 243, 243, + 70, -500, 256, 211, -500, -500, -500, -500, -500, -500, + 648, -500, 322, -500, -500, 317, 97, -500, 233, -500, + 449, 61, 456, 332, 461, 70, 70, 383, -500, 379, + 280, 471, 429, 70, 282, 285, 479, 479, 479, 484, + 70, 70, -500, 295, 229, -500, 296, 485, 480, -500, + -500, -500, -26, 378, 368, -26, 32, -500, -500, -500, + 431, 302, 494, -500, 496, -500, -500, 35, -500, 308, + 306, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, -500, -500, 462, -500, 376, -47, 280, 319, + -500, 479, 506, 269, 336, -41, -500, -500, 420, -500, + -500, -500, -54, -54, -54, -500, -500, -500, -500, -500, + 513, -500, -500, -500, 319, 444, -500, -500, 97, -500, + -500, 319, 444, 319, 149, 403, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, 299, -500, 259, -500, -500, -500, 61, -500, 70, + 520, 412, 20, 399, -121, 333, 334, 335, 270, 411, + 338, 433, -500, 292, 44, 465, -500, -500, -500, -500, + -500, -500, -500, -500, -500, -500, -500, -500, -500, -500, + -500, -500, 438, -500, 11, 340, -500, 319, 471, -500, + 492, -500, -500, 345, 36, -500, 383, -500, 346, 83, + -500, 446, 344, -500, 50, 32, -26, 347, -500, -35, + 32, 44, 487, 56, 2, -500, 403, -500, 418, -500, + -500, 352, 454, -500, 738, 355, 380, 381, 152, -500, + -500, -500, 412, 9, 16, 491, 259, 319, 319, 170, + 102, 357, 433, 679, 319, 197, 361, -53, 319, 319, + 433, -500, 433, -39, 358, -29, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, - 433, 467, 86, -463, 553, 19, -42, -463, 295, 45, - 554, 403, 96, -463, 19, -463, 508, 15, 365, -463, - 364, -463, 561, -463, -463, -463, -463, 364, -463, -463, - -463, 393, 364, 364, -463, 395, -463, 404, 128, -463, - 732, 505, 461, -463, -463, 378, -463, 380, -463, -463, - 382, -463, -463, 383, -463, -463, -463, -463, 385, -463, - -463, 119, 505, 388, 396, -463, 24, -463, 495, 364, - -463, -463, 392, 472, 200, 202, 137, 364, 364, -463, - 489, 473, 72, -463, -463, -463, 474, 602, 702, 433, - 398, 293, -463, 490, 402, 702, 702, 702, 702, 423, - 423, 423, 423, 117, 117, -79, -79, -79, -76, 405, - -463, -463, 130, 595, 152, -463, -463, -463, 201, 156, - -463, 410, -463, 9, -463, 406, -463, 51, -463, 530, - -463, -463, -463, -463, -42, -42, 540, -463, 505, -463, - 446, -463, 421, 162, -463, 607, 610, -463, 611, 614, - 615, -463, -463, 518, -463, 451, 86, -463, 119, -463, - -463, 168, 505, 505, -463, 432, -463, 169, -463, 364, - 732, 364, 364, -463, 194, 206, 430, -463, 433, 702, - 293, 434, 178, -463, -463, -463, -463, -463, 623, 403, - -463, 435, 531, -463, -463, -463, 560, 573, 574, 533, - 15, 636, -463, -463, -463, 527, -463, -463, 25, -463, - -463, -463, 464, 179, 465, 466, 468, -463, -463, 258, - -463, -463, -463, 185, 186, 549, 495, -53, 469, -42, - 215, -463, 364, -463, 673, 476, 198, -463, -463, -463, - -463, 51, 15, -463, -463, -463, 15, 148, 462, 364, - -463, -463, -463, 655, -463, -463, -463, -463, -463, 492, - 541, 441, -463, -463, -463, -463, -42, -463, -463, -463, - -463, 375, 505, -19, 477, -463, 364, 254, 475, 364, - 199, 364, -463, -463, 341, -463, -463, -463, 479, 34, - 505, -42, -463, -463, -42, -463, 100, 53, 147, -463, - -463, 208, -463, -463, 556, -463, -463, -463, 53, -463 + 433, 485, 70, -500, 553, 61, 44, -500, 243, 36, + 554, 360, 165, -500, 61, -500, 513, 25, 383, -500, + 319, -500, 556, -500, -500, -500, -500, 319, -500, -500, + 557, 403, 319, 319, -500, 385, -500, 404, 96, -500, + 738, 506, 479, -500, -500, 371, -500, 374, -500, -500, + 388, -500, -500, 389, -500, -500, -500, -500, 394, -500, + -500, 120, 506, 395, 396, -500, 20, -500, 514, 319, + -500, -500, 398, 501, 133, 135, 107, 319, 319, -500, + 491, 489, 144, -500, -500, -500, 482, 608, 708, 433, + 406, 292, -500, 499, 409, 708, 708, 708, 708, 723, + 723, 723, 723, 197, 197, -75, -75, -75, 57, 413, + -500, -500, 167, 603, 175, -500, -500, -500, 214, 179, + -500, 412, -500, 69, -500, 410, -500, 46, -500, 539, + -500, -500, -500, 607, -500, -500, 44, 44, 549, -500, + 506, -500, 452, -500, 419, 181, -500, 609, 610, -500, + 611, 614, 615, -500, -500, 510, -500, 450, 70, -500, + 120, -500, -500, 195, 506, 506, -500, 430, -500, 196, + -500, 319, 738, 319, 319, -500, 111, 176, 434, -500, + 433, 708, 292, 436, 212, -500, -500, -500, -500, -500, + 620, 360, -500, 439, 526, -500, -500, -500, 551, 558, + 559, 528, 25, 631, -500, -500, -500, 509, -500, -500, + -500, -90, -500, -500, -500, 451, 231, 463, 464, 466, + -500, -500, 280, -500, -500, -500, 232, 236, 533, 514, + -15, 467, 44, 194, -500, 319, -500, 679, 470, 237, + -500, -500, -500, -500, 46, 25, -500, -500, -500, 25, + 435, 472, 319, -500, -500, -500, 638, -500, -500, -500, + -500, -500, 486, 540, 444, -500, -500, -500, -500, 44, + -500, -500, -500, -500, 157, 506, -20, 473, -500, 319, + 189, 475, 319, 238, 319, -500, -500, 344, -500, -500, + -500, 477, 33, 506, 44, -500, -500, 44, -500, 162, + 19, 178, -500, -500, 251, -500, -500, 560, -500, -500, + -500, 19, -500 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1081,89 +1084,90 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 0, - 347, 3, 21, 19, 21, 18, 8, 9, 7, 11, - 16, 17, 13, 14, 12, 15, 10, 0, 326, 0, - 301, 110, 33, 0, 50, 57, 57, 57, 0, 0, - 0, 0, 300, 105, 0, 0, 0, 105, 105, 105, - 0, 48, 0, 328, 329, 29, 26, 28, 27, 1, - 327, 2, 0, 6, 5, 158, 119, 120, 150, 102, - 0, 168, 0, 0, 304, 0, 0, 144, 37, 0, + 349, 3, 21, 19, 21, 18, 8, 9, 7, 11, + 16, 17, 13, 14, 12, 15, 10, 0, 328, 0, + 303, 110, 33, 0, 50, 57, 57, 57, 0, 0, + 0, 0, 302, 105, 0, 0, 0, 105, 105, 105, + 0, 48, 0, 330, 331, 29, 26, 28, 27, 1, + 329, 2, 0, 6, 5, 160, 119, 120, 150, 102, + 0, 170, 0, 0, 306, 0, 0, 144, 37, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 4, 0, 0, 138, 132, - 133, 131, 0, 135, 0, 0, 164, 302, 279, 282, - 284, 0, 0, 285, 0, 280, 281, 0, 290, 0, - 167, 169, 171, 173, 272, 273, 274, 283, 275, 276, - 277, 278, 32, 31, 0, 303, 0, 0, 114, 0, + 133, 131, 0, 135, 0, 0, 166, 304, 281, 284, + 286, 0, 0, 287, 0, 282, 283, 0, 292, 0, + 169, 171, 173, 175, 274, 275, 276, 285, 277, 278, + 279, 280, 32, 31, 0, 305, 0, 0, 114, 0, 109, 0, 0, 0, 0, 144, 116, 104, 0, 127, - 126, 38, 41, 41, 41, 103, 100, 101, 331, 330, - 0, 284, 157, 137, 0, 150, 123, 122, 124, 134, - 130, 0, 150, 0, 0, 314, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 287, 0, 286, 289, 174, 175, 34, 0, 56, 0, - 0, 327, 0, 0, 268, 0, 0, 0, 0, 0, - 0, 0, 270, 0, 143, 177, 184, 185, 186, 179, - 181, 187, 180, 200, 188, 189, 190, 191, 183, 178, - 193, 194, 0, 348, 0, 0, 112, 0, 0, 115, + 126, 38, 41, 41, 41, 103, 100, 101, 333, 332, + 0, 286, 159, 137, 0, 150, 123, 122, 124, 134, + 130, 0, 150, 0, 0, 316, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 289, 0, 288, 291, 176, 177, 34, 0, 56, 0, + 0, 329, 0, 0, 270, 0, 0, 0, 0, 0, + 0, 0, 272, 0, 143, 179, 186, 187, 188, 181, + 183, 189, 182, 202, 190, 191, 192, 193, 185, 180, + 195, 196, 0, 350, 0, 0, 112, 0, 0, 115, 0, 106, 107, 0, 0, 47, 144, 46, 24, 0, - 22, 141, 139, 165, 312, 164, 0, 149, 151, 156, - 164, 160, 162, 159, 0, 128, 313, 315, 0, 288, - 170, 0, 0, 53, 0, 0, 0, 0, 0, 58, - 60, 61, 327, 138, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 196, 0, 195, 0, 0, 0, 0, - 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 141, 139, 167, 314, 166, 0, 149, 151, 156, + 166, 162, 164, 161, 0, 128, 315, 317, 0, 290, + 172, 0, 0, 53, 0, 0, 0, 0, 0, 58, + 60, 61, 329, 138, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 198, 0, 197, 0, 0, 0, 0, + 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, 0, 118, 117, 105, 0, 0, 0, 0, 36, 0, 20, 0, 0, 144, 140, - 0, 310, 0, 311, 176, 121, 125, 0, 155, 154, - 153, 314, 0, 0, 319, 0, 321, 0, 325, 316, + 0, 312, 0, 313, 178, 121, 125, 0, 155, 154, + 157, 316, 0, 0, 321, 0, 323, 0, 327, 318, 0, 0, 0, 79, 73, 0, 75, 85, 76, 63, 0, 70, 71, 0, 67, 68, 74, 77, 82, 72, - 64, 87, 0, 0, 0, 52, 0, 55, 235, 0, - 269, 271, 0, 0, 0, 0, 0, 0, 0, 219, - 0, 0, 0, 192, 182, 211, 212, 0, 207, 0, - 0, 0, 198, 0, 210, 209, 225, 226, 227, 228, - 229, 230, 231, 202, 201, 204, 203, 205, 206, 0, - 35, 349, 0, 0, 0, 45, 43, 40, 0, 0, - 23, 327, 142, 291, 293, 0, 295, 308, 294, 146, - 166, 309, 152, 129, 163, 161, 0, 322, 0, 324, - 0, 317, 0, 0, 51, 0, 0, 69, 0, 0, - 0, 78, 94, 0, 93, 0, 0, 62, 86, 88, - 90, 0, 0, 0, 59, 0, 232, 0, 223, 0, - 0, 0, 0, 217, 0, 0, 0, 265, 0, 208, - 0, 0, 0, 199, 266, 111, 108, 39, 0, 0, - 25, 0, 0, 343, 335, 341, 339, 342, 337, 0, - 0, 0, 307, 299, 305, 0, 136, 320, 325, 323, - 172, 54, 0, 0, 0, 0, 0, 95, 92, 114, - 89, 91, 97, 0, 0, 237, 235, 0, 0, 221, - 0, 220, 0, 224, 267, 0, 0, 215, 213, 44, - 42, 308, 0, 338, 340, 336, 0, 292, 309, 0, - 318, 66, 84, 0, 80, 65, 81, 99, 96, 0, - 0, 150, 233, 249, 250, 218, 222, 216, 214, 296, - 332, 344, 0, 148, 0, 98, 0, 240, 0, 0, - 0, 0, 145, 83, 236, 241, 242, 243, 0, 0, - 0, 345, 333, 306, 147, 234, 0, 0, 0, 248, - 238, 0, 247, 245, 0, 246, 244, 334, 0, 239 + 64, 87, 0, 0, 0, 52, 0, 55, 237, 0, + 271, 273, 0, 0, 0, 0, 0, 0, 0, 221, + 0, 0, 0, 194, 184, 213, 214, 0, 209, 0, + 0, 0, 200, 0, 212, 211, 227, 228, 229, 230, + 231, 232, 233, 204, 203, 206, 205, 207, 208, 0, + 35, 351, 0, 0, 0, 45, 43, 40, 0, 0, + 23, 329, 142, 293, 295, 0, 297, 310, 296, 146, + 168, 311, 152, 0, 153, 129, 165, 163, 0, 324, + 0, 326, 0, 319, 0, 0, 51, 0, 0, 69, + 0, 0, 0, 78, 94, 0, 93, 0, 0, 62, + 86, 88, 90, 0, 0, 0, 59, 0, 234, 0, + 225, 0, 0, 0, 0, 219, 0, 0, 0, 267, + 0, 210, 0, 0, 0, 201, 268, 111, 108, 39, + 0, 0, 25, 0, 0, 345, 337, 343, 341, 344, + 339, 0, 0, 0, 309, 301, 307, 0, 136, 158, + 322, 327, 325, 174, 54, 0, 0, 0, 0, 0, + 95, 92, 114, 89, 91, 97, 0, 0, 239, 237, + 0, 0, 223, 0, 222, 0, 226, 269, 0, 0, + 217, 215, 44, 42, 310, 0, 340, 342, 338, 0, + 294, 311, 0, 320, 66, 84, 0, 80, 65, 81, + 99, 96, 0, 0, 150, 235, 251, 252, 220, 224, + 218, 216, 298, 334, 346, 0, 148, 0, 98, 0, + 242, 0, 0, 0, 0, 145, 83, 238, 243, 244, + 245, 0, 0, 0, 347, 335, 308, 147, 236, 0, + 0, 0, 250, 240, 0, 249, 247, 0, 248, 246, + 336, 0, 241 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -463, -463, -463, 605, -463, 652, -463, 342, -463, 311, - -463, -463, -463, -463, -319, -81, 240, 345, -463, -463, - -463, 373, -463, 282, -463, -325, -463, -463, -463, -463, - 192, -463, -441, -463, -44, -463, -463, -463, -463, -463, - -463, -142, -463, -463, 429, -210, -84, -463, 41, -50, - -29, -463, -463, -74, 399, -463, -463, -463, -136, -463, - -463, -170, -463, 328, -463, -463, 3, -297, -463, -263, - 480, 488, 340, -147, -191, -463, -463, -463, -463, -463, - -463, 407, -463, -463, -463, 135, -463, -463, -463, -396, - -463, -463, -139, -463, -463, -463, -463, -463, -463, -61, - -463, -463, 566, -98, -463, -463, 570, -463, -463, -462, - 126, -463, -463, -463, -2, -463, -463, 134, 437, -463, - 347, -463, 426, -463, 171, -463, -463, -463, 606, -463, - -463, -463, -463, -350 + -500, -500, -500, 599, -500, 649, -500, 328, -500, 377, + -500, -500, -500, -500, -321, -81, 248, 339, -500, -500, + -500, 400, -500, 281, -500, -332, -500, -500, -500, -500, + 191, -500, -447, -500, -44, -500, -500, -500, -500, -500, + -500, -142, -500, -500, 442, -204, -85, -500, 40, -50, + -21, -500, -500, -86, 386, -500, -500, -500, -144, -500, + -500, -170, -500, 325, -500, -500, -500, 78, -303, -500, + -242, 476, 483, 341, -147, -197, -500, -500, -500, -500, + -500, -500, 387, -500, -500, -500, 134, -500, -500, -500, + -310, -500, -500, -159, -500, -500, -500, -500, -500, -500, + -63, -500, -500, 567, -98, -500, -500, 568, -500, -500, + -499, 121, -500, -500, -500, -2, -500, -500, 123, 440, + -500, 337, -500, 423, -500, 166, -500, -500, -500, 604, + -500, -500, -500, -500, -336 }; /* YYDEFGOTO[NTERM-NUM]. */ @@ -1171,18 +1175,18 @@ static const yytype_int16 yydefgoto[] = { 0, 19, 20, 21, 22, 73, 259, 260, 23, 66, 24, 143, 25, 26, 89, 162, 255, 342, 27, 28, - 29, 84, 288, 289, 290, 391, 481, 477, 487, 488, - 489, 291, 490, 30, 93, 31, 251, 252, 32, 33, + 29, 84, 288, 289, 290, 391, 483, 479, 489, 490, + 491, 291, 492, 30, 93, 31, 251, 252, 32, 33, 34, 153, 35, 155, 156, 36, 175, 176, 177, 77, - 112, 113, 180, 78, 174, 261, 348, 349, 150, 536, - 612, 116, 267, 268, 360, 108, 185, 262, 129, 130, - 131, 132, 263, 264, 225, 226, 227, 228, 229, 230, - 231, 300, 232, 233, 234, 496, 591, 618, 619, 630, - 235, 236, 198, 199, 200, 237, 238, 239, 240, 241, - 134, 135, 136, 137, 138, 139, 140, 141, 452, 453, - 454, 455, 456, 51, 457, 146, 532, 533, 534, 354, - 275, 276, 277, 368, 471, 37, 38, 63, 64, 458, - 529, 622, 71, 244 + 112, 113, 180, 78, 174, 261, 348, 349, 150, 538, + 615, 116, 267, 268, 360, 464, 108, 185, 262, 129, + 130, 131, 132, 263, 264, 225, 226, 227, 228, 229, + 230, 231, 300, 232, 233, 234, 498, 594, 621, 622, + 633, 235, 236, 198, 199, 200, 237, 238, 239, 240, + 241, 134, 135, 136, 137, 138, 139, 140, 141, 452, + 453, 454, 455, 456, 51, 457, 146, 534, 535, 536, + 354, 275, 276, 277, 368, 473, 37, 38, 63, 64, + 458, 531, 625, 71, 244 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1190,192 +1194,194 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 41, 283, 224, 44, 95, 265, 213, 412, 52, 172, - 56, 40, 270, 99, 100, 101, 163, 164, 40, 249, - 133, 473, 446, 118, 119, 120, 400, 284, 303, 173, - 305, 182, 611, 75, 269, 522, 271, 273, 178, 308, - 626, 178, 491, 119, 120, 472, 87, 551, 90, 115, - 351, 627, 149, 55, 351, 309, 45, 316, 102, 626, - 316, 210, 97, 308, 279, 253, 46, 121, 577, 340, - 242, 299, 442, 298, 308, 523, 307, 308, 76, 309, - 524, 449, 397, 147, 148, 39, 109, 525, 526, 40, - 309, 158, 211, 309, 341, 94, 422, 47, 166, 167, - 336, 98, 497, 246, 527, 42, 57, 122, -344, 528, - 330, 303, 331, 423, 601, 331, 58, 414, 538, 417, - 343, 418, 110, 123, 512, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 133, 593, 553, 554, 168, 254, 133, 59, 605, 266, - 404, 405, 364, 214, 118, 119, 120, 403, 111, 363, - 212, 415, 416, 308, 60, 407, 248, 109, 54, 124, - 125, 126, 352, 306, 522, 558, 531, 333, 350, 309, - 334, 75, 356, 469, 470, 408, 245, 345, 124, 48, - 346, 409, 178, 285, 286, 287, 215, 216, 217, 628, - 570, 54, 629, 110, 127, 61, -297, 281, 451, 401, - 269, 398, 459, 566, 523, 464, 465, 128, 628, 524, - 308, 629, 334, 482, 365, 518, 525, 526, 509, 502, - 358, 634, 419, 439, 114, 218, 309, 43, 122, 111, - 483, 521, 639, 527, 50, 402, 183, -344, 528, 408, - 519, 366, 610, 316, 123, 503, 308, 359, 468, 420, - 504, 505, 367, 184, 507, 272, 632, 633, 355, 350, - 631, 219, 309, 361, 133, 49, 214, 118, 119, 120, - 62, 395, 603, 133, 396, 220, 469, 470, 484, 485, - 447, 474, 486, 448, 443, 65, 214, 118, 119, 120, - 124, 125, 126, 327, 328, 329, 330, 53, 331, 614, - 308, 501, 561, 635, 636, 562, 308, 564, 308, 215, - 216, 217, 308, 69, 515, 500, 309, 207, 67, 68, - 440, 308, 309, 595, 309, 221, 222, 72, 309, 215, - 216, 217, 293, 223, 294, -298, 517, 309, 128, 448, - 520, 75, 557, 207, 559, 560, 541, 70, 218, 334, - 506, 122, 552, 556, 79, 334, 350, 214, 118, 119, - 120, 511, 568, 582, 82, 350, 583, 123, 218, 588, - 589, 122, 334, 334, 80, 298, 81, 214, 118, 119, - 120, 83, 598, 623, 219, 350, 334, 123, 118, 119, - 120, 522, 637, 256, 257, 334, 88, 587, 220, 91, - 215, 216, 217, 103, 219, 596, 615, 616, 617, 85, - 86, 607, 92, 124, 125, 126, 104, 96, 220, 106, - 301, 216, 217, 107, 117, 144, 214, 118, 119, 120, - 142, 523, 145, 124, 125, 126, 524, 154, 149, 218, - 151, 152, 122, 525, 526, 157, 159, 608, 221, 222, - 565, 160, 621, 165, 624, 161, 223, 54, 123, 218, - 527, 128, 122, 171, 170, 528, 310, 311, 221, 222, - 216, 217, 122, 173, 549, 219, 223, 179, 123, 181, - 201, 128, 186, 187, 188, 189, 190, 191, 123, 220, - 202, 203, 206, 207, 208, 302, 609, 209, 243, 247, - 250, 258, 274, 311, 124, 125, 126, 114, 218, 220, - 282, 122, 292, 15, 295, 332, 296, 297, 304, 335, - 338, 339, 344, 362, 124, 125, 126, 123, 350, 347, - 357, 370, 371, 372, 124, 125, 126, 75, 392, 221, - 222, 393, 315, 394, 302, 410, 441, 223, 445, 316, - 312, 413, 128, 421, 461, 467, 499, 466, 220, 221, - 222, 475, 495, 476, 419, 478, 479, 223, 480, 127, - 313, 492, 128, 124, 125, 126, 498, 314, 315, 493, - 308, 510, 128, 331, 513, 316, 317, 514, 516, 535, - -347, -347, 537, 530, -347, -347, 539, 325, 326, 327, - 328, 329, 330, 542, 331, 540, 543, 544, 221, 222, - 545, 546, 547, 548, 563, 555, 223, 569, 567, 571, - 572, 128, 576, 318, 319, 320, 321, 322, 573, 578, - 323, 324, -346, 325, 326, 327, 328, 329, 330, 1, - 331, 574, 575, 579, 590, 602, 311, 2, 581, 584, - 585, 604, 586, 594, 3, 486, 1, 606, 620, 4, - 597, 613, 638, 625, 2, 105, 74, 337, 494, 5, - 550, 3, 6, 7, 444, 462, 4, 280, 450, 278, - 460, 592, 399, 204, 8, 9, 5, 205, 600, 6, - 7, 353, 369, 312, 10, 599, 406, 11, 463, 580, - 169, 8, 9, 0, 0, 0, 0, 0, 508, 0, - 0, 10, 0, 411, 11, 0, 0, 311, 0, 12, - 0, 315, 0, 13, 0, 0, 0, 0, 316, 317, - 0, 0, 0, 373, 0, 0, 12, 0, 0, 14, - 13, 0, 0, 0, 0, 15, 311, 374, 0, 0, - 0, 375, 376, 377, 378, 379, 14, 380, 0, 0, - 0, 0, 15, 0, 312, 381, 318, 319, 320, 321, - 322, 0, 0, 323, 324, 0, 325, 326, 327, 328, - 329, 330, 0, 331, 411, 0, 0, 16, 17, 18, - 382, 0, 315, -347, 0, 0, 0, 0, 0, 316, - 317, 0, 0, 0, 16, 17, 18, 0, 383, 0, - 384, 385, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 315, 0, 0, 0, 386, 0, 0, 316, -347, - 387, 0, 388, 0, 0, 0, 0, 318, 319, 320, - 321, 322, 389, 0, 323, 324, 0, 325, 326, 327, - 328, 329, 330, 0, 331, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -347, -347, -347, 321, - 322, 0, 0, 323, 324, 390, 325, 326, 327, 328, - 329, 330, 0, 331, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197 + 41, 412, 224, 44, 95, 265, 213, 283, 52, 172, + 56, 249, 270, 99, 100, 101, 163, 164, 133, 400, + 446, 173, 303, 284, 305, 629, 178, 40, 40, 178, + 182, 614, 75, 580, 269, 475, 271, 273, 474, 629, + 119, 120, 149, 554, 279, 60, 87, 210, 90, 351, + 630, 97, 55, 351, 39, 358, 493, 115, 102, 253, + 340, 316, 419, 308, 364, 118, 119, 120, 471, 472, + 242, 299, 293, 40, 294, 422, 307, 76, 211, 309, + 604, 308, 359, 147, 148, 341, 61, 183, 397, 420, + 98, 158, 423, 442, 94, 524, 499, 309, 166, 167, + 336, 308, 449, 246, 184, 303, 109, 334, 42, 121, + 50, 363, 343, 417, 330, 418, 331, 309, 514, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 541, 525, 365, 403, 133, 254, + 526, 414, 110, 168, 133, 608, 212, 527, 528, 122, + 404, 405, 214, 118, 119, 120, 248, 266, 556, 557, + 308, 415, 416, 366, 529, 123, 308, 54, -346, 530, + 561, 533, 308, 306, 367, 352, 309, 350, 111, 596, + 178, 356, 309, 524, 631, 124, 43, 632, 309, 285, + 286, 287, 48, 316, 407, 215, 216, 217, 631, 504, + 573, 632, 401, 398, 459, 333, 49, 281, 334, 569, + 269, 124, 125, 126, 408, 466, 467, 54, 451, 408, + 409, 45, 511, 525, 484, 505, 470, 308, 526, 564, + 57, 46, 62, 439, 218, 527, 528, 122, 520, 611, + 58, 485, 109, 309, 503, 402, 127, 523, 331, 308, + 69, 308, 529, 123, 471, 472, 70, 530, 502, 128, + 506, 507, 47, 521, 272, 309, -299, 309, 53, 613, + 219, 59, 133, 214, 118, 119, 120, 345, 110, 606, + 346, 133, 298, 65, 220, 565, 308, 634, 612, 486, + 487, 476, 308, 488, 443, 214, 118, 119, 120, 124, + 125, 126, 309, 118, 119, 120, 617, 79, 309, 114, + 308, 72, 598, 567, 111, 81, 215, 216, 217, 80, + 637, 82, 214, 118, 119, 120, 309, 75, 635, 636, + 440, 642, 245, 316, 221, 222, 509, 83, 215, 216, + 217, 350, 223, 355, 638, 639, 395, 128, 361, 396, + 75, 618, 619, 620, 560, 218, 562, 563, 122, 447, + 508, 517, 448, 88, 207, 215, 216, 217, 91, 519, + 92, 513, 448, 522, 123, 544, 207, 218, 334, 96, + 122, 103, 298, 327, 328, 329, 330, 122, 331, 555, + 559, 219, 334, 350, 67, 68, 123, 186, 187, 188, + 189, 190, 191, 123, 218, 220, 571, 122, 104, 350, + 590, 256, 257, 219, 214, 118, 119, 120, 599, 106, + 124, 125, 126, 123, 610, 585, 591, 220, 586, 334, + 592, 601, 626, 334, 350, 334, 214, 118, 119, 120, + 219, 107, 124, 125, 126, 640, 85, 86, 334, 124, + 125, 126, 117, 144, 220, 221, 222, 301, 216, 217, + 142, 524, 568, 223, 145, 624, 149, 627, 128, 124, + 125, 126, 151, 152, 154, 157, 159, 221, 222, 160, + 216, 217, 310, 161, 127, 223, 552, 165, 54, 170, + 128, 171, 173, 179, 181, 201, 218, 128, 202, 122, + 203, 525, 206, 207, 221, 222, 526, 209, 208, 243, + 247, 250, 223, 527, 528, 123, 258, 128, 218, 311, + 114, 122, 274, 282, 292, 15, 295, 296, 297, 304, + 529, 338, 302, 335, -346, 530, 332, 123, 339, 344, + 347, 350, 362, 370, 357, 371, 220, 372, 392, 75, + 410, 421, 393, 394, 302, 413, 441, 468, 445, 461, + 463, 124, 125, 126, 477, 469, 312, 478, 220, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 480, 481, 124, 125, 126, 313, 482, 494, 495, + 419, 497, 500, 314, 315, 501, 221, 222, 308, 512, + 331, 316, 317, 515, 223, 516, 518, 532, 537, 128, + 539, 540, 542, 543, 550, 545, 546, 547, 221, 222, + 548, 549, 551, 558, 572, 575, 223, 579, 566, 576, + 570, 128, -300, 574, 581, 582, 577, 578, 593, 318, + 319, 320, 321, 322, 607, 584, 323, 324, -348, 325, + 326, 327, 328, 329, 330, 1, 331, 587, 588, 488, + 589, 597, 311, 2, 600, 605, 609, 616, 623, 105, + 3, 628, 1, 74, 450, 4, 641, 496, 444, 399, + 2, 553, 462, 280, 278, 5, 406, 3, 6, 7, + 337, 460, 4, 595, 204, 205, 603, 602, 465, 369, + 8, 9, 5, 0, 353, 6, 7, 583, 169, 312, + 10, 0, 0, 11, 0, 0, 0, 8, 9, 0, + 0, 0, 0, 0, 510, 0, 0, 10, 0, 411, + 11, 0, 0, 311, 0, 12, 0, 315, 0, 13, + 0, 0, 0, 0, 316, 317, 0, 0, 0, 373, + 0, 0, 12, 0, 0, 14, 13, 0, 0, 0, + 0, 15, 311, 374, 0, 0, 0, 375, 376, 377, + 378, 379, 14, 380, 0, 0, 0, 311, 15, 0, + 312, 381, 318, 319, 320, 321, 322, 0, 0, 323, + 324, 0, 325, 326, 327, 328, 329, 330, 0, 331, + 411, 0, 0, 16, 17, 18, 382, 0, 315, -349, + 0, 0, 0, 0, 0, 316, 317, 0, 0, 0, + 16, 17, 18, 0, 383, 0, 384, 385, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 315, 0, 0, + 0, 386, 0, 0, 316, -349, 387, 0, 388, 0, + 0, 0, 315, 318, 319, 320, 321, 322, 389, 316, + 323, 324, 0, 325, 326, 327, 328, 329, 330, 0, + 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -349, -349, -349, 321, 322, 0, 0, 323, + 324, 390, 325, 326, 327, 328, 329, 330, 0, 331, + -349, -349, 0, 0, -349, -349, 0, 325, 326, 327, + 328, 329, 330, 0, 331 }; static const yytype_int16 yycheck[] = { - 2, 211, 149, 5, 54, 175, 148, 304, 10, 107, - 12, 3, 182, 57, 58, 59, 97, 98, 3, 155, - 81, 371, 341, 4, 5, 6, 3, 3, 219, 12, - 221, 115, 51, 58, 181, 26, 183, 184, 112, 116, - 6, 115, 392, 5, 6, 370, 48, 488, 50, 78, - 3, 17, 83, 12, 3, 132, 70, 136, 60, 6, - 136, 94, 94, 116, 203, 113, 80, 48, 530, 24, - 151, 218, 335, 112, 116, 66, 223, 116, 37, 132, - 71, 344, 292, 85, 86, 27, 9, 78, 79, 3, - 132, 93, 125, 132, 49, 54, 104, 111, 100, 101, - 247, 133, 399, 153, 95, 3, 70, 88, 99, 100, - 189, 302, 191, 121, 576, 191, 80, 194, 468, 310, - 256, 312, 45, 104, 421, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 201, 194, 492, 493, 103, 193, 207, 111, 589, 178, - 297, 298, 62, 3, 4, 5, 6, 296, 81, 55, - 193, 308, 309, 116, 19, 92, 197, 9, 193, 150, - 151, 152, 125, 223, 26, 500, 125, 194, 197, 132, - 197, 58, 266, 158, 159, 112, 63, 194, 150, 94, - 197, 118, 266, 169, 170, 171, 46, 47, 48, 165, - 519, 193, 168, 45, 185, 60, 197, 209, 193, 186, - 357, 194, 348, 510, 66, 362, 363, 198, 165, 71, - 116, 168, 197, 104, 134, 24, 78, 79, 419, 92, - 90, 627, 101, 331, 76, 85, 132, 3, 88, 81, - 121, 451, 638, 95, 98, 295, 55, 99, 100, 112, - 49, 161, 602, 136, 104, 118, 116, 117, 130, 128, - 407, 408, 172, 72, 192, 115, 166, 167, 265, 197, - 620, 121, 132, 270, 335, 94, 3, 4, 5, 6, - 3, 194, 579, 344, 197, 135, 158, 159, 169, 170, - 194, 372, 173, 197, 338, 154, 3, 4, 5, 6, - 150, 151, 152, 186, 187, 188, 189, 80, 191, 606, - 116, 109, 118, 166, 167, 109, 116, 508, 116, 46, - 47, 48, 116, 0, 194, 125, 132, 197, 17, 18, - 332, 116, 132, 118, 132, 185, 186, 113, 132, 46, - 47, 48, 193, 193, 195, 197, 194, 132, 198, 197, - 194, 58, 499, 197, 501, 502, 194, 196, 85, 197, - 410, 88, 194, 194, 3, 197, 197, 3, 4, 5, - 6, 421, 194, 194, 94, 197, 197, 104, 85, 194, - 194, 88, 197, 197, 195, 112, 193, 3, 4, 5, - 6, 127, 194, 194, 121, 197, 197, 104, 4, 5, - 6, 26, 194, 163, 164, 197, 3, 549, 135, 123, - 46, 47, 48, 125, 121, 562, 162, 163, 164, 46, - 47, 591, 127, 150, 151, 152, 197, 133, 135, 97, - 46, 47, 48, 124, 3, 121, 3, 4, 5, 6, - 4, 66, 3, 150, 151, 152, 71, 3, 83, 85, - 93, 193, 88, 78, 79, 46, 194, 82, 185, 186, - 510, 194, 609, 3, 611, 4, 193, 193, 104, 85, - 95, 198, 88, 6, 193, 100, 17, 54, 185, 186, - 47, 48, 88, 12, 486, 121, 193, 115, 104, 126, - 193, 198, 138, 139, 140, 141, 142, 143, 104, 135, - 4, 4, 194, 197, 46, 121, 131, 131, 3, 174, - 91, 3, 119, 54, 150, 151, 152, 76, 85, 135, - 3, 88, 125, 113, 193, 98, 193, 193, 191, 193, - 39, 193, 193, 55, 150, 151, 152, 104, 197, 94, - 197, 125, 193, 93, 150, 151, 152, 58, 193, 185, - 186, 172, 129, 172, 121, 193, 3, 193, 4, 136, - 101, 194, 198, 193, 3, 161, 94, 172, 135, 185, - 186, 193, 77, 193, 101, 193, 193, 193, 193, 185, - 121, 193, 198, 150, 151, 152, 194, 128, 129, 193, - 116, 193, 198, 191, 104, 136, 137, 192, 3, 69, - 177, 178, 62, 197, 181, 182, 160, 184, 185, 186, - 187, 188, 189, 6, 191, 194, 6, 6, 185, 186, - 6, 6, 104, 172, 194, 193, 193, 4, 194, 194, - 99, 198, 99, 174, 175, 176, 177, 178, 78, 3, - 181, 182, 0, 184, 185, 186, 187, 188, 189, 7, - 191, 78, 78, 126, 105, 193, 54, 15, 194, 194, - 194, 6, 194, 194, 22, 173, 7, 126, 193, 27, - 194, 194, 116, 194, 15, 70, 24, 248, 396, 37, - 488, 22, 40, 41, 339, 357, 27, 207, 346, 201, - 350, 556, 293, 127, 52, 53, 37, 127, 572, 40, - 41, 264, 276, 101, 62, 571, 299, 65, 361, 538, - 104, 52, 53, -1, -1, -1, -1, -1, 116, -1, - -1, 62, -1, 121, 65, -1, -1, 54, -1, 87, - -1, 129, -1, 91, -1, -1, -1, -1, 136, 137, - -1, -1, -1, 11, -1, -1, 87, -1, -1, 107, - 91, -1, -1, -1, -1, 113, 54, 25, -1, -1, - -1, 29, 30, 31, 32, 33, 107, 35, -1, -1, - -1, -1, 113, -1, 101, 43, 174, 175, 176, 177, - 178, -1, -1, 181, 182, -1, 184, 185, 186, 187, - 188, 189, -1, 191, 121, -1, -1, 155, 156, 157, - 68, -1, 129, 101, -1, -1, -1, -1, -1, 136, - 137, -1, -1, -1, 155, 156, 157, -1, 86, -1, - 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 129, -1, -1, -1, 103, -1, -1, 136, 137, - 108, -1, 110, -1, -1, -1, -1, 174, 175, 176, - 177, 178, 120, -1, 181, 182, -1, 184, 185, 186, - 187, 188, 189, -1, 191, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 174, 175, 176, 177, - 178, -1, -1, 181, 182, 153, 184, 185, 186, 187, - 188, 189, -1, 191, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149 + 2, 304, 149, 5, 54, 175, 148, 211, 10, 107, + 12, 155, 182, 57, 58, 59, 97, 98, 81, 3, + 341, 12, 219, 3, 221, 6, 112, 3, 3, 115, + 115, 51, 58, 532, 181, 371, 183, 184, 370, 6, + 5, 6, 83, 490, 203, 19, 48, 94, 50, 3, + 17, 94, 12, 3, 27, 90, 392, 78, 60, 113, + 24, 136, 101, 116, 62, 4, 5, 6, 158, 159, + 151, 218, 193, 3, 195, 104, 223, 37, 125, 132, + 579, 116, 117, 85, 86, 49, 60, 55, 292, 128, + 133, 93, 121, 335, 54, 26, 399, 132, 100, 101, + 247, 116, 344, 153, 72, 302, 9, 197, 3, 48, + 98, 55, 256, 310, 189, 312, 191, 132, 421, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 470, 66, 134, 296, 201, 193, + 71, 194, 45, 103, 207, 592, 193, 78, 79, 88, + 297, 298, 3, 4, 5, 6, 197, 178, 494, 495, + 116, 308, 309, 161, 95, 104, 116, 193, 99, 100, + 502, 125, 116, 223, 172, 125, 132, 197, 81, 194, + 266, 266, 132, 26, 165, 150, 3, 168, 132, 169, + 170, 171, 94, 136, 92, 46, 47, 48, 165, 92, + 521, 168, 186, 194, 348, 194, 94, 209, 197, 512, + 357, 150, 151, 152, 112, 362, 363, 193, 193, 112, + 118, 70, 419, 66, 104, 118, 130, 116, 71, 118, + 70, 80, 3, 331, 85, 78, 79, 88, 24, 82, + 80, 121, 9, 132, 109, 295, 185, 451, 191, 116, + 0, 116, 95, 104, 158, 159, 196, 100, 125, 198, + 407, 408, 111, 49, 115, 132, 197, 132, 80, 605, + 121, 111, 335, 3, 4, 5, 6, 194, 45, 582, + 197, 344, 112, 154, 135, 109, 116, 623, 131, 169, + 170, 372, 116, 173, 338, 3, 4, 5, 6, 150, + 151, 152, 132, 4, 5, 6, 609, 3, 132, 76, + 116, 113, 118, 510, 81, 193, 46, 47, 48, 195, + 630, 94, 3, 4, 5, 6, 132, 58, 166, 167, + 332, 641, 63, 136, 185, 186, 192, 127, 46, 47, + 48, 197, 193, 265, 166, 167, 194, 198, 270, 197, + 58, 162, 163, 164, 501, 85, 503, 504, 88, 194, + 410, 194, 197, 3, 197, 46, 47, 48, 123, 194, + 127, 421, 197, 194, 104, 194, 197, 85, 197, 133, + 88, 125, 112, 186, 187, 188, 189, 88, 191, 194, + 194, 121, 197, 197, 17, 18, 104, 138, 139, 140, + 141, 142, 143, 104, 85, 135, 194, 88, 197, 197, + 552, 163, 164, 121, 3, 4, 5, 6, 565, 97, + 150, 151, 152, 104, 594, 194, 194, 135, 197, 197, + 194, 194, 194, 197, 197, 197, 3, 4, 5, 6, + 121, 124, 150, 151, 152, 194, 46, 47, 197, 150, + 151, 152, 3, 121, 135, 185, 186, 46, 47, 48, + 4, 26, 512, 193, 3, 612, 83, 614, 198, 150, + 151, 152, 93, 193, 3, 46, 194, 185, 186, 194, + 47, 48, 17, 4, 185, 193, 488, 3, 193, 193, + 198, 6, 12, 115, 126, 193, 85, 198, 4, 88, + 4, 66, 194, 197, 185, 186, 71, 131, 46, 3, + 174, 91, 193, 78, 79, 104, 3, 198, 85, 54, + 76, 88, 119, 3, 125, 113, 193, 193, 193, 191, + 95, 39, 121, 193, 99, 100, 98, 104, 193, 193, + 94, 197, 55, 125, 197, 193, 135, 93, 193, 58, + 193, 193, 172, 172, 121, 194, 3, 172, 4, 3, + 3, 150, 151, 152, 193, 161, 101, 193, 135, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 193, 193, 150, 151, 152, 121, 193, 193, 193, + 101, 77, 194, 128, 129, 94, 185, 186, 116, 193, + 191, 136, 137, 104, 193, 192, 3, 197, 69, 198, + 3, 62, 160, 194, 104, 6, 6, 6, 185, 186, + 6, 6, 172, 193, 4, 99, 193, 99, 194, 78, + 194, 198, 197, 194, 3, 126, 78, 78, 105, 174, + 175, 176, 177, 178, 6, 194, 181, 182, 0, 184, + 185, 186, 187, 188, 189, 7, 191, 194, 194, 173, + 194, 194, 54, 15, 194, 193, 126, 194, 193, 70, + 22, 194, 7, 24, 346, 27, 116, 396, 339, 293, + 15, 490, 357, 207, 201, 37, 299, 22, 40, 41, + 248, 350, 27, 559, 127, 127, 575, 574, 361, 276, + 52, 53, 37, -1, 264, 40, 41, 541, 104, 101, + 62, -1, -1, 65, -1, -1, -1, 52, 53, -1, + -1, -1, -1, -1, 116, -1, -1, 62, -1, 121, + 65, -1, -1, 54, -1, 87, -1, 129, -1, 91, + -1, -1, -1, -1, 136, 137, -1, -1, -1, 11, + -1, -1, 87, -1, -1, 107, 91, -1, -1, -1, + -1, 113, 54, 25, -1, -1, -1, 29, 30, 31, + 32, 33, 107, 35, -1, -1, -1, 54, 113, -1, + 101, 43, 174, 175, 176, 177, 178, -1, -1, 181, + 182, -1, 184, 185, 186, 187, 188, 189, -1, 191, + 121, -1, -1, 155, 156, 157, 68, -1, 129, 101, + -1, -1, -1, -1, -1, 136, 137, -1, -1, -1, + 155, 156, 157, -1, 86, -1, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 129, -1, -1, + -1, 103, -1, -1, 136, 137, 108, -1, 110, -1, + -1, -1, 129, 174, 175, 176, 177, 178, 120, 136, + 181, 182, -1, 184, 185, 186, 187, 188, 189, -1, + 191, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 174, 175, 176, 177, 178, -1, -1, 181, + 182, 153, 184, 185, 186, 187, 188, 189, -1, 191, + 177, 178, -1, -1, 181, 182, -1, 184, 185, 186, + 187, 188, 189, -1, 191 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1385,67 +1391,68 @@ static const yytype_int16 yystos[] = 0, 7, 15, 22, 27, 37, 40, 41, 52, 53, 62, 65, 87, 91, 107, 113, 155, 156, 157, 200, 201, 202, 203, 207, 209, 211, 212, 217, 218, 219, - 232, 234, 237, 238, 239, 241, 244, 324, 325, 27, - 3, 313, 3, 3, 313, 70, 80, 111, 94, 94, - 98, 312, 313, 80, 193, 247, 313, 70, 80, 111, - 19, 60, 3, 326, 327, 154, 208, 208, 208, 0, - 196, 331, 113, 204, 204, 58, 247, 248, 252, 3, - 195, 193, 94, 127, 220, 220, 220, 313, 3, 213, - 313, 123, 127, 233, 247, 248, 133, 94, 133, 233, - 233, 233, 313, 125, 197, 202, 97, 124, 264, 9, + 232, 234, 237, 238, 239, 241, 244, 325, 326, 27, + 3, 314, 3, 3, 314, 70, 80, 111, 94, 94, + 98, 313, 314, 80, 193, 247, 314, 70, 80, 111, + 19, 60, 3, 327, 328, 154, 208, 208, 208, 0, + 196, 332, 113, 204, 204, 58, 247, 248, 252, 3, + 195, 193, 94, 127, 220, 220, 220, 314, 3, 213, + 314, 123, 127, 233, 247, 248, 133, 94, 133, 233, + 233, 233, 314, 125, 197, 202, 97, 124, 265, 9, 45, 81, 249, 250, 76, 249, 260, 3, 4, 5, - 6, 48, 88, 104, 150, 151, 152, 185, 198, 267, - 268, 269, 270, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 4, 210, 121, 3, 314, 313, 313, 83, - 257, 93, 193, 240, 3, 242, 243, 46, 313, 194, - 194, 4, 214, 214, 214, 3, 313, 313, 247, 327, - 193, 6, 302, 12, 253, 245, 246, 247, 252, 115, - 251, 126, 245, 55, 72, 265, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 291, 292, - 293, 193, 4, 4, 301, 305, 194, 197, 46, 131, + 6, 48, 88, 104, 150, 151, 152, 185, 198, 268, + 269, 270, 271, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 4, 210, 121, 3, 315, 314, 314, 83, + 257, 93, 193, 240, 3, 242, 243, 46, 314, 194, + 194, 4, 214, 214, 214, 3, 314, 314, 247, 328, + 193, 6, 303, 12, 253, 245, 246, 247, 252, 115, + 251, 126, 245, 55, 72, 266, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 292, 293, + 294, 193, 4, 4, 302, 306, 194, 197, 46, 131, 94, 125, 193, 240, 3, 46, 47, 48, 85, 121, - 135, 185, 186, 193, 272, 273, 274, 275, 276, 277, - 278, 279, 281, 282, 283, 289, 290, 294, 295, 296, - 297, 298, 214, 3, 332, 63, 248, 174, 197, 257, + 135, 185, 186, 193, 273, 274, 275, 276, 277, 278, + 279, 280, 282, 283, 284, 290, 291, 295, 296, 297, + 298, 299, 214, 3, 333, 63, 248, 174, 197, 257, 91, 235, 236, 113, 193, 215, 215, 215, 3, 205, - 206, 254, 266, 271, 272, 260, 249, 261, 262, 272, - 260, 272, 115, 272, 119, 319, 320, 321, 270, 291, - 269, 313, 3, 244, 3, 169, 170, 171, 221, 222, - 223, 230, 125, 193, 195, 193, 193, 193, 112, 272, - 280, 46, 121, 273, 191, 273, 248, 272, 116, 132, + 206, 254, 267, 272, 273, 260, 249, 261, 262, 273, + 260, 273, 115, 273, 119, 320, 321, 322, 271, 292, + 270, 314, 3, 244, 3, 169, 170, 171, 221, 222, + 223, 230, 125, 193, 195, 193, 193, 193, 112, 273, + 281, 46, 121, 274, 191, 274, 248, 273, 116, 132, 17, 54, 101, 121, 128, 129, 136, 137, 174, 175, 176, 177, 178, 181, 182, 184, 185, 186, 187, 188, - 189, 191, 98, 194, 197, 193, 272, 243, 39, 193, + 189, 191, 98, 194, 197, 193, 273, 243, 39, 193, 24, 49, 216, 257, 193, 194, 197, 94, 255, 256, - 197, 3, 125, 317, 318, 265, 245, 197, 90, 117, - 263, 265, 55, 55, 62, 134, 161, 172, 322, 321, + 197, 3, 125, 318, 319, 266, 245, 197, 90, 117, + 263, 266, 55, 55, 62, 134, 161, 172, 323, 322, 125, 193, 93, 11, 25, 29, 30, 31, 32, 33, 35, 43, 68, 86, 88, 89, 103, 108, 110, 120, 153, 224, 193, 172, 172, 194, 197, 244, 194, 253, - 3, 186, 248, 291, 272, 272, 280, 92, 112, 118, - 193, 121, 266, 194, 194, 272, 272, 273, 273, 101, - 128, 193, 104, 121, 273, 273, 273, 273, 273, 273, - 273, 273, 273, 273, 273, 273, 273, 273, 273, 302, - 313, 3, 268, 233, 216, 4, 213, 194, 197, 268, - 206, 193, 307, 308, 309, 310, 311, 313, 328, 257, - 271, 3, 262, 319, 272, 272, 172, 161, 130, 158, - 159, 323, 224, 332, 214, 193, 193, 226, 193, 193, - 193, 225, 104, 121, 169, 170, 173, 227, 228, 229, - 231, 332, 193, 193, 222, 77, 284, 266, 194, 94, - 125, 109, 92, 118, 272, 272, 248, 192, 116, 273, - 193, 248, 266, 104, 192, 194, 3, 194, 24, 49, - 194, 244, 26, 66, 71, 78, 79, 95, 100, 329, - 197, 125, 315, 316, 317, 69, 258, 62, 332, 160, - 194, 194, 6, 6, 6, 6, 6, 104, 172, 313, - 229, 231, 194, 332, 332, 193, 194, 272, 224, 272, - 272, 118, 109, 194, 273, 248, 266, 194, 194, 4, - 213, 194, 99, 78, 78, 78, 99, 308, 3, 126, - 323, 194, 194, 197, 194, 194, 194, 240, 194, 194, - 105, 285, 284, 194, 194, 118, 272, 194, 194, 316, - 309, 308, 193, 266, 6, 231, 126, 260, 82, 131, - 332, 51, 259, 194, 266, 162, 163, 164, 286, 287, - 193, 272, 330, 194, 272, 194, 6, 17, 165, 168, - 288, 332, 166, 167, 288, 166, 167, 194, 116, 288 + 3, 186, 248, 292, 273, 273, 281, 92, 112, 118, + 193, 121, 267, 194, 194, 273, 273, 274, 274, 101, + 128, 193, 104, 121, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 303, + 314, 3, 269, 233, 216, 4, 213, 194, 197, 269, + 206, 193, 308, 309, 310, 311, 312, 314, 329, 257, + 272, 3, 262, 3, 264, 320, 273, 273, 172, 161, + 130, 158, 159, 324, 224, 333, 214, 193, 193, 226, + 193, 193, 193, 225, 104, 121, 169, 170, 173, 227, + 228, 229, 231, 333, 193, 193, 222, 77, 285, 267, + 194, 94, 125, 109, 92, 118, 273, 273, 248, 192, + 116, 274, 193, 248, 267, 104, 192, 194, 3, 194, + 24, 49, 194, 244, 26, 66, 71, 78, 79, 95, + 100, 330, 197, 125, 316, 317, 318, 69, 258, 3, + 62, 333, 160, 194, 194, 6, 6, 6, 6, 6, + 104, 172, 314, 229, 231, 194, 333, 333, 193, 194, + 273, 224, 273, 273, 118, 109, 194, 274, 248, 267, + 194, 194, 4, 213, 194, 99, 78, 78, 78, 99, + 309, 3, 126, 324, 194, 194, 197, 194, 194, 194, + 240, 194, 194, 105, 286, 285, 194, 194, 118, 273, + 194, 194, 317, 310, 309, 193, 267, 6, 231, 126, + 260, 82, 131, 333, 51, 259, 194, 267, 162, 163, + 164, 287, 288, 193, 273, 331, 194, 273, 194, 6, + 17, 165, 168, 289, 333, 166, 167, 289, 166, 167, + 194, 116, 289 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1467,25 +1474,26 @@ static const yytype_int16 yyr1[] = 249, 250, 250, 250, 251, 251, 252, 253, 253, 254, 255, 255, 256, 257, 257, 258, 258, 259, 259, 260, 260, 261, 261, 262, 263, 263, 263, 264, 264, 265, - 265, 265, 265, 265, 265, 266, 266, 267, 267, 268, - 268, 269, 269, 270, 270, 270, 271, 272, 272, 272, - 272, 272, 273, 273, 273, 273, 273, 273, 273, 273, - 273, 273, 273, 274, 274, 275, 275, 275, 275, 275, - 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, - 276, 277, 277, 278, 278, 278, 278, 279, 279, 279, - 279, 280, 280, 281, 281, 282, 282, 282, 282, 282, - 282, 282, 283, 283, 284, 284, 285, 285, 286, 286, - 286, 287, 287, 287, 288, 288, 288, 288, 288, 289, - 290, 291, 291, 291, 291, 291, 291, 292, 292, 292, - 292, 292, 292, 293, 293, 294, 295, 296, 297, 297, - 297, 297, 298, 298, 298, 298, 298, 298, 298, 299, - 300, 300, 301, 301, 302, 303, 304, 305, 305, 305, - 306, 307, 307, 308, 308, 309, 309, 310, 310, 311, - 312, 313, 313, 314, 314, 315, 315, 316, 316, 317, + 265, 266, 266, 266, 266, 266, 266, 267, 267, 268, + 268, 269, 269, 270, 270, 271, 271, 271, 272, 273, + 273, 273, 273, 273, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 275, 275, 276, 276, 276, + 276, 276, 277, 277, 277, 277, 277, 277, 277, 277, + 277, 277, 277, 278, 278, 279, 279, 279, 279, 280, + 280, 280, 280, 281, 281, 282, 282, 283, 283, 283, + 283, 283, 283, 283, 284, 284, 285, 285, 286, 286, + 287, 287, 287, 288, 288, 288, 289, 289, 289, 289, + 289, 290, 291, 292, 292, 292, 292, 292, 292, 293, + 293, 293, 293, 293, 293, 294, 294, 295, 296, 297, + 298, 298, 298, 298, 299, 299, 299, 299, 299, 299, + 299, 300, 301, 301, 302, 302, 303, 304, 305, 306, + 306, 306, 307, 308, 308, 309, 309, 310, 310, 311, + 311, 312, 313, 314, 314, 315, 315, 316, 316, 317, 317, 318, 318, 319, 319, 320, 320, 321, 321, 322, - 322, 322, 322, 323, 323, 323, 324, 324, 325, 326, - 326, 327, 328, 328, 328, 329, 329, 329, 329, 329, - 329, 329, 329, 329, 329, 330, 331, 331, 332, 332 + 322, 323, 323, 323, 323, 324, 324, 324, 325, 325, + 326, 327, 327, 328, 329, 329, 329, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 331, 332, 332, + 333, 333 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1506,26 +1514,27 @@ static const yytype_int8 yyr2[] = 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 + 0, 1, 3, 3, 1, 1, 0, 0, 2, 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 }; @@ -2089,31 +2098,31 @@ yydestruct (const char *yymsg, switch (yykind) { case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ -#line 192 "bison_parser.y" +#line 193 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2095 "bison_parser.cpp" +#line 2104 "bison_parser.cpp" break; case YYSYMBOL_STRING: /* STRING */ -#line 192 "bison_parser.y" +#line 193 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2101 "bison_parser.cpp" +#line 2110 "bison_parser.cpp" break; case YYSYMBOL_FLOATVAL: /* FLOATVAL */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2107 "bison_parser.cpp" +#line 2116 "bison_parser.cpp" break; case YYSYMBOL_INTVAL: /* INTVAL */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2113 "bison_parser.cpp" +#line 2122 "bison_parser.cpp" break; case YYSYMBOL_statement_list: /* statement_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).stmt_vec)) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { @@ -2122,23 +2131,23 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).stmt_vec)); } -#line 2126 "bison_parser.cpp" +#line 2135 "bison_parser.cpp" break; case YYSYMBOL_statement: /* statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).statement)); } -#line 2132 "bison_parser.cpp" +#line 2141 "bison_parser.cpp" break; case YYSYMBOL_preparable_statement: /* preparable_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).statement)); } -#line 2138 "bison_parser.cpp" +#line 2147 "bison_parser.cpp" break; case YYSYMBOL_opt_hints: /* opt_hints */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2147,11 +2156,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2151 "bison_parser.cpp" +#line 2160 "bison_parser.cpp" break; case YYSYMBOL_hint_list: /* hint_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2160,95 +2169,95 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2164 "bison_parser.cpp" +#line 2173 "bison_parser.cpp" break; case YYSYMBOL_hint: /* hint */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2170 "bison_parser.cpp" +#line 2179 "bison_parser.cpp" break; case YYSYMBOL_transaction_statement: /* transaction_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).transaction_stmt)); } -#line 2176 "bison_parser.cpp" +#line 2185 "bison_parser.cpp" break; case YYSYMBOL_prepare_statement: /* prepare_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).prep_stmt)); } -#line 2182 "bison_parser.cpp" +#line 2191 "bison_parser.cpp" break; case YYSYMBOL_prepare_target_query: /* prepare_target_query */ -#line 192 "bison_parser.y" +#line 193 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2188 "bison_parser.cpp" +#line 2197 "bison_parser.cpp" break; case YYSYMBOL_execute_statement: /* execute_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).exec_stmt)); } -#line 2194 "bison_parser.cpp" +#line 2203 "bison_parser.cpp" break; case YYSYMBOL_import_statement: /* import_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).import_stmt)); } -#line 2200 "bison_parser.cpp" +#line 2209 "bison_parser.cpp" break; case YYSYMBOL_file_type: /* file_type */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2206 "bison_parser.cpp" +#line 2215 "bison_parser.cpp" break; case YYSYMBOL_file_path: /* file_path */ -#line 192 "bison_parser.y" +#line 193 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2212 "bison_parser.cpp" +#line 2221 "bison_parser.cpp" break; case YYSYMBOL_opt_import_export_options: /* opt_import_export_options */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).import_export_option_t)); } -#line 2218 "bison_parser.cpp" +#line 2227 "bison_parser.cpp" break; case YYSYMBOL_import_export_options: /* import_export_options */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).import_export_option_t)); } -#line 2224 "bison_parser.cpp" +#line 2233 "bison_parser.cpp" break; case YYSYMBOL_export_statement: /* export_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).export_stmt)); } -#line 2230 "bison_parser.cpp" +#line 2239 "bison_parser.cpp" break; case YYSYMBOL_show_statement: /* show_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).show_stmt)); } -#line 2236 "bison_parser.cpp" +#line 2245 "bison_parser.cpp" break; case YYSYMBOL_create_statement: /* create_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).create_stmt)); } -#line 2242 "bison_parser.cpp" +#line 2251 "bison_parser.cpp" break; case YYSYMBOL_opt_not_exists: /* opt_not_exists */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2248 "bison_parser.cpp" +#line 2257 "bison_parser.cpp" break; case YYSYMBOL_table_elem_commalist: /* table_elem_commalist */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).table_element_vec)) { for (auto ptr : *(((*yyvaluep).table_element_vec))) { @@ -2257,119 +2266,119 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).table_element_vec)); } -#line 2261 "bison_parser.cpp" +#line 2270 "bison_parser.cpp" break; case YYSYMBOL_table_elem: /* table_elem */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table_element_t)); } -#line 2267 "bison_parser.cpp" +#line 2276 "bison_parser.cpp" break; case YYSYMBOL_column_def: /* column_def */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).column_t)); } -#line 2273 "bison_parser.cpp" +#line 2282 "bison_parser.cpp" break; case YYSYMBOL_column_type: /* column_type */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2279 "bison_parser.cpp" +#line 2288 "bison_parser.cpp" break; case YYSYMBOL_opt_time_precision: /* opt_time_precision */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2285 "bison_parser.cpp" +#line 2294 "bison_parser.cpp" break; case YYSYMBOL_opt_decimal_specification: /* opt_decimal_specification */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).ival_pair)); } -#line 2291 "bison_parser.cpp" +#line 2300 "bison_parser.cpp" break; case YYSYMBOL_opt_column_constraints: /* opt_column_constraints */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).column_constraints_t)); } -#line 2297 "bison_parser.cpp" +#line 2306 "bison_parser.cpp" break; case YYSYMBOL_column_constraints: /* column_constraints */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).column_constraints_t)); } -#line 2303 "bison_parser.cpp" +#line 2312 "bison_parser.cpp" break; case YYSYMBOL_column_constraint: /* column_constraint */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2309 "bison_parser.cpp" +#line 2318 "bison_parser.cpp" break; case YYSYMBOL_table_constraint: /* table_constraint */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table_constraint_t)); } -#line 2315 "bison_parser.cpp" +#line 2324 "bison_parser.cpp" break; case YYSYMBOL_references_spec: /* references_spec */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).references_spec_t)); } -#line 2321 "bison_parser.cpp" +#line 2330 "bison_parser.cpp" break; case YYSYMBOL_drop_statement: /* drop_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).drop_stmt)); } -#line 2327 "bison_parser.cpp" +#line 2336 "bison_parser.cpp" break; case YYSYMBOL_opt_exists: /* opt_exists */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2333 "bison_parser.cpp" +#line 2342 "bison_parser.cpp" break; case YYSYMBOL_alter_statement: /* alter_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).alter_stmt)); } -#line 2339 "bison_parser.cpp" +#line 2348 "bison_parser.cpp" break; case YYSYMBOL_alter_action: /* alter_action */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).alter_action_t)); } -#line 2345 "bison_parser.cpp" +#line 2354 "bison_parser.cpp" break; case YYSYMBOL_drop_action: /* drop_action */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).drop_action_t)); } -#line 2351 "bison_parser.cpp" +#line 2360 "bison_parser.cpp" break; case YYSYMBOL_delete_statement: /* delete_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).delete_stmt)); } -#line 2357 "bison_parser.cpp" +#line 2366 "bison_parser.cpp" break; case YYSYMBOL_truncate_statement: /* truncate_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).delete_stmt)); } -#line 2363 "bison_parser.cpp" +#line 2372 "bison_parser.cpp" break; case YYSYMBOL_insert_statement: /* insert_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).insert_stmt)); } -#line 2369 "bison_parser.cpp" +#line 2378 "bison_parser.cpp" break; case YYSYMBOL_opt_column_list: /* opt_column_list */ -#line 184 "bison_parser.y" +#line 185 "bison_parser.y" { if (((*yyvaluep).str_vec)) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2378,17 +2387,17 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).str_vec)); } -#line 2382 "bison_parser.cpp" +#line 2391 "bison_parser.cpp" break; case YYSYMBOL_update_statement: /* update_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).update_stmt)); } -#line 2388 "bison_parser.cpp" +#line 2397 "bison_parser.cpp" break; case YYSYMBOL_update_clause_commalist: /* update_clause_commalist */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).update_vec)) { for (auto ptr : *(((*yyvaluep).update_vec))) { @@ -2397,77 +2406,77 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).update_vec)); } -#line 2401 "bison_parser.cpp" +#line 2410 "bison_parser.cpp" break; case YYSYMBOL_update_clause: /* update_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).update_t)); } -#line 2407 "bison_parser.cpp" +#line 2416 "bison_parser.cpp" break; case YYSYMBOL_select_statement: /* select_statement */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2413 "bison_parser.cpp" +#line 2422 "bison_parser.cpp" break; case YYSYMBOL_select_within_set_operation: /* select_within_set_operation */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2419 "bison_parser.cpp" +#line 2428 "bison_parser.cpp" break; case YYSYMBOL_select_within_set_operation_no_parentheses: /* select_within_set_operation_no_parentheses */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2425 "bison_parser.cpp" +#line 2434 "bison_parser.cpp" break; case YYSYMBOL_select_with_paren: /* select_with_paren */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2431 "bison_parser.cpp" +#line 2440 "bison_parser.cpp" break; case YYSYMBOL_select_no_paren: /* select_no_paren */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2437 "bison_parser.cpp" +#line 2446 "bison_parser.cpp" break; case YYSYMBOL_set_operator: /* set_operator */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).set_operator_t)); } -#line 2443 "bison_parser.cpp" +#line 2452 "bison_parser.cpp" break; case YYSYMBOL_set_type: /* set_type */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).set_operator_t)); } -#line 2449 "bison_parser.cpp" +#line 2458 "bison_parser.cpp" break; case YYSYMBOL_opt_all: /* opt_all */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2455 "bison_parser.cpp" +#line 2464 "bison_parser.cpp" break; case YYSYMBOL_select_clause: /* select_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2461 "bison_parser.cpp" +#line 2470 "bison_parser.cpp" break; case YYSYMBOL_opt_distinct: /* opt_distinct */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2467 "bison_parser.cpp" +#line 2476 "bison_parser.cpp" break; case YYSYMBOL_select_list: /* select_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2476,41 +2485,41 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2480 "bison_parser.cpp" +#line 2489 "bison_parser.cpp" break; case YYSYMBOL_opt_from_clause: /* opt_from_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2486 "bison_parser.cpp" +#line 2495 "bison_parser.cpp" break; case YYSYMBOL_from_clause: /* from_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2492 "bison_parser.cpp" +#line 2501 "bison_parser.cpp" break; case YYSYMBOL_opt_where: /* opt_where */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2498 "bison_parser.cpp" +#line 2507 "bison_parser.cpp" break; case YYSYMBOL_opt_group: /* opt_group */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).group_t)); } -#line 2504 "bison_parser.cpp" +#line 2513 "bison_parser.cpp" break; case YYSYMBOL_opt_having: /* opt_having */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2510 "bison_parser.cpp" +#line 2519 "bison_parser.cpp" break; case YYSYMBOL_opt_order: /* opt_order */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).order_vec)) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -2519,11 +2528,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).order_vec)); } -#line 2523 "bison_parser.cpp" +#line 2532 "bison_parser.cpp" break; case YYSYMBOL_order_list: /* order_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).order_vec)) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -2532,35 +2541,41 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).order_vec)); } -#line 2536 "bison_parser.cpp" +#line 2545 "bison_parser.cpp" break; case YYSYMBOL_order_desc: /* order_desc */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).order)); } -#line 2542 "bison_parser.cpp" +#line 2551 "bison_parser.cpp" break; case YYSYMBOL_opt_order_type: /* opt_order_type */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" + { } +#line 2557 "bison_parser.cpp" + break; + + case YYSYMBOL_opt_null_ordering: /* opt_null_ordering */ +#line 180 "bison_parser.y" { } -#line 2548 "bison_parser.cpp" +#line 2563 "bison_parser.cpp" break; case YYSYMBOL_opt_top: /* opt_top */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).limit)); } -#line 2554 "bison_parser.cpp" +#line 2569 "bison_parser.cpp" break; case YYSYMBOL_opt_limit: /* opt_limit */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).limit)); } -#line 2560 "bison_parser.cpp" +#line 2575 "bison_parser.cpp" break; case YYSYMBOL_expr_list: /* expr_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2569,11 +2584,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2573 "bison_parser.cpp" +#line 2588 "bison_parser.cpp" break; case YYSYMBOL_opt_extended_literal_list: /* opt_extended_literal_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2582,11 +2597,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2586 "bison_parser.cpp" +#line 2601 "bison_parser.cpp" break; case YYSYMBOL_extended_literal_list: /* extended_literal_list */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2595,107 +2610,107 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2599 "bison_parser.cpp" +#line 2614 "bison_parser.cpp" break; case YYSYMBOL_casted_extended_literal: /* casted_extended_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2605 "bison_parser.cpp" +#line 2620 "bison_parser.cpp" break; case YYSYMBOL_extended_literal: /* extended_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2611 "bison_parser.cpp" +#line 2626 "bison_parser.cpp" break; case YYSYMBOL_expr_alias: /* expr_alias */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2617 "bison_parser.cpp" +#line 2632 "bison_parser.cpp" break; case YYSYMBOL_expr: /* expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2623 "bison_parser.cpp" +#line 2638 "bison_parser.cpp" break; case YYSYMBOL_operand: /* operand */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2629 "bison_parser.cpp" +#line 2644 "bison_parser.cpp" break; case YYSYMBOL_scalar_expr: /* scalar_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2635 "bison_parser.cpp" +#line 2650 "bison_parser.cpp" break; case YYSYMBOL_unary_expr: /* unary_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2641 "bison_parser.cpp" +#line 2656 "bison_parser.cpp" break; case YYSYMBOL_binary_expr: /* binary_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2647 "bison_parser.cpp" +#line 2662 "bison_parser.cpp" break; case YYSYMBOL_logic_expr: /* logic_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2653 "bison_parser.cpp" +#line 2668 "bison_parser.cpp" break; case YYSYMBOL_in_expr: /* in_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2659 "bison_parser.cpp" +#line 2674 "bison_parser.cpp" break; case YYSYMBOL_case_expr: /* case_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2665 "bison_parser.cpp" +#line 2680 "bison_parser.cpp" break; case YYSYMBOL_case_list: /* case_list */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2671 "bison_parser.cpp" +#line 2686 "bison_parser.cpp" break; case YYSYMBOL_exists_expr: /* exists_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2677 "bison_parser.cpp" +#line 2692 "bison_parser.cpp" break; case YYSYMBOL_comp_expr: /* comp_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2683 "bison_parser.cpp" +#line 2698 "bison_parser.cpp" break; case YYSYMBOL_function_expr: /* function_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2689 "bison_parser.cpp" +#line 2704 "bison_parser.cpp" break; case YYSYMBOL_opt_window: /* opt_window */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).window_description)); } -#line 2695 "bison_parser.cpp" +#line 2710 "bison_parser.cpp" break; case YYSYMBOL_opt_partition: /* opt_partition */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2704,155 +2719,155 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2708 "bison_parser.cpp" +#line 2723 "bison_parser.cpp" break; case YYSYMBOL_opt_frame_clause: /* opt_frame_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).frame_description)); } -#line 2714 "bison_parser.cpp" +#line 2729 "bison_parser.cpp" break; case YYSYMBOL_frame_type: /* frame_type */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2720 "bison_parser.cpp" +#line 2735 "bison_parser.cpp" break; case YYSYMBOL_frame_bound: /* frame_bound */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).frame_bound)); } -#line 2726 "bison_parser.cpp" +#line 2741 "bison_parser.cpp" break; case YYSYMBOL_extract_expr: /* extract_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2732 "bison_parser.cpp" +#line 2747 "bison_parser.cpp" break; case YYSYMBOL_cast_expr: /* cast_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2738 "bison_parser.cpp" +#line 2753 "bison_parser.cpp" break; case YYSYMBOL_datetime_field: /* datetime_field */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2744 "bison_parser.cpp" +#line 2759 "bison_parser.cpp" break; case YYSYMBOL_datetime_field_plural: /* datetime_field_plural */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2750 "bison_parser.cpp" +#line 2765 "bison_parser.cpp" break; case YYSYMBOL_duration_field: /* duration_field */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2756 "bison_parser.cpp" +#line 2771 "bison_parser.cpp" break; case YYSYMBOL_array_expr: /* array_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2762 "bison_parser.cpp" +#line 2777 "bison_parser.cpp" break; case YYSYMBOL_array_index: /* array_index */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2768 "bison_parser.cpp" +#line 2783 "bison_parser.cpp" break; case YYSYMBOL_between_expr: /* between_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2774 "bison_parser.cpp" +#line 2789 "bison_parser.cpp" break; case YYSYMBOL_column_name: /* column_name */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2780 "bison_parser.cpp" +#line 2795 "bison_parser.cpp" break; case YYSYMBOL_literal: /* literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2786 "bison_parser.cpp" +#line 2801 "bison_parser.cpp" break; case YYSYMBOL_string_literal: /* string_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2792 "bison_parser.cpp" +#line 2807 "bison_parser.cpp" break; case YYSYMBOL_bool_literal: /* bool_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2798 "bison_parser.cpp" +#line 2813 "bison_parser.cpp" break; case YYSYMBOL_num_literal: /* num_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2804 "bison_parser.cpp" +#line 2819 "bison_parser.cpp" break; case YYSYMBOL_int_literal: /* int_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2810 "bison_parser.cpp" +#line 2825 "bison_parser.cpp" break; case YYSYMBOL_null_literal: /* null_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2816 "bison_parser.cpp" +#line 2831 "bison_parser.cpp" break; case YYSYMBOL_date_literal: /* date_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2822 "bison_parser.cpp" +#line 2837 "bison_parser.cpp" break; case YYSYMBOL_interval_literal: /* interval_literal */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2828 "bison_parser.cpp" +#line 2843 "bison_parser.cpp" break; case YYSYMBOL_param_expr: /* param_expr */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2834 "bison_parser.cpp" +#line 2849 "bison_parser.cpp" break; case YYSYMBOL_table_ref: /* table_ref */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2840 "bison_parser.cpp" +#line 2855 "bison_parser.cpp" break; case YYSYMBOL_table_ref_atomic: /* table_ref_atomic */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2846 "bison_parser.cpp" +#line 2861 "bison_parser.cpp" break; case YYSYMBOL_nonjoin_table_ref_atomic: /* nonjoin_table_ref_atomic */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2852 "bison_parser.cpp" +#line 2867 "bison_parser.cpp" break; case YYSYMBOL_table_ref_commalist: /* table_ref_commalist */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { if (((*yyvaluep).table_vec)) { for (auto ptr : *(((*yyvaluep).table_vec))) { @@ -2861,134 +2876,134 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).table_vec)); } -#line 2865 "bison_parser.cpp" +#line 2880 "bison_parser.cpp" break; case YYSYMBOL_table_ref_name: /* table_ref_name */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2871 "bison_parser.cpp" +#line 2886 "bison_parser.cpp" break; case YYSYMBOL_table_ref_name_no_alias: /* table_ref_name_no_alias */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2877 "bison_parser.cpp" +#line 2892 "bison_parser.cpp" break; case YYSYMBOL_table_name: /* table_name */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { free(((*yyvaluep).table_name).name); free(((*yyvaluep).table_name).schema); } -#line 2886 "bison_parser.cpp" +#line 2901 "bison_parser.cpp" break; case YYSYMBOL_opt_index_name: /* opt_index_name */ -#line 192 "bison_parser.y" +#line 193 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2892 "bison_parser.cpp" +#line 2907 "bison_parser.cpp" break; case YYSYMBOL_table_alias: /* table_alias */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2898 "bison_parser.cpp" +#line 2913 "bison_parser.cpp" break; case YYSYMBOL_opt_table_alias: /* opt_table_alias */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2904 "bison_parser.cpp" +#line 2919 "bison_parser.cpp" break; case YYSYMBOL_alias: /* alias */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2910 "bison_parser.cpp" +#line 2925 "bison_parser.cpp" break; case YYSYMBOL_opt_alias: /* opt_alias */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2916 "bison_parser.cpp" +#line 2931 "bison_parser.cpp" break; case YYSYMBOL_opt_locking_clause: /* opt_locking_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).locking_clause_vec)); } -#line 2922 "bison_parser.cpp" +#line 2937 "bison_parser.cpp" break; case YYSYMBOL_opt_locking_clause_list: /* opt_locking_clause_list */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).locking_clause_vec)); } -#line 2928 "bison_parser.cpp" +#line 2943 "bison_parser.cpp" break; case YYSYMBOL_locking_clause: /* locking_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).locking_t)); } -#line 2934 "bison_parser.cpp" +#line 2949 "bison_parser.cpp" break; case YYSYMBOL_row_lock_mode: /* row_lock_mode */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2940 "bison_parser.cpp" +#line 2955 "bison_parser.cpp" break; case YYSYMBOL_opt_row_lock_policy: /* opt_row_lock_policy */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2946 "bison_parser.cpp" +#line 2961 "bison_parser.cpp" break; case YYSYMBOL_opt_with_clause: /* opt_with_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2952 "bison_parser.cpp" +#line 2967 "bison_parser.cpp" break; case YYSYMBOL_with_clause: /* with_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2958 "bison_parser.cpp" +#line 2973 "bison_parser.cpp" break; case YYSYMBOL_with_description_list: /* with_description_list */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2964 "bison_parser.cpp" +#line 2979 "bison_parser.cpp" break; case YYSYMBOL_with_description: /* with_description */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).with_description_t)); } -#line 2970 "bison_parser.cpp" +#line 2985 "bison_parser.cpp" break; case YYSYMBOL_join_clause: /* join_clause */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2976 "bison_parser.cpp" +#line 2991 "bison_parser.cpp" break; case YYSYMBOL_opt_join_type: /* opt_join_type */ -#line 179 "bison_parser.y" +#line 180 "bison_parser.y" { } -#line 2982 "bison_parser.cpp" +#line 2997 "bison_parser.cpp" break; case YYSYMBOL_join_condition: /* join_condition */ -#line 201 "bison_parser.y" +#line 202 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2988 "bison_parser.cpp" +#line 3003 "bison_parser.cpp" break; case YYSYMBOL_ident_commalist: /* ident_commalist */ -#line 184 "bison_parser.y" +#line 185 "bison_parser.y" { if (((*yyvaluep).str_vec)) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2997,7 +3012,7 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).str_vec)); } -#line 3001 "bison_parser.cpp" +#line 3016 "bison_parser.cpp" break; default: @@ -3105,7 +3120,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.string_length = 0; } -#line 3109 "bison_parser.cpp" +#line 3124 "bison_parser.cpp" yylsp[0] = yylloc; goto yysetstate; @@ -3316,7 +3331,7 @@ YYLTYPE yylloc = yyloc_default; switch (yyn) { case 2: /* input: statement_list opt_semicolon */ -#line 335 "bison_parser.y" +#line 337 "bison_parser.y" { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. @@ -3334,236 +3349,236 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].stmt_vec); } -#line 3338 "bison_parser.cpp" +#line 3353 "bison_parser.cpp" break; case 3: /* statement_list: statement */ -#line 354 "bison_parser.y" +#line 356 "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 3349 "bison_parser.cpp" +#line 3364 "bison_parser.cpp" break; case 4: /* statement_list: statement_list ';' statement */ -#line 360 "bison_parser.y" +#line 362 "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 3360 "bison_parser.cpp" +#line 3375 "bison_parser.cpp" break; case 5: /* statement: prepare_statement opt_hints */ -#line 367 "bison_parser.y" +#line 369 "bison_parser.y" { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 3369 "bison_parser.cpp" +#line 3384 "bison_parser.cpp" break; case 6: /* statement: preparable_statement opt_hints */ -#line 371 "bison_parser.y" +#line 373 "bison_parser.y" { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 3378 "bison_parser.cpp" +#line 3393 "bison_parser.cpp" break; case 7: /* statement: show_statement */ -#line 375 "bison_parser.y" +#line 377 "bison_parser.y" { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 3384 "bison_parser.cpp" +#line 3399 "bison_parser.cpp" break; case 8: /* statement: import_statement */ -#line 376 "bison_parser.y" +#line 378 "bison_parser.y" { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 3390 "bison_parser.cpp" +#line 3405 "bison_parser.cpp" break; case 9: /* statement: export_statement */ -#line 377 "bison_parser.y" +#line 379 "bison_parser.y" { (yyval.statement) = (yyvsp[0].export_stmt); } -#line 3396 "bison_parser.cpp" +#line 3411 "bison_parser.cpp" break; case 10: /* preparable_statement: select_statement */ -#line 379 "bison_parser.y" +#line 381 "bison_parser.y" { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 3402 "bison_parser.cpp" +#line 3417 "bison_parser.cpp" break; case 11: /* preparable_statement: create_statement */ -#line 380 "bison_parser.y" +#line 382 "bison_parser.y" { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 3408 "bison_parser.cpp" +#line 3423 "bison_parser.cpp" break; case 12: /* preparable_statement: insert_statement */ -#line 381 "bison_parser.y" +#line 383 "bison_parser.y" { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 3414 "bison_parser.cpp" +#line 3429 "bison_parser.cpp" break; case 13: /* preparable_statement: delete_statement */ -#line 382 "bison_parser.y" +#line 384 "bison_parser.y" { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 3420 "bison_parser.cpp" +#line 3435 "bison_parser.cpp" break; case 14: /* preparable_statement: truncate_statement */ -#line 383 "bison_parser.y" +#line 385 "bison_parser.y" { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 3426 "bison_parser.cpp" +#line 3441 "bison_parser.cpp" break; case 15: /* preparable_statement: update_statement */ -#line 384 "bison_parser.y" +#line 386 "bison_parser.y" { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 3432 "bison_parser.cpp" +#line 3447 "bison_parser.cpp" break; case 16: /* preparable_statement: drop_statement */ -#line 385 "bison_parser.y" +#line 387 "bison_parser.y" { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 3438 "bison_parser.cpp" +#line 3453 "bison_parser.cpp" break; case 17: /* preparable_statement: alter_statement */ -#line 386 "bison_parser.y" +#line 388 "bison_parser.y" { (yyval.statement) = (yyvsp[0].alter_stmt); } -#line 3444 "bison_parser.cpp" +#line 3459 "bison_parser.cpp" break; case 18: /* preparable_statement: execute_statement */ -#line 387 "bison_parser.y" +#line 389 "bison_parser.y" { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 3450 "bison_parser.cpp" +#line 3465 "bison_parser.cpp" break; case 19: /* preparable_statement: transaction_statement */ -#line 388 "bison_parser.y" +#line 390 "bison_parser.y" { (yyval.statement) = (yyvsp[0].transaction_stmt); } -#line 3456 "bison_parser.cpp" +#line 3471 "bison_parser.cpp" break; case 20: /* opt_hints: WITH HINT '(' hint_list ')' */ -#line 394 "bison_parser.y" +#line 396 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 3462 "bison_parser.cpp" +#line 3477 "bison_parser.cpp" break; case 21: /* opt_hints: %empty */ -#line 395 "bison_parser.y" +#line 397 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 3468 "bison_parser.cpp" +#line 3483 "bison_parser.cpp" break; case 22: /* hint_list: hint */ -#line 397 "bison_parser.y" +#line 399 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3477 "bison_parser.cpp" +#line 3492 "bison_parser.cpp" break; case 23: /* hint_list: hint_list ',' hint */ -#line 401 "bison_parser.y" +#line 403 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3486 "bison_parser.cpp" +#line 3501 "bison_parser.cpp" break; case 24: /* hint: IDENTIFIER */ -#line 406 "bison_parser.y" +#line 408 "bison_parser.y" { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 3495 "bison_parser.cpp" +#line 3510 "bison_parser.cpp" break; case 25: /* hint: IDENTIFIER '(' extended_literal_list ')' */ -#line 410 "bison_parser.y" +#line 412 "bison_parser.y" { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 3505 "bison_parser.cpp" +#line 3520 "bison_parser.cpp" break; case 26: /* transaction_statement: BEGIN opt_transaction_keyword */ -#line 420 "bison_parser.y" +#line 422 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kBeginTransaction); } -#line 3511 "bison_parser.cpp" +#line 3526 "bison_parser.cpp" break; case 27: /* transaction_statement: ROLLBACK opt_transaction_keyword */ -#line 421 "bison_parser.y" +#line 423 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kRollbackTransaction); } -#line 3517 "bison_parser.cpp" +#line 3532 "bison_parser.cpp" break; case 28: /* transaction_statement: COMMIT opt_transaction_keyword */ -#line 422 "bison_parser.y" +#line 424 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kCommitTransaction); } -#line 3523 "bison_parser.cpp" +#line 3538 "bison_parser.cpp" break; case 31: /* prepare_statement: PREPARE IDENTIFIER FROM prepare_target_query */ -#line 430 "bison_parser.y" +#line 432 "bison_parser.y" { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 3533 "bison_parser.cpp" +#line 3548 "bison_parser.cpp" break; case 33: /* execute_statement: EXECUTE IDENTIFIER */ -#line 438 "bison_parser.y" +#line 440 "bison_parser.y" { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 3542 "bison_parser.cpp" +#line 3557 "bison_parser.cpp" break; case 34: /* execute_statement: EXECUTE IDENTIFIER '(' opt_extended_literal_list ')' */ -#line 442 "bison_parser.y" +#line 444 "bison_parser.y" { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 3552 "bison_parser.cpp" +#line 3567 "bison_parser.cpp" break; case 35: /* import_statement: IMPORT FROM file_type FILE file_path INTO table_name */ -#line 454 "bison_parser.y" +#line 456 "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 3563 "bison_parser.cpp" +#line 3578 "bison_parser.cpp" break; case 36: /* import_statement: COPY table_name FROM file_path opt_import_export_options opt_where */ -#line 460 "bison_parser.y" +#line 462 "bison_parser.y" { (yyval.import_stmt) = new ImportStatement((yyvsp[-1].import_export_option_t)->format); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); @@ -3576,11 +3591,11 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].import_export_option_t); } -#line 3580 "bison_parser.cpp" +#line 3595 "bison_parser.cpp" break; case 37: /* file_type: IDENTIFIER */ -#line 473 "bison_parser.y" +#line 475 "bison_parser.y" { if (strcasecmp((yyvsp[0].sval), "csv") == 0) { (yyval.import_type_t) = kImportCSV; @@ -3595,35 +3610,35 @@ YYLTYPE yylloc = yyloc_default; } free((yyvsp[0].sval)); } -#line 3599 "bison_parser.cpp" +#line 3614 "bison_parser.cpp" break; case 38: /* file_path: STRING */ -#line 488 "bison_parser.y" +#line 490 "bison_parser.y" { (yyval.sval) = (yyvsp[0].sval); } -#line 3605 "bison_parser.cpp" +#line 3620 "bison_parser.cpp" break; case 39: /* opt_import_export_options: WITH '(' import_export_options ')' */ -#line 490 "bison_parser.y" +#line 492 "bison_parser.y" { (yyval.import_export_option_t) = (yyvsp[-1].import_export_option_t); } -#line 3611 "bison_parser.cpp" +#line 3626 "bison_parser.cpp" break; case 40: /* opt_import_export_options: '(' import_export_options ')' */ -#line 491 "bison_parser.y" +#line 493 "bison_parser.y" { (yyval.import_export_option_t) = (yyvsp[-1].import_export_option_t); } -#line 3617 "bison_parser.cpp" +#line 3632 "bison_parser.cpp" break; case 41: /* opt_import_export_options: %empty */ -#line 492 "bison_parser.y" +#line 494 "bison_parser.y" { (yyval.import_export_option_t) = new ImportExportOptions{}; } -#line 3623 "bison_parser.cpp" +#line 3638 "bison_parser.cpp" break; case 42: /* import_export_options: import_export_options ',' FORMAT file_type */ -#line 494 "bison_parser.y" +#line 496 "bison_parser.y" { if ((yyvsp[-3].import_export_option_t)->format != kImportAuto) { delete (yyvsp[-3].import_export_option_t); @@ -3633,20 +3648,20 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-3].import_export_option_t)->format = (yyvsp[0].import_type_t); (yyval.import_export_option_t) = (yyvsp[-3].import_export_option_t); } -#line 3637 "bison_parser.cpp" +#line 3652 "bison_parser.cpp" break; case 43: /* import_export_options: FORMAT file_type */ -#line 503 "bison_parser.y" +#line 505 "bison_parser.y" { (yyval.import_export_option_t) = new ImportExportOptions{}; (yyval.import_export_option_t)->format = (yyvsp[0].import_type_t); } -#line 3646 "bison_parser.cpp" +#line 3661 "bison_parser.cpp" break; case 44: /* import_export_options: import_export_options ',' ENCODING STRING */ -#line 507 "bison_parser.y" +#line 509 "bison_parser.y" { if ((yyvsp[-3].import_export_option_t)->encoding) { delete (yyvsp[-3].import_export_option_t); @@ -3657,20 +3672,20 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-3].import_export_option_t)->encoding = (yyvsp[0].sval); (yyval.import_export_option_t) = (yyvsp[-3].import_export_option_t); } -#line 3661 "bison_parser.cpp" +#line 3676 "bison_parser.cpp" break; case 45: /* import_export_options: ENCODING STRING */ -#line 517 "bison_parser.y" +#line 519 "bison_parser.y" { (yyval.import_export_option_t) = new ImportExportOptions{}; (yyval.import_export_option_t)->encoding = (yyvsp[0].sval); } -#line 3670 "bison_parser.cpp" +#line 3685 "bison_parser.cpp" break; case 46: /* export_statement: COPY table_name TO file_path opt_import_export_options */ -#line 527 "bison_parser.y" +#line 529 "bison_parser.y" { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_export_option_t)->format); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); @@ -3682,11 +3697,11 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[0].import_export_option_t); } -#line 3686 "bison_parser.cpp" +#line 3701 "bison_parser.cpp" break; case 47: /* export_statement: COPY select_with_paren TO file_path opt_import_export_options */ -#line 538 "bison_parser.y" +#line 540 "bison_parser.y" { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_export_option_t)->format); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); @@ -3697,37 +3712,37 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[0].import_export_option_t); } -#line 3701 "bison_parser.cpp" +#line 3716 "bison_parser.cpp" break; case 48: /* show_statement: SHOW TABLES */ -#line 554 "bison_parser.y" +#line 556 "bison_parser.y" { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 3707 "bison_parser.cpp" +#line 3722 "bison_parser.cpp" break; case 49: /* show_statement: SHOW COLUMNS table_name */ -#line 555 "bison_parser.y" +#line 557 "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 3717 "bison_parser.cpp" +#line 3732 "bison_parser.cpp" break; case 50: /* show_statement: DESCRIBE table_name */ -#line 560 "bison_parser.y" +#line 562 "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 3727 "bison_parser.cpp" +#line 3742 "bison_parser.cpp" break; case 51: /* create_statement: CREATE TABLE opt_not_exists table_name FROM IDENTIFIER FILE file_path */ -#line 571 "bison_parser.y" +#line 573 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); @@ -3741,11 +3756,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].sval)); (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 3745 "bison_parser.cpp" +#line 3760 "bison_parser.cpp" break; case 52: /* create_statement: CREATE TABLE opt_not_exists table_name '(' table_elem_commalist ')' */ -#line 584 "bison_parser.y" +#line 586 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -3758,11 +3773,11 @@ YYLTYPE yylloc = yyloc_default; YYERROR; } } -#line 3762 "bison_parser.cpp" +#line 3777 "bison_parser.cpp" break; case 53: /* create_statement: CREATE TABLE opt_not_exists table_name AS select_statement */ -#line 596 "bison_parser.y" +#line 598 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-3].bval); @@ -3770,11 +3785,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->tableName = (yyvsp[-2].table_name).name; (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 3774 "bison_parser.cpp" +#line 3789 "bison_parser.cpp" break; case 54: /* create_statement: CREATE INDEX opt_not_exists opt_index_name ON table_name '(' ident_commalist ')' */ -#line 603 "bison_parser.y" +#line 605 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateIndex); (yyval.create_stmt)->indexName = (yyvsp[-5].sval); @@ -3782,11 +3797,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->indexColumns = (yyvsp[-1].str_vec); } -#line 3786 "bison_parser.cpp" +#line 3801 "bison_parser.cpp" break; case 55: /* create_statement: CREATE VIEW opt_not_exists table_name opt_column_list AS select_statement */ -#line 610 "bison_parser.y" +#line 612 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -3795,53 +3810,53 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 3799 "bison_parser.cpp" +#line 3814 "bison_parser.cpp" break; case 56: /* opt_not_exists: IF NOT EXISTS */ -#line 619 "bison_parser.y" +#line 621 "bison_parser.y" { (yyval.bval) = true; } -#line 3805 "bison_parser.cpp" +#line 3820 "bison_parser.cpp" break; case 57: /* opt_not_exists: %empty */ -#line 620 "bison_parser.y" +#line 622 "bison_parser.y" { (yyval.bval) = false; } -#line 3811 "bison_parser.cpp" +#line 3826 "bison_parser.cpp" break; case 58: /* table_elem_commalist: table_elem */ -#line 622 "bison_parser.y" +#line 624 "bison_parser.y" { (yyval.table_element_vec) = new std::vector(); (yyval.table_element_vec)->push_back((yyvsp[0].table_element_t)); } -#line 3820 "bison_parser.cpp" +#line 3835 "bison_parser.cpp" break; case 59: /* table_elem_commalist: table_elem_commalist ',' table_elem */ -#line 626 "bison_parser.y" +#line 628 "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 3829 "bison_parser.cpp" +#line 3844 "bison_parser.cpp" break; case 60: /* table_elem: column_def */ -#line 631 "bison_parser.y" +#line 633 "bison_parser.y" { (yyval.table_element_t) = (yyvsp[0].column_t); } -#line 3835 "bison_parser.cpp" +#line 3850 "bison_parser.cpp" break; case 61: /* table_elem: table_constraint */ -#line 632 "bison_parser.y" +#line 634 "bison_parser.y" { (yyval.table_element_t) = (yyvsp[0].table_constraint_t); } -#line 3841 "bison_parser.cpp" +#line 3856 "bison_parser.cpp" break; case 62: /* column_def: IDENTIFIER column_type opt_column_constraints */ -#line 634 "bison_parser.y" +#line 636 "bison_parser.y" { (yyval.column_t) = new ColumnDefinition((yyvsp[-2].sval), (yyvsp[-1].column_type_t), (yyvsp[0].column_constraints_t)->constraints, (yyvsp[0].column_constraints_t)->references); if (!(yyval.column_t)->trySetNullableExplicit()) { @@ -3849,192 +3864,192 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[0].column_constraints_t); } -#line 3853 "bison_parser.cpp" +#line 3868 "bison_parser.cpp" break; case 63: /* column_type: BIGINT */ -#line 642 "bison_parser.y" +#line 644 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::BIGINT}; } -#line 3859 "bison_parser.cpp" +#line 3874 "bison_parser.cpp" break; case 64: /* column_type: BOOLEAN */ -#line 643 "bison_parser.y" +#line 645 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::BOOLEAN}; } -#line 3865 "bison_parser.cpp" +#line 3880 "bison_parser.cpp" break; case 65: /* column_type: CHAR '(' INTVAL ')' */ -#line 644 "bison_parser.y" +#line 646 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::CHAR, (yyvsp[-1].ival)}; } -#line 3871 "bison_parser.cpp" +#line 3886 "bison_parser.cpp" break; case 66: /* column_type: CHARACTER_VARYING '(' INTVAL ')' */ -#line 645 "bison_parser.y" +#line 647 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } -#line 3877 "bison_parser.cpp" +#line 3892 "bison_parser.cpp" break; case 67: /* column_type: DATE */ -#line 646 "bison_parser.y" +#line 648 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATE}; } -#line 3883 "bison_parser.cpp" +#line 3898 "bison_parser.cpp" break; case 68: /* column_type: DATETIME */ -#line 647 "bison_parser.y" +#line 649 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } -#line 3889 "bison_parser.cpp" +#line 3904 "bison_parser.cpp" break; case 69: /* column_type: DECIMAL opt_decimal_specification */ -#line 648 "bison_parser.y" +#line 650 "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 3898 "bison_parser.cpp" +#line 3913 "bison_parser.cpp" break; case 70: /* column_type: DOUBLE */ -#line 652 "bison_parser.y" +#line 654 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DOUBLE}; } -#line 3904 "bison_parser.cpp" +#line 3919 "bison_parser.cpp" break; case 71: /* column_type: FLOAT */ -#line 653 "bison_parser.y" +#line 655 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::FLOAT}; } -#line 3910 "bison_parser.cpp" +#line 3925 "bison_parser.cpp" break; case 72: /* column_type: INT */ -#line 654 "bison_parser.y" +#line 656 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::INT}; } -#line 3916 "bison_parser.cpp" +#line 3931 "bison_parser.cpp" break; case 73: /* column_type: INTEGER */ -#line 655 "bison_parser.y" +#line 657 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::INT}; } -#line 3922 "bison_parser.cpp" +#line 3937 "bison_parser.cpp" break; case 74: /* column_type: LONG */ -#line 656 "bison_parser.y" +#line 658 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::LONG}; } -#line 3928 "bison_parser.cpp" +#line 3943 "bison_parser.cpp" break; case 75: /* column_type: REAL */ -#line 657 "bison_parser.y" +#line 659 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::REAL}; } -#line 3934 "bison_parser.cpp" +#line 3949 "bison_parser.cpp" break; case 76: /* column_type: SMALLINT */ -#line 658 "bison_parser.y" +#line 660 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::SMALLINT}; } -#line 3940 "bison_parser.cpp" +#line 3955 "bison_parser.cpp" break; case 77: /* column_type: TEXT */ -#line 659 "bison_parser.y" +#line 661 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::TEXT}; } -#line 3946 "bison_parser.cpp" +#line 3961 "bison_parser.cpp" break; case 78: /* column_type: TIME opt_time_precision */ -#line 660 "bison_parser.y" +#line 662 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::TIME, 0, (yyvsp[0].ival)}; } -#line 3952 "bison_parser.cpp" +#line 3967 "bison_parser.cpp" break; case 79: /* column_type: TIMESTAMP */ -#line 661 "bison_parser.y" +#line 663 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } -#line 3958 "bison_parser.cpp" +#line 3973 "bison_parser.cpp" break; case 80: /* column_type: VARCHAR '(' INTVAL ')' */ -#line 662 "bison_parser.y" +#line 664 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } -#line 3964 "bison_parser.cpp" +#line 3979 "bison_parser.cpp" break; case 81: /* opt_time_precision: '(' INTVAL ')' */ -#line 664 "bison_parser.y" +#line 666 "bison_parser.y" { (yyval.ival) = (yyvsp[-1].ival); } -#line 3970 "bison_parser.cpp" +#line 3985 "bison_parser.cpp" break; case 82: /* opt_time_precision: %empty */ -#line 665 "bison_parser.y" +#line 667 "bison_parser.y" { (yyval.ival) = 0; } -#line 3976 "bison_parser.cpp" +#line 3991 "bison_parser.cpp" break; case 83: /* opt_decimal_specification: '(' INTVAL ',' INTVAL ')' */ -#line 667 "bison_parser.y" +#line 669 "bison_parser.y" { (yyval.ival_pair) = new std::pair{(yyvsp[-3].ival), (yyvsp[-1].ival)}; } -#line 3982 "bison_parser.cpp" +#line 3997 "bison_parser.cpp" break; case 84: /* opt_decimal_specification: '(' INTVAL ')' */ -#line 668 "bison_parser.y" +#line 670 "bison_parser.y" { (yyval.ival_pair) = new std::pair{(yyvsp[-1].ival), 0}; } -#line 3988 "bison_parser.cpp" +#line 4003 "bison_parser.cpp" break; case 85: /* opt_decimal_specification: %empty */ -#line 669 "bison_parser.y" +#line 671 "bison_parser.y" { (yyval.ival_pair) = new std::pair{0, 0}; } -#line 3994 "bison_parser.cpp" +#line 4009 "bison_parser.cpp" break; case 86: /* opt_column_constraints: column_constraints */ -#line 671 "bison_parser.y" +#line 673 "bison_parser.y" { (yyval.column_constraints_t) = (yyvsp[0].column_constraints_t); } -#line 4000 "bison_parser.cpp" +#line 4015 "bison_parser.cpp" break; case 87: /* opt_column_constraints: %empty */ -#line 672 "bison_parser.y" +#line 674 "bison_parser.y" { (yyval.column_constraints_t) = new ColumnConstraints(); } -#line 4006 "bison_parser.cpp" +#line 4021 "bison_parser.cpp" break; case 88: /* column_constraints: column_constraint */ -#line 674 "bison_parser.y" +#line 676 "bison_parser.y" { (yyval.column_constraints_t) = new ColumnConstraints(); (yyval.column_constraints_t)->constraints->insert((yyvsp[0].column_constraint_t)); } -#line 4015 "bison_parser.cpp" +#line 4030 "bison_parser.cpp" break; case 89: /* column_constraints: column_constraints column_constraint */ -#line 678 "bison_parser.y" +#line 680 "bison_parser.y" { (yyvsp[-1].column_constraints_t)->constraints->insert((yyvsp[0].column_constraint_t)); (yyval.column_constraints_t) = (yyvsp[-1].column_constraints_t); } -#line 4024 "bison_parser.cpp" +#line 4039 "bison_parser.cpp" break; case 90: /* column_constraints: references_spec */ -#line 682 "bison_parser.y" +#line 684 "bison_parser.y" { (yyval.column_constraints_t) = new ColumnConstraints(); (yyval.column_constraints_t)->constraints->insert(ConstraintType::ForeignKey); (yyval.column_constraints_t)->references->emplace_back((yyvsp[0].references_spec_t)); } -#line 4034 "bison_parser.cpp" +#line 4049 "bison_parser.cpp" break; case 91: /* column_constraints: column_constraints references_spec */ -#line 687 "bison_parser.y" +#line 689 "bison_parser.y" { // Multiple foreign keys for the same column could be possible, so we do not raise an error in that case. // Think of foreign keys referenced on multiple levels (returned item references sold item references items). @@ -4042,159 +4057,159 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-1].column_constraints_t)->references->emplace_back((yyvsp[0].references_spec_t)); (yyval.column_constraints_t) = (yyvsp[-1].column_constraints_t); } -#line 4046 "bison_parser.cpp" +#line 4061 "bison_parser.cpp" break; case 92: /* column_constraint: PRIMARY KEY */ -#line 695 "bison_parser.y" +#line 697 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::PrimaryKey; } -#line 4052 "bison_parser.cpp" +#line 4067 "bison_parser.cpp" break; case 93: /* column_constraint: UNIQUE */ -#line 696 "bison_parser.y" +#line 698 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::Unique; } -#line 4058 "bison_parser.cpp" +#line 4073 "bison_parser.cpp" break; case 94: /* column_constraint: NULL */ -#line 697 "bison_parser.y" +#line 699 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::Null; } -#line 4064 "bison_parser.cpp" +#line 4079 "bison_parser.cpp" break; case 95: /* column_constraint: NOT NULL */ -#line 698 "bison_parser.y" +#line 700 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::NotNull; } -#line 4070 "bison_parser.cpp" +#line 4085 "bison_parser.cpp" break; case 96: /* table_constraint: PRIMARY KEY '(' ident_commalist ')' */ -#line 700 "bison_parser.y" +#line 702 "bison_parser.y" { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::PrimaryKey, (yyvsp[-1].str_vec)); } -#line 4076 "bison_parser.cpp" +#line 4091 "bison_parser.cpp" break; case 97: /* table_constraint: UNIQUE '(' ident_commalist ')' */ -#line 701 "bison_parser.y" +#line 703 "bison_parser.y" { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::Unique, (yyvsp[-1].str_vec)); } -#line 4082 "bison_parser.cpp" +#line 4097 "bison_parser.cpp" break; case 98: /* table_constraint: FOREIGN KEY '(' ident_commalist ')' references_spec */ -#line 702 "bison_parser.y" +#line 704 "bison_parser.y" { (yyval.table_constraint_t) = new ForeignKeyConstraint((yyvsp[-2].str_vec), (yyvsp[0].references_spec_t)); } -#line 4088 "bison_parser.cpp" +#line 4103 "bison_parser.cpp" break; case 99: /* references_spec: REFERENCES table_name opt_column_list */ -#line 704 "bison_parser.y" +#line 706 "bison_parser.y" { (yyval.references_spec_t) = new ReferencesSpecification((yyvsp[-1].table_name).schema, (yyvsp[-1].table_name).name, (yyvsp[0].str_vec)); } -#line 4094 "bison_parser.cpp" +#line 4109 "bison_parser.cpp" break; case 100: /* drop_statement: DROP TABLE opt_exists table_name */ -#line 712 "bison_parser.y" +#line 714 "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 4105 "bison_parser.cpp" +#line 4120 "bison_parser.cpp" break; case 101: /* drop_statement: DROP VIEW opt_exists table_name */ -#line 718 "bison_parser.y" +#line 720 "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 4116 "bison_parser.cpp" +#line 4131 "bison_parser.cpp" break; case 102: /* drop_statement: DEALLOCATE PREPARE IDENTIFIER */ -#line 724 "bison_parser.y" +#line 726 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 4126 "bison_parser.cpp" +#line 4141 "bison_parser.cpp" break; case 103: /* drop_statement: DROP INDEX opt_exists IDENTIFIER */ -#line 730 "bison_parser.y" +#line 732 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropIndex); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->indexName = (yyvsp[0].sval); } -#line 4136 "bison_parser.cpp" +#line 4151 "bison_parser.cpp" break; case 104: /* opt_exists: IF EXISTS */ -#line 736 "bison_parser.y" +#line 738 "bison_parser.y" { (yyval.bval) = true; } -#line 4142 "bison_parser.cpp" +#line 4157 "bison_parser.cpp" break; case 105: /* opt_exists: %empty */ -#line 737 "bison_parser.y" +#line 739 "bison_parser.y" { (yyval.bval) = false; } -#line 4148 "bison_parser.cpp" +#line 4163 "bison_parser.cpp" break; case 106: /* alter_statement: ALTER TABLE opt_exists table_name alter_action */ -#line 744 "bison_parser.y" +#line 746 "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 4158 "bison_parser.cpp" +#line 4173 "bison_parser.cpp" break; case 107: /* alter_action: drop_action */ -#line 750 "bison_parser.y" +#line 752 "bison_parser.y" { (yyval.alter_action_t) = (yyvsp[0].drop_action_t); } -#line 4164 "bison_parser.cpp" +#line 4179 "bison_parser.cpp" break; case 108: /* drop_action: DROP COLUMN opt_exists IDENTIFIER */ -#line 752 "bison_parser.y" +#line 754 "bison_parser.y" { (yyval.drop_action_t) = new DropColumnAction((yyvsp[0].sval)); (yyval.drop_action_t)->ifExists = (yyvsp[-1].bval); } -#line 4173 "bison_parser.cpp" +#line 4188 "bison_parser.cpp" break; case 109: /* delete_statement: DELETE FROM table_name opt_where */ -#line 762 "bison_parser.y" +#line 764 "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 4184 "bison_parser.cpp" +#line 4199 "bison_parser.cpp" break; case 110: /* truncate_statement: TRUNCATE table_name */ -#line 769 "bison_parser.y" +#line 771 "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 4194 "bison_parser.cpp" +#line 4209 "bison_parser.cpp" break; case 111: /* insert_statement: INSERT INTO table_name opt_column_list VALUES '(' extended_literal_list ')' */ -#line 780 "bison_parser.y" +#line 782 "bison_parser.y" { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; @@ -4202,11 +4217,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 4206 "bison_parser.cpp" +#line 4221 "bison_parser.cpp" break; case 112: /* insert_statement: INSERT INTO table_name opt_column_list select_no_paren */ -#line 787 "bison_parser.y" +#line 789 "bison_parser.y" { (yyval.insert_stmt) = new InsertStatement(kInsertSelect); (yyval.insert_stmt)->schema = (yyvsp[-2].table_name).schema; @@ -4214,80 +4229,80 @@ YYLTYPE yylloc = yyloc_default; (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } -#line 4218 "bison_parser.cpp" +#line 4233 "bison_parser.cpp" break; case 113: /* opt_column_list: '(' ident_commalist ')' */ -#line 795 "bison_parser.y" +#line 797 "bison_parser.y" { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 4224 "bison_parser.cpp" +#line 4239 "bison_parser.cpp" break; case 114: /* opt_column_list: %empty */ -#line 796 "bison_parser.y" +#line 798 "bison_parser.y" { (yyval.str_vec) = nullptr; } -#line 4230 "bison_parser.cpp" +#line 4245 "bison_parser.cpp" break; case 115: /* update_statement: UPDATE table_ref_name_no_alias SET update_clause_commalist opt_where */ -#line 803 "bison_parser.y" +#line 805 "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 4241 "bison_parser.cpp" +#line 4256 "bison_parser.cpp" break; case 116: /* update_clause_commalist: update_clause */ -#line 810 "bison_parser.y" +#line 812 "bison_parser.y" { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 4250 "bison_parser.cpp" +#line 4265 "bison_parser.cpp" break; case 117: /* update_clause_commalist: update_clause_commalist ',' update_clause */ -#line 814 "bison_parser.y" +#line 816 "bison_parser.y" { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 4259 "bison_parser.cpp" +#line 4274 "bison_parser.cpp" break; case 118: /* update_clause: IDENTIFIER '=' expr */ -#line 819 "bison_parser.y" +#line 821 "bison_parser.y" { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 4269 "bison_parser.cpp" +#line 4284 "bison_parser.cpp" break; case 119: /* select_statement: opt_with_clause select_with_paren */ -#line 829 "bison_parser.y" +#line 831 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[0].select_stmt); (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); } -#line 4278 "bison_parser.cpp" +#line 4293 "bison_parser.cpp" break; case 120: /* select_statement: opt_with_clause select_no_paren */ -#line 833 "bison_parser.y" +#line 835 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[0].select_stmt); (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); } -#line 4287 "bison_parser.cpp" +#line 4302 "bison_parser.cpp" break; case 121: /* select_statement: opt_with_clause select_with_paren set_operator select_within_set_operation opt_order opt_limit */ -#line 837 "bison_parser.y" +#line 839 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-4].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { @@ -4299,17 +4314,17 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->setOperations->back()->resultLimit = (yyvsp[0].limit); (yyval.select_stmt)->withDescriptions = (yyvsp[-5].with_description_vec); } -#line 4303 "bison_parser.cpp" +#line 4318 "bison_parser.cpp" break; case 124: /* select_within_set_operation_no_parentheses: select_clause */ -#line 851 "bison_parser.y" +#line 853 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[0].select_stmt); } -#line 4309 "bison_parser.cpp" +#line 4324 "bison_parser.cpp" break; case 125: /* select_within_set_operation_no_parentheses: select_clause set_operator select_within_set_operation */ -#line 852 "bison_parser.y" +#line 854 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-2].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { @@ -4318,23 +4333,23 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->setOperations->push_back((yyvsp[-1].set_operator_t)); (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[0].select_stmt); } -#line 4322 "bison_parser.cpp" +#line 4337 "bison_parser.cpp" break; case 126: /* select_with_paren: '(' select_no_paren ')' */ -#line 861 "bison_parser.y" +#line 863 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 4328 "bison_parser.cpp" +#line 4343 "bison_parser.cpp" break; case 127: /* select_with_paren: '(' select_with_paren ')' */ -#line 862 "bison_parser.y" +#line 864 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 4334 "bison_parser.cpp" +#line 4349 "bison_parser.cpp" break; case 128: /* select_no_paren: select_clause opt_order opt_limit opt_locking_clause */ -#line 864 "bison_parser.y" +#line 866 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-3].select_stmt); (yyval.select_stmt)->order = (yyvsp[-2].order_vec); @@ -4349,11 +4364,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); } } -#line 4353 "bison_parser.cpp" +#line 4368 "bison_parser.cpp" break; case 129: /* select_no_paren: select_clause set_operator select_within_set_operation opt_order opt_limit opt_locking_clause */ -#line 878 "bison_parser.y" +#line 880 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-5].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { @@ -4365,59 +4380,59 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->setOperations->back()->resultLimit = (yyvsp[-1].limit); (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); } -#line 4369 "bison_parser.cpp" +#line 4384 "bison_parser.cpp" break; case 130: /* set_operator: set_type opt_all */ -#line 890 "bison_parser.y" +#line 892 "bison_parser.y" { (yyval.set_operator_t) = (yyvsp[-1].set_operator_t); (yyval.set_operator_t)->isAll = (yyvsp[0].bval); } -#line 4378 "bison_parser.cpp" +#line 4393 "bison_parser.cpp" break; case 131: /* set_type: UNION */ -#line 895 "bison_parser.y" +#line 897 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetUnion; } -#line 4387 "bison_parser.cpp" +#line 4402 "bison_parser.cpp" break; case 132: /* set_type: INTERSECT */ -#line 899 "bison_parser.y" +#line 901 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetIntersect; } -#line 4396 "bison_parser.cpp" +#line 4411 "bison_parser.cpp" break; case 133: /* set_type: EXCEPT */ -#line 903 "bison_parser.y" +#line 905 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetExcept; } -#line 4405 "bison_parser.cpp" +#line 4420 "bison_parser.cpp" break; case 134: /* opt_all: ALL */ -#line 908 "bison_parser.y" +#line 910 "bison_parser.y" { (yyval.bval) = true; } -#line 4411 "bison_parser.cpp" +#line 4426 "bison_parser.cpp" break; case 135: /* opt_all: %empty */ -#line 909 "bison_parser.y" +#line 911 "bison_parser.y" { (yyval.bval) = false; } -#line 4417 "bison_parser.cpp" +#line 4432 "bison_parser.cpp" break; case 136: /* select_clause: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group */ -#line 911 "bison_parser.y" +#line 913 "bison_parser.y" { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); @@ -4427,239 +4442,269 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 4431 "bison_parser.cpp" +#line 4446 "bison_parser.cpp" break; case 137: /* opt_distinct: DISTINCT */ -#line 921 "bison_parser.y" +#line 923 "bison_parser.y" { (yyval.bval) = true; } -#line 4437 "bison_parser.cpp" +#line 4452 "bison_parser.cpp" break; case 138: /* opt_distinct: %empty */ -#line 922 "bison_parser.y" +#line 924 "bison_parser.y" { (yyval.bval) = false; } -#line 4443 "bison_parser.cpp" +#line 4458 "bison_parser.cpp" break; case 140: /* opt_from_clause: from_clause */ -#line 926 "bison_parser.y" +#line 928 "bison_parser.y" { (yyval.table) = (yyvsp[0].table); } -#line 4449 "bison_parser.cpp" +#line 4464 "bison_parser.cpp" break; case 141: /* opt_from_clause: %empty */ -#line 927 "bison_parser.y" +#line 929 "bison_parser.y" { (yyval.table) = nullptr; } -#line 4455 "bison_parser.cpp" +#line 4470 "bison_parser.cpp" break; case 142: /* from_clause: FROM table_ref */ -#line 929 "bison_parser.y" +#line 931 "bison_parser.y" { (yyval.table) = (yyvsp[0].table); } -#line 4461 "bison_parser.cpp" +#line 4476 "bison_parser.cpp" break; case 143: /* opt_where: WHERE expr */ -#line 931 "bison_parser.y" +#line 933 "bison_parser.y" { (yyval.expr) = (yyvsp[0].expr); } -#line 4467 "bison_parser.cpp" +#line 4482 "bison_parser.cpp" break; case 144: /* opt_where: %empty */ -#line 932 "bison_parser.y" +#line 934 "bison_parser.y" { (yyval.expr) = nullptr; } -#line 4473 "bison_parser.cpp" +#line 4488 "bison_parser.cpp" break; case 145: /* opt_group: GROUP BY expr_list opt_having */ -#line 934 "bison_parser.y" +#line 936 "bison_parser.y" { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 4483 "bison_parser.cpp" +#line 4498 "bison_parser.cpp" break; case 146: /* opt_group: %empty */ -#line 939 "bison_parser.y" +#line 941 "bison_parser.y" { (yyval.group_t) = nullptr; } -#line 4489 "bison_parser.cpp" +#line 4504 "bison_parser.cpp" break; case 147: /* opt_having: HAVING expr */ -#line 941 "bison_parser.y" +#line 943 "bison_parser.y" { (yyval.expr) = (yyvsp[0].expr); } -#line 4495 "bison_parser.cpp" +#line 4510 "bison_parser.cpp" break; case 148: /* opt_having: %empty */ -#line 942 "bison_parser.y" +#line 944 "bison_parser.y" { (yyval.expr) = nullptr; } -#line 4501 "bison_parser.cpp" +#line 4516 "bison_parser.cpp" break; case 149: /* opt_order: ORDER BY order_list */ -#line 944 "bison_parser.y" +#line 946 "bison_parser.y" { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 4507 "bison_parser.cpp" +#line 4522 "bison_parser.cpp" break; case 150: /* opt_order: %empty */ -#line 945 "bison_parser.y" +#line 947 "bison_parser.y" { (yyval.order_vec) = nullptr; } -#line 4513 "bison_parser.cpp" +#line 4528 "bison_parser.cpp" break; case 151: /* order_list: order_desc */ -#line 947 "bison_parser.y" +#line 949 "bison_parser.y" { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 4522 "bison_parser.cpp" +#line 4537 "bison_parser.cpp" break; case 152: /* order_list: order_list ',' order_desc */ -#line 951 "bison_parser.y" +#line 953 "bison_parser.y" { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 4531 "bison_parser.cpp" +#line 4546 "bison_parser.cpp" break; - case 153: /* order_desc: expr opt_order_type */ -#line 956 "bison_parser.y" - { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 4537 "bison_parser.cpp" + case 153: /* order_desc: expr opt_order_type opt_null_ordering */ +#line 958 "bison_parser.y" + { (yyval.order) = new OrderDescription((yyvsp[-1].order_type), (yyvsp[-2].expr), (yyvsp[0].null_ordering_t)); } +#line 4552 "bison_parser.cpp" break; case 154: /* opt_order_type: ASC */ -#line 958 "bison_parser.y" +#line 960 "bison_parser.y" { (yyval.order_type) = kOrderAsc; } -#line 4543 "bison_parser.cpp" +#line 4558 "bison_parser.cpp" break; case 155: /* opt_order_type: DESC */ -#line 959 "bison_parser.y" +#line 961 "bison_parser.y" { (yyval.order_type) = kOrderDesc; } -#line 4549 "bison_parser.cpp" +#line 4564 "bison_parser.cpp" break; case 156: /* opt_order_type: %empty */ -#line 960 "bison_parser.y" +#line 962 "bison_parser.y" { (yyval.order_type) = kOrderAsc; } -#line 4555 "bison_parser.cpp" +#line 4570 "bison_parser.cpp" break; - case 157: /* opt_top: TOP int_literal */ + case 157: /* opt_null_ordering: %empty */ #line 964 "bison_parser.y" - { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } -#line 4561 "bison_parser.cpp" + { (yyval.null_ordering_t) = NullOrdering::Undefined; } +#line 4576 "bison_parser.cpp" break; - case 158: /* opt_top: %empty */ + case 158: /* opt_null_ordering: IDENTIFIER IDENTIFIER */ #line 965 "bison_parser.y" + { + auto null_ordering = NullOrdering::Undefined; + if (strcasecmp((yyvsp[-1].sval), "nulls") == 0) { + if (strcasecmp((yyvsp[0].sval), "first") == 0) { + null_ordering = NullOrdering::First; + } else if (strcasecmp((yyvsp[0].sval), "last") == 0) { + null_ordering = NullOrdering::Last; + } + } + free((yyvsp[-1].sval)); + free((yyvsp[0].sval)); + + if (null_ordering == NullOrdering::Undefined) { + yyerror(&yyloc, result, scanner, "Expected NULLS FIRST or NULLS LAST ordering."); + YYERROR; + } + + (yyval.null_ordering_t) = null_ordering; +} +#line 4600 "bison_parser.cpp" + break; + + case 159: /* opt_top: TOP int_literal */ +#line 987 "bison_parser.y" + { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } +#line 4606 "bison_parser.cpp" + break; + + case 160: /* opt_top: %empty */ +#line 988 "bison_parser.y" { (yyval.limit) = nullptr; } -#line 4567 "bison_parser.cpp" +#line 4612 "bison_parser.cpp" break; - case 159: /* opt_limit: LIMIT expr */ -#line 967 "bison_parser.y" + case 161: /* opt_limit: LIMIT expr */ +#line 990 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } -#line 4573 "bison_parser.cpp" +#line 4618 "bison_parser.cpp" break; - case 160: /* opt_limit: OFFSET expr */ -#line 968 "bison_parser.y" + case 162: /* opt_limit: OFFSET expr */ +#line 991 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } -#line 4579 "bison_parser.cpp" +#line 4624 "bison_parser.cpp" break; - case 161: /* opt_limit: LIMIT expr OFFSET expr */ -#line 969 "bison_parser.y" + case 163: /* opt_limit: LIMIT expr OFFSET expr */ +#line 992 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4585 "bison_parser.cpp" +#line 4630 "bison_parser.cpp" break; - case 162: /* opt_limit: LIMIT ALL */ -#line 970 "bison_parser.y" + case 164: /* opt_limit: LIMIT ALL */ +#line 993 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, nullptr); } -#line 4591 "bison_parser.cpp" +#line 4636 "bison_parser.cpp" break; - case 163: /* opt_limit: LIMIT ALL OFFSET expr */ -#line 971 "bison_parser.y" + case 165: /* opt_limit: LIMIT ALL OFFSET expr */ +#line 994 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } -#line 4597 "bison_parser.cpp" +#line 4642 "bison_parser.cpp" break; - case 164: /* opt_limit: %empty */ -#line 972 "bison_parser.y" + case 166: /* opt_limit: %empty */ +#line 995 "bison_parser.y" { (yyval.limit) = nullptr; } -#line 4603 "bison_parser.cpp" +#line 4648 "bison_parser.cpp" break; - case 165: /* expr_list: expr_alias */ -#line 977 "bison_parser.y" + case 167: /* expr_list: expr_alias */ +#line 1000 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 4612 "bison_parser.cpp" +#line 4657 "bison_parser.cpp" break; - case 166: /* expr_list: expr_list ',' expr_alias */ -#line 981 "bison_parser.y" + case 168: /* expr_list: expr_list ',' expr_alias */ +#line 1004 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 4621 "bison_parser.cpp" +#line 4666 "bison_parser.cpp" break; - case 167: /* opt_extended_literal_list: extended_literal_list */ -#line 987 "bison_parser.y" + case 169: /* opt_extended_literal_list: extended_literal_list */ +#line 1010 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[0].expr_vec); } -#line 4627 "bison_parser.cpp" +#line 4672 "bison_parser.cpp" break; - case 168: /* opt_extended_literal_list: %empty */ -#line 988 "bison_parser.y" + case 170: /* opt_extended_literal_list: %empty */ +#line 1011 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 4633 "bison_parser.cpp" +#line 4678 "bison_parser.cpp" break; - case 169: /* extended_literal_list: casted_extended_literal */ -#line 990 "bison_parser.y" + case 171: /* extended_literal_list: casted_extended_literal */ +#line 1013 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 4642 "bison_parser.cpp" +#line 4687 "bison_parser.cpp" break; - case 170: /* extended_literal_list: extended_literal_list ',' casted_extended_literal */ -#line 994 "bison_parser.y" + case 172: /* extended_literal_list: extended_literal_list ',' casted_extended_literal */ +#line 1017 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 4651 "bison_parser.cpp" +#line 4696 "bison_parser.cpp" break; - case 172: /* casted_extended_literal: CAST '(' extended_literal AS column_type ')' */ -#line 999 "bison_parser.y" + case 174: /* casted_extended_literal: CAST '(' extended_literal AS column_type ')' */ +#line 1022 "bison_parser.y" { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } -#line 4659 "bison_parser.cpp" +#line 4704 "bison_parser.cpp" break; - case 173: /* extended_literal: literal */ -#line 1003 "bison_parser.y" + case 175: /* extended_literal: literal */ +#line 1026 "bison_parser.y" { if ((yyvsp[0].expr)->type == ExprType::kExprParameter) { delete (yyvsp[0].expr); @@ -4668,23 +4713,23 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = (yyvsp[0].expr); } -#line 4672 "bison_parser.cpp" +#line 4717 "bison_parser.cpp" break; - case 174: /* extended_literal: '-' num_literal */ -#line 1011 "bison_parser.y" + case 176: /* extended_literal: '-' num_literal */ +#line 1034 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4678 "bison_parser.cpp" +#line 4723 "bison_parser.cpp" break; - case 175: /* extended_literal: '-' interval_literal */ -#line 1012 "bison_parser.y" + case 177: /* extended_literal: '-' interval_literal */ +#line 1035 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4684 "bison_parser.cpp" +#line 4729 "bison_parser.cpp" break; - case 176: /* expr_alias: expr opt_alias */ -#line 1014 "bison_parser.y" + case 178: /* expr_alias: expr opt_alias */ +#line 1037 "bison_parser.y" { (yyval.expr) = (yyvsp[-1].expr); if ((yyvsp[0].alias_t)) { @@ -4693,507 +4738,507 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[0].alias_t); } } -#line 4697 "bison_parser.cpp" +#line 4742 "bison_parser.cpp" break; - case 182: /* operand: '(' expr ')' */ -#line 1025 "bison_parser.y" + case 184: /* operand: '(' expr ')' */ +#line 1048 "bison_parser.y" { (yyval.expr) = (yyvsp[-1].expr); } -#line 4703 "bison_parser.cpp" +#line 4748 "bison_parser.cpp" break; - case 192: /* operand: '(' select_no_paren ')' */ -#line 1027 "bison_parser.y" + case 194: /* operand: '(' select_no_paren ')' */ +#line 1050 "bison_parser.y" { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 4711 "bison_parser.cpp" +#line 4756 "bison_parser.cpp" break; - case 195: /* unary_expr: '-' operand */ -#line 1033 "bison_parser.y" + case 197: /* unary_expr: '-' operand */ +#line 1056 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4717 "bison_parser.cpp" +#line 4762 "bison_parser.cpp" break; - case 196: /* unary_expr: NOT operand */ -#line 1034 "bison_parser.y" + case 198: /* unary_expr: NOT operand */ +#line 1057 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 4723 "bison_parser.cpp" +#line 4768 "bison_parser.cpp" break; - case 197: /* unary_expr: operand ISNULL */ -#line 1035 "bison_parser.y" + case 199: /* unary_expr: operand ISNULL */ +#line 1058 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 4729 "bison_parser.cpp" +#line 4774 "bison_parser.cpp" break; - case 198: /* unary_expr: operand IS NULL */ -#line 1036 "bison_parser.y" + case 200: /* unary_expr: operand IS NULL */ +#line 1059 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 4735 "bison_parser.cpp" +#line 4780 "bison_parser.cpp" break; - case 199: /* unary_expr: operand IS NOT NULL */ -#line 1037 "bison_parser.y" + case 201: /* unary_expr: operand IS NOT NULL */ +#line 1060 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 4741 "bison_parser.cpp" +#line 4786 "bison_parser.cpp" break; - case 201: /* binary_expr: operand '-' operand */ -#line 1039 "bison_parser.y" + case 203: /* binary_expr: operand '-' operand */ +#line 1062 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 4747 "bison_parser.cpp" +#line 4792 "bison_parser.cpp" break; - case 202: /* binary_expr: operand '+' operand */ -#line 1040 "bison_parser.y" + case 204: /* binary_expr: operand '+' operand */ +#line 1063 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 4753 "bison_parser.cpp" +#line 4798 "bison_parser.cpp" break; - case 203: /* binary_expr: operand '/' operand */ -#line 1041 "bison_parser.y" + case 205: /* binary_expr: operand '/' operand */ +#line 1064 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 4759 "bison_parser.cpp" +#line 4804 "bison_parser.cpp" break; - case 204: /* binary_expr: operand '*' operand */ -#line 1042 "bison_parser.y" + case 206: /* binary_expr: operand '*' operand */ +#line 1065 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 4765 "bison_parser.cpp" +#line 4810 "bison_parser.cpp" break; - case 205: /* binary_expr: operand '%' operand */ -#line 1043 "bison_parser.y" + case 207: /* binary_expr: operand '%' operand */ +#line 1066 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 4771 "bison_parser.cpp" +#line 4816 "bison_parser.cpp" break; - case 206: /* binary_expr: operand '^' operand */ -#line 1044 "bison_parser.y" + case 208: /* binary_expr: operand '^' operand */ +#line 1067 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 4777 "bison_parser.cpp" +#line 4822 "bison_parser.cpp" break; - case 207: /* binary_expr: operand LIKE operand */ -#line 1045 "bison_parser.y" + case 209: /* binary_expr: operand LIKE operand */ +#line 1068 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 4783 "bison_parser.cpp" +#line 4828 "bison_parser.cpp" break; - case 208: /* binary_expr: operand NOT LIKE operand */ -#line 1046 "bison_parser.y" + case 210: /* binary_expr: operand NOT LIKE operand */ +#line 1069 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 4789 "bison_parser.cpp" +#line 4834 "bison_parser.cpp" break; - case 209: /* binary_expr: operand ILIKE operand */ -#line 1047 "bison_parser.y" + case 211: /* binary_expr: operand ILIKE operand */ +#line 1070 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 4795 "bison_parser.cpp" +#line 4840 "bison_parser.cpp" break; - case 210: /* binary_expr: operand CONCAT operand */ -#line 1048 "bison_parser.y" + case 212: /* binary_expr: operand CONCAT operand */ +#line 1071 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 4801 "bison_parser.cpp" +#line 4846 "bison_parser.cpp" break; - case 211: /* logic_expr: expr AND expr */ -#line 1050 "bison_parser.y" + case 213: /* logic_expr: expr AND expr */ +#line 1073 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 4807 "bison_parser.cpp" +#line 4852 "bison_parser.cpp" break; - case 212: /* logic_expr: expr OR expr */ -#line 1051 "bison_parser.y" + case 214: /* logic_expr: expr OR expr */ +#line 1074 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 4813 "bison_parser.cpp" +#line 4858 "bison_parser.cpp" break; - case 213: /* in_expr: operand IN '(' expr_list ')' */ -#line 1053 "bison_parser.y" + case 215: /* in_expr: operand IN '(' expr_list ')' */ +#line 1076 "bison_parser.y" { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 4819 "bison_parser.cpp" +#line 4864 "bison_parser.cpp" break; - case 214: /* in_expr: operand NOT IN '(' expr_list ')' */ -#line 1054 "bison_parser.y" + case 216: /* in_expr: operand NOT IN '(' expr_list ')' */ +#line 1077 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 4825 "bison_parser.cpp" +#line 4870 "bison_parser.cpp" break; - case 215: /* in_expr: operand IN '(' select_no_paren ')' */ -#line 1055 "bison_parser.y" + case 217: /* in_expr: operand IN '(' select_no_paren ')' */ +#line 1078 "bison_parser.y" { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 4831 "bison_parser.cpp" +#line 4876 "bison_parser.cpp" break; - case 216: /* in_expr: operand NOT IN '(' select_no_paren ')' */ -#line 1056 "bison_parser.y" + case 218: /* in_expr: operand NOT IN '(' select_no_paren ')' */ +#line 1079 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 4837 "bison_parser.cpp" +#line 4882 "bison_parser.cpp" break; - case 217: /* case_expr: CASE expr case_list END */ -#line 1060 "bison_parser.y" + case 219: /* case_expr: CASE expr case_list END */ +#line 1083 "bison_parser.y" { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } -#line 4843 "bison_parser.cpp" +#line 4888 "bison_parser.cpp" break; - case 218: /* case_expr: CASE expr case_list ELSE expr END */ -#line 1061 "bison_parser.y" + case 220: /* case_expr: CASE expr case_list ELSE expr END */ +#line 1084 "bison_parser.y" { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4849 "bison_parser.cpp" +#line 4894 "bison_parser.cpp" break; - case 219: /* case_expr: CASE case_list END */ -#line 1062 "bison_parser.y" + case 221: /* case_expr: CASE case_list END */ +#line 1085 "bison_parser.y" { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } -#line 4855 "bison_parser.cpp" +#line 4900 "bison_parser.cpp" break; - case 220: /* case_expr: CASE case_list ELSE expr END */ -#line 1063 "bison_parser.y" + case 222: /* case_expr: CASE case_list ELSE expr END */ +#line 1086 "bison_parser.y" { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4861 "bison_parser.cpp" +#line 4906 "bison_parser.cpp" break; - case 221: /* case_list: WHEN expr THEN expr */ -#line 1065 "bison_parser.y" + case 223: /* case_list: WHEN expr THEN expr */ +#line 1088 "bison_parser.y" { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 4867 "bison_parser.cpp" +#line 4912 "bison_parser.cpp" break; - case 222: /* case_list: case_list WHEN expr THEN expr */ -#line 1066 "bison_parser.y" + case 224: /* case_list: case_list WHEN expr THEN expr */ +#line 1089 "bison_parser.y" { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 4873 "bison_parser.cpp" +#line 4918 "bison_parser.cpp" break; - case 223: /* exists_expr: EXISTS '(' select_no_paren ')' */ -#line 1068 "bison_parser.y" + case 225: /* exists_expr: EXISTS '(' select_no_paren ')' */ +#line 1091 "bison_parser.y" { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 4879 "bison_parser.cpp" +#line 4924 "bison_parser.cpp" break; - case 224: /* exists_expr: NOT EXISTS '(' select_no_paren ')' */ -#line 1069 "bison_parser.y" + case 226: /* exists_expr: NOT EXISTS '(' select_no_paren ')' */ +#line 1092 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 4885 "bison_parser.cpp" +#line 4930 "bison_parser.cpp" break; - case 225: /* comp_expr: operand '=' operand */ -#line 1071 "bison_parser.y" + case 227: /* comp_expr: operand '=' operand */ +#line 1094 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 4891 "bison_parser.cpp" +#line 4936 "bison_parser.cpp" break; - case 226: /* comp_expr: operand EQUALS operand */ -#line 1072 "bison_parser.y" + case 228: /* comp_expr: operand EQUALS operand */ +#line 1095 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 4897 "bison_parser.cpp" +#line 4942 "bison_parser.cpp" break; - case 227: /* comp_expr: operand NOTEQUALS operand */ -#line 1073 "bison_parser.y" + case 229: /* comp_expr: operand NOTEQUALS operand */ +#line 1096 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 4903 "bison_parser.cpp" +#line 4948 "bison_parser.cpp" break; - case 228: /* comp_expr: operand '<' operand */ -#line 1074 "bison_parser.y" + case 230: /* comp_expr: operand '<' operand */ +#line 1097 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 4909 "bison_parser.cpp" +#line 4954 "bison_parser.cpp" break; - case 229: /* comp_expr: operand '>' operand */ -#line 1075 "bison_parser.y" + case 231: /* comp_expr: operand '>' operand */ +#line 1098 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 4915 "bison_parser.cpp" +#line 4960 "bison_parser.cpp" break; - case 230: /* comp_expr: operand LESSEQ operand */ -#line 1076 "bison_parser.y" + case 232: /* comp_expr: operand LESSEQ operand */ +#line 1099 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 4921 "bison_parser.cpp" +#line 4966 "bison_parser.cpp" break; - case 231: /* comp_expr: operand GREATEREQ operand */ -#line 1077 "bison_parser.y" + case 233: /* comp_expr: operand GREATEREQ operand */ +#line 1100 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 4927 "bison_parser.cpp" +#line 4972 "bison_parser.cpp" break; - case 232: /* function_expr: IDENTIFIER '(' ')' opt_window */ -#line 1081 "bison_parser.y" + case 234: /* function_expr: IDENTIFIER '(' ')' opt_window */ +#line 1104 "bison_parser.y" { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-3].sval), new std::vector(), false, (yyvsp[0].window_description)); } -#line 4933 "bison_parser.cpp" +#line 4978 "bison_parser.cpp" break; - case 233: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ -#line 1082 "bison_parser.y" + case 235: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ +#line 1105 "bison_parser.y" { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-5].sval), (yyvsp[-2].expr_vec), (yyvsp[-3].bval), (yyvsp[0].window_description)); } -#line 4939 "bison_parser.cpp" +#line 4984 "bison_parser.cpp" break; - case 234: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ -#line 1086 "bison_parser.y" + case 236: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ +#line 1109 "bison_parser.y" { (yyval.window_description) = new WindowDescription((yyvsp[-3].expr_vec), (yyvsp[-2].order_vec), (yyvsp[-1].frame_description)); } -#line 4945 "bison_parser.cpp" +#line 4990 "bison_parser.cpp" break; - case 235: /* opt_window: %empty */ -#line 1087 "bison_parser.y" + case 237: /* opt_window: %empty */ +#line 1110 "bison_parser.y" { (yyval.window_description) = nullptr; } -#line 4951 "bison_parser.cpp" +#line 4996 "bison_parser.cpp" break; - case 236: /* opt_partition: PARTITION BY expr_list */ -#line 1089 "bison_parser.y" + case 238: /* opt_partition: PARTITION BY expr_list */ +#line 1112 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[0].expr_vec); } -#line 4957 "bison_parser.cpp" +#line 5002 "bison_parser.cpp" break; - case 237: /* opt_partition: %empty */ -#line 1090 "bison_parser.y" + case 239: /* opt_partition: %empty */ +#line 1113 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 4963 "bison_parser.cpp" +#line 5008 "bison_parser.cpp" break; - case 238: /* opt_frame_clause: frame_type frame_bound */ -#line 1095 "bison_parser.y" + case 240: /* opt_frame_clause: frame_type frame_bound */ +#line 1118 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{(yyvsp[-1].frame_type), (yyvsp[0].frame_bound), new FrameBound{0, kCurrentRow, false}}; } -#line 4969 "bison_parser.cpp" +#line 5014 "bison_parser.cpp" break; - case 239: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ -#line 1096 "bison_parser.y" + case 241: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ +#line 1119 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{(yyvsp[-4].frame_type), (yyvsp[-2].frame_bound), (yyvsp[0].frame_bound)}; } -#line 4975 "bison_parser.cpp" +#line 5020 "bison_parser.cpp" break; - case 240: /* opt_frame_clause: %empty */ -#line 1097 "bison_parser.y" + case 242: /* opt_frame_clause: %empty */ +#line 1120 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{kRange, new FrameBound{0, kPreceding, true}, new FrameBound{0, kCurrentRow, false}}; } -#line 4983 "bison_parser.cpp" +#line 5028 "bison_parser.cpp" break; - case 241: /* frame_type: RANGE */ -#line 1101 "bison_parser.y" + case 243: /* frame_type: RANGE */ +#line 1124 "bison_parser.y" { (yyval.frame_type) = kRange; } -#line 4989 "bison_parser.cpp" +#line 5034 "bison_parser.cpp" break; - case 242: /* frame_type: ROWS */ -#line 1102 "bison_parser.y" + case 244: /* frame_type: ROWS */ +#line 1125 "bison_parser.y" { (yyval.frame_type) = kRows; } -#line 4995 "bison_parser.cpp" +#line 5040 "bison_parser.cpp" break; - case 243: /* frame_type: GROUPS */ -#line 1103 "bison_parser.y" + case 245: /* frame_type: GROUPS */ +#line 1126 "bison_parser.y" { (yyval.frame_type) = kGroups; } -#line 5001 "bison_parser.cpp" +#line 5046 "bison_parser.cpp" break; - case 244: /* frame_bound: UNBOUNDED PRECEDING */ -#line 1105 "bison_parser.y" + case 246: /* frame_bound: UNBOUNDED PRECEDING */ +#line 1128 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kPreceding, true}; } -#line 5007 "bison_parser.cpp" +#line 5052 "bison_parser.cpp" break; - case 245: /* frame_bound: INTVAL PRECEDING */ -#line 1106 "bison_parser.y" + case 247: /* frame_bound: INTVAL PRECEDING */ +#line 1129 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kPreceding, false}; } -#line 5013 "bison_parser.cpp" +#line 5058 "bison_parser.cpp" break; - case 246: /* frame_bound: UNBOUNDED FOLLOWING */ -#line 1107 "bison_parser.y" + case 248: /* frame_bound: UNBOUNDED FOLLOWING */ +#line 1130 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kFollowing, true}; } -#line 5019 "bison_parser.cpp" +#line 5064 "bison_parser.cpp" break; - case 247: /* frame_bound: INTVAL FOLLOWING */ -#line 1108 "bison_parser.y" + case 249: /* frame_bound: INTVAL FOLLOWING */ +#line 1131 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kFollowing, false}; } -#line 5025 "bison_parser.cpp" +#line 5070 "bison_parser.cpp" break; - case 248: /* frame_bound: CURRENT_ROW */ -#line 1109 "bison_parser.y" + case 250: /* frame_bound: CURRENT_ROW */ +#line 1132 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kCurrentRow, false}; } -#line 5031 "bison_parser.cpp" +#line 5076 "bison_parser.cpp" break; - case 249: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ -#line 1111 "bison_parser.y" + case 251: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ +#line 1134 "bison_parser.y" { (yyval.expr) = Expr::makeExtract((yyvsp[-3].datetime_field), (yyvsp[-1].expr)); } -#line 5037 "bison_parser.cpp" +#line 5082 "bison_parser.cpp" break; - case 250: /* cast_expr: CAST '(' expr AS column_type ')' */ -#line 1113 "bison_parser.y" + case 252: /* cast_expr: CAST '(' expr AS column_type ')' */ +#line 1136 "bison_parser.y" { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } -#line 5043 "bison_parser.cpp" +#line 5088 "bison_parser.cpp" break; - case 251: /* datetime_field: SECOND */ -#line 1115 "bison_parser.y" + case 253: /* datetime_field: SECOND */ +#line 1138 "bison_parser.y" { (yyval.datetime_field) = kDatetimeSecond; } -#line 5049 "bison_parser.cpp" +#line 5094 "bison_parser.cpp" break; - case 252: /* datetime_field: MINUTE */ -#line 1116 "bison_parser.y" + case 254: /* datetime_field: MINUTE */ +#line 1139 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMinute; } -#line 5055 "bison_parser.cpp" +#line 5100 "bison_parser.cpp" break; - case 253: /* datetime_field: HOUR */ -#line 1117 "bison_parser.y" + case 255: /* datetime_field: HOUR */ +#line 1140 "bison_parser.y" { (yyval.datetime_field) = kDatetimeHour; } -#line 5061 "bison_parser.cpp" +#line 5106 "bison_parser.cpp" break; - case 254: /* datetime_field: DAY */ -#line 1118 "bison_parser.y" + case 256: /* datetime_field: DAY */ +#line 1141 "bison_parser.y" { (yyval.datetime_field) = kDatetimeDay; } -#line 5067 "bison_parser.cpp" +#line 5112 "bison_parser.cpp" break; - case 255: /* datetime_field: MONTH */ -#line 1119 "bison_parser.y" + case 257: /* datetime_field: MONTH */ +#line 1142 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMonth; } -#line 5073 "bison_parser.cpp" +#line 5118 "bison_parser.cpp" break; - case 256: /* datetime_field: YEAR */ -#line 1120 "bison_parser.y" + case 258: /* datetime_field: YEAR */ +#line 1143 "bison_parser.y" { (yyval.datetime_field) = kDatetimeYear; } -#line 5079 "bison_parser.cpp" +#line 5124 "bison_parser.cpp" break; - case 257: /* datetime_field_plural: SECONDS */ -#line 1122 "bison_parser.y" + case 259: /* datetime_field_plural: SECONDS */ +#line 1145 "bison_parser.y" { (yyval.datetime_field) = kDatetimeSecond; } -#line 5085 "bison_parser.cpp" +#line 5130 "bison_parser.cpp" break; - case 258: /* datetime_field_plural: MINUTES */ -#line 1123 "bison_parser.y" + case 260: /* datetime_field_plural: MINUTES */ +#line 1146 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMinute; } -#line 5091 "bison_parser.cpp" +#line 5136 "bison_parser.cpp" break; - case 259: /* datetime_field_plural: HOURS */ -#line 1124 "bison_parser.y" + case 261: /* datetime_field_plural: HOURS */ +#line 1147 "bison_parser.y" { (yyval.datetime_field) = kDatetimeHour; } -#line 5097 "bison_parser.cpp" +#line 5142 "bison_parser.cpp" break; - case 260: /* datetime_field_plural: DAYS */ -#line 1125 "bison_parser.y" + case 262: /* datetime_field_plural: DAYS */ +#line 1148 "bison_parser.y" { (yyval.datetime_field) = kDatetimeDay; } -#line 5103 "bison_parser.cpp" +#line 5148 "bison_parser.cpp" break; - case 261: /* datetime_field_plural: MONTHS */ -#line 1126 "bison_parser.y" + case 263: /* datetime_field_plural: MONTHS */ +#line 1149 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMonth; } -#line 5109 "bison_parser.cpp" +#line 5154 "bison_parser.cpp" break; - case 262: /* datetime_field_plural: YEARS */ -#line 1127 "bison_parser.y" + case 264: /* datetime_field_plural: YEARS */ +#line 1150 "bison_parser.y" { (yyval.datetime_field) = kDatetimeYear; } -#line 5115 "bison_parser.cpp" +#line 5160 "bison_parser.cpp" break; - case 265: /* array_expr: ARRAY '[' expr_list ']' */ -#line 1131 "bison_parser.y" + case 267: /* array_expr: ARRAY '[' expr_list ']' */ +#line 1154 "bison_parser.y" { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 5121 "bison_parser.cpp" +#line 5166 "bison_parser.cpp" break; - case 266: /* array_index: operand '[' int_literal ']' */ -#line 1133 "bison_parser.y" + case 268: /* array_index: operand '[' int_literal ']' */ +#line 1156 "bison_parser.y" { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 5127 "bison_parser.cpp" +#line 5172 "bison_parser.cpp" break; - case 267: /* between_expr: operand BETWEEN operand AND operand */ -#line 1135 "bison_parser.y" + case 269: /* between_expr: operand BETWEEN operand AND operand */ +#line 1158 "bison_parser.y" { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 5133 "bison_parser.cpp" +#line 5178 "bison_parser.cpp" break; - case 268: /* column_name: IDENTIFIER */ -#line 1137 "bison_parser.y" + case 270: /* column_name: IDENTIFIER */ +#line 1160 "bison_parser.y" { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 5139 "bison_parser.cpp" +#line 5184 "bison_parser.cpp" break; - case 269: /* column_name: IDENTIFIER '.' IDENTIFIER */ -#line 1138 "bison_parser.y" + case 271: /* column_name: IDENTIFIER '.' IDENTIFIER */ +#line 1161 "bison_parser.y" { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 5145 "bison_parser.cpp" +#line 5190 "bison_parser.cpp" break; - case 270: /* column_name: '*' */ -#line 1139 "bison_parser.y" + case 272: /* column_name: '*' */ +#line 1162 "bison_parser.y" { (yyval.expr) = Expr::makeStar(); } -#line 5151 "bison_parser.cpp" +#line 5196 "bison_parser.cpp" break; - case 271: /* column_name: IDENTIFIER '.' '*' */ -#line 1140 "bison_parser.y" + case 273: /* column_name: IDENTIFIER '.' '*' */ +#line 1163 "bison_parser.y" { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 5157 "bison_parser.cpp" +#line 5202 "bison_parser.cpp" break; - case 279: /* string_literal: STRING */ -#line 1144 "bison_parser.y" + case 281: /* string_literal: STRING */ +#line 1167 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 5163 "bison_parser.cpp" +#line 5208 "bison_parser.cpp" break; - case 280: /* bool_literal: TRUE */ -#line 1146 "bison_parser.y" + case 282: /* bool_literal: TRUE */ +#line 1169 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral(true); } -#line 5169 "bison_parser.cpp" +#line 5214 "bison_parser.cpp" break; - case 281: /* bool_literal: FALSE */ -#line 1147 "bison_parser.y" + case 283: /* bool_literal: FALSE */ +#line 1170 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral(false); } -#line 5175 "bison_parser.cpp" +#line 5220 "bison_parser.cpp" break; - case 282: /* num_literal: FLOATVAL */ -#line 1149 "bison_parser.y" + case 284: /* num_literal: FLOATVAL */ +#line 1172 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 5181 "bison_parser.cpp" +#line 5226 "bison_parser.cpp" break; - case 284: /* int_literal: INTVAL */ -#line 1152 "bison_parser.y" + case 286: /* int_literal: INTVAL */ +#line 1175 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 5187 "bison_parser.cpp" +#line 5232 "bison_parser.cpp" break; - case 285: /* null_literal: NULL */ -#line 1154 "bison_parser.y" + case 287: /* null_literal: NULL */ +#line 1177 "bison_parser.y" { (yyval.expr) = Expr::makeNullLiteral(); } -#line 5193 "bison_parser.cpp" +#line 5238 "bison_parser.cpp" break; - case 286: /* date_literal: DATE STRING */ -#line 1156 "bison_parser.y" + case 288: /* date_literal: DATE STRING */ +#line 1179 "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 @@ -5204,17 +5249,17 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = Expr::makeDateLiteral((yyvsp[0].sval)); } -#line 5208 "bison_parser.cpp" +#line 5253 "bison_parser.cpp" break; - case 287: /* interval_literal: INTVAL duration_field */ -#line 1167 "bison_parser.y" + case 289: /* interval_literal: INTVAL duration_field */ +#line 1190 "bison_parser.y" { (yyval.expr) = Expr::makeIntervalLiteral((yyvsp[-1].ival), (yyvsp[0].datetime_field)); } -#line 5214 "bison_parser.cpp" +#line 5259 "bison_parser.cpp" break; - case 288: /* interval_literal: INTERVAL STRING datetime_field */ -#line 1168 "bison_parser.y" + case 290: /* interval_literal: INTERVAL STRING datetime_field */ +#line 1191 "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 @@ -5226,11 +5271,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].sval)); (yyval.expr) = Expr::makeIntervalLiteral(duration, (yyvsp[0].datetime_field)); } -#line 5230 "bison_parser.cpp" +#line 5275 "bison_parser.cpp" break; - case 289: /* interval_literal: INTERVAL STRING */ -#line 1179 "bison_parser.y" + case 291: /* interval_literal: INTERVAL STRING */ +#line 1202 "bison_parser.y" { int duration{0}, chars_parsed{0}; // 'seconds' and 'minutes' are the longest accepted interval qualifiers (7 chars) + null byte @@ -5262,61 +5307,61 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = Expr::makeIntervalLiteral(duration, unit); } -#line 5266 "bison_parser.cpp" +#line 5311 "bison_parser.cpp" break; - case 290: /* param_expr: '?' */ -#line 1211 "bison_parser.y" + case 292: /* param_expr: '?' */ +#line 1234 "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 5276 "bison_parser.cpp" +#line 5321 "bison_parser.cpp" break; - case 292: /* table_ref: table_ref_commalist ',' table_ref_atomic */ -#line 1220 "bison_parser.y" + case 294: /* table_ref: table_ref_commalist ',' table_ref_atomic */ +#line 1243 "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 5287 "bison_parser.cpp" +#line 5332 "bison_parser.cpp" break; - case 296: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ -#line 1229 "bison_parser.y" + case 298: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ +#line 1252 "bison_parser.y" { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } -#line 5298 "bison_parser.cpp" +#line 5343 "bison_parser.cpp" break; - case 297: /* table_ref_commalist: table_ref_atomic */ -#line 1236 "bison_parser.y" + case 299: /* table_ref_commalist: table_ref_atomic */ +#line 1259 "bison_parser.y" { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 5307 "bison_parser.cpp" +#line 5352 "bison_parser.cpp" break; - case 298: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ -#line 1240 "bison_parser.y" + case 300: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ +#line 1263 "bison_parser.y" { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 5316 "bison_parser.cpp" +#line 5361 "bison_parser.cpp" break; - case 299: /* table_ref_name: table_name opt_table_alias */ -#line 1245 "bison_parser.y" + case 301: /* table_ref_name: table_name opt_table_alias */ +#line 1268 "bison_parser.y" { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; @@ -5324,215 +5369,215 @@ YYLTYPE yylloc = yyloc_default; tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } -#line 5328 "bison_parser.cpp" +#line 5373 "bison_parser.cpp" break; - case 300: /* table_ref_name_no_alias: table_name */ -#line 1253 "bison_parser.y" + case 302: /* table_ref_name_no_alias: table_name */ +#line 1276 "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 5338 "bison_parser.cpp" +#line 5383 "bison_parser.cpp" break; - case 301: /* table_name: IDENTIFIER */ -#line 1259 "bison_parser.y" + case 303: /* table_name: IDENTIFIER */ +#line 1282 "bison_parser.y" { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval); } -#line 5347 "bison_parser.cpp" +#line 5392 "bison_parser.cpp" break; - case 302: /* table_name: IDENTIFIER '.' IDENTIFIER */ -#line 1263 "bison_parser.y" + case 304: /* table_name: IDENTIFIER '.' IDENTIFIER */ +#line 1286 "bison_parser.y" { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } -#line 5356 "bison_parser.cpp" +#line 5401 "bison_parser.cpp" break; - case 303: /* opt_index_name: IDENTIFIER */ -#line 1268 "bison_parser.y" + case 305: /* opt_index_name: IDENTIFIER */ +#line 1291 "bison_parser.y" { (yyval.sval) = (yyvsp[0].sval); } -#line 5362 "bison_parser.cpp" +#line 5407 "bison_parser.cpp" break; - case 304: /* opt_index_name: %empty */ -#line 1269 "bison_parser.y" + case 306: /* opt_index_name: %empty */ +#line 1292 "bison_parser.y" { (yyval.sval) = nullptr; } -#line 5368 "bison_parser.cpp" +#line 5413 "bison_parser.cpp" break; - case 306: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ -#line 1271 "bison_parser.y" + case 308: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ +#line 1294 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[-3].sval), (yyvsp[-1].str_vec)); } -#line 5374 "bison_parser.cpp" +#line 5419 "bison_parser.cpp" break; - case 308: /* opt_table_alias: %empty */ -#line 1273 "bison_parser.y" + case 310: /* opt_table_alias: %empty */ +#line 1296 "bison_parser.y" { (yyval.alias_t) = nullptr; } -#line 5380 "bison_parser.cpp" +#line 5425 "bison_parser.cpp" break; - case 309: /* alias: AS IDENTIFIER */ -#line 1275 "bison_parser.y" + case 311: /* alias: AS IDENTIFIER */ +#line 1298 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } -#line 5386 "bison_parser.cpp" +#line 5431 "bison_parser.cpp" break; - case 310: /* alias: IDENTIFIER */ -#line 1276 "bison_parser.y" + case 312: /* alias: IDENTIFIER */ +#line 1299 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } -#line 5392 "bison_parser.cpp" +#line 5437 "bison_parser.cpp" break; - case 312: /* opt_alias: %empty */ -#line 1278 "bison_parser.y" + case 314: /* opt_alias: %empty */ +#line 1301 "bison_parser.y" { (yyval.alias_t) = nullptr; } -#line 5398 "bison_parser.cpp" +#line 5443 "bison_parser.cpp" break; - case 313: /* opt_locking_clause: opt_locking_clause_list */ -#line 1284 "bison_parser.y" + case 315: /* opt_locking_clause: opt_locking_clause_list */ +#line 1307 "bison_parser.y" { (yyval.locking_clause_vec) = (yyvsp[0].locking_clause_vec); } -#line 5404 "bison_parser.cpp" +#line 5449 "bison_parser.cpp" break; - case 314: /* opt_locking_clause: %empty */ -#line 1285 "bison_parser.y" + case 316: /* opt_locking_clause: %empty */ +#line 1308 "bison_parser.y" { (yyval.locking_clause_vec) = nullptr; } -#line 5410 "bison_parser.cpp" +#line 5455 "bison_parser.cpp" break; - case 315: /* opt_locking_clause_list: locking_clause */ -#line 1287 "bison_parser.y" + case 317: /* opt_locking_clause_list: locking_clause */ +#line 1310 "bison_parser.y" { (yyval.locking_clause_vec) = new std::vector(); (yyval.locking_clause_vec)->push_back((yyvsp[0].locking_t)); } -#line 5419 "bison_parser.cpp" +#line 5464 "bison_parser.cpp" break; - case 316: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ -#line 1291 "bison_parser.y" + case 318: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ +#line 1314 "bison_parser.y" { (yyvsp[-1].locking_clause_vec)->push_back((yyvsp[0].locking_t)); (yyval.locking_clause_vec) = (yyvsp[-1].locking_clause_vec); } -#line 5428 "bison_parser.cpp" +#line 5473 "bison_parser.cpp" break; - case 317: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ -#line 1296 "bison_parser.y" + case 319: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ +#line 1319 "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 5439 "bison_parser.cpp" +#line 5484 "bison_parser.cpp" break; - case 318: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ -#line 1302 "bison_parser.y" + case 320: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ +#line 1325 "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 5450 "bison_parser.cpp" +#line 5495 "bison_parser.cpp" break; - case 319: /* row_lock_mode: UPDATE */ -#line 1309 "bison_parser.y" + case 321: /* row_lock_mode: UPDATE */ +#line 1332 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForUpdate; } -#line 5456 "bison_parser.cpp" +#line 5501 "bison_parser.cpp" break; - case 320: /* row_lock_mode: NO KEY UPDATE */ -#line 1310 "bison_parser.y" + case 322: /* row_lock_mode: NO KEY UPDATE */ +#line 1333 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForNoKeyUpdate; } -#line 5462 "bison_parser.cpp" +#line 5507 "bison_parser.cpp" break; - case 321: /* row_lock_mode: SHARE */ -#line 1311 "bison_parser.y" + case 323: /* row_lock_mode: SHARE */ +#line 1334 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForShare; } -#line 5468 "bison_parser.cpp" +#line 5513 "bison_parser.cpp" break; - case 322: /* row_lock_mode: KEY SHARE */ -#line 1312 "bison_parser.y" + case 324: /* row_lock_mode: KEY SHARE */ +#line 1335 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForKeyShare; } -#line 5474 "bison_parser.cpp" +#line 5519 "bison_parser.cpp" break; - case 323: /* opt_row_lock_policy: SKIP LOCKED */ -#line 1314 "bison_parser.y" + case 325: /* opt_row_lock_policy: SKIP LOCKED */ +#line 1337 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::SkipLocked; } -#line 5480 "bison_parser.cpp" +#line 5525 "bison_parser.cpp" break; - case 324: /* opt_row_lock_policy: NOWAIT */ -#line 1315 "bison_parser.y" + case 326: /* opt_row_lock_policy: NOWAIT */ +#line 1338 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::NoWait; } -#line 5486 "bison_parser.cpp" +#line 5531 "bison_parser.cpp" break; - case 325: /* opt_row_lock_policy: %empty */ -#line 1316 "bison_parser.y" + case 327: /* opt_row_lock_policy: %empty */ +#line 1339 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::None; } -#line 5492 "bison_parser.cpp" +#line 5537 "bison_parser.cpp" break; - case 327: /* opt_with_clause: %empty */ -#line 1322 "bison_parser.y" + case 329: /* opt_with_clause: %empty */ +#line 1345 "bison_parser.y" { (yyval.with_description_vec) = nullptr; } -#line 5498 "bison_parser.cpp" +#line 5543 "bison_parser.cpp" break; - case 328: /* with_clause: WITH with_description_list */ -#line 1324 "bison_parser.y" + case 330: /* with_clause: WITH with_description_list */ +#line 1347 "bison_parser.y" { (yyval.with_description_vec) = (yyvsp[0].with_description_vec); } -#line 5504 "bison_parser.cpp" +#line 5549 "bison_parser.cpp" break; - case 329: /* with_description_list: with_description */ -#line 1326 "bison_parser.y" + case 331: /* with_description_list: with_description */ +#line 1349 "bison_parser.y" { (yyval.with_description_vec) = new std::vector(); (yyval.with_description_vec)->push_back((yyvsp[0].with_description_t)); } -#line 5513 "bison_parser.cpp" +#line 5558 "bison_parser.cpp" break; - case 330: /* with_description_list: with_description_list ',' with_description */ -#line 1330 "bison_parser.y" + case 332: /* with_description_list: with_description_list ',' with_description */ +#line 1353 "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 5522 "bison_parser.cpp" +#line 5567 "bison_parser.cpp" break; - case 331: /* with_description: IDENTIFIER AS select_with_paren */ -#line 1335 "bison_parser.y" + case 333: /* with_description: IDENTIFIER AS select_with_paren */ +#line 1358 "bison_parser.y" { (yyval.with_description_t) = new WithDescription(); (yyval.with_description_t)->alias = (yyvsp[-2].sval); (yyval.with_description_t)->select = (yyvsp[0].select_stmt); } -#line 5532 "bison_parser.cpp" +#line 5577 "bison_parser.cpp" break; - case 332: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ -#line 1345 "bison_parser.y" + case 334: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ +#line 1368 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5540,11 +5585,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 5544 "bison_parser.cpp" +#line 5589 "bison_parser.cpp" break; - case 333: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ -#line 1352 "bison_parser.y" + case 335: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ +#line 1375 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5553,11 +5598,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 5557 "bison_parser.cpp" +#line 5602 "bison_parser.cpp" break; - case 334: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' ident_commalist ')' */ -#line 1360 "bison_parser.y" + case 336: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' ident_commalist ')' */ +#line 1383 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5566,89 +5611,89 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->right = (yyvsp[-4].table); (yyval.table)->join->namedColumns = (yyvsp[-1].str_vec); } -#line 5570 "bison_parser.cpp" +#line 5615 "bison_parser.cpp" break; - case 335: /* opt_join_type: INNER */ -#line 1369 "bison_parser.y" + case 337: /* opt_join_type: INNER */ +#line 1392 "bison_parser.y" { (yyval.join_type) = kJoinInner; } -#line 5576 "bison_parser.cpp" +#line 5621 "bison_parser.cpp" break; - case 336: /* opt_join_type: LEFT OUTER */ -#line 1370 "bison_parser.y" + case 338: /* opt_join_type: LEFT OUTER */ +#line 1393 "bison_parser.y" { (yyval.join_type) = kJoinLeft; } -#line 5582 "bison_parser.cpp" +#line 5627 "bison_parser.cpp" break; - case 337: /* opt_join_type: LEFT */ -#line 1371 "bison_parser.y" + case 339: /* opt_join_type: LEFT */ +#line 1394 "bison_parser.y" { (yyval.join_type) = kJoinLeft; } -#line 5588 "bison_parser.cpp" +#line 5633 "bison_parser.cpp" break; - case 338: /* opt_join_type: RIGHT OUTER */ -#line 1372 "bison_parser.y" + case 340: /* opt_join_type: RIGHT OUTER */ +#line 1395 "bison_parser.y" { (yyval.join_type) = kJoinRight; } -#line 5594 "bison_parser.cpp" +#line 5639 "bison_parser.cpp" break; - case 339: /* opt_join_type: RIGHT */ -#line 1373 "bison_parser.y" + case 341: /* opt_join_type: RIGHT */ +#line 1396 "bison_parser.y" { (yyval.join_type) = kJoinRight; } -#line 5600 "bison_parser.cpp" +#line 5645 "bison_parser.cpp" break; - case 340: /* opt_join_type: FULL OUTER */ -#line 1374 "bison_parser.y" + case 342: /* opt_join_type: FULL OUTER */ +#line 1397 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5606 "bison_parser.cpp" +#line 5651 "bison_parser.cpp" break; - case 341: /* opt_join_type: OUTER */ -#line 1375 "bison_parser.y" + case 343: /* opt_join_type: OUTER */ +#line 1398 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5612 "bison_parser.cpp" +#line 5657 "bison_parser.cpp" break; - case 342: /* opt_join_type: FULL */ -#line 1376 "bison_parser.y" + case 344: /* opt_join_type: FULL */ +#line 1399 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5618 "bison_parser.cpp" +#line 5663 "bison_parser.cpp" break; - case 343: /* opt_join_type: CROSS */ -#line 1377 "bison_parser.y" + case 345: /* opt_join_type: CROSS */ +#line 1400 "bison_parser.y" { (yyval.join_type) = kJoinCross; } -#line 5624 "bison_parser.cpp" +#line 5669 "bison_parser.cpp" break; - case 344: /* opt_join_type: %empty */ -#line 1378 "bison_parser.y" + case 346: /* opt_join_type: %empty */ +#line 1401 "bison_parser.y" { (yyval.join_type) = kJoinInner; } -#line 5630 "bison_parser.cpp" +#line 5675 "bison_parser.cpp" break; - case 348: /* ident_commalist: IDENTIFIER */ -#line 1389 "bison_parser.y" + case 350: /* ident_commalist: IDENTIFIER */ +#line 1412 "bison_parser.y" { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 5639 "bison_parser.cpp" +#line 5684 "bison_parser.cpp" break; - case 349: /* ident_commalist: ident_commalist ',' IDENTIFIER */ -#line 1393 "bison_parser.y" + case 351: /* ident_commalist: ident_commalist ',' IDENTIFIER */ +#line 1416 "bison_parser.y" { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 5648 "bison_parser.cpp" +#line 5693 "bison_parser.cpp" break; -#line 5652 "bison_parser.cpp" +#line 5697 "bison_parser.cpp" default: break; } @@ -5877,7 +5922,7 @@ YYLTYPE yylloc = yyloc_default; return yyresult; } -#line 1399 "bison_parser.y" +#line 1422 "bison_parser.y" /********************************* diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h index 8357584b..aa56d392 100644 --- a/src/parser/bison_parser.h +++ b/src/parser/bison_parser.h @@ -318,6 +318,7 @@ union HSQL_STYPE hsql::LockingClause* locking_t; hsql::OrderDescription* order; hsql::OrderType order_type; + hsql::NullOrdering null_ordering_t; hsql::ReferencesSpecification* references_spec_t; hsql::SetOperation* set_operator_t; hsql::TableConstraint* table_constraint_t; @@ -347,7 +348,7 @@ union HSQL_STYPE // clang-format off -#line 351 "bison_parser.h" +#line 352 "bison_parser.h" }; typedef union HSQL_STYPE HSQL_STYPE; diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index f907a494..74b27660 100644 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -142,6 +142,7 @@ hsql::LockingClause* locking_t; hsql::OrderDescription* order; hsql::OrderType order_type; + hsql::NullOrdering null_ordering_t; hsql::ReferencesSpecification* references_spec_t; hsql::SetOperation* set_operator_t; hsql::TableConstraint* table_constraint_t; @@ -176,7 +177,7 @@ ** Destructor symbols *********************************/ -%destructor { } +%destructor { } %destructor { free($$.name); free($$.schema); @@ -270,6 +271,7 @@ %type opt_limit opt_top %type order_desc %type opt_order_type +%type opt_null_ordering %type datetime_field datetime_field_plural duration_field %type column_def %type table_elem @@ -953,12 +955,33 @@ order_list : order_desc { $$ = $1; }; -order_desc : expr opt_order_type { $$ = new OrderDescription($2, $1); }; +order_desc : expr opt_order_type opt_null_ordering { $$ = new OrderDescription($2, $1, $3); }; opt_order_type : ASC { $$ = kOrderAsc; } | DESC { $$ = kOrderDesc; } | /* empty */ { $$ = kOrderAsc; }; +opt_null_ordering : /* empty */ { $$ = NullOrdering::Undefined; } +| IDENTIFIER IDENTIFIER { + auto null_ordering = NullOrdering::Undefined; + if (strcasecmp($1, "nulls") == 0) { + if (strcasecmp($2, "first") == 0) { + null_ordering = NullOrdering::First; + } else if (strcasecmp($2, "last") == 0) { + null_ordering = NullOrdering::Last; + } + } + free($1); + free($2); + + if (null_ordering == NullOrdering::Undefined) { + yyerror(&yyloc, result, scanner, "Expected NULLS FIRST or NULLS LAST ordering."); + YYERROR; + } + + $$ = null_ordering; +}; + // TODO: TOP and LIMIT can take more than just int literals. opt_top : TOP int_literal { $$ = new LimitDescription($2, nullptr); } diff --git a/src/sql/SelectStatement.h b/src/sql/SelectStatement.h index 7396e796..a19e699c 100644 --- a/src/sql/SelectStatement.h +++ b/src/sql/SelectStatement.h @@ -7,6 +7,7 @@ namespace hsql { enum OrderType { kOrderAsc, kOrderDesc }; +enum NullOrdering { Undefined, First, Last }; enum SetType { kSetUnion, kSetIntersect, kSetExcept }; @@ -15,11 +16,12 @@ enum RowLockWaitPolicy { NoWait, SkipLocked, None }; // Description of the order by clause within a select statement. struct OrderDescription { - OrderDescription(OrderType type, Expr* expr); + OrderDescription(OrderType type, Expr* expr, NullOrdering null_ordering); virtual ~OrderDescription(); OrderType type; Expr* expr; + NullOrdering null_ordering; }; // Description of the limit clause within a select statement. diff --git a/src/sql/statements.cpp b/src/sql/statements.cpp index e502665c..63eb0dd7 100644 --- a/src/sql/statements.cpp +++ b/src/sql/statements.cpp @@ -213,7 +213,8 @@ ShowStatement::~ShowStatement() { // SelectStatement.h // OrderDescription -OrderDescription::OrderDescription(OrderType type, Expr* expr) : type(type), expr(expr) {} +OrderDescription::OrderDescription(OrderType type, Expr* expr, NullOrdering null_ordering) + : type(type), expr(expr), null_ordering(null_ordering) {} OrderDescription::~OrderDescription() { delete expr; } diff --git a/test/queries/queries-bad.sql b/test/queries/queries-bad.sql index 995b5ded..0159ceca 100644 --- a/test/queries/queries-bad.sql +++ b/test/queries/queries-bad.sql @@ -93,3 +93,12 @@ !SELECT * FROM foo WITH HINT (?); !SELECT * FROM foo WITH HINT (CAST(column_a AS INT)); !SELECT * FROM foo WITH HINT (AVG(another_column)); +# ORDER BY with NULL ordering. +!SELECT * FROM students ORDER BY name ASC NULL FIRST; +!SELECT * FROM students ORDER BY name ASC gibberish LAST; +!SELECT * FROM students ORDER BY name NULLS FIRS; +!SELECT * FROM students ORDER BY name NULLS; +!SELECT * FROM students ORDER BY name ASC NULLS; +!SELECT * FROM students ORDER BY name FIRST; +!SELECT * FROM students ORDER BY name ASC LAST; +!SELECT * FROM students ORDER BY name DESC NULLS gibberish; diff --git a/test/select_tests.cpp b/test/select_tests.cpp index 2334827c..d57a3be2 100644 --- a/test/select_tests.cpp +++ b/test/select_tests.cpp @@ -172,18 +172,24 @@ TEST(SelectGroupDistinctTest) { } TEST(OrderByTest) { - TEST_PARSE_SINGLE_SQL("SELECT grade, city FROM students ORDER BY grade, city DESC;", kStmtSelect, SelectStatement, - result, stmt); + TEST_PARSE_SINGLE_SQL("SELECT grade, city FROM students ORDER BY grade, city DESC NULLS FIRST, name NULLS LAST;", + kStmtSelect, SelectStatement, result, stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NOTNULL(stmt->order); - ASSERT_EQ(stmt->order->size(), 2); + ASSERT_EQ(stmt->order->size(), 3); ASSERT_EQ(stmt->order->at(0)->type, kOrderAsc); ASSERT_STREQ(stmt->order->at(0)->expr->name, "grade"); + ASSERT_EQ(stmt->order->at(0)->null_ordering, NullOrdering::Undefined); ASSERT_EQ(stmt->order->at(1)->type, kOrderDesc); ASSERT_STREQ(stmt->order->at(1)->expr->name, "city"); + ASSERT_EQ(stmt->order->at(1)->null_ordering, NullOrdering::First); + + ASSERT_EQ(stmt->order->at(2)->type, kOrderAsc); + ASSERT_STREQ(stmt->order->at(2)->expr->name, "name"); + ASSERT_EQ(stmt->order->at(2)->null_ordering, NullOrdering::Last); } TEST(SelectBetweenTest) {