diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 9dcbe936..0bba6ad7 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -350,123 +350,124 @@ enum yysymbol_kind_t YYSYMBOL_file_path = 214, /* file_path */ YYSYMBOL_opt_import_export_options = 215, /* opt_import_export_options */ YYSYMBOL_import_export_options = 216, /* import_export_options */ - YYSYMBOL_export_statement = 217, /* export_statement */ - YYSYMBOL_show_statement = 218, /* show_statement */ - YYSYMBOL_create_statement = 219, /* create_statement */ - YYSYMBOL_opt_not_exists = 220, /* opt_not_exists */ - YYSYMBOL_table_elem_commalist = 221, /* table_elem_commalist */ - YYSYMBOL_table_elem = 222, /* table_elem */ - YYSYMBOL_column_def = 223, /* column_def */ - YYSYMBOL_column_type = 224, /* column_type */ - YYSYMBOL_opt_time_precision = 225, /* opt_time_precision */ - YYSYMBOL_opt_decimal_specification = 226, /* opt_decimal_specification */ - YYSYMBOL_opt_column_constraints = 227, /* opt_column_constraints */ - YYSYMBOL_column_constraints = 228, /* column_constraints */ - YYSYMBOL_column_constraint = 229, /* column_constraint */ - YYSYMBOL_table_constraint = 230, /* table_constraint */ - YYSYMBOL_references_spec = 231, /* references_spec */ - YYSYMBOL_drop_statement = 232, /* drop_statement */ - YYSYMBOL_opt_exists = 233, /* opt_exists */ - YYSYMBOL_alter_statement = 234, /* alter_statement */ - YYSYMBOL_alter_action = 235, /* alter_action */ - YYSYMBOL_drop_action = 236, /* drop_action */ - YYSYMBOL_delete_statement = 237, /* delete_statement */ - YYSYMBOL_truncate_statement = 238, /* truncate_statement */ - YYSYMBOL_insert_statement = 239, /* insert_statement */ - YYSYMBOL_opt_column_list = 240, /* opt_column_list */ - YYSYMBOL_update_statement = 241, /* update_statement */ - YYSYMBOL_update_clause_commalist = 242, /* update_clause_commalist */ - YYSYMBOL_update_clause = 243, /* update_clause */ - YYSYMBOL_select_statement = 244, /* select_statement */ - YYSYMBOL_select_within_set_operation = 245, /* select_within_set_operation */ - YYSYMBOL_select_within_set_operation_no_parentheses = 246, /* select_within_set_operation_no_parentheses */ - YYSYMBOL_select_with_paren = 247, /* select_with_paren */ - YYSYMBOL_select_no_paren = 248, /* select_no_paren */ - YYSYMBOL_set_operator = 249, /* set_operator */ - YYSYMBOL_set_type = 250, /* set_type */ - YYSYMBOL_opt_all = 251, /* opt_all */ - YYSYMBOL_select_clause = 252, /* select_clause */ - YYSYMBOL_opt_distinct = 253, /* opt_distinct */ - YYSYMBOL_select_list = 254, /* select_list */ - YYSYMBOL_opt_from_clause = 255, /* opt_from_clause */ - YYSYMBOL_from_clause = 256, /* from_clause */ - YYSYMBOL_opt_where = 257, /* opt_where */ - YYSYMBOL_opt_group = 258, /* opt_group */ - YYSYMBOL_opt_having = 259, /* opt_having */ - YYSYMBOL_opt_order = 260, /* opt_order */ - YYSYMBOL_order_list = 261, /* order_list */ - YYSYMBOL_order_desc = 262, /* order_desc */ - YYSYMBOL_opt_order_type = 263, /* opt_order_type */ - 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 */ + YYSYMBOL_csv_option = 217, /* csv_option */ + YYSYMBOL_export_statement = 218, /* export_statement */ + YYSYMBOL_show_statement = 219, /* show_statement */ + YYSYMBOL_create_statement = 220, /* create_statement */ + YYSYMBOL_opt_not_exists = 221, /* opt_not_exists */ + YYSYMBOL_table_elem_commalist = 222, /* table_elem_commalist */ + YYSYMBOL_table_elem = 223, /* table_elem */ + YYSYMBOL_column_def = 224, /* column_def */ + YYSYMBOL_column_type = 225, /* column_type */ + YYSYMBOL_opt_time_precision = 226, /* opt_time_precision */ + YYSYMBOL_opt_decimal_specification = 227, /* opt_decimal_specification */ + YYSYMBOL_opt_column_constraints = 228, /* opt_column_constraints */ + YYSYMBOL_column_constraints = 229, /* column_constraints */ + YYSYMBOL_column_constraint = 230, /* column_constraint */ + YYSYMBOL_table_constraint = 231, /* table_constraint */ + YYSYMBOL_references_spec = 232, /* references_spec */ + YYSYMBOL_drop_statement = 233, /* drop_statement */ + YYSYMBOL_opt_exists = 234, /* opt_exists */ + YYSYMBOL_alter_statement = 235, /* alter_statement */ + YYSYMBOL_alter_action = 236, /* alter_action */ + YYSYMBOL_drop_action = 237, /* drop_action */ + YYSYMBOL_delete_statement = 238, /* delete_statement */ + YYSYMBOL_truncate_statement = 239, /* truncate_statement */ + YYSYMBOL_insert_statement = 240, /* insert_statement */ + YYSYMBOL_opt_column_list = 241, /* opt_column_list */ + YYSYMBOL_update_statement = 242, /* update_statement */ + YYSYMBOL_update_clause_commalist = 243, /* update_clause_commalist */ + YYSYMBOL_update_clause = 244, /* update_clause */ + YYSYMBOL_select_statement = 245, /* select_statement */ + YYSYMBOL_select_within_set_operation = 246, /* select_within_set_operation */ + YYSYMBOL_select_within_set_operation_no_parentheses = 247, /* select_within_set_operation_no_parentheses */ + YYSYMBOL_select_with_paren = 248, /* select_with_paren */ + YYSYMBOL_select_no_paren = 249, /* select_no_paren */ + YYSYMBOL_set_operator = 250, /* set_operator */ + YYSYMBOL_set_type = 251, /* set_type */ + YYSYMBOL_opt_all = 252, /* opt_all */ + YYSYMBOL_select_clause = 253, /* select_clause */ + YYSYMBOL_opt_distinct = 254, /* opt_distinct */ + YYSYMBOL_select_list = 255, /* select_list */ + YYSYMBOL_opt_from_clause = 256, /* opt_from_clause */ + YYSYMBOL_from_clause = 257, /* from_clause */ + YYSYMBOL_opt_where = 258, /* opt_where */ + YYSYMBOL_opt_group = 259, /* opt_group */ + YYSYMBOL_opt_having = 260, /* opt_having */ + YYSYMBOL_opt_order = 261, /* opt_order */ + YYSYMBOL_order_list = 262, /* order_list */ + YYSYMBOL_order_desc = 263, /* order_desc */ + YYSYMBOL_opt_order_type = 264, /* opt_order_type */ + YYSYMBOL_opt_null_ordering = 265, /* opt_null_ordering */ + YYSYMBOL_opt_top = 266, /* opt_top */ + YYSYMBOL_opt_limit = 267, /* opt_limit */ + YYSYMBOL_expr_list = 268, /* expr_list */ + YYSYMBOL_opt_extended_literal_list = 269, /* opt_extended_literal_list */ + YYSYMBOL_extended_literal_list = 270, /* extended_literal_list */ + YYSYMBOL_casted_extended_literal = 271, /* casted_extended_literal */ + YYSYMBOL_extended_literal = 272, /* extended_literal */ + YYSYMBOL_expr_alias = 273, /* expr_alias */ + YYSYMBOL_expr = 274, /* expr */ + YYSYMBOL_operand = 275, /* operand */ + YYSYMBOL_scalar_expr = 276, /* scalar_expr */ + YYSYMBOL_unary_expr = 277, /* unary_expr */ + YYSYMBOL_binary_expr = 278, /* binary_expr */ + YYSYMBOL_logic_expr = 279, /* logic_expr */ + YYSYMBOL_in_expr = 280, /* in_expr */ + YYSYMBOL_case_expr = 281, /* case_expr */ + YYSYMBOL_case_list = 282, /* case_list */ + YYSYMBOL_exists_expr = 283, /* exists_expr */ + YYSYMBOL_comp_expr = 284, /* comp_expr */ + YYSYMBOL_function_expr = 285, /* function_expr */ + YYSYMBOL_opt_window = 286, /* opt_window */ + YYSYMBOL_opt_partition = 287, /* opt_partition */ + YYSYMBOL_opt_frame_clause = 288, /* opt_frame_clause */ + YYSYMBOL_frame_type = 289, /* frame_type */ + YYSYMBOL_frame_bound = 290, /* frame_bound */ + YYSYMBOL_extract_expr = 291, /* extract_expr */ + YYSYMBOL_cast_expr = 292, /* cast_expr */ + YYSYMBOL_datetime_field = 293, /* datetime_field */ + YYSYMBOL_datetime_field_plural = 294, /* datetime_field_plural */ + YYSYMBOL_duration_field = 295, /* duration_field */ + YYSYMBOL_array_expr = 296, /* array_expr */ + YYSYMBOL_array_index = 297, /* array_index */ + YYSYMBOL_between_expr = 298, /* between_expr */ + YYSYMBOL_column_name = 299, /* column_name */ + YYSYMBOL_literal = 300, /* literal */ + YYSYMBOL_string_literal = 301, /* string_literal */ + YYSYMBOL_bool_literal = 302, /* bool_literal */ + YYSYMBOL_num_literal = 303, /* num_literal */ + YYSYMBOL_int_literal = 304, /* int_literal */ + YYSYMBOL_null_literal = 305, /* null_literal */ + YYSYMBOL_date_literal = 306, /* date_literal */ + YYSYMBOL_interval_literal = 307, /* interval_literal */ + YYSYMBOL_param_expr = 308, /* param_expr */ + YYSYMBOL_table_ref = 309, /* table_ref */ + YYSYMBOL_table_ref_atomic = 310, /* table_ref_atomic */ + YYSYMBOL_nonjoin_table_ref_atomic = 311, /* nonjoin_table_ref_atomic */ + YYSYMBOL_table_ref_commalist = 312, /* table_ref_commalist */ + YYSYMBOL_table_ref_name = 313, /* table_ref_name */ + YYSYMBOL_table_ref_name_no_alias = 314, /* table_ref_name_no_alias */ + YYSYMBOL_table_name = 315, /* table_name */ + YYSYMBOL_opt_index_name = 316, /* opt_index_name */ + YYSYMBOL_table_alias = 317, /* table_alias */ + YYSYMBOL_opt_table_alias = 318, /* opt_table_alias */ + YYSYMBOL_alias = 319, /* alias */ + YYSYMBOL_opt_alias = 320, /* opt_alias */ + YYSYMBOL_opt_locking_clause = 321, /* opt_locking_clause */ + YYSYMBOL_opt_locking_clause_list = 322, /* opt_locking_clause_list */ + YYSYMBOL_locking_clause = 323, /* locking_clause */ + YYSYMBOL_row_lock_mode = 324, /* row_lock_mode */ + YYSYMBOL_opt_row_lock_policy = 325, /* opt_row_lock_policy */ + YYSYMBOL_opt_with_clause = 326, /* opt_with_clause */ + YYSYMBOL_with_clause = 327, /* with_clause */ + YYSYMBOL_with_description_list = 328, /* with_description_list */ + YYSYMBOL_with_description = 329, /* with_description */ + YYSYMBOL_join_clause = 330, /* join_clause */ + YYSYMBOL_opt_join_type = 331, /* opt_join_type */ + YYSYMBOL_join_condition = 332, /* join_condition */ + YYSYMBOL_opt_semicolon = 333, /* opt_semicolon */ + YYSYMBOL_ident_commalist = 334 /* ident_commalist */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -797,16 +798,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 69 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 914 +#define YYLAST 947 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 199 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 135 +#define YYNNTS 136 /* YYNRULES -- Number of rules. */ -#define YYNRULES 351 +#define YYNRULES 355 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 643 +#define YYNSTATES 649 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 436 @@ -873,42 +874,42 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 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 + 0, 343, 343, 362, 368, 375, 379, 383, 384, 385, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 402, 403, 405, 409, 414, 418, 428, 429, 430, 432, + 432, 438, 444, 446, 450, 462, 468, 485, 500, 502, + 503, 504, 506, 520, 524, 534, 538, 562, 570, 583, + 590, 605, 625, 626, 631, 642, 655, 667, 674, 681, + 690, 691, 693, 697, 702, 703, 705, 713, 714, 715, + 716, 717, 718, 719, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 735, 736, 738, 739, 740, + 742, 743, 745, 749, 753, 758, 766, 767, 768, 769, + 771, 772, 773, 775, 783, 789, 795, 801, 807, 808, + 815, 821, 823, 833, 840, 851, 858, 866, 867, 874, + 881, 885, 890, 900, 904, 908, 920, 920, 922, 923, + 932, 933, 935, 949, 961, 966, 970, 974, 979, 980, + 982, 992, 993, 995, 997, 998, 1000, 1002, 1003, 1005, + 1010, 1012, 1013, 1015, 1016, 1018, 1022, 1027, 1029, 1030, + 1031, 1033, 1034, 1056, 1057, 1059, 1060, 1061, 1062, 1063, + 1064, 1069, 1073, 1079, 1080, 1082, 1086, 1091, 1091, 1095, + 1103, 1104, 1106, 1115, 1115, 1115, 1115, 1115, 1117, 1118, + 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1119, 1119, 1123, + 1123, 1125, 1126, 1127, 1128, 1129, 1131, 1131, 1132, 1133, + 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1142, 1143, 1145, + 1146, 1147, 1148, 1152, 1153, 1154, 1155, 1157, 1158, 1160, + 1161, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1173, 1174, + 1178, 1179, 1181, 1182, 1187, 1188, 1189, 1193, 1194, 1195, + 1197, 1198, 1199, 1200, 1201, 1203, 1205, 1207, 1208, 1209, + 1210, 1211, 1212, 1214, 1215, 1216, 1217, 1218, 1219, 1221, + 1221, 1223, 1225, 1227, 1229, 1230, 1231, 1232, 1234, 1234, + 1234, 1234, 1234, 1234, 1234, 1236, 1238, 1239, 1241, 1242, + 1244, 1246, 1248, 1259, 1260, 1271, 1303, 1312, 1312, 1319, + 1319, 1321, 1321, 1328, 1332, 1337, 1345, 1351, 1355, 1360, + 1361, 1363, 1363, 1365, 1365, 1367, 1368, 1370, 1370, 1376, + 1377, 1379, 1383, 1388, 1394, 1401, 1402, 1403, 1404, 1406, + 1407, 1408, 1414, 1414, 1416, 1418, 1422, 1427, 1437, 1444, + 1452, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, + 1470, 1472, 1478, 1478, 1481, 1485 }; #endif @@ -956,16 +957,16 @@ static const char *const yytname[] = "transaction_statement", "opt_transaction_keyword", "prepare_statement", "prepare_target_query", "execute_statement", "import_statement", "file_type", "file_path", "opt_import_export_options", - "import_export_options", "export_statement", "show_statement", - "create_statement", "opt_not_exists", "table_elem_commalist", - "table_elem", "column_def", "column_type", "opt_time_precision", - "opt_decimal_specification", "opt_column_constraints", - "column_constraints", "column_constraint", "table_constraint", - "references_spec", "drop_statement", "opt_exists", "alter_statement", - "alter_action", "drop_action", "delete_statement", "truncate_statement", - "insert_statement", "opt_column_list", "update_statement", - "update_clause_commalist", "update_clause", "select_statement", - "select_within_set_operation", + "import_export_options", "csv_option", "export_statement", + "show_statement", "create_statement", "opt_not_exists", + "table_elem_commalist", "table_elem", "column_def", "column_type", + "opt_time_precision", "opt_decimal_specification", + "opt_column_constraints", "column_constraints", "column_constraint", + "table_constraint", "references_spec", "drop_statement", "opt_exists", + "alter_statement", "alter_action", "drop_action", "delete_statement", + "truncate_statement", "insert_statement", "opt_column_list", + "update_statement", "update_clause_commalist", "update_clause", + "select_statement", "select_within_set_operation", "select_within_set_operation_no_parentheses", "select_with_paren", "select_no_paren", "set_operator", "set_type", "opt_all", "select_clause", "opt_distinct", "select_list", "opt_from_clause", @@ -998,12 +999,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-500) +#define YYPACT_NINF (-568) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-349) +#define YYTABLE_NINF (-353) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) @@ -1012,71 +1013,71 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 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, 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 + 641, 28, 135, 199, 259, 135, -18, 150, 175, 190, + 135, 218, 23, 89, 125, 282, 156, 156, 156, 304, + 116, -568, 201, -568, 201, -568, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -23, -568, 328, + 153, -568, 161, 245, -568, 231, 231, 231, 135, 342, + 135, 237, -568, 246, -23, 253, 31, 246, 246, 246, + 135, -568, 274, 228, -568, -568, -568, -568, -568, -568, + 618, -568, 281, -568, -568, 278, 192, -568, 184, -568, + 412, 91, 425, 310, 431, 135, 135, 356, -568, 349, + 247, 441, 397, 135, 251, 252, 443, 443, 443, 454, + 135, 135, -568, 265, 282, -568, 270, 460, 462, -568, + -568, -568, -23, 357, 350, -23, 80, -568, -568, -568, + 440, 284, 471, -568, 474, -568, -568, 27, -568, 289, + 287, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, -568, -568, 439, -568, 355, -47, 247, 347, + -568, 443, 484, 242, 314, -44, -568, -568, 399, -568, + -568, -568, -69, -69, -69, -568, -568, -568, -568, -568, + 490, -568, -568, -568, 347, 418, -568, -568, 192, -568, + -568, 347, 418, 347, 151, 381, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, 220, -568, 226, -568, -568, -568, 91, -568, 135, + 499, 392, 21, 382, 99, 313, 317, 319, 205, 407, + 322, 456, -568, 329, 73, 435, -568, -568, -568, -568, + -568, -568, -568, -568, -568, -568, -568, -568, -568, -568, + -568, -568, 419, -568, -105, 323, -568, 347, 441, -568, + 479, -568, -568, 326, 82, -568, 356, -568, 327, -19, + -568, 427, 334, -568, 42, 80, -23, 337, -568, 106, + 80, 73, 468, 33, -1, -568, 381, -568, 401, -568, + -568, 331, 442, -568, 691, 344, 366, 367, -13, -568, + -568, -568, 392, 9, 20, 485, 226, 347, 347, -42, + 76, 353, 456, 702, 347, 134, 354, -66, 347, 347, + 456, -568, 456, -41, 358, 154, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 460, 135, -568, 544, 91, 73, -568, 246, 82, + 545, 546, 342, 548, 84, -568, -568, 91, -568, 490, + 24, 356, -568, 347, -568, 550, -568, -568, -568, -568, + 347, -568, -568, 551, 381, 347, 347, -568, 383, -568, + 400, 98, -568, 691, 484, 443, -568, -568, 369, -568, + 372, -568, -568, 373, -568, -568, 375, -568, -568, -568, + -568, 376, -568, -568, 146, 484, 377, 380, -568, 21, + -568, 497, 347, -568, -568, 396, 481, 115, -53, 162, + 347, 347, -568, 485, 475, 114, -568, -568, -568, 478, + 684, 727, 456, 402, 329, -568, 492, 406, 727, 727, + 727, 727, 756, 756, 756, 756, 134, 134, -55, -55, + -55, -61, 409, -568, -568, 85, 595, 144, -568, -568, + -568, -568, -568, 83, 149, -568, 392, -568, 370, -568, + 405, -568, 38, -568, 530, -568, -568, -568, 600, -568, + -568, 73, 73, 542, -568, 484, -568, 455, -568, 420, + 185, -568, 622, 623, -568, 624, 625, 626, -568, -568, + 531, -568, 464, 135, -568, 146, -568, -568, 186, 484, + 484, -568, 444, -568, 187, -568, 347, 691, 347, 347, + -568, -59, 152, 449, -568, 456, 727, 329, 450, 191, + -568, -568, -568, -568, -568, 630, 342, -568, -568, 452, + 539, -568, -568, -568, 569, 572, 573, 553, 24, 650, + -568, -568, -568, 534, -568, -568, -568, 90, -568, -568, + -568, 463, 195, 467, 470, 472, -568, -568, 247, -568, + -568, -568, 203, 207, 557, 497, -65, 473, 73, 181, + -568, 347, -568, 702, 480, 212, -568, -568, -568, -568, + 38, 24, -568, -568, -568, 24, 430, 476, 347, -568, + -568, -568, 659, -568, -568, -568, -568, -568, 500, 549, + 418, -568, -568, -568, -568, 73, -568, -568, -568, -568, + 613, 484, -21, 482, -568, 347, 165, 493, 347, 225, + 347, -568, -568, 334, -568, -568, -568, 483, 47, 484, + 73, -568, -568, 73, -568, 68, 62, 241, -568, -568, + 229, -568, -568, 556, -568, -568, -568, 62, -568 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1084,109 +1085,109 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 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, 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, 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, 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, + 353, 3, 21, 19, 21, 18, 8, 9, 7, 11, + 16, 17, 13, 14, 12, 15, 10, 0, 332, 0, + 307, 114, 33, 0, 54, 61, 61, 61, 0, 0, + 0, 0, 306, 109, 0, 0, 0, 109, 109, 109, + 0, 52, 0, 334, 335, 29, 26, 28, 27, 1, + 333, 2, 0, 6, 5, 164, 123, 124, 154, 106, + 0, 174, 0, 0, 310, 0, 0, 148, 37, 0, + 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 53, 0, 0, 4, 0, 0, 142, 136, + 137, 135, 0, 139, 0, 0, 170, 308, 285, 288, + 290, 0, 0, 291, 0, 286, 287, 0, 296, 0, + 173, 175, 177, 179, 278, 279, 280, 289, 281, 282, + 283, 284, 32, 31, 0, 309, 0, 0, 118, 0, + 113, 0, 0, 0, 0, 148, 120, 108, 0, 131, + 130, 38, 41, 41, 41, 107, 104, 105, 337, 336, + 0, 290, 163, 141, 0, 154, 127, 126, 128, 138, + 134, 0, 154, 0, 0, 320, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 293, 0, 292, 295, 180, 181, 34, 0, 60, 0, + 0, 333, 0, 0, 274, 0, 0, 0, 0, 0, + 0, 0, 276, 0, 147, 183, 190, 191, 192, 185, + 187, 193, 186, 206, 194, 195, 196, 197, 189, 184, + 199, 200, 0, 354, 0, 0, 116, 0, 0, 119, + 0, 110, 111, 0, 0, 51, 148, 50, 24, 0, + 22, 145, 143, 171, 318, 170, 0, 153, 155, 160, + 170, 166, 168, 165, 0, 132, 319, 321, 0, 294, + 176, 0, 0, 57, 0, 0, 0, 0, 0, 62, + 64, 65, 333, 142, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 202, 0, 201, 0, 0, 0, 0, + 0, 203, 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, 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, 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 + 0, 0, 0, 117, 0, 0, 122, 121, 109, 0, + 0, 0, 0, 0, 0, 47, 36, 0, 20, 0, + 0, 148, 144, 0, 316, 0, 317, 182, 125, 129, + 0, 159, 158, 161, 320, 0, 0, 325, 0, 327, + 0, 331, 322, 0, 0, 0, 83, 77, 0, 79, + 89, 80, 67, 0, 74, 75, 0, 71, 72, 78, + 81, 86, 76, 68, 91, 0, 0, 0, 56, 0, + 59, 241, 0, 275, 277, 0, 0, 0, 0, 0, + 0, 0, 225, 0, 0, 0, 198, 188, 217, 218, + 0, 213, 0, 0, 0, 204, 0, 216, 215, 231, + 232, 233, 234, 235, 236, 237, 208, 207, 210, 209, + 211, 212, 0, 35, 355, 0, 0, 0, 48, 45, + 43, 49, 40, 0, 0, 23, 333, 146, 297, 299, + 0, 301, 314, 300, 150, 172, 315, 156, 0, 157, + 133, 169, 167, 0, 328, 0, 330, 0, 323, 0, + 0, 55, 0, 0, 73, 0, 0, 0, 82, 98, + 0, 97, 0, 0, 66, 90, 92, 94, 0, 0, + 0, 63, 0, 238, 0, 229, 0, 0, 0, 0, + 223, 0, 0, 0, 271, 0, 214, 0, 0, 0, + 205, 272, 115, 112, 39, 0, 0, 46, 25, 0, + 0, 349, 341, 347, 345, 348, 343, 0, 0, 0, + 313, 305, 311, 0, 140, 162, 326, 331, 329, 178, + 58, 0, 0, 0, 0, 0, 99, 96, 118, 93, + 95, 101, 0, 0, 243, 241, 0, 0, 227, 0, + 226, 0, 230, 273, 0, 0, 221, 219, 44, 42, + 314, 0, 344, 346, 342, 0, 298, 315, 0, 324, + 70, 88, 0, 84, 69, 85, 103, 100, 0, 0, + 154, 239, 255, 256, 224, 228, 222, 220, 302, 338, + 350, 0, 152, 0, 102, 0, 246, 0, 0, 0, + 0, 149, 87, 242, 247, 248, 249, 0, 0, 0, + 351, 339, 312, 151, 240, 0, 0, 0, 254, 244, + 0, 253, 251, 0, 252, 250, 340, 0, 245 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -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 + -568, -568, -568, 615, -568, 663, -568, 339, -568, 403, + -568, -568, -568, -568, -322, -79, 264, 351, 236, -568, + -568, -568, 391, -568, 297, -568, -335, -568, -568, -568, + -568, 202, -568, -453, -568, -43, -568, -568, -568, -568, + -568, -568, -142, -568, -568, 451, -210, -86, -568, 129, + -50, -38, -568, -568, -84, 408, -568, -568, -568, -130, + -568, -568, -170, -568, 338, -568, -568, -568, 77, -297, + -568, -270, 503, 506, 359, -147, -208, -568, -568, -568, + -568, -568, -568, 415, -568, -568, -568, 139, -568, -568, + -568, -567, -568, -568, -154, -568, -568, -568, -568, -568, + -568, -64, -568, -568, 584, -98, -568, -568, 588, -568, + -568, -484, 119, -568, -568, -568, -2, -568, -568, 137, + 465, -568, 363, -568, 457, -568, 171, -568, -568, -568, + 631, -568, -568, -568, -568, -352 }; /* YYDEFGOTO[NTERM-NUM]. */ 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, 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, 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 + 24, 143, 25, 26, 89, 162, 255, 344, 345, 27, + 28, 29, 84, 288, 289, 290, 394, 488, 484, 494, + 495, 496, 291, 497, 30, 93, 31, 251, 252, 32, + 33, 34, 153, 35, 155, 156, 36, 175, 176, 177, + 77, 112, 113, 180, 78, 174, 261, 351, 352, 150, + 544, 621, 116, 267, 268, 363, 469, 108, 185, 262, + 129, 130, 131, 132, 263, 264, 225, 226, 227, 228, + 229, 230, 231, 300, 232, 233, 234, 503, 600, 627, + 628, 639, 235, 236, 198, 199, 200, 237, 238, 239, + 240, 241, 134, 135, 136, 137, 138, 139, 140, 141, + 457, 458, 459, 460, 461, 51, 462, 146, 540, 541, + 542, 357, 275, 276, 277, 371, 478, 37, 38, 63, + 64, 463, 537, 631, 71, 244 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1194,194 +1195,200 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 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 + 41, 283, 224, 44, 95, 265, 213, 415, 52, 172, + 56, 303, 270, 305, 99, 100, 101, 133, 163, 164, + 450, 173, 480, 403, 284, 249, 40, 40, 178, 182, + 620, 178, 119, 120, 269, 75, 271, 273, 479, 149, + 115, 354, 560, 498, 253, 354, 87, 210, 90, 279, + 308, 308, 45, 635, 586, 39, 508, 308, 102, 570, + 422, 367, 46, 308, 636, 445, 309, 309, 635, 643, + 298, 299, 242, 309, 308, 316, 307, 454, 211, 309, + 648, 316, 400, 147, 148, 340, 340, 423, 366, 333, + 309, 158, 334, 47, 303, 118, 119, 120, 166, 167, + 336, 610, 420, 246, 421, 504, 341, 525, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 547, 254, 97, 346, 519, 417, 602, + 331, 342, 526, 368, 330, 183, 331, 133, 40, 121, + 266, 55, 406, 133, 60, 614, 212, 562, 563, 308, + 407, 408, 184, 248, 214, 118, 119, 120, 308, 57, + 369, 418, 419, 539, 98, 309, 76, 355, 410, 58, + 54, 370, 567, 306, 309, 348, 353, 124, 349, 122, + 359, 398, 178, 94, 399, 61, 343, 343, 411, 308, + 285, 286, 287, 109, 412, 123, 361, 215, 216, 217, + 59, 109, 42, 401, 579, 309, 404, 281, 214, 118, + 119, 120, 637, 269, 516, 638, 54, 456, 471, 472, + 575, 464, 308, 362, 118, 119, 120, 637, 475, 110, + 638, 308, 168, 442, 641, 642, 218, 110, 309, 122, + 507, 124, 125, 126, 48, 405, 529, 309, 476, 477, + 489, 215, 216, 217, 509, 123, 476, 477, 425, 619, + 114, 571, 43, 511, 512, 111, 272, 490, 308, 49, + 316, 133, 219, 111, 411, 426, 127, 640, 452, 522, + 510, 453, 207, 133, 309, 62, 220, 334, 50, 128, + 218, 612, 293, 122, 294, 446, 481, 308, 53, 604, + 75, 124, 125, 126, 69, 245, 514, 573, 122, 123, + 65, 353, 70, 309, 72, 491, 492, 298, 623, 493, + 327, 328, 329, 330, 123, 331, 219, 624, 625, 626, + 443, 79, 214, 118, 119, 120, 221, 222, 524, 82, + 220, 453, 358, 528, 223, 88, 207, 364, 80, 128, + 214, 118, 119, 120, 81, 124, 125, 126, 83, 566, + 91, 568, 569, 513, 186, 187, 188, 189, 190, 191, + 124, 125, 126, 92, 518, 215, 216, 217, 106, 550, + 561, 565, 334, 334, 353, 577, 96, 75, 353, 591, + 221, 222, 592, 215, 216, 217, 530, 597, 223, 103, + 334, 598, 107, 128, 334, 127, 607, 644, 645, 353, + 214, 118, 119, 120, 218, 117, 596, 122, 128, 632, + 67, 68, 334, 646, 605, 104, 334, 256, 257, 142, + 616, 144, 218, 123, 145, 122, 531, 85, 86, 149, + 152, 532, 151, 157, 154, 159, 160, 161, 533, 534, + 219, 123, 310, 301, 216, 217, 530, 165, 54, 214, + 118, 119, 120, 170, 220, 535, 171, 574, 219, -350, + 536, 630, 179, 633, 173, 202, 181, 201, 203, 124, + 125, 126, 220, 206, 207, 208, 209, 243, 247, 311, + 250, 558, 218, 258, 114, 122, 531, 124, 125, 126, + 274, 532, 282, 216, 217, 15, 295, 292, 533, 534, + 296, 123, 297, 304, 221, 222, 335, 332, 338, 339, + 347, 350, 223, 365, 374, 535, 373, 128, 302, -350, + 536, 353, 221, 222, 360, 375, 312, 395, 396, 397, + 223, 218, 220, 75, 122, 128, 413, 444, 416, 448, + 449, 424, 451, 466, 468, 473, 313, 124, 125, 126, + 123, 474, 482, 314, 315, 483, 485, -303, 486, 487, + 499, 316, 317, 500, 502, 506, 422, 302, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 505, 220, 221, 222, 308, 517, 520, 331, 523, 543, + 223, 521, 538, 545, 546, 128, 124, 125, 126, 318, + 319, 320, 321, 322, 549, 548, 323, 324, -352, 325, + 326, 327, 328, 329, 330, 1, 331, -304, 551, 552, + 553, 554, 555, 2, 578, 556, 557, 564, 581, 530, + 3, 221, 222, 572, 576, 4, 580, 582, 1, 223, + 583, 584, 585, 587, 128, 5, 2, 590, 6, 7, + 588, 593, 599, 3, 594, 613, 595, 603, 4, 611, + 8, 9, 647, 493, 606, 615, 622, 634, 5, 531, + 10, 6, 7, 11, 532, 105, 629, 74, 455, 527, + 447, 533, 534, 8, 9, 617, 501, 559, 467, 337, + 609, 402, 376, 10, 601, 12, 11, 278, 535, 13, + 280, 204, 465, 536, 409, 205, 377, 608, 589, 0, + 378, 379, 380, 381, 382, 14, 383, 470, 12, 356, + 0, 15, 13, 372, 384, 169, 0, 0, 311, 0, + 0, 0, 0, 0, 618, 0, 0, 0, 14, 0, + 0, 0, 0, 0, 15, 0, 311, 0, 0, 385, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 17, 18, 0, 386, 0, 387, + 388, 311, 0, 0, 0, 312, 0, 0, 0, 0, + 0, 0, 0, 0, 389, 0, 16, 17, 18, 390, + 515, 391, 0, 312, 0, 414, 0, 0, 0, 0, + 311, 392, 0, 315, 0, 0, 0, 0, 0, 0, + 316, 317, 0, 414, 0, 0, 0, 0, -353, 0, + 0, 315, 0, 0, 0, 0, 0, 0, 316, 317, + 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 315, 0, 318, 319, + 320, 321, 322, 316, -353, 323, 324, 0, 325, 326, + 327, 328, 329, 330, 0, 331, 318, 319, 320, 321, + 322, 0, 0, 323, 324, 315, 325, 326, 327, 328, + 329, 330, 316, 331, 0, 0, 0, 0, 0, 0, + 0, -353, -353, -353, 321, 322, 0, 0, 323, 324, + 0, 325, 326, 327, 328, 329, 330, 0, 331, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -353, -353, 0, 0, -353, -353, 0, + 325, 326, 327, 328, 329, 330, 0, 331 }; static const yytype_int16 yycheck[] = { - 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 + 2, 211, 149, 5, 54, 175, 148, 304, 10, 107, + 12, 219, 182, 221, 57, 58, 59, 81, 97, 98, + 342, 12, 374, 3, 3, 155, 3, 3, 112, 115, + 51, 115, 5, 6, 181, 58, 183, 184, 373, 83, + 78, 3, 495, 395, 113, 3, 48, 94, 50, 203, + 116, 116, 70, 6, 538, 27, 109, 116, 60, 118, + 101, 62, 80, 116, 17, 335, 132, 132, 6, 636, + 112, 218, 151, 132, 116, 136, 223, 347, 125, 132, + 647, 136, 292, 85, 86, 3, 3, 128, 55, 194, + 132, 93, 197, 111, 302, 4, 5, 6, 100, 101, + 247, 585, 310, 153, 312, 402, 24, 24, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 475, 193, 94, 256, 424, 194, 194, + 191, 49, 49, 134, 189, 55, 191, 201, 3, 48, + 178, 12, 296, 207, 19, 598, 193, 499, 500, 116, + 297, 298, 72, 197, 3, 4, 5, 6, 116, 70, + 161, 308, 309, 125, 133, 132, 37, 125, 92, 80, + 193, 172, 507, 223, 132, 194, 197, 150, 197, 88, + 266, 194, 266, 54, 197, 60, 104, 104, 112, 116, + 169, 170, 171, 9, 118, 104, 90, 46, 47, 48, + 111, 9, 3, 194, 526, 132, 186, 209, 3, 4, + 5, 6, 165, 360, 422, 168, 193, 193, 365, 366, + 517, 351, 116, 117, 4, 5, 6, 165, 130, 45, + 168, 116, 103, 331, 166, 167, 85, 45, 132, 88, + 125, 150, 151, 152, 94, 295, 456, 132, 158, 159, + 104, 46, 47, 48, 92, 104, 158, 159, 104, 611, + 76, 109, 3, 410, 411, 81, 115, 121, 116, 94, + 136, 335, 121, 81, 112, 121, 185, 629, 194, 194, + 118, 197, 197, 347, 132, 3, 135, 197, 98, 198, + 85, 588, 193, 88, 195, 338, 375, 116, 80, 118, + 58, 150, 151, 152, 0, 63, 192, 515, 88, 104, + 154, 197, 196, 132, 113, 169, 170, 112, 615, 173, + 186, 187, 188, 189, 104, 191, 121, 162, 163, 164, + 332, 3, 3, 4, 5, 6, 185, 186, 194, 94, + 135, 197, 265, 194, 193, 3, 197, 270, 195, 198, + 3, 4, 5, 6, 193, 150, 151, 152, 127, 506, + 123, 508, 509, 413, 138, 139, 140, 141, 142, 143, + 150, 151, 152, 127, 424, 46, 47, 48, 97, 194, + 194, 194, 197, 197, 197, 194, 133, 58, 197, 194, + 185, 186, 197, 46, 47, 48, 26, 194, 193, 125, + 197, 194, 124, 198, 197, 185, 194, 166, 167, 197, + 3, 4, 5, 6, 85, 3, 558, 88, 198, 194, + 17, 18, 197, 194, 571, 197, 197, 163, 164, 4, + 600, 121, 85, 104, 3, 88, 66, 46, 47, 83, + 193, 71, 93, 46, 3, 194, 194, 4, 78, 79, + 121, 104, 17, 46, 47, 48, 26, 3, 193, 3, + 4, 5, 6, 193, 135, 95, 6, 517, 121, 99, + 100, 618, 115, 620, 12, 4, 126, 193, 4, 150, + 151, 152, 135, 194, 197, 46, 131, 3, 174, 54, + 91, 493, 85, 3, 76, 88, 66, 150, 151, 152, + 119, 71, 3, 47, 48, 113, 193, 125, 78, 79, + 193, 104, 193, 191, 185, 186, 193, 98, 39, 193, + 193, 94, 193, 55, 193, 95, 125, 198, 121, 99, + 100, 197, 185, 186, 197, 93, 101, 193, 172, 172, + 193, 85, 135, 58, 88, 198, 193, 3, 194, 4, + 4, 193, 4, 3, 3, 172, 121, 150, 151, 152, + 104, 161, 193, 128, 129, 193, 193, 197, 193, 193, + 193, 136, 137, 193, 77, 94, 101, 121, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 194, 135, 185, 186, 116, 193, 104, 191, 3, 69, + 193, 192, 197, 3, 62, 198, 150, 151, 152, 174, + 175, 176, 177, 178, 194, 160, 181, 182, 0, 184, + 185, 186, 187, 188, 189, 7, 191, 197, 6, 6, + 6, 6, 6, 15, 4, 104, 172, 193, 99, 26, + 22, 185, 186, 194, 194, 27, 194, 78, 7, 193, + 78, 78, 99, 3, 198, 37, 15, 194, 40, 41, + 126, 194, 105, 22, 194, 6, 194, 194, 27, 193, + 52, 53, 116, 173, 194, 126, 194, 194, 37, 66, + 62, 40, 41, 65, 71, 70, 193, 24, 349, 453, + 339, 78, 79, 52, 53, 82, 399, 495, 360, 248, + 581, 293, 11, 62, 565, 87, 65, 201, 95, 91, + 207, 127, 353, 100, 299, 127, 25, 580, 547, -1, + 29, 30, 31, 32, 33, 107, 35, 364, 87, 264, + -1, 113, 91, 276, 43, 104, -1, -1, 54, -1, + -1, -1, -1, -1, 131, -1, -1, -1, 107, -1, + -1, -1, -1, -1, 113, -1, 54, -1, -1, 68, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 155, 156, 157, -1, 86, -1, 88, + 89, 54, -1, -1, -1, 101, -1, -1, -1, -1, + -1, -1, -1, -1, 103, -1, 155, 156, 157, 108, + 116, 110, -1, 101, -1, 121, -1, -1, -1, -1, + 54, 120, -1, 129, -1, -1, -1, -1, -1, -1, + 136, 137, -1, 121, -1, -1, -1, -1, 101, -1, + -1, 129, -1, -1, -1, -1, -1, -1, 136, 137, + -1, -1, -1, -1, 153, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 129, -1, 174, 175, + 176, 177, 178, 136, 137, 181, 182, -1, 184, 185, + 186, 187, 188, 189, -1, 191, 174, 175, 176, 177, + 178, -1, -1, 181, 182, 129, 184, 185, 186, 187, + 188, 189, 136, 191, -1, -1, -1, -1, -1, -1, + -1, 174, 175, 176, 177, 178, -1, -1, 181, 182, + -1, 184, 185, 186, 187, 188, 189, -1, 191, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 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 @@ -1390,69 +1397,69 @@ 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, 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, 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, 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, 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, + 201, 202, 203, 207, 209, 211, 212, 218, 219, 220, + 233, 235, 238, 239, 240, 242, 245, 326, 327, 27, + 3, 315, 3, 3, 315, 70, 80, 111, 94, 94, + 98, 314, 315, 80, 193, 248, 315, 70, 80, 111, + 19, 60, 3, 328, 329, 154, 208, 208, 208, 0, + 196, 333, 113, 204, 204, 58, 248, 249, 253, 3, + 195, 193, 94, 127, 221, 221, 221, 315, 3, 213, + 315, 123, 127, 234, 248, 249, 133, 94, 133, 234, + 234, 234, 315, 125, 197, 202, 97, 124, 266, 9, + 45, 81, 250, 251, 76, 250, 261, 3, 4, 5, + 6, 48, 88, 104, 150, 151, 152, 185, 198, 269, + 270, 271, 272, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 4, 210, 121, 3, 316, 315, 315, 83, + 258, 93, 193, 241, 3, 243, 244, 46, 315, 194, + 194, 4, 214, 214, 214, 3, 315, 315, 248, 329, + 193, 6, 304, 12, 254, 246, 247, 248, 253, 115, + 252, 126, 246, 55, 72, 267, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 293, 294, + 295, 193, 4, 4, 303, 307, 194, 197, 46, 131, + 94, 125, 193, 241, 3, 46, 47, 48, 85, 121, + 135, 185, 186, 193, 274, 275, 276, 277, 278, 279, + 280, 281, 283, 284, 285, 291, 292, 296, 297, 298, + 299, 300, 214, 3, 334, 63, 249, 174, 197, 258, + 91, 236, 237, 113, 193, 215, 215, 215, 3, 205, + 206, 255, 268, 273, 274, 261, 250, 262, 263, 274, + 261, 274, 115, 274, 119, 321, 322, 323, 272, 293, + 271, 315, 3, 245, 3, 169, 170, 171, 222, 223, + 224, 231, 125, 193, 195, 193, 193, 193, 112, 274, + 282, 46, 121, 275, 191, 275, 249, 274, 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, 273, 243, 39, 193, - 24, 49, 216, 257, 193, 194, 197, 94, 255, 256, - 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, 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 + 189, 191, 98, 194, 197, 193, 274, 244, 39, 193, + 3, 24, 49, 104, 216, 217, 258, 193, 194, 197, + 94, 256, 257, 197, 3, 125, 319, 320, 267, 246, + 197, 90, 117, 264, 267, 55, 55, 62, 134, 161, + 172, 324, 323, 125, 193, 93, 11, 25, 29, 30, + 31, 32, 33, 35, 43, 68, 86, 88, 89, 103, + 108, 110, 120, 153, 225, 193, 172, 172, 194, 197, + 245, 194, 254, 3, 186, 249, 293, 274, 274, 282, + 92, 112, 118, 193, 121, 268, 194, 194, 274, 274, + 275, 275, 101, 128, 193, 104, 121, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 304, 315, 3, 270, 234, 216, 4, 4, + 213, 4, 194, 197, 270, 206, 193, 309, 310, 311, + 312, 313, 315, 330, 258, 273, 3, 263, 3, 265, + 321, 274, 274, 172, 161, 130, 158, 159, 325, 225, + 334, 214, 193, 193, 227, 193, 193, 193, 226, 104, + 121, 169, 170, 173, 228, 229, 230, 232, 334, 193, + 193, 223, 77, 286, 268, 194, 94, 125, 109, 92, + 118, 274, 274, 249, 192, 116, 275, 193, 249, 268, + 104, 192, 194, 3, 194, 24, 49, 217, 194, 245, + 26, 66, 71, 78, 79, 95, 100, 331, 197, 125, + 317, 318, 319, 69, 259, 3, 62, 334, 160, 194, + 194, 6, 6, 6, 6, 6, 104, 172, 315, 230, + 232, 194, 334, 334, 193, 194, 274, 225, 274, 274, + 118, 109, 194, 275, 249, 268, 194, 194, 4, 213, + 194, 99, 78, 78, 78, 99, 310, 3, 126, 325, + 194, 194, 197, 194, 194, 194, 241, 194, 194, 105, + 287, 286, 194, 194, 118, 274, 194, 194, 318, 311, + 310, 193, 268, 6, 232, 126, 261, 82, 131, 334, + 51, 260, 194, 268, 162, 163, 164, 288, 289, 193, + 274, 332, 194, 274, 194, 6, 17, 165, 168, 290, + 334, 166, 167, 290, 166, 167, 194, 116, 290 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1462,38 +1469,38 @@ static const yytype_int16 yyr1[] = 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207, 207, 208, 208, 209, 210, 211, 211, 212, 212, 213, 214, 215, - 215, 215, 216, 216, 216, 216, 217, 217, 218, 218, - 218, 219, 219, 219, 219, 219, 220, 220, 221, 221, - 222, 222, 223, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, - 224, 225, 225, 226, 226, 226, 227, 227, 228, 228, - 228, 228, 229, 229, 229, 229, 230, 230, 230, 231, - 232, 232, 232, 232, 233, 233, 234, 235, 236, 237, - 238, 239, 239, 240, 240, 241, 242, 242, 243, 244, - 244, 244, 245, 245, 246, 246, 247, 247, 248, 248, - 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, 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, 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 + 215, 215, 216, 216, 216, 216, 216, 216, 217, 217, + 218, 218, 219, 219, 219, 220, 220, 220, 220, 220, + 221, 221, 222, 222, 223, 223, 224, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 226, 226, 227, 227, 227, + 228, 228, 229, 229, 229, 229, 230, 230, 230, 230, + 231, 231, 231, 232, 233, 233, 233, 233, 234, 234, + 235, 236, 237, 238, 239, 240, 240, 241, 241, 242, + 243, 243, 244, 245, 245, 245, 246, 246, 247, 247, + 248, 248, 249, 249, 250, 251, 251, 251, 252, 252, + 253, 254, 254, 255, 256, 256, 257, 258, 258, 259, + 259, 260, 260, 261, 261, 262, 262, 263, 264, 264, + 264, 265, 265, 266, 266, 267, 267, 267, 267, 267, + 267, 268, 268, 269, 269, 270, 270, 271, 271, 272, + 272, 272, 273, 274, 274, 274, 274, 274, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 276, + 276, 277, 277, 277, 277, 277, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 279, 279, 280, + 280, 280, 280, 281, 281, 281, 281, 282, 282, 283, + 283, 284, 284, 284, 284, 284, 284, 284, 285, 285, + 286, 286, 287, 287, 288, 288, 288, 289, 289, 289, + 290, 290, 290, 290, 290, 291, 292, 293, 293, 293, + 293, 293, 293, 294, 294, 294, 294, 294, 294, 295, + 295, 296, 297, 298, 299, 299, 299, 299, 300, 300, + 300, 300, 300, 300, 300, 301, 302, 302, 303, 303, + 304, 305, 306, 307, 307, 307, 308, 309, 309, 310, + 310, 311, 311, 312, 312, 313, 314, 315, 315, 316, + 316, 317, 317, 318, 318, 319, 319, 320, 320, 321, + 321, 322, 322, 323, 323, 324, 324, 324, 324, 325, + 325, 325, 326, 326, 327, 328, 328, 329, 330, 330, + 330, 331, 331, 331, 331, 331, 331, 331, 331, 331, + 331, 332, 333, 333, 334, 334 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1503,38 +1510,38 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 0, 1, 3, 1, 4, 2, 2, 2, 1, 0, 4, 1, 2, 5, 7, 6, 1, 1, 4, - 3, 0, 4, 2, 4, 2, 5, 5, 2, 3, - 2, 8, 7, 6, 9, 7, 3, 0, 1, 3, - 1, 1, 3, 1, 1, 4, 4, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 4, 3, 0, 5, 3, 0, 1, 0, 1, 2, - 1, 2, 2, 1, 1, 2, 5, 4, 6, 3, - 4, 4, 3, 4, 2, 0, 5, 1, 4, 4, - 2, 8, 5, 3, 0, 5, 1, 3, 3, 2, - 2, 6, 1, 1, 1, 3, 3, 3, 4, 6, - 2, 1, 1, 1, 1, 0, 7, 1, 0, 1, - 1, 0, 2, 2, 0, 4, 0, 2, 0, 3, - 0, 1, 3, 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 + 3, 0, 4, 2, 4, 2, 3, 1, 2, 2, + 5, 5, 2, 3, 2, 8, 7, 6, 9, 7, + 3, 0, 1, 3, 1, 1, 3, 1, 1, 4, + 4, 1, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 4, 3, 0, 5, 3, 0, + 1, 0, 1, 2, 1, 2, 2, 1, 1, 2, + 5, 4, 6, 3, 4, 4, 3, 4, 2, 0, + 5, 1, 4, 4, 2, 8, 5, 3, 0, 5, + 1, 3, 3, 2, 2, 6, 1, 1, 1, 3, + 3, 3, 4, 6, 2, 1, 1, 1, 1, 0, + 7, 1, 0, 1, 1, 0, 2, 2, 0, 4, + 0, 2, 0, 3, 0, 1, 3, 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 }; @@ -2098,31 +2105,31 @@ yydestruct (const char *yymsg, switch (yykind) { case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2104 "bison_parser.cpp" +#line 2111 "bison_parser.cpp" break; case YYSYMBOL_STRING: /* STRING */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2110 "bison_parser.cpp" +#line 2117 "bison_parser.cpp" break; case YYSYMBOL_FLOATVAL: /* FLOATVAL */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2116 "bison_parser.cpp" +#line 2123 "bison_parser.cpp" break; case YYSYMBOL_INTVAL: /* INTVAL */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2122 "bison_parser.cpp" +#line 2129 "bison_parser.cpp" break; case YYSYMBOL_statement_list: /* statement_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).stmt_vec)) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { @@ -2131,23 +2138,23 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).stmt_vec)); } -#line 2135 "bison_parser.cpp" +#line 2142 "bison_parser.cpp" break; case YYSYMBOL_statement: /* statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).statement)); } -#line 2141 "bison_parser.cpp" +#line 2148 "bison_parser.cpp" break; case YYSYMBOL_preparable_statement: /* preparable_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).statement)); } -#line 2147 "bison_parser.cpp" +#line 2154 "bison_parser.cpp" break; case YYSYMBOL_opt_hints: /* opt_hints */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2156,11 +2163,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2160 "bison_parser.cpp" +#line 2167 "bison_parser.cpp" break; case YYSYMBOL_hint_list: /* hint_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2169,95 +2176,104 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2173 "bison_parser.cpp" +#line 2180 "bison_parser.cpp" break; case YYSYMBOL_hint: /* hint */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2179 "bison_parser.cpp" +#line 2186 "bison_parser.cpp" break; case YYSYMBOL_transaction_statement: /* transaction_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).transaction_stmt)); } -#line 2185 "bison_parser.cpp" +#line 2192 "bison_parser.cpp" break; case YYSYMBOL_prepare_statement: /* prepare_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).prep_stmt)); } -#line 2191 "bison_parser.cpp" +#line 2198 "bison_parser.cpp" break; case YYSYMBOL_prepare_target_query: /* prepare_target_query */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2197 "bison_parser.cpp" +#line 2204 "bison_parser.cpp" break; case YYSYMBOL_execute_statement: /* execute_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).exec_stmt)); } -#line 2203 "bison_parser.cpp" +#line 2210 "bison_parser.cpp" break; case YYSYMBOL_import_statement: /* import_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).import_stmt)); } -#line 2209 "bison_parser.cpp" +#line 2216 "bison_parser.cpp" break; case YYSYMBOL_file_type: /* file_type */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2215 "bison_parser.cpp" +#line 2222 "bison_parser.cpp" break; case YYSYMBOL_file_path: /* file_path */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2221 "bison_parser.cpp" +#line 2228 "bison_parser.cpp" break; case YYSYMBOL_opt_import_export_options: /* opt_import_export_options */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).import_export_option_t)); } -#line 2227 "bison_parser.cpp" +#line 2234 "bison_parser.cpp" break; case YYSYMBOL_import_export_options: /* import_export_options */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).import_export_option_t)); } -#line 2233 "bison_parser.cpp" +#line 2240 "bison_parser.cpp" + break; + + case YYSYMBOL_csv_option: /* csv_option */ +#line 203 "bison_parser.y" + { + free(((*yyvaluep).csv_option_t)->second); + delete (((*yyvaluep).csv_option_t)); +} +#line 2249 "bison_parser.cpp" break; case YYSYMBOL_export_statement: /* export_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).export_stmt)); } -#line 2239 "bison_parser.cpp" +#line 2255 "bison_parser.cpp" break; case YYSYMBOL_show_statement: /* show_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).show_stmt)); } -#line 2245 "bison_parser.cpp" +#line 2261 "bison_parser.cpp" break; case YYSYMBOL_create_statement: /* create_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).create_stmt)); } -#line 2251 "bison_parser.cpp" +#line 2267 "bison_parser.cpp" break; case YYSYMBOL_opt_not_exists: /* opt_not_exists */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2257 "bison_parser.cpp" +#line 2273 "bison_parser.cpp" break; case YYSYMBOL_table_elem_commalist: /* table_elem_commalist */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).table_element_vec)) { for (auto ptr : *(((*yyvaluep).table_element_vec))) { @@ -2266,119 +2282,119 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).table_element_vec)); } -#line 2270 "bison_parser.cpp" +#line 2286 "bison_parser.cpp" break; case YYSYMBOL_table_elem: /* table_elem */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table_element_t)); } -#line 2276 "bison_parser.cpp" +#line 2292 "bison_parser.cpp" break; case YYSYMBOL_column_def: /* column_def */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).column_t)); } -#line 2282 "bison_parser.cpp" +#line 2298 "bison_parser.cpp" break; case YYSYMBOL_column_type: /* column_type */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2288 "bison_parser.cpp" +#line 2304 "bison_parser.cpp" break; case YYSYMBOL_opt_time_precision: /* opt_time_precision */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2294 "bison_parser.cpp" +#line 2310 "bison_parser.cpp" break; case YYSYMBOL_opt_decimal_specification: /* opt_decimal_specification */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).ival_pair)); } -#line 2300 "bison_parser.cpp" +#line 2316 "bison_parser.cpp" break; case YYSYMBOL_opt_column_constraints: /* opt_column_constraints */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).column_constraints_t)); } -#line 2306 "bison_parser.cpp" +#line 2322 "bison_parser.cpp" break; case YYSYMBOL_column_constraints: /* column_constraints */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).column_constraints_t)); } -#line 2312 "bison_parser.cpp" +#line 2328 "bison_parser.cpp" break; case YYSYMBOL_column_constraint: /* column_constraint */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2318 "bison_parser.cpp" +#line 2334 "bison_parser.cpp" break; case YYSYMBOL_table_constraint: /* table_constraint */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table_constraint_t)); } -#line 2324 "bison_parser.cpp" +#line 2340 "bison_parser.cpp" break; case YYSYMBOL_references_spec: /* references_spec */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).references_spec_t)); } -#line 2330 "bison_parser.cpp" +#line 2346 "bison_parser.cpp" break; case YYSYMBOL_drop_statement: /* drop_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).drop_stmt)); } -#line 2336 "bison_parser.cpp" +#line 2352 "bison_parser.cpp" break; case YYSYMBOL_opt_exists: /* opt_exists */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2342 "bison_parser.cpp" +#line 2358 "bison_parser.cpp" break; case YYSYMBOL_alter_statement: /* alter_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).alter_stmt)); } -#line 2348 "bison_parser.cpp" +#line 2364 "bison_parser.cpp" break; case YYSYMBOL_alter_action: /* alter_action */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).alter_action_t)); } -#line 2354 "bison_parser.cpp" +#line 2370 "bison_parser.cpp" break; case YYSYMBOL_drop_action: /* drop_action */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).drop_action_t)); } -#line 2360 "bison_parser.cpp" +#line 2376 "bison_parser.cpp" break; case YYSYMBOL_delete_statement: /* delete_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).delete_stmt)); } -#line 2366 "bison_parser.cpp" +#line 2382 "bison_parser.cpp" break; case YYSYMBOL_truncate_statement: /* truncate_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).delete_stmt)); } -#line 2372 "bison_parser.cpp" +#line 2388 "bison_parser.cpp" break; case YYSYMBOL_insert_statement: /* insert_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).insert_stmt)); } -#line 2378 "bison_parser.cpp" +#line 2394 "bison_parser.cpp" break; case YYSYMBOL_opt_column_list: /* opt_column_list */ -#line 185 "bison_parser.y" +#line 186 "bison_parser.y" { if (((*yyvaluep).str_vec)) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2387,17 +2403,17 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).str_vec)); } -#line 2391 "bison_parser.cpp" +#line 2407 "bison_parser.cpp" break; case YYSYMBOL_update_statement: /* update_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).update_stmt)); } -#line 2397 "bison_parser.cpp" +#line 2413 "bison_parser.cpp" break; case YYSYMBOL_update_clause_commalist: /* update_clause_commalist */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).update_vec)) { for (auto ptr : *(((*yyvaluep).update_vec))) { @@ -2406,77 +2422,77 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).update_vec)); } -#line 2410 "bison_parser.cpp" +#line 2426 "bison_parser.cpp" break; case YYSYMBOL_update_clause: /* update_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).update_t)); } -#line 2416 "bison_parser.cpp" +#line 2432 "bison_parser.cpp" break; case YYSYMBOL_select_statement: /* select_statement */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2422 "bison_parser.cpp" +#line 2438 "bison_parser.cpp" break; case YYSYMBOL_select_within_set_operation: /* select_within_set_operation */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2428 "bison_parser.cpp" +#line 2444 "bison_parser.cpp" break; case YYSYMBOL_select_within_set_operation_no_parentheses: /* select_within_set_operation_no_parentheses */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2434 "bison_parser.cpp" +#line 2450 "bison_parser.cpp" break; case YYSYMBOL_select_with_paren: /* select_with_paren */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2440 "bison_parser.cpp" +#line 2456 "bison_parser.cpp" break; case YYSYMBOL_select_no_paren: /* select_no_paren */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2446 "bison_parser.cpp" +#line 2462 "bison_parser.cpp" break; case YYSYMBOL_set_operator: /* set_operator */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).set_operator_t)); } -#line 2452 "bison_parser.cpp" +#line 2468 "bison_parser.cpp" break; case YYSYMBOL_set_type: /* set_type */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).set_operator_t)); } -#line 2458 "bison_parser.cpp" +#line 2474 "bison_parser.cpp" break; case YYSYMBOL_opt_all: /* opt_all */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2464 "bison_parser.cpp" +#line 2480 "bison_parser.cpp" break; case YYSYMBOL_select_clause: /* select_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).select_stmt)); } -#line 2470 "bison_parser.cpp" +#line 2486 "bison_parser.cpp" break; case YYSYMBOL_opt_distinct: /* opt_distinct */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2476 "bison_parser.cpp" +#line 2492 "bison_parser.cpp" break; case YYSYMBOL_select_list: /* select_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2485,41 +2501,41 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2489 "bison_parser.cpp" +#line 2505 "bison_parser.cpp" break; case YYSYMBOL_opt_from_clause: /* opt_from_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2495 "bison_parser.cpp" +#line 2511 "bison_parser.cpp" break; case YYSYMBOL_from_clause: /* from_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2501 "bison_parser.cpp" +#line 2517 "bison_parser.cpp" break; case YYSYMBOL_opt_where: /* opt_where */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2507 "bison_parser.cpp" +#line 2523 "bison_parser.cpp" break; case YYSYMBOL_opt_group: /* opt_group */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).group_t)); } -#line 2513 "bison_parser.cpp" +#line 2529 "bison_parser.cpp" break; case YYSYMBOL_opt_having: /* opt_having */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2519 "bison_parser.cpp" +#line 2535 "bison_parser.cpp" break; case YYSYMBOL_opt_order: /* opt_order */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).order_vec)) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -2528,11 +2544,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).order_vec)); } -#line 2532 "bison_parser.cpp" +#line 2548 "bison_parser.cpp" break; case YYSYMBOL_order_list: /* order_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).order_vec)) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -2541,41 +2557,41 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).order_vec)); } -#line 2545 "bison_parser.cpp" +#line 2561 "bison_parser.cpp" break; case YYSYMBOL_order_desc: /* order_desc */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).order)); } -#line 2551 "bison_parser.cpp" +#line 2567 "bison_parser.cpp" break; case YYSYMBOL_opt_order_type: /* opt_order_type */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2557 "bison_parser.cpp" +#line 2573 "bison_parser.cpp" break; case YYSYMBOL_opt_null_ordering: /* opt_null_ordering */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2563 "bison_parser.cpp" +#line 2579 "bison_parser.cpp" break; case YYSYMBOL_opt_top: /* opt_top */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).limit)); } -#line 2569 "bison_parser.cpp" +#line 2585 "bison_parser.cpp" break; case YYSYMBOL_opt_limit: /* opt_limit */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).limit)); } -#line 2575 "bison_parser.cpp" +#line 2591 "bison_parser.cpp" break; case YYSYMBOL_expr_list: /* expr_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2584,11 +2600,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2588 "bison_parser.cpp" +#line 2604 "bison_parser.cpp" break; case YYSYMBOL_opt_extended_literal_list: /* opt_extended_literal_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2597,11 +2613,11 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2601 "bison_parser.cpp" +#line 2617 "bison_parser.cpp" break; case YYSYMBOL_extended_literal_list: /* extended_literal_list */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2610,107 +2626,107 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2614 "bison_parser.cpp" +#line 2630 "bison_parser.cpp" break; case YYSYMBOL_casted_extended_literal: /* casted_extended_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2620 "bison_parser.cpp" +#line 2636 "bison_parser.cpp" break; case YYSYMBOL_extended_literal: /* extended_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2626 "bison_parser.cpp" +#line 2642 "bison_parser.cpp" break; case YYSYMBOL_expr_alias: /* expr_alias */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2632 "bison_parser.cpp" +#line 2648 "bison_parser.cpp" break; case YYSYMBOL_expr: /* expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2638 "bison_parser.cpp" +#line 2654 "bison_parser.cpp" break; case YYSYMBOL_operand: /* operand */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2644 "bison_parser.cpp" +#line 2660 "bison_parser.cpp" break; case YYSYMBOL_scalar_expr: /* scalar_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2650 "bison_parser.cpp" +#line 2666 "bison_parser.cpp" break; case YYSYMBOL_unary_expr: /* unary_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2656 "bison_parser.cpp" +#line 2672 "bison_parser.cpp" break; case YYSYMBOL_binary_expr: /* binary_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2662 "bison_parser.cpp" +#line 2678 "bison_parser.cpp" break; case YYSYMBOL_logic_expr: /* logic_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2668 "bison_parser.cpp" +#line 2684 "bison_parser.cpp" break; case YYSYMBOL_in_expr: /* in_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2674 "bison_parser.cpp" +#line 2690 "bison_parser.cpp" break; case YYSYMBOL_case_expr: /* case_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2680 "bison_parser.cpp" +#line 2696 "bison_parser.cpp" break; case YYSYMBOL_case_list: /* case_list */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2686 "bison_parser.cpp" +#line 2702 "bison_parser.cpp" break; case YYSYMBOL_exists_expr: /* exists_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2692 "bison_parser.cpp" +#line 2708 "bison_parser.cpp" break; case YYSYMBOL_comp_expr: /* comp_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2698 "bison_parser.cpp" +#line 2714 "bison_parser.cpp" break; case YYSYMBOL_function_expr: /* function_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2704 "bison_parser.cpp" +#line 2720 "bison_parser.cpp" break; case YYSYMBOL_opt_window: /* opt_window */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).window_description)); } -#line 2710 "bison_parser.cpp" +#line 2726 "bison_parser.cpp" break; case YYSYMBOL_opt_partition: /* opt_partition */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).expr_vec)) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -2719,155 +2735,155 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).expr_vec)); } -#line 2723 "bison_parser.cpp" +#line 2739 "bison_parser.cpp" break; case YYSYMBOL_opt_frame_clause: /* opt_frame_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).frame_description)); } -#line 2729 "bison_parser.cpp" +#line 2745 "bison_parser.cpp" break; case YYSYMBOL_frame_type: /* frame_type */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2735 "bison_parser.cpp" +#line 2751 "bison_parser.cpp" break; case YYSYMBOL_frame_bound: /* frame_bound */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).frame_bound)); } -#line 2741 "bison_parser.cpp" +#line 2757 "bison_parser.cpp" break; case YYSYMBOL_extract_expr: /* extract_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2747 "bison_parser.cpp" +#line 2763 "bison_parser.cpp" break; case YYSYMBOL_cast_expr: /* cast_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2753 "bison_parser.cpp" +#line 2769 "bison_parser.cpp" break; case YYSYMBOL_datetime_field: /* datetime_field */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2759 "bison_parser.cpp" +#line 2775 "bison_parser.cpp" break; case YYSYMBOL_datetime_field_plural: /* datetime_field_plural */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2765 "bison_parser.cpp" +#line 2781 "bison_parser.cpp" break; case YYSYMBOL_duration_field: /* duration_field */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2771 "bison_parser.cpp" +#line 2787 "bison_parser.cpp" break; case YYSYMBOL_array_expr: /* array_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2777 "bison_parser.cpp" +#line 2793 "bison_parser.cpp" break; case YYSYMBOL_array_index: /* array_index */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2783 "bison_parser.cpp" +#line 2799 "bison_parser.cpp" break; case YYSYMBOL_between_expr: /* between_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2789 "bison_parser.cpp" +#line 2805 "bison_parser.cpp" break; case YYSYMBOL_column_name: /* column_name */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2795 "bison_parser.cpp" +#line 2811 "bison_parser.cpp" break; case YYSYMBOL_literal: /* literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2801 "bison_parser.cpp" +#line 2817 "bison_parser.cpp" break; case YYSYMBOL_string_literal: /* string_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2807 "bison_parser.cpp" +#line 2823 "bison_parser.cpp" break; case YYSYMBOL_bool_literal: /* bool_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2813 "bison_parser.cpp" +#line 2829 "bison_parser.cpp" break; case YYSYMBOL_num_literal: /* num_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2819 "bison_parser.cpp" +#line 2835 "bison_parser.cpp" break; case YYSYMBOL_int_literal: /* int_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2825 "bison_parser.cpp" +#line 2841 "bison_parser.cpp" break; case YYSYMBOL_null_literal: /* null_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2831 "bison_parser.cpp" +#line 2847 "bison_parser.cpp" break; case YYSYMBOL_date_literal: /* date_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2837 "bison_parser.cpp" +#line 2853 "bison_parser.cpp" break; case YYSYMBOL_interval_literal: /* interval_literal */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2843 "bison_parser.cpp" +#line 2859 "bison_parser.cpp" break; case YYSYMBOL_param_expr: /* param_expr */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 2849 "bison_parser.cpp" +#line 2865 "bison_parser.cpp" break; case YYSYMBOL_table_ref: /* table_ref */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2855 "bison_parser.cpp" +#line 2871 "bison_parser.cpp" break; case YYSYMBOL_table_ref_atomic: /* table_ref_atomic */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2861 "bison_parser.cpp" +#line 2877 "bison_parser.cpp" break; case YYSYMBOL_nonjoin_table_ref_atomic: /* nonjoin_table_ref_atomic */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2867 "bison_parser.cpp" +#line 2883 "bison_parser.cpp" break; case YYSYMBOL_table_ref_commalist: /* table_ref_commalist */ -#line 194 "bison_parser.y" +#line 195 "bison_parser.y" { if (((*yyvaluep).table_vec)) { for (auto ptr : *(((*yyvaluep).table_vec))) { @@ -2876,134 +2892,134 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).table_vec)); } -#line 2880 "bison_parser.cpp" +#line 2896 "bison_parser.cpp" break; case YYSYMBOL_table_ref_name: /* table_ref_name */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2886 "bison_parser.cpp" +#line 2902 "bison_parser.cpp" break; case YYSYMBOL_table_ref_name_no_alias: /* table_ref_name_no_alias */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2892 "bison_parser.cpp" +#line 2908 "bison_parser.cpp" break; case YYSYMBOL_table_name: /* table_name */ -#line 181 "bison_parser.y" +#line 182 "bison_parser.y" { free(((*yyvaluep).table_name).name); free(((*yyvaluep).table_name).schema); } -#line 2901 "bison_parser.cpp" +#line 2917 "bison_parser.cpp" break; case YYSYMBOL_opt_index_name: /* opt_index_name */ -#line 193 "bison_parser.y" +#line 194 "bison_parser.y" { free(((*yyvaluep).sval)); } -#line 2907 "bison_parser.cpp" +#line 2923 "bison_parser.cpp" break; case YYSYMBOL_table_alias: /* table_alias */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2913 "bison_parser.cpp" +#line 2929 "bison_parser.cpp" break; case YYSYMBOL_opt_table_alias: /* opt_table_alias */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2919 "bison_parser.cpp" +#line 2935 "bison_parser.cpp" break; case YYSYMBOL_alias: /* alias */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2925 "bison_parser.cpp" +#line 2941 "bison_parser.cpp" break; case YYSYMBOL_opt_alias: /* opt_alias */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).alias_t)); } -#line 2931 "bison_parser.cpp" +#line 2947 "bison_parser.cpp" break; case YYSYMBOL_opt_locking_clause: /* opt_locking_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).locking_clause_vec)); } -#line 2937 "bison_parser.cpp" +#line 2953 "bison_parser.cpp" break; case YYSYMBOL_opt_locking_clause_list: /* opt_locking_clause_list */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).locking_clause_vec)); } -#line 2943 "bison_parser.cpp" +#line 2959 "bison_parser.cpp" break; case YYSYMBOL_locking_clause: /* locking_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).locking_t)); } -#line 2949 "bison_parser.cpp" +#line 2965 "bison_parser.cpp" break; case YYSYMBOL_row_lock_mode: /* row_lock_mode */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2955 "bison_parser.cpp" +#line 2971 "bison_parser.cpp" break; case YYSYMBOL_opt_row_lock_policy: /* opt_row_lock_policy */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2961 "bison_parser.cpp" +#line 2977 "bison_parser.cpp" break; case YYSYMBOL_opt_with_clause: /* opt_with_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2967 "bison_parser.cpp" +#line 2983 "bison_parser.cpp" break; case YYSYMBOL_with_clause: /* with_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2973 "bison_parser.cpp" +#line 2989 "bison_parser.cpp" break; case YYSYMBOL_with_description_list: /* with_description_list */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).with_description_vec)); } -#line 2979 "bison_parser.cpp" +#line 2995 "bison_parser.cpp" break; case YYSYMBOL_with_description: /* with_description */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).with_description_t)); } -#line 2985 "bison_parser.cpp" +#line 3001 "bison_parser.cpp" break; case YYSYMBOL_join_clause: /* join_clause */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).table)); } -#line 2991 "bison_parser.cpp" +#line 3007 "bison_parser.cpp" break; case YYSYMBOL_opt_join_type: /* opt_join_type */ -#line 180 "bison_parser.y" +#line 181 "bison_parser.y" { } -#line 2997 "bison_parser.cpp" +#line 3013 "bison_parser.cpp" break; case YYSYMBOL_join_condition: /* join_condition */ -#line 202 "bison_parser.y" +#line 207 "bison_parser.y" { delete (((*yyvaluep).expr)); } -#line 3003 "bison_parser.cpp" +#line 3019 "bison_parser.cpp" break; case YYSYMBOL_ident_commalist: /* ident_commalist */ -#line 185 "bison_parser.y" +#line 186 "bison_parser.y" { if (((*yyvaluep).str_vec)) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -3012,7 +3028,7 @@ yydestruct (const char *yymsg, } delete (((*yyvaluep).str_vec)); } -#line 3016 "bison_parser.cpp" +#line 3032 "bison_parser.cpp" break; default: @@ -3120,7 +3136,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.string_length = 0; } -#line 3124 "bison_parser.cpp" +#line 3140 "bison_parser.cpp" yylsp[0] = yylloc; goto yysetstate; @@ -3331,7 +3347,7 @@ YYLTYPE yylloc = yyloc_default; switch (yyn) { case 2: /* input: statement_list opt_semicolon */ -#line 337 "bison_parser.y" +#line 343 "bison_parser.y" { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. @@ -3349,236 +3365,236 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].stmt_vec); } -#line 3353 "bison_parser.cpp" +#line 3369 "bison_parser.cpp" break; case 3: /* statement_list: statement */ -#line 356 "bison_parser.y" +#line 362 "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 3364 "bison_parser.cpp" +#line 3380 "bison_parser.cpp" break; case 4: /* statement_list: statement_list ';' statement */ -#line 362 "bison_parser.y" +#line 368 "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 3375 "bison_parser.cpp" +#line 3391 "bison_parser.cpp" break; case 5: /* statement: prepare_statement opt_hints */ -#line 369 "bison_parser.y" +#line 375 "bison_parser.y" { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 3384 "bison_parser.cpp" +#line 3400 "bison_parser.cpp" break; case 6: /* statement: preparable_statement opt_hints */ -#line 373 "bison_parser.y" +#line 379 "bison_parser.y" { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 3393 "bison_parser.cpp" +#line 3409 "bison_parser.cpp" break; case 7: /* statement: show_statement */ -#line 377 "bison_parser.y" +#line 383 "bison_parser.y" { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 3399 "bison_parser.cpp" +#line 3415 "bison_parser.cpp" break; case 8: /* statement: import_statement */ -#line 378 "bison_parser.y" +#line 384 "bison_parser.y" { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 3405 "bison_parser.cpp" +#line 3421 "bison_parser.cpp" break; case 9: /* statement: export_statement */ -#line 379 "bison_parser.y" +#line 385 "bison_parser.y" { (yyval.statement) = (yyvsp[0].export_stmt); } -#line 3411 "bison_parser.cpp" +#line 3427 "bison_parser.cpp" break; case 10: /* preparable_statement: select_statement */ -#line 381 "bison_parser.y" +#line 387 "bison_parser.y" { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 3417 "bison_parser.cpp" +#line 3433 "bison_parser.cpp" break; case 11: /* preparable_statement: create_statement */ -#line 382 "bison_parser.y" +#line 388 "bison_parser.y" { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 3423 "bison_parser.cpp" +#line 3439 "bison_parser.cpp" break; case 12: /* preparable_statement: insert_statement */ -#line 383 "bison_parser.y" +#line 389 "bison_parser.y" { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 3429 "bison_parser.cpp" +#line 3445 "bison_parser.cpp" break; case 13: /* preparable_statement: delete_statement */ -#line 384 "bison_parser.y" +#line 390 "bison_parser.y" { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 3435 "bison_parser.cpp" +#line 3451 "bison_parser.cpp" break; case 14: /* preparable_statement: truncate_statement */ -#line 385 "bison_parser.y" +#line 391 "bison_parser.y" { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 3441 "bison_parser.cpp" +#line 3457 "bison_parser.cpp" break; case 15: /* preparable_statement: update_statement */ -#line 386 "bison_parser.y" +#line 392 "bison_parser.y" { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 3447 "bison_parser.cpp" +#line 3463 "bison_parser.cpp" break; case 16: /* preparable_statement: drop_statement */ -#line 387 "bison_parser.y" +#line 393 "bison_parser.y" { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 3453 "bison_parser.cpp" +#line 3469 "bison_parser.cpp" break; case 17: /* preparable_statement: alter_statement */ -#line 388 "bison_parser.y" +#line 394 "bison_parser.y" { (yyval.statement) = (yyvsp[0].alter_stmt); } -#line 3459 "bison_parser.cpp" +#line 3475 "bison_parser.cpp" break; case 18: /* preparable_statement: execute_statement */ -#line 389 "bison_parser.y" +#line 395 "bison_parser.y" { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 3465 "bison_parser.cpp" +#line 3481 "bison_parser.cpp" break; case 19: /* preparable_statement: transaction_statement */ -#line 390 "bison_parser.y" +#line 396 "bison_parser.y" { (yyval.statement) = (yyvsp[0].transaction_stmt); } -#line 3471 "bison_parser.cpp" +#line 3487 "bison_parser.cpp" break; case 20: /* opt_hints: WITH HINT '(' hint_list ')' */ -#line 396 "bison_parser.y" +#line 402 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 3477 "bison_parser.cpp" +#line 3493 "bison_parser.cpp" break; case 21: /* opt_hints: %empty */ -#line 397 "bison_parser.y" +#line 403 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 3483 "bison_parser.cpp" +#line 3499 "bison_parser.cpp" break; case 22: /* hint_list: hint */ -#line 399 "bison_parser.y" +#line 405 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3492 "bison_parser.cpp" +#line 3508 "bison_parser.cpp" break; case 23: /* hint_list: hint_list ',' hint */ -#line 403 "bison_parser.y" +#line 409 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3501 "bison_parser.cpp" +#line 3517 "bison_parser.cpp" break; case 24: /* hint: IDENTIFIER */ -#line 408 "bison_parser.y" +#line 414 "bison_parser.y" { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 3510 "bison_parser.cpp" +#line 3526 "bison_parser.cpp" break; case 25: /* hint: IDENTIFIER '(' extended_literal_list ')' */ -#line 412 "bison_parser.y" +#line 418 "bison_parser.y" { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 3520 "bison_parser.cpp" +#line 3536 "bison_parser.cpp" break; case 26: /* transaction_statement: BEGIN opt_transaction_keyword */ -#line 422 "bison_parser.y" +#line 428 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kBeginTransaction); } -#line 3526 "bison_parser.cpp" +#line 3542 "bison_parser.cpp" break; case 27: /* transaction_statement: ROLLBACK opt_transaction_keyword */ -#line 423 "bison_parser.y" +#line 429 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kRollbackTransaction); } -#line 3532 "bison_parser.cpp" +#line 3548 "bison_parser.cpp" break; case 28: /* transaction_statement: COMMIT opt_transaction_keyword */ -#line 424 "bison_parser.y" +#line 430 "bison_parser.y" { (yyval.transaction_stmt) = new TransactionStatement(kCommitTransaction); } -#line 3538 "bison_parser.cpp" +#line 3554 "bison_parser.cpp" break; case 31: /* prepare_statement: PREPARE IDENTIFIER FROM prepare_target_query */ -#line 432 "bison_parser.y" +#line 438 "bison_parser.y" { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 3548 "bison_parser.cpp" +#line 3564 "bison_parser.cpp" break; case 33: /* execute_statement: EXECUTE IDENTIFIER */ -#line 440 "bison_parser.y" +#line 446 "bison_parser.y" { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 3557 "bison_parser.cpp" +#line 3573 "bison_parser.cpp" break; case 34: /* execute_statement: EXECUTE IDENTIFIER '(' opt_extended_literal_list ')' */ -#line 444 "bison_parser.y" +#line 450 "bison_parser.y" { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 3567 "bison_parser.cpp" +#line 3583 "bison_parser.cpp" break; case 35: /* import_statement: IMPORT FROM file_type FILE file_path INTO table_name */ -#line 456 "bison_parser.y" +#line 462 "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 3578 "bison_parser.cpp" +#line 3594 "bison_parser.cpp" break; case 36: /* import_statement: COPY table_name FROM file_path opt_import_export_options opt_where */ -#line 462 "bison_parser.y" +#line 468 "bison_parser.y" { (yyval.import_stmt) = new ImportStatement((yyvsp[-1].import_export_option_t)->format); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); @@ -3589,13 +3605,17 @@ YYLTYPE yylloc = yyloc_default; (yyval.import_stmt)->encoding = (yyvsp[-1].import_export_option_t)->encoding; (yyvsp[-1].import_export_option_t)->encoding = nullptr; } + if ((yyvsp[-1].import_export_option_t)->csv_options) { + (yyval.import_stmt)->csv_options = (yyvsp[-1].import_export_option_t)->csv_options; + (yyvsp[-1].import_export_option_t)->csv_options = nullptr; + } delete (yyvsp[-1].import_export_option_t); } -#line 3595 "bison_parser.cpp" +#line 3615 "bison_parser.cpp" break; case 37: /* file_type: IDENTIFIER */ -#line 475 "bison_parser.y" +#line 485 "bison_parser.y" { if (strcasecmp((yyvsp[0].sval), "csv") == 0) { (yyval.import_type_t) = kImportCSV; @@ -3610,58 +3630,63 @@ YYLTYPE yylloc = yyloc_default; } free((yyvsp[0].sval)); } -#line 3614 "bison_parser.cpp" +#line 3634 "bison_parser.cpp" break; case 38: /* file_path: STRING */ -#line 490 "bison_parser.y" +#line 500 "bison_parser.y" { (yyval.sval) = (yyvsp[0].sval); } -#line 3620 "bison_parser.cpp" +#line 3640 "bison_parser.cpp" break; case 39: /* opt_import_export_options: WITH '(' import_export_options ')' */ -#line 492 "bison_parser.y" +#line 502 "bison_parser.y" { (yyval.import_export_option_t) = (yyvsp[-1].import_export_option_t); } -#line 3626 "bison_parser.cpp" +#line 3646 "bison_parser.cpp" break; case 40: /* opt_import_export_options: '(' import_export_options ')' */ -#line 493 "bison_parser.y" +#line 503 "bison_parser.y" { (yyval.import_export_option_t) = (yyvsp[-1].import_export_option_t); } -#line 3632 "bison_parser.cpp" +#line 3652 "bison_parser.cpp" break; case 41: /* opt_import_export_options: %empty */ -#line 494 "bison_parser.y" +#line 504 "bison_parser.y" { (yyval.import_export_option_t) = new ImportExportOptions{}; } -#line 3638 "bison_parser.cpp" +#line 3658 "bison_parser.cpp" break; case 42: /* import_export_options: import_export_options ',' FORMAT file_type */ -#line 496 "bison_parser.y" +#line 506 "bison_parser.y" { if ((yyvsp[-3].import_export_option_t)->format != kImportAuto) { delete (yyvsp[-3].import_export_option_t); yyerror(&yyloc, result, scanner, "File type must only be provided once."); YYERROR; } + if ((yyvsp[-3].import_export_option_t)->csv_options && (yyvsp[0].import_type_t) != kImportCSV && (yyvsp[0].import_type_t) != kImportAuto) { + delete (yyvsp[-3].import_export_option_t); + yyerror(&yyloc, result, scanner, "CSV options (DELIMITER, NULL, QUOTE) are only allowed for CSV files."); + YYERROR; + } (yyvsp[-3].import_export_option_t)->format = (yyvsp[0].import_type_t); (yyval.import_export_option_t) = (yyvsp[-3].import_export_option_t); } -#line 3652 "bison_parser.cpp" +#line 3677 "bison_parser.cpp" break; case 43: /* import_export_options: FORMAT file_type */ -#line 505 "bison_parser.y" +#line 520 "bison_parser.y" { (yyval.import_export_option_t) = new ImportExportOptions{}; (yyval.import_export_option_t)->format = (yyvsp[0].import_type_t); } -#line 3661 "bison_parser.cpp" +#line 3686 "bison_parser.cpp" break; case 44: /* import_export_options: import_export_options ',' ENCODING STRING */ -#line 509 "bison_parser.y" +#line 524 "bison_parser.y" { if ((yyvsp[-3].import_export_option_t)->encoding) { delete (yyvsp[-3].import_export_option_t); @@ -3672,20 +3697,85 @@ 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 3676 "bison_parser.cpp" +#line 3701 "bison_parser.cpp" break; case 45: /* import_export_options: ENCODING STRING */ -#line 519 "bison_parser.y" +#line 534 "bison_parser.y" { (yyval.import_export_option_t) = new ImportExportOptions{}; (yyval.import_export_option_t)->encoding = (yyvsp[0].sval); } -#line 3685 "bison_parser.cpp" +#line 3710 "bison_parser.cpp" break; - case 46: /* export_statement: COPY table_name TO file_path opt_import_export_options */ -#line 529 "bison_parser.y" + case 46: /* import_export_options: import_export_options ',' csv_option */ +#line 538 "bison_parser.y" + { + if ((yyvsp[-2].import_export_option_t)->format != kImportAuto && (yyvsp[-2].import_export_option_t)->format != kImportCSV) { + delete (yyvsp[-2].import_export_option_t); + free((yyvsp[0].csv_option_t)->second); + delete (yyvsp[0].csv_option_t); + yyerror(&yyloc, result, scanner, "CSV options (DELIMITER, NULL, QUOTE) are only allowed for CSV files."); + YYERROR; + } + + if ((yyvsp[-2].import_export_option_t)->csv_options == nullptr) { + (yyvsp[-2].import_export_option_t)->csv_options = new CsvOptions{}; + } + + if (!(yyvsp[-2].import_export_option_t)->csv_options->accept_csv_option((yyvsp[0].csv_option_t))) { + free((yyvsp[0].csv_option_t)->second); + delete (yyvsp[0].csv_option_t); + delete (yyvsp[-2].import_export_option_t); + yyerror(&yyloc, result, scanner, "CSV options (DELIMITER, NULL, QUOTE) cannot be provided more than once."); + YYERROR; + } + + delete (yyvsp[0].csv_option_t); + (yyval.import_export_option_t) = (yyvsp[-2].import_export_option_t); +} +#line 3739 "bison_parser.cpp" + break; + + case 47: /* import_export_options: csv_option */ +#line 562 "bison_parser.y" + { + (yyval.import_export_option_t) = new ImportExportOptions{}; + (yyval.import_export_option_t)->csv_options = new CsvOptions{}; + (yyval.import_export_option_t)->csv_options->accept_csv_option((yyvsp[0].csv_option_t)); + + delete (yyvsp[0].csv_option_t); +} +#line 3751 "bison_parser.cpp" + break; + + case 48: /* csv_option: IDENTIFIER STRING */ +#line 570 "bison_parser.y" + { + if (strcasecmp((yyvsp[-1].sval), "DELIMITER") == 0) { + (yyval.csv_option_t) = new std::pair(CsvOptionType::Delimiter, (yyvsp[0].sval)); + } else if (strcasecmp((yyvsp[-1].sval), "QUOTE") == 0) { + (yyval.csv_option_t) = new std::pair(CsvOptionType::Quote, (yyvsp[0].sval)); + } else { + free((yyvsp[-1].sval)); + free((yyvsp[0].sval)); + yyerror(&yyloc, result, scanner, "Unknown CSV option."); + YYERROR; + } + free((yyvsp[-1].sval)); +} +#line 3769 "bison_parser.cpp" + break; + + case 49: /* csv_option: NULL STRING */ +#line 583 "bison_parser.y" + { (yyval.csv_option_t) = new std::pair(CsvOptionType::Null, (yyvsp[0].sval)); } +#line 3775 "bison_parser.cpp" + break; + + case 50: /* export_statement: COPY table_name TO file_path opt_import_export_options */ +#line 590 "bison_parser.y" { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_export_option_t)->format); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); @@ -3695,13 +3785,17 @@ YYLTYPE yylloc = yyloc_default; (yyval.export_stmt)->encoding = (yyvsp[0].import_export_option_t)->encoding; (yyvsp[0].import_export_option_t)->encoding = nullptr; } + if ((yyvsp[0].import_export_option_t)->csv_options) { + (yyval.export_stmt)->csv_options = (yyvsp[0].import_export_option_t)->csv_options; + (yyvsp[0].import_export_option_t)->csv_options = nullptr; + } delete (yyvsp[0].import_export_option_t); } -#line 3701 "bison_parser.cpp" +#line 3795 "bison_parser.cpp" break; - case 47: /* export_statement: COPY select_with_paren TO file_path opt_import_export_options */ -#line 540 "bison_parser.y" + case 51: /* export_statement: COPY select_with_paren TO file_path opt_import_export_options */ +#line 605 "bison_parser.y" { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_export_option_t)->format); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); @@ -3710,39 +3804,43 @@ YYLTYPE yylloc = yyloc_default; (yyval.export_stmt)->encoding = (yyvsp[0].import_export_option_t)->encoding; (yyvsp[0].import_export_option_t)->encoding = nullptr; } + if ((yyvsp[0].import_export_option_t)->csv_options) { + (yyval.export_stmt)->csv_options = (yyvsp[0].import_export_option_t)->csv_options; + (yyvsp[0].import_export_option_t)->csv_options = nullptr; + } delete (yyvsp[0].import_export_option_t); } -#line 3716 "bison_parser.cpp" +#line 3814 "bison_parser.cpp" break; - case 48: /* show_statement: SHOW TABLES */ -#line 556 "bison_parser.y" + case 52: /* show_statement: SHOW TABLES */ +#line 625 "bison_parser.y" { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 3722 "bison_parser.cpp" +#line 3820 "bison_parser.cpp" break; - case 49: /* show_statement: SHOW COLUMNS table_name */ -#line 557 "bison_parser.y" + case 53: /* show_statement: SHOW COLUMNS table_name */ +#line 626 "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 3732 "bison_parser.cpp" +#line 3830 "bison_parser.cpp" break; - case 50: /* show_statement: DESCRIBE table_name */ -#line 562 "bison_parser.y" + case 54: /* show_statement: DESCRIBE table_name */ +#line 631 "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 3742 "bison_parser.cpp" +#line 3840 "bison_parser.cpp" break; - case 51: /* create_statement: CREATE TABLE opt_not_exists table_name FROM IDENTIFIER FILE file_path */ -#line 573 "bison_parser.y" + case 55: /* create_statement: CREATE TABLE opt_not_exists table_name FROM IDENTIFIER FILE file_path */ +#line 642 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); @@ -3756,11 +3854,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].sval)); (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 3760 "bison_parser.cpp" +#line 3858 "bison_parser.cpp" break; - case 52: /* create_statement: CREATE TABLE opt_not_exists table_name '(' table_elem_commalist ')' */ -#line 586 "bison_parser.y" + case 56: /* create_statement: CREATE TABLE opt_not_exists table_name '(' table_elem_commalist ')' */ +#line 655 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -3773,11 +3871,11 @@ YYLTYPE yylloc = yyloc_default; YYERROR; } } -#line 3777 "bison_parser.cpp" +#line 3875 "bison_parser.cpp" break; - case 53: /* create_statement: CREATE TABLE opt_not_exists table_name AS select_statement */ -#line 598 "bison_parser.y" + case 57: /* create_statement: CREATE TABLE opt_not_exists table_name AS select_statement */ +#line 667 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-3].bval); @@ -3785,11 +3883,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->tableName = (yyvsp[-2].table_name).name; (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 3789 "bison_parser.cpp" +#line 3887 "bison_parser.cpp" break; - case 54: /* create_statement: CREATE INDEX opt_not_exists opt_index_name ON table_name '(' ident_commalist ')' */ -#line 605 "bison_parser.y" + case 58: /* create_statement: CREATE INDEX opt_not_exists opt_index_name ON table_name '(' ident_commalist ')' */ +#line 674 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateIndex); (yyval.create_stmt)->indexName = (yyvsp[-5].sval); @@ -3797,11 +3895,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->indexColumns = (yyvsp[-1].str_vec); } -#line 3801 "bison_parser.cpp" +#line 3899 "bison_parser.cpp" break; - case 55: /* create_statement: CREATE VIEW opt_not_exists table_name opt_column_list AS select_statement */ -#line 612 "bison_parser.y" + case 59: /* create_statement: CREATE VIEW opt_not_exists table_name opt_column_list AS select_statement */ +#line 681 "bison_parser.y" { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -3810,53 +3908,53 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 3814 "bison_parser.cpp" +#line 3912 "bison_parser.cpp" break; - case 56: /* opt_not_exists: IF NOT EXISTS */ -#line 621 "bison_parser.y" + case 60: /* opt_not_exists: IF NOT EXISTS */ +#line 690 "bison_parser.y" { (yyval.bval) = true; } -#line 3820 "bison_parser.cpp" +#line 3918 "bison_parser.cpp" break; - case 57: /* opt_not_exists: %empty */ -#line 622 "bison_parser.y" + case 61: /* opt_not_exists: %empty */ +#line 691 "bison_parser.y" { (yyval.bval) = false; } -#line 3826 "bison_parser.cpp" +#line 3924 "bison_parser.cpp" break; - case 58: /* table_elem_commalist: table_elem */ -#line 624 "bison_parser.y" + case 62: /* table_elem_commalist: table_elem */ +#line 693 "bison_parser.y" { (yyval.table_element_vec) = new std::vector(); (yyval.table_element_vec)->push_back((yyvsp[0].table_element_t)); } -#line 3835 "bison_parser.cpp" +#line 3933 "bison_parser.cpp" break; - case 59: /* table_elem_commalist: table_elem_commalist ',' table_elem */ -#line 628 "bison_parser.y" + case 63: /* table_elem_commalist: table_elem_commalist ',' table_elem */ +#line 697 "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 3844 "bison_parser.cpp" +#line 3942 "bison_parser.cpp" break; - case 60: /* table_elem: column_def */ -#line 633 "bison_parser.y" + case 64: /* table_elem: column_def */ +#line 702 "bison_parser.y" { (yyval.table_element_t) = (yyvsp[0].column_t); } -#line 3850 "bison_parser.cpp" +#line 3948 "bison_parser.cpp" break; - case 61: /* table_elem: table_constraint */ -#line 634 "bison_parser.y" + case 65: /* table_elem: table_constraint */ +#line 703 "bison_parser.y" { (yyval.table_element_t) = (yyvsp[0].table_constraint_t); } -#line 3856 "bison_parser.cpp" +#line 3954 "bison_parser.cpp" break; - case 62: /* column_def: IDENTIFIER column_type opt_column_constraints */ -#line 636 "bison_parser.y" + case 66: /* column_def: IDENTIFIER column_type opt_column_constraints */ +#line 705 "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()) { @@ -3864,192 +3962,192 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[0].column_constraints_t); } -#line 3868 "bison_parser.cpp" +#line 3966 "bison_parser.cpp" break; - case 63: /* column_type: BIGINT */ -#line 644 "bison_parser.y" + case 67: /* column_type: BIGINT */ +#line 713 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::BIGINT}; } -#line 3874 "bison_parser.cpp" +#line 3972 "bison_parser.cpp" break; - case 64: /* column_type: BOOLEAN */ -#line 645 "bison_parser.y" + case 68: /* column_type: BOOLEAN */ +#line 714 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::BOOLEAN}; } -#line 3880 "bison_parser.cpp" +#line 3978 "bison_parser.cpp" break; - case 65: /* column_type: CHAR '(' INTVAL ')' */ -#line 646 "bison_parser.y" + case 69: /* column_type: CHAR '(' INTVAL ')' */ +#line 715 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::CHAR, (yyvsp[-1].ival)}; } -#line 3886 "bison_parser.cpp" +#line 3984 "bison_parser.cpp" break; - case 66: /* column_type: CHARACTER_VARYING '(' INTVAL ')' */ -#line 647 "bison_parser.y" + case 70: /* column_type: CHARACTER_VARYING '(' INTVAL ')' */ +#line 716 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } -#line 3892 "bison_parser.cpp" +#line 3990 "bison_parser.cpp" break; - case 67: /* column_type: DATE */ -#line 648 "bison_parser.y" + case 71: /* column_type: DATE */ +#line 717 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATE}; } -#line 3898 "bison_parser.cpp" +#line 3996 "bison_parser.cpp" break; - case 68: /* column_type: DATETIME */ -#line 649 "bison_parser.y" + case 72: /* column_type: DATETIME */ +#line 718 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } -#line 3904 "bison_parser.cpp" +#line 4002 "bison_parser.cpp" break; - case 69: /* column_type: DECIMAL opt_decimal_specification */ -#line 650 "bison_parser.y" + case 73: /* column_type: DECIMAL opt_decimal_specification */ +#line 719 "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 3913 "bison_parser.cpp" +#line 4011 "bison_parser.cpp" break; - case 70: /* column_type: DOUBLE */ -#line 654 "bison_parser.y" + case 74: /* column_type: DOUBLE */ +#line 723 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DOUBLE}; } -#line 3919 "bison_parser.cpp" +#line 4017 "bison_parser.cpp" break; - case 71: /* column_type: FLOAT */ -#line 655 "bison_parser.y" + case 75: /* column_type: FLOAT */ +#line 724 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::FLOAT}; } -#line 3925 "bison_parser.cpp" +#line 4023 "bison_parser.cpp" break; - case 72: /* column_type: INT */ -#line 656 "bison_parser.y" + case 76: /* column_type: INT */ +#line 725 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::INT}; } -#line 3931 "bison_parser.cpp" +#line 4029 "bison_parser.cpp" break; - case 73: /* column_type: INTEGER */ -#line 657 "bison_parser.y" + case 77: /* column_type: INTEGER */ +#line 726 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::INT}; } -#line 3937 "bison_parser.cpp" +#line 4035 "bison_parser.cpp" break; - case 74: /* column_type: LONG */ -#line 658 "bison_parser.y" + case 78: /* column_type: LONG */ +#line 727 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::LONG}; } -#line 3943 "bison_parser.cpp" +#line 4041 "bison_parser.cpp" break; - case 75: /* column_type: REAL */ -#line 659 "bison_parser.y" + case 79: /* column_type: REAL */ +#line 728 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::REAL}; } -#line 3949 "bison_parser.cpp" +#line 4047 "bison_parser.cpp" break; - case 76: /* column_type: SMALLINT */ -#line 660 "bison_parser.y" + case 80: /* column_type: SMALLINT */ +#line 729 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::SMALLINT}; } -#line 3955 "bison_parser.cpp" +#line 4053 "bison_parser.cpp" break; - case 77: /* column_type: TEXT */ -#line 661 "bison_parser.y" + case 81: /* column_type: TEXT */ +#line 730 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::TEXT}; } -#line 3961 "bison_parser.cpp" +#line 4059 "bison_parser.cpp" break; - case 78: /* column_type: TIME opt_time_precision */ -#line 662 "bison_parser.y" + case 82: /* column_type: TIME opt_time_precision */ +#line 731 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::TIME, 0, (yyvsp[0].ival)}; } -#line 3967 "bison_parser.cpp" +#line 4065 "bison_parser.cpp" break; - case 79: /* column_type: TIMESTAMP */ -#line 663 "bison_parser.y" + case 83: /* column_type: TIMESTAMP */ +#line 732 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } -#line 3973 "bison_parser.cpp" +#line 4071 "bison_parser.cpp" break; - case 80: /* column_type: VARCHAR '(' INTVAL ')' */ -#line 664 "bison_parser.y" + case 84: /* column_type: VARCHAR '(' INTVAL ')' */ +#line 733 "bison_parser.y" { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } -#line 3979 "bison_parser.cpp" +#line 4077 "bison_parser.cpp" break; - case 81: /* opt_time_precision: '(' INTVAL ')' */ -#line 666 "bison_parser.y" + case 85: /* opt_time_precision: '(' INTVAL ')' */ +#line 735 "bison_parser.y" { (yyval.ival) = (yyvsp[-1].ival); } -#line 3985 "bison_parser.cpp" +#line 4083 "bison_parser.cpp" break; - case 82: /* opt_time_precision: %empty */ -#line 667 "bison_parser.y" + case 86: /* opt_time_precision: %empty */ +#line 736 "bison_parser.y" { (yyval.ival) = 0; } -#line 3991 "bison_parser.cpp" +#line 4089 "bison_parser.cpp" break; - case 83: /* opt_decimal_specification: '(' INTVAL ',' INTVAL ')' */ -#line 669 "bison_parser.y" + case 87: /* opt_decimal_specification: '(' INTVAL ',' INTVAL ')' */ +#line 738 "bison_parser.y" { (yyval.ival_pair) = new std::pair{(yyvsp[-3].ival), (yyvsp[-1].ival)}; } -#line 3997 "bison_parser.cpp" +#line 4095 "bison_parser.cpp" break; - case 84: /* opt_decimal_specification: '(' INTVAL ')' */ -#line 670 "bison_parser.y" + case 88: /* opt_decimal_specification: '(' INTVAL ')' */ +#line 739 "bison_parser.y" { (yyval.ival_pair) = new std::pair{(yyvsp[-1].ival), 0}; } -#line 4003 "bison_parser.cpp" +#line 4101 "bison_parser.cpp" break; - case 85: /* opt_decimal_specification: %empty */ -#line 671 "bison_parser.y" + case 89: /* opt_decimal_specification: %empty */ +#line 740 "bison_parser.y" { (yyval.ival_pair) = new std::pair{0, 0}; } -#line 4009 "bison_parser.cpp" +#line 4107 "bison_parser.cpp" break; - case 86: /* opt_column_constraints: column_constraints */ -#line 673 "bison_parser.y" + case 90: /* opt_column_constraints: column_constraints */ +#line 742 "bison_parser.y" { (yyval.column_constraints_t) = (yyvsp[0].column_constraints_t); } -#line 4015 "bison_parser.cpp" +#line 4113 "bison_parser.cpp" break; - case 87: /* opt_column_constraints: %empty */ -#line 674 "bison_parser.y" + case 91: /* opt_column_constraints: %empty */ +#line 743 "bison_parser.y" { (yyval.column_constraints_t) = new ColumnConstraints(); } -#line 4021 "bison_parser.cpp" +#line 4119 "bison_parser.cpp" break; - case 88: /* column_constraints: column_constraint */ -#line 676 "bison_parser.y" + case 92: /* column_constraints: column_constraint */ +#line 745 "bison_parser.y" { (yyval.column_constraints_t) = new ColumnConstraints(); (yyval.column_constraints_t)->constraints->insert((yyvsp[0].column_constraint_t)); } -#line 4030 "bison_parser.cpp" +#line 4128 "bison_parser.cpp" break; - case 89: /* column_constraints: column_constraints column_constraint */ -#line 680 "bison_parser.y" + case 93: /* column_constraints: column_constraints column_constraint */ +#line 749 "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 4039 "bison_parser.cpp" +#line 4137 "bison_parser.cpp" break; - case 90: /* column_constraints: references_spec */ -#line 684 "bison_parser.y" + case 94: /* column_constraints: references_spec */ +#line 753 "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 4049 "bison_parser.cpp" +#line 4147 "bison_parser.cpp" break; - case 91: /* column_constraints: column_constraints references_spec */ -#line 689 "bison_parser.y" + case 95: /* column_constraints: column_constraints references_spec */ +#line 758 "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). @@ -4057,159 +4155,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 4061 "bison_parser.cpp" +#line 4159 "bison_parser.cpp" break; - case 92: /* column_constraint: PRIMARY KEY */ -#line 697 "bison_parser.y" + case 96: /* column_constraint: PRIMARY KEY */ +#line 766 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::PrimaryKey; } -#line 4067 "bison_parser.cpp" +#line 4165 "bison_parser.cpp" break; - case 93: /* column_constraint: UNIQUE */ -#line 698 "bison_parser.y" + case 97: /* column_constraint: UNIQUE */ +#line 767 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::Unique; } -#line 4073 "bison_parser.cpp" +#line 4171 "bison_parser.cpp" break; - case 94: /* column_constraint: NULL */ -#line 699 "bison_parser.y" + case 98: /* column_constraint: NULL */ +#line 768 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::Null; } -#line 4079 "bison_parser.cpp" +#line 4177 "bison_parser.cpp" break; - case 95: /* column_constraint: NOT NULL */ -#line 700 "bison_parser.y" + case 99: /* column_constraint: NOT NULL */ +#line 769 "bison_parser.y" { (yyval.column_constraint_t) = ConstraintType::NotNull; } -#line 4085 "bison_parser.cpp" +#line 4183 "bison_parser.cpp" break; - case 96: /* table_constraint: PRIMARY KEY '(' ident_commalist ')' */ -#line 702 "bison_parser.y" + case 100: /* table_constraint: PRIMARY KEY '(' ident_commalist ')' */ +#line 771 "bison_parser.y" { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::PrimaryKey, (yyvsp[-1].str_vec)); } -#line 4091 "bison_parser.cpp" +#line 4189 "bison_parser.cpp" break; - case 97: /* table_constraint: UNIQUE '(' ident_commalist ')' */ -#line 703 "bison_parser.y" + case 101: /* table_constraint: UNIQUE '(' ident_commalist ')' */ +#line 772 "bison_parser.y" { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::Unique, (yyvsp[-1].str_vec)); } -#line 4097 "bison_parser.cpp" +#line 4195 "bison_parser.cpp" break; - case 98: /* table_constraint: FOREIGN KEY '(' ident_commalist ')' references_spec */ -#line 704 "bison_parser.y" + case 102: /* table_constraint: FOREIGN KEY '(' ident_commalist ')' references_spec */ +#line 773 "bison_parser.y" { (yyval.table_constraint_t) = new ForeignKeyConstraint((yyvsp[-2].str_vec), (yyvsp[0].references_spec_t)); } -#line 4103 "bison_parser.cpp" +#line 4201 "bison_parser.cpp" break; - case 99: /* references_spec: REFERENCES table_name opt_column_list */ -#line 706 "bison_parser.y" + case 103: /* references_spec: REFERENCES table_name opt_column_list */ +#line 775 "bison_parser.y" { (yyval.references_spec_t) = new ReferencesSpecification((yyvsp[-1].table_name).schema, (yyvsp[-1].table_name).name, (yyvsp[0].str_vec)); } -#line 4109 "bison_parser.cpp" +#line 4207 "bison_parser.cpp" break; - case 100: /* drop_statement: DROP TABLE opt_exists table_name */ -#line 714 "bison_parser.y" + case 104: /* drop_statement: DROP TABLE opt_exists table_name */ +#line 783 "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 4120 "bison_parser.cpp" +#line 4218 "bison_parser.cpp" break; - case 101: /* drop_statement: DROP VIEW opt_exists table_name */ -#line 720 "bison_parser.y" + case 105: /* drop_statement: DROP VIEW opt_exists table_name */ +#line 789 "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 4131 "bison_parser.cpp" +#line 4229 "bison_parser.cpp" break; - case 102: /* drop_statement: DEALLOCATE PREPARE IDENTIFIER */ -#line 726 "bison_parser.y" + case 106: /* drop_statement: DEALLOCATE PREPARE IDENTIFIER */ +#line 795 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 4141 "bison_parser.cpp" +#line 4239 "bison_parser.cpp" break; - case 103: /* drop_statement: DROP INDEX opt_exists IDENTIFIER */ -#line 732 "bison_parser.y" + case 107: /* drop_statement: DROP INDEX opt_exists IDENTIFIER */ +#line 801 "bison_parser.y" { (yyval.drop_stmt) = new DropStatement(kDropIndex); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->indexName = (yyvsp[0].sval); } -#line 4151 "bison_parser.cpp" +#line 4249 "bison_parser.cpp" break; - case 104: /* opt_exists: IF EXISTS */ -#line 738 "bison_parser.y" + case 108: /* opt_exists: IF EXISTS */ +#line 807 "bison_parser.y" { (yyval.bval) = true; } -#line 4157 "bison_parser.cpp" +#line 4255 "bison_parser.cpp" break; - case 105: /* opt_exists: %empty */ -#line 739 "bison_parser.y" + case 109: /* opt_exists: %empty */ +#line 808 "bison_parser.y" { (yyval.bval) = false; } -#line 4163 "bison_parser.cpp" +#line 4261 "bison_parser.cpp" break; - case 106: /* alter_statement: ALTER TABLE opt_exists table_name alter_action */ -#line 746 "bison_parser.y" + case 110: /* alter_statement: ALTER TABLE opt_exists table_name alter_action */ +#line 815 "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 4173 "bison_parser.cpp" +#line 4271 "bison_parser.cpp" break; - case 107: /* alter_action: drop_action */ -#line 752 "bison_parser.y" + case 111: /* alter_action: drop_action */ +#line 821 "bison_parser.y" { (yyval.alter_action_t) = (yyvsp[0].drop_action_t); } -#line 4179 "bison_parser.cpp" +#line 4277 "bison_parser.cpp" break; - case 108: /* drop_action: DROP COLUMN opt_exists IDENTIFIER */ -#line 754 "bison_parser.y" + case 112: /* drop_action: DROP COLUMN opt_exists IDENTIFIER */ +#line 823 "bison_parser.y" { (yyval.drop_action_t) = new DropColumnAction((yyvsp[0].sval)); (yyval.drop_action_t)->ifExists = (yyvsp[-1].bval); } -#line 4188 "bison_parser.cpp" +#line 4286 "bison_parser.cpp" break; - case 109: /* delete_statement: DELETE FROM table_name opt_where */ -#line 764 "bison_parser.y" + case 113: /* delete_statement: DELETE FROM table_name opt_where */ +#line 833 "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 4199 "bison_parser.cpp" +#line 4297 "bison_parser.cpp" break; - case 110: /* truncate_statement: TRUNCATE table_name */ -#line 771 "bison_parser.y" + case 114: /* truncate_statement: TRUNCATE table_name */ +#line 840 "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 4209 "bison_parser.cpp" +#line 4307 "bison_parser.cpp" break; - case 111: /* insert_statement: INSERT INTO table_name opt_column_list VALUES '(' extended_literal_list ')' */ -#line 782 "bison_parser.y" + case 115: /* insert_statement: INSERT INTO table_name opt_column_list VALUES '(' extended_literal_list ')' */ +#line 851 "bison_parser.y" { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; @@ -4217,11 +4315,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 4221 "bison_parser.cpp" +#line 4319 "bison_parser.cpp" break; - case 112: /* insert_statement: INSERT INTO table_name opt_column_list select_no_paren */ -#line 789 "bison_parser.y" + case 116: /* insert_statement: INSERT INTO table_name opt_column_list select_no_paren */ +#line 858 "bison_parser.y" { (yyval.insert_stmt) = new InsertStatement(kInsertSelect); (yyval.insert_stmt)->schema = (yyvsp[-2].table_name).schema; @@ -4229,80 +4327,80 @@ YYLTYPE yylloc = yyloc_default; (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } -#line 4233 "bison_parser.cpp" +#line 4331 "bison_parser.cpp" break; - case 113: /* opt_column_list: '(' ident_commalist ')' */ -#line 797 "bison_parser.y" + case 117: /* opt_column_list: '(' ident_commalist ')' */ +#line 866 "bison_parser.y" { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 4239 "bison_parser.cpp" +#line 4337 "bison_parser.cpp" break; - case 114: /* opt_column_list: %empty */ -#line 798 "bison_parser.y" + case 118: /* opt_column_list: %empty */ +#line 867 "bison_parser.y" { (yyval.str_vec) = nullptr; } -#line 4245 "bison_parser.cpp" +#line 4343 "bison_parser.cpp" break; - case 115: /* update_statement: UPDATE table_ref_name_no_alias SET update_clause_commalist opt_where */ -#line 805 "bison_parser.y" + case 119: /* update_statement: UPDATE table_ref_name_no_alias SET update_clause_commalist opt_where */ +#line 874 "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 4256 "bison_parser.cpp" +#line 4354 "bison_parser.cpp" break; - case 116: /* update_clause_commalist: update_clause */ -#line 812 "bison_parser.y" + case 120: /* update_clause_commalist: update_clause */ +#line 881 "bison_parser.y" { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 4265 "bison_parser.cpp" +#line 4363 "bison_parser.cpp" break; - case 117: /* update_clause_commalist: update_clause_commalist ',' update_clause */ -#line 816 "bison_parser.y" + case 121: /* update_clause_commalist: update_clause_commalist ',' update_clause */ +#line 885 "bison_parser.y" { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 4274 "bison_parser.cpp" +#line 4372 "bison_parser.cpp" break; - case 118: /* update_clause: IDENTIFIER '=' expr */ -#line 821 "bison_parser.y" + case 122: /* update_clause: IDENTIFIER '=' expr */ +#line 890 "bison_parser.y" { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 4284 "bison_parser.cpp" +#line 4382 "bison_parser.cpp" break; - case 119: /* select_statement: opt_with_clause select_with_paren */ -#line 831 "bison_parser.y" + case 123: /* select_statement: opt_with_clause select_with_paren */ +#line 900 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[0].select_stmt); (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); } -#line 4293 "bison_parser.cpp" +#line 4391 "bison_parser.cpp" break; - case 120: /* select_statement: opt_with_clause select_no_paren */ -#line 835 "bison_parser.y" + case 124: /* select_statement: opt_with_clause select_no_paren */ +#line 904 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[0].select_stmt); (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); } -#line 4302 "bison_parser.cpp" +#line 4400 "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 839 "bison_parser.y" + case 125: /* select_statement: opt_with_clause select_with_paren set_operator select_within_set_operation opt_order opt_limit */ +#line 908 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-4].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { @@ -4314,17 +4412,17 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->setOperations->back()->resultLimit = (yyvsp[0].limit); (yyval.select_stmt)->withDescriptions = (yyvsp[-5].with_description_vec); } -#line 4318 "bison_parser.cpp" +#line 4416 "bison_parser.cpp" break; - case 124: /* select_within_set_operation_no_parentheses: select_clause */ -#line 853 "bison_parser.y" + case 128: /* select_within_set_operation_no_parentheses: select_clause */ +#line 922 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[0].select_stmt); } -#line 4324 "bison_parser.cpp" +#line 4422 "bison_parser.cpp" break; - case 125: /* select_within_set_operation_no_parentheses: select_clause set_operator select_within_set_operation */ -#line 854 "bison_parser.y" + case 129: /* select_within_set_operation_no_parentheses: select_clause set_operator select_within_set_operation */ +#line 923 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-2].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { @@ -4333,23 +4431,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 4337 "bison_parser.cpp" +#line 4435 "bison_parser.cpp" break; - case 126: /* select_with_paren: '(' select_no_paren ')' */ -#line 863 "bison_parser.y" + case 130: /* select_with_paren: '(' select_no_paren ')' */ +#line 932 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 4343 "bison_parser.cpp" +#line 4441 "bison_parser.cpp" break; - case 127: /* select_with_paren: '(' select_with_paren ')' */ -#line 864 "bison_parser.y" + case 131: /* select_with_paren: '(' select_with_paren ')' */ +#line 933 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 4349 "bison_parser.cpp" +#line 4447 "bison_parser.cpp" break; - case 128: /* select_no_paren: select_clause opt_order opt_limit opt_locking_clause */ -#line 866 "bison_parser.y" + case 132: /* select_no_paren: select_clause opt_order opt_limit opt_locking_clause */ +#line 935 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-3].select_stmt); (yyval.select_stmt)->order = (yyvsp[-2].order_vec); @@ -4364,11 +4462,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); } } -#line 4368 "bison_parser.cpp" +#line 4466 "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 880 "bison_parser.y" + case 133: /* select_no_paren: select_clause set_operator select_within_set_operation opt_order opt_limit opt_locking_clause */ +#line 949 "bison_parser.y" { (yyval.select_stmt) = (yyvsp[-5].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { @@ -4380,59 +4478,59 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->setOperations->back()->resultLimit = (yyvsp[-1].limit); (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); } -#line 4384 "bison_parser.cpp" +#line 4482 "bison_parser.cpp" break; - case 130: /* set_operator: set_type opt_all */ -#line 892 "bison_parser.y" + case 134: /* set_operator: set_type opt_all */ +#line 961 "bison_parser.y" { (yyval.set_operator_t) = (yyvsp[-1].set_operator_t); (yyval.set_operator_t)->isAll = (yyvsp[0].bval); } -#line 4393 "bison_parser.cpp" +#line 4491 "bison_parser.cpp" break; - case 131: /* set_type: UNION */ -#line 897 "bison_parser.y" + case 135: /* set_type: UNION */ +#line 966 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetUnion; } -#line 4402 "bison_parser.cpp" +#line 4500 "bison_parser.cpp" break; - case 132: /* set_type: INTERSECT */ -#line 901 "bison_parser.y" + case 136: /* set_type: INTERSECT */ +#line 970 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetIntersect; } -#line 4411 "bison_parser.cpp" +#line 4509 "bison_parser.cpp" break; - case 133: /* set_type: EXCEPT */ -#line 905 "bison_parser.y" + case 137: /* set_type: EXCEPT */ +#line 974 "bison_parser.y" { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetExcept; } -#line 4420 "bison_parser.cpp" +#line 4518 "bison_parser.cpp" break; - case 134: /* opt_all: ALL */ -#line 910 "bison_parser.y" + case 138: /* opt_all: ALL */ +#line 979 "bison_parser.y" { (yyval.bval) = true; } -#line 4426 "bison_parser.cpp" +#line 4524 "bison_parser.cpp" break; - case 135: /* opt_all: %empty */ -#line 911 "bison_parser.y" + case 139: /* opt_all: %empty */ +#line 980 "bison_parser.y" { (yyval.bval) = false; } -#line 4432 "bison_parser.cpp" +#line 4530 "bison_parser.cpp" break; - case 136: /* select_clause: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group */ -#line 913 "bison_parser.y" + case 140: /* select_clause: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group */ +#line 982 "bison_parser.y" { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); @@ -4442,141 +4540,141 @@ YYLTYPE yylloc = yyloc_default; (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 4446 "bison_parser.cpp" +#line 4544 "bison_parser.cpp" break; - case 137: /* opt_distinct: DISTINCT */ -#line 923 "bison_parser.y" + case 141: /* opt_distinct: DISTINCT */ +#line 992 "bison_parser.y" { (yyval.bval) = true; } -#line 4452 "bison_parser.cpp" +#line 4550 "bison_parser.cpp" break; - case 138: /* opt_distinct: %empty */ -#line 924 "bison_parser.y" + case 142: /* opt_distinct: %empty */ +#line 993 "bison_parser.y" { (yyval.bval) = false; } -#line 4458 "bison_parser.cpp" +#line 4556 "bison_parser.cpp" break; - case 140: /* opt_from_clause: from_clause */ -#line 928 "bison_parser.y" + case 144: /* opt_from_clause: from_clause */ +#line 997 "bison_parser.y" { (yyval.table) = (yyvsp[0].table); } -#line 4464 "bison_parser.cpp" +#line 4562 "bison_parser.cpp" break; - case 141: /* opt_from_clause: %empty */ -#line 929 "bison_parser.y" + case 145: /* opt_from_clause: %empty */ +#line 998 "bison_parser.y" { (yyval.table) = nullptr; } -#line 4470 "bison_parser.cpp" +#line 4568 "bison_parser.cpp" break; - case 142: /* from_clause: FROM table_ref */ -#line 931 "bison_parser.y" + case 146: /* from_clause: FROM table_ref */ +#line 1000 "bison_parser.y" { (yyval.table) = (yyvsp[0].table); } -#line 4476 "bison_parser.cpp" +#line 4574 "bison_parser.cpp" break; - case 143: /* opt_where: WHERE expr */ -#line 933 "bison_parser.y" + case 147: /* opt_where: WHERE expr */ +#line 1002 "bison_parser.y" { (yyval.expr) = (yyvsp[0].expr); } -#line 4482 "bison_parser.cpp" +#line 4580 "bison_parser.cpp" break; - case 144: /* opt_where: %empty */ -#line 934 "bison_parser.y" + case 148: /* opt_where: %empty */ +#line 1003 "bison_parser.y" { (yyval.expr) = nullptr; } -#line 4488 "bison_parser.cpp" +#line 4586 "bison_parser.cpp" break; - case 145: /* opt_group: GROUP BY expr_list opt_having */ -#line 936 "bison_parser.y" + case 149: /* opt_group: GROUP BY expr_list opt_having */ +#line 1005 "bison_parser.y" { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 4498 "bison_parser.cpp" +#line 4596 "bison_parser.cpp" break; - case 146: /* opt_group: %empty */ -#line 941 "bison_parser.y" + case 150: /* opt_group: %empty */ +#line 1010 "bison_parser.y" { (yyval.group_t) = nullptr; } -#line 4504 "bison_parser.cpp" +#line 4602 "bison_parser.cpp" break; - case 147: /* opt_having: HAVING expr */ -#line 943 "bison_parser.y" + case 151: /* opt_having: HAVING expr */ +#line 1012 "bison_parser.y" { (yyval.expr) = (yyvsp[0].expr); } -#line 4510 "bison_parser.cpp" +#line 4608 "bison_parser.cpp" break; - case 148: /* opt_having: %empty */ -#line 944 "bison_parser.y" + case 152: /* opt_having: %empty */ +#line 1013 "bison_parser.y" { (yyval.expr) = nullptr; } -#line 4516 "bison_parser.cpp" +#line 4614 "bison_parser.cpp" break; - case 149: /* opt_order: ORDER BY order_list */ -#line 946 "bison_parser.y" + case 153: /* opt_order: ORDER BY order_list */ +#line 1015 "bison_parser.y" { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 4522 "bison_parser.cpp" +#line 4620 "bison_parser.cpp" break; - case 150: /* opt_order: %empty */ -#line 947 "bison_parser.y" + case 154: /* opt_order: %empty */ +#line 1016 "bison_parser.y" { (yyval.order_vec) = nullptr; } -#line 4528 "bison_parser.cpp" +#line 4626 "bison_parser.cpp" break; - case 151: /* order_list: order_desc */ -#line 949 "bison_parser.y" + case 155: /* order_list: order_desc */ +#line 1018 "bison_parser.y" { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 4537 "bison_parser.cpp" +#line 4635 "bison_parser.cpp" break; - case 152: /* order_list: order_list ',' order_desc */ -#line 953 "bison_parser.y" + case 156: /* order_list: order_list ',' order_desc */ +#line 1022 "bison_parser.y" { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 4546 "bison_parser.cpp" +#line 4644 "bison_parser.cpp" break; - case 153: /* order_desc: expr opt_order_type opt_null_ordering */ -#line 958 "bison_parser.y" + case 157: /* order_desc: expr opt_order_type opt_null_ordering */ +#line 1027 "bison_parser.y" { (yyval.order) = new OrderDescription((yyvsp[-1].order_type), (yyvsp[-2].expr), (yyvsp[0].null_ordering_t)); } -#line 4552 "bison_parser.cpp" +#line 4650 "bison_parser.cpp" break; - case 154: /* opt_order_type: ASC */ -#line 960 "bison_parser.y" + case 158: /* opt_order_type: ASC */ +#line 1029 "bison_parser.y" { (yyval.order_type) = kOrderAsc; } -#line 4558 "bison_parser.cpp" +#line 4656 "bison_parser.cpp" break; - case 155: /* opt_order_type: DESC */ -#line 961 "bison_parser.y" + case 159: /* opt_order_type: DESC */ +#line 1030 "bison_parser.y" { (yyval.order_type) = kOrderDesc; } -#line 4564 "bison_parser.cpp" +#line 4662 "bison_parser.cpp" break; - case 156: /* opt_order_type: %empty */ -#line 962 "bison_parser.y" + case 160: /* opt_order_type: %empty */ +#line 1031 "bison_parser.y" { (yyval.order_type) = kOrderAsc; } -#line 4570 "bison_parser.cpp" +#line 4668 "bison_parser.cpp" break; - case 157: /* opt_null_ordering: %empty */ -#line 964 "bison_parser.y" + case 161: /* opt_null_ordering: %empty */ +#line 1033 "bison_parser.y" { (yyval.null_ordering_t) = NullOrdering::Undefined; } -#line 4576 "bison_parser.cpp" +#line 4674 "bison_parser.cpp" break; - case 158: /* opt_null_ordering: IDENTIFIER IDENTIFIER */ -#line 965 "bison_parser.y" + case 162: /* opt_null_ordering: IDENTIFIER IDENTIFIER */ +#line 1034 "bison_parser.y" { auto null_ordering = NullOrdering::Undefined; if (strcasecmp((yyvsp[-1].sval), "nulls") == 0) { @@ -4596,115 +4694,115 @@ YYLTYPE yylloc = yyloc_default; (yyval.null_ordering_t) = null_ordering; } -#line 4600 "bison_parser.cpp" +#line 4698 "bison_parser.cpp" break; - case 159: /* opt_top: TOP int_literal */ -#line 987 "bison_parser.y" + case 163: /* opt_top: TOP int_literal */ +#line 1056 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } -#line 4606 "bison_parser.cpp" +#line 4704 "bison_parser.cpp" break; - case 160: /* opt_top: %empty */ -#line 988 "bison_parser.y" + case 164: /* opt_top: %empty */ +#line 1057 "bison_parser.y" { (yyval.limit) = nullptr; } -#line 4612 "bison_parser.cpp" +#line 4710 "bison_parser.cpp" break; - case 161: /* opt_limit: LIMIT expr */ -#line 990 "bison_parser.y" + case 165: /* opt_limit: LIMIT expr */ +#line 1059 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } -#line 4618 "bison_parser.cpp" +#line 4716 "bison_parser.cpp" break; - case 162: /* opt_limit: OFFSET expr */ -#line 991 "bison_parser.y" + case 166: /* opt_limit: OFFSET expr */ +#line 1060 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } -#line 4624 "bison_parser.cpp" +#line 4722 "bison_parser.cpp" break; - case 163: /* opt_limit: LIMIT expr OFFSET expr */ -#line 992 "bison_parser.y" + case 167: /* opt_limit: LIMIT expr OFFSET expr */ +#line 1061 "bison_parser.y" { (yyval.limit) = new LimitDescription((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4630 "bison_parser.cpp" +#line 4728 "bison_parser.cpp" break; - case 164: /* opt_limit: LIMIT ALL */ -#line 993 "bison_parser.y" + case 168: /* opt_limit: LIMIT ALL */ +#line 1062 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, nullptr); } -#line 4636 "bison_parser.cpp" +#line 4734 "bison_parser.cpp" break; - case 165: /* opt_limit: LIMIT ALL OFFSET expr */ -#line 994 "bison_parser.y" + case 169: /* opt_limit: LIMIT ALL OFFSET expr */ +#line 1063 "bison_parser.y" { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } -#line 4642 "bison_parser.cpp" +#line 4740 "bison_parser.cpp" break; - case 166: /* opt_limit: %empty */ -#line 995 "bison_parser.y" + case 170: /* opt_limit: %empty */ +#line 1064 "bison_parser.y" { (yyval.limit) = nullptr; } -#line 4648 "bison_parser.cpp" +#line 4746 "bison_parser.cpp" break; - case 167: /* expr_list: expr_alias */ -#line 1000 "bison_parser.y" + case 171: /* expr_list: expr_alias */ +#line 1069 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 4657 "bison_parser.cpp" +#line 4755 "bison_parser.cpp" break; - case 168: /* expr_list: expr_list ',' expr_alias */ -#line 1004 "bison_parser.y" + case 172: /* expr_list: expr_list ',' expr_alias */ +#line 1073 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 4666 "bison_parser.cpp" +#line 4764 "bison_parser.cpp" break; - case 169: /* opt_extended_literal_list: extended_literal_list */ -#line 1010 "bison_parser.y" + case 173: /* opt_extended_literal_list: extended_literal_list */ +#line 1079 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[0].expr_vec); } -#line 4672 "bison_parser.cpp" +#line 4770 "bison_parser.cpp" break; - case 170: /* opt_extended_literal_list: %empty */ -#line 1011 "bison_parser.y" + case 174: /* opt_extended_literal_list: %empty */ +#line 1080 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 4678 "bison_parser.cpp" +#line 4776 "bison_parser.cpp" break; - case 171: /* extended_literal_list: casted_extended_literal */ -#line 1013 "bison_parser.y" + case 175: /* extended_literal_list: casted_extended_literal */ +#line 1082 "bison_parser.y" { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 4687 "bison_parser.cpp" +#line 4785 "bison_parser.cpp" break; - case 172: /* extended_literal_list: extended_literal_list ',' casted_extended_literal */ -#line 1017 "bison_parser.y" + case 176: /* extended_literal_list: extended_literal_list ',' casted_extended_literal */ +#line 1086 "bison_parser.y" { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 4696 "bison_parser.cpp" +#line 4794 "bison_parser.cpp" break; - case 174: /* casted_extended_literal: CAST '(' extended_literal AS column_type ')' */ -#line 1022 "bison_parser.y" + case 178: /* casted_extended_literal: CAST '(' extended_literal AS column_type ')' */ +#line 1091 "bison_parser.y" { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } -#line 4704 "bison_parser.cpp" +#line 4802 "bison_parser.cpp" break; - case 175: /* extended_literal: literal */ -#line 1026 "bison_parser.y" + case 179: /* extended_literal: literal */ +#line 1095 "bison_parser.y" { if ((yyvsp[0].expr)->type == ExprType::kExprParameter) { delete (yyvsp[0].expr); @@ -4713,23 +4811,23 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = (yyvsp[0].expr); } -#line 4717 "bison_parser.cpp" +#line 4815 "bison_parser.cpp" break; - case 176: /* extended_literal: '-' num_literal */ -#line 1034 "bison_parser.y" + case 180: /* extended_literal: '-' num_literal */ +#line 1103 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4723 "bison_parser.cpp" +#line 4821 "bison_parser.cpp" break; - case 177: /* extended_literal: '-' interval_literal */ -#line 1035 "bison_parser.y" + case 181: /* extended_literal: '-' interval_literal */ +#line 1104 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4729 "bison_parser.cpp" +#line 4827 "bison_parser.cpp" break; - case 178: /* expr_alias: expr opt_alias */ -#line 1037 "bison_parser.y" + case 182: /* expr_alias: expr opt_alias */ +#line 1106 "bison_parser.y" { (yyval.expr) = (yyvsp[-1].expr); if ((yyvsp[0].alias_t)) { @@ -4738,507 +4836,507 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[0].alias_t); } } -#line 4742 "bison_parser.cpp" +#line 4840 "bison_parser.cpp" break; - case 184: /* operand: '(' expr ')' */ -#line 1048 "bison_parser.y" + case 188: /* operand: '(' expr ')' */ +#line 1117 "bison_parser.y" { (yyval.expr) = (yyvsp[-1].expr); } -#line 4748 "bison_parser.cpp" +#line 4846 "bison_parser.cpp" break; - case 194: /* operand: '(' select_no_paren ')' */ -#line 1050 "bison_parser.y" + case 198: /* operand: '(' select_no_paren ')' */ +#line 1119 "bison_parser.y" { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 4756 "bison_parser.cpp" +#line 4854 "bison_parser.cpp" break; - case 197: /* unary_expr: '-' operand */ -#line 1056 "bison_parser.y" + case 201: /* unary_expr: '-' operand */ +#line 1125 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 4762 "bison_parser.cpp" +#line 4860 "bison_parser.cpp" break; - case 198: /* unary_expr: NOT operand */ -#line 1057 "bison_parser.y" + case 202: /* unary_expr: NOT operand */ +#line 1126 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 4768 "bison_parser.cpp" +#line 4866 "bison_parser.cpp" break; - case 199: /* unary_expr: operand ISNULL */ -#line 1058 "bison_parser.y" + case 203: /* unary_expr: operand ISNULL */ +#line 1127 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 4774 "bison_parser.cpp" +#line 4872 "bison_parser.cpp" break; - case 200: /* unary_expr: operand IS NULL */ -#line 1059 "bison_parser.y" + case 204: /* unary_expr: operand IS NULL */ +#line 1128 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 4780 "bison_parser.cpp" +#line 4878 "bison_parser.cpp" break; - case 201: /* unary_expr: operand IS NOT NULL */ -#line 1060 "bison_parser.y" + case 205: /* unary_expr: operand IS NOT NULL */ +#line 1129 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 4786 "bison_parser.cpp" +#line 4884 "bison_parser.cpp" break; - case 203: /* binary_expr: operand '-' operand */ -#line 1062 "bison_parser.y" + case 207: /* binary_expr: operand '-' operand */ +#line 1131 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 4792 "bison_parser.cpp" +#line 4890 "bison_parser.cpp" break; - case 204: /* binary_expr: operand '+' operand */ -#line 1063 "bison_parser.y" + case 208: /* binary_expr: operand '+' operand */ +#line 1132 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 4798 "bison_parser.cpp" +#line 4896 "bison_parser.cpp" break; - case 205: /* binary_expr: operand '/' operand */ -#line 1064 "bison_parser.y" + case 209: /* binary_expr: operand '/' operand */ +#line 1133 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 4804 "bison_parser.cpp" +#line 4902 "bison_parser.cpp" break; - case 206: /* binary_expr: operand '*' operand */ -#line 1065 "bison_parser.y" + case 210: /* binary_expr: operand '*' operand */ +#line 1134 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 4810 "bison_parser.cpp" +#line 4908 "bison_parser.cpp" break; - case 207: /* binary_expr: operand '%' operand */ -#line 1066 "bison_parser.y" + case 211: /* binary_expr: operand '%' operand */ +#line 1135 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 4816 "bison_parser.cpp" +#line 4914 "bison_parser.cpp" break; - case 208: /* binary_expr: operand '^' operand */ -#line 1067 "bison_parser.y" + case 212: /* binary_expr: operand '^' operand */ +#line 1136 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 4822 "bison_parser.cpp" +#line 4920 "bison_parser.cpp" break; - case 209: /* binary_expr: operand LIKE operand */ -#line 1068 "bison_parser.y" + case 213: /* binary_expr: operand LIKE operand */ +#line 1137 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 4828 "bison_parser.cpp" +#line 4926 "bison_parser.cpp" break; - case 210: /* binary_expr: operand NOT LIKE operand */ -#line 1069 "bison_parser.y" + case 214: /* binary_expr: operand NOT LIKE operand */ +#line 1138 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 4834 "bison_parser.cpp" +#line 4932 "bison_parser.cpp" break; - case 211: /* binary_expr: operand ILIKE operand */ -#line 1070 "bison_parser.y" + case 215: /* binary_expr: operand ILIKE operand */ +#line 1139 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 4840 "bison_parser.cpp" +#line 4938 "bison_parser.cpp" break; - case 212: /* binary_expr: operand CONCAT operand */ -#line 1071 "bison_parser.y" + case 216: /* binary_expr: operand CONCAT operand */ +#line 1140 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 4846 "bison_parser.cpp" +#line 4944 "bison_parser.cpp" break; - case 213: /* logic_expr: expr AND expr */ -#line 1073 "bison_parser.y" + case 217: /* logic_expr: expr AND expr */ +#line 1142 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 4852 "bison_parser.cpp" +#line 4950 "bison_parser.cpp" break; - case 214: /* logic_expr: expr OR expr */ -#line 1074 "bison_parser.y" + case 218: /* logic_expr: expr OR expr */ +#line 1143 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 4858 "bison_parser.cpp" +#line 4956 "bison_parser.cpp" break; - case 215: /* in_expr: operand IN '(' expr_list ')' */ -#line 1076 "bison_parser.y" + case 219: /* in_expr: operand IN '(' expr_list ')' */ +#line 1145 "bison_parser.y" { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 4864 "bison_parser.cpp" +#line 4962 "bison_parser.cpp" break; - case 216: /* in_expr: operand NOT IN '(' expr_list ')' */ -#line 1077 "bison_parser.y" + case 220: /* in_expr: operand NOT IN '(' expr_list ')' */ +#line 1146 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 4870 "bison_parser.cpp" +#line 4968 "bison_parser.cpp" break; - case 217: /* in_expr: operand IN '(' select_no_paren ')' */ -#line 1078 "bison_parser.y" + case 221: /* in_expr: operand IN '(' select_no_paren ')' */ +#line 1147 "bison_parser.y" { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 4876 "bison_parser.cpp" +#line 4974 "bison_parser.cpp" break; - case 218: /* in_expr: operand NOT IN '(' select_no_paren ')' */ -#line 1079 "bison_parser.y" + case 222: /* in_expr: operand NOT IN '(' select_no_paren ')' */ +#line 1148 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 4882 "bison_parser.cpp" +#line 4980 "bison_parser.cpp" break; - case 219: /* case_expr: CASE expr case_list END */ -#line 1083 "bison_parser.y" + case 223: /* case_expr: CASE expr case_list END */ +#line 1152 "bison_parser.y" { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } -#line 4888 "bison_parser.cpp" +#line 4986 "bison_parser.cpp" break; - case 220: /* case_expr: CASE expr case_list ELSE expr END */ -#line 1084 "bison_parser.y" + case 224: /* case_expr: CASE expr case_list ELSE expr END */ +#line 1153 "bison_parser.y" { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4894 "bison_parser.cpp" +#line 4992 "bison_parser.cpp" break; - case 221: /* case_expr: CASE case_list END */ -#line 1085 "bison_parser.y" + case 225: /* case_expr: CASE case_list END */ +#line 1154 "bison_parser.y" { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } -#line 4900 "bison_parser.cpp" +#line 4998 "bison_parser.cpp" break; - case 222: /* case_expr: CASE case_list ELSE expr END */ -#line 1086 "bison_parser.y" + case 226: /* case_expr: CASE case_list ELSE expr END */ +#line 1155 "bison_parser.y" { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4906 "bison_parser.cpp" +#line 5004 "bison_parser.cpp" break; - case 223: /* case_list: WHEN expr THEN expr */ -#line 1088 "bison_parser.y" + case 227: /* case_list: WHEN expr THEN expr */ +#line 1157 "bison_parser.y" { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 4912 "bison_parser.cpp" +#line 5010 "bison_parser.cpp" break; - case 224: /* case_list: case_list WHEN expr THEN expr */ -#line 1089 "bison_parser.y" + case 228: /* case_list: case_list WHEN expr THEN expr */ +#line 1158 "bison_parser.y" { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 4918 "bison_parser.cpp" +#line 5016 "bison_parser.cpp" break; - case 225: /* exists_expr: EXISTS '(' select_no_paren ')' */ -#line 1091 "bison_parser.y" + case 229: /* exists_expr: EXISTS '(' select_no_paren ')' */ +#line 1160 "bison_parser.y" { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 4924 "bison_parser.cpp" +#line 5022 "bison_parser.cpp" break; - case 226: /* exists_expr: NOT EXISTS '(' select_no_paren ')' */ -#line 1092 "bison_parser.y" + case 230: /* exists_expr: NOT EXISTS '(' select_no_paren ')' */ +#line 1161 "bison_parser.y" { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 4930 "bison_parser.cpp" +#line 5028 "bison_parser.cpp" break; - case 227: /* comp_expr: operand '=' operand */ -#line 1094 "bison_parser.y" + case 231: /* comp_expr: operand '=' operand */ +#line 1163 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 4936 "bison_parser.cpp" +#line 5034 "bison_parser.cpp" break; - case 228: /* comp_expr: operand EQUALS operand */ -#line 1095 "bison_parser.y" + case 232: /* comp_expr: operand EQUALS operand */ +#line 1164 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 4942 "bison_parser.cpp" +#line 5040 "bison_parser.cpp" break; - case 229: /* comp_expr: operand NOTEQUALS operand */ -#line 1096 "bison_parser.y" + case 233: /* comp_expr: operand NOTEQUALS operand */ +#line 1165 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 4948 "bison_parser.cpp" +#line 5046 "bison_parser.cpp" break; - case 230: /* comp_expr: operand '<' operand */ -#line 1097 "bison_parser.y" + case 234: /* comp_expr: operand '<' operand */ +#line 1166 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 4954 "bison_parser.cpp" +#line 5052 "bison_parser.cpp" break; - case 231: /* comp_expr: operand '>' operand */ -#line 1098 "bison_parser.y" + case 235: /* comp_expr: operand '>' operand */ +#line 1167 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 4960 "bison_parser.cpp" +#line 5058 "bison_parser.cpp" break; - case 232: /* comp_expr: operand LESSEQ operand */ -#line 1099 "bison_parser.y" + case 236: /* comp_expr: operand LESSEQ operand */ +#line 1168 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 4966 "bison_parser.cpp" +#line 5064 "bison_parser.cpp" break; - case 233: /* comp_expr: operand GREATEREQ operand */ -#line 1100 "bison_parser.y" + case 237: /* comp_expr: operand GREATEREQ operand */ +#line 1169 "bison_parser.y" { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 4972 "bison_parser.cpp" +#line 5070 "bison_parser.cpp" break; - case 234: /* function_expr: IDENTIFIER '(' ')' opt_window */ -#line 1104 "bison_parser.y" + case 238: /* function_expr: IDENTIFIER '(' ')' opt_window */ +#line 1173 "bison_parser.y" { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-3].sval), new std::vector(), false, (yyvsp[0].window_description)); } -#line 4978 "bison_parser.cpp" +#line 5076 "bison_parser.cpp" break; - case 235: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ -#line 1105 "bison_parser.y" + case 239: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ +#line 1174 "bison_parser.y" { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-5].sval), (yyvsp[-2].expr_vec), (yyvsp[-3].bval), (yyvsp[0].window_description)); } -#line 4984 "bison_parser.cpp" +#line 5082 "bison_parser.cpp" break; - case 236: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ -#line 1109 "bison_parser.y" + case 240: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ +#line 1178 "bison_parser.y" { (yyval.window_description) = new WindowDescription((yyvsp[-3].expr_vec), (yyvsp[-2].order_vec), (yyvsp[-1].frame_description)); } -#line 4990 "bison_parser.cpp" +#line 5088 "bison_parser.cpp" break; - case 237: /* opt_window: %empty */ -#line 1110 "bison_parser.y" + case 241: /* opt_window: %empty */ +#line 1179 "bison_parser.y" { (yyval.window_description) = nullptr; } -#line 4996 "bison_parser.cpp" +#line 5094 "bison_parser.cpp" break; - case 238: /* opt_partition: PARTITION BY expr_list */ -#line 1112 "bison_parser.y" + case 242: /* opt_partition: PARTITION BY expr_list */ +#line 1181 "bison_parser.y" { (yyval.expr_vec) = (yyvsp[0].expr_vec); } -#line 5002 "bison_parser.cpp" +#line 5100 "bison_parser.cpp" break; - case 239: /* opt_partition: %empty */ -#line 1113 "bison_parser.y" + case 243: /* opt_partition: %empty */ +#line 1182 "bison_parser.y" { (yyval.expr_vec) = nullptr; } -#line 5008 "bison_parser.cpp" +#line 5106 "bison_parser.cpp" break; - case 240: /* opt_frame_clause: frame_type frame_bound */ -#line 1118 "bison_parser.y" + case 244: /* opt_frame_clause: frame_type frame_bound */ +#line 1187 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{(yyvsp[-1].frame_type), (yyvsp[0].frame_bound), new FrameBound{0, kCurrentRow, false}}; } -#line 5014 "bison_parser.cpp" +#line 5112 "bison_parser.cpp" break; - case 241: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ -#line 1119 "bison_parser.y" + case 245: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ +#line 1188 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{(yyvsp[-4].frame_type), (yyvsp[-2].frame_bound), (yyvsp[0].frame_bound)}; } -#line 5020 "bison_parser.cpp" +#line 5118 "bison_parser.cpp" break; - case 242: /* opt_frame_clause: %empty */ -#line 1120 "bison_parser.y" + case 246: /* opt_frame_clause: %empty */ +#line 1189 "bison_parser.y" { (yyval.frame_description) = new FrameDescription{kRange, new FrameBound{0, kPreceding, true}, new FrameBound{0, kCurrentRow, false}}; } -#line 5028 "bison_parser.cpp" +#line 5126 "bison_parser.cpp" break; - case 243: /* frame_type: RANGE */ -#line 1124 "bison_parser.y" + case 247: /* frame_type: RANGE */ +#line 1193 "bison_parser.y" { (yyval.frame_type) = kRange; } -#line 5034 "bison_parser.cpp" +#line 5132 "bison_parser.cpp" break; - case 244: /* frame_type: ROWS */ -#line 1125 "bison_parser.y" + case 248: /* frame_type: ROWS */ +#line 1194 "bison_parser.y" { (yyval.frame_type) = kRows; } -#line 5040 "bison_parser.cpp" +#line 5138 "bison_parser.cpp" break; - case 245: /* frame_type: GROUPS */ -#line 1126 "bison_parser.y" + case 249: /* frame_type: GROUPS */ +#line 1195 "bison_parser.y" { (yyval.frame_type) = kGroups; } -#line 5046 "bison_parser.cpp" +#line 5144 "bison_parser.cpp" break; - case 246: /* frame_bound: UNBOUNDED PRECEDING */ -#line 1128 "bison_parser.y" + case 250: /* frame_bound: UNBOUNDED PRECEDING */ +#line 1197 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kPreceding, true}; } -#line 5052 "bison_parser.cpp" +#line 5150 "bison_parser.cpp" break; - case 247: /* frame_bound: INTVAL PRECEDING */ -#line 1129 "bison_parser.y" + case 251: /* frame_bound: INTVAL PRECEDING */ +#line 1198 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kPreceding, false}; } -#line 5058 "bison_parser.cpp" +#line 5156 "bison_parser.cpp" break; - case 248: /* frame_bound: UNBOUNDED FOLLOWING */ -#line 1130 "bison_parser.y" + case 252: /* frame_bound: UNBOUNDED FOLLOWING */ +#line 1199 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kFollowing, true}; } -#line 5064 "bison_parser.cpp" +#line 5162 "bison_parser.cpp" break; - case 249: /* frame_bound: INTVAL FOLLOWING */ -#line 1131 "bison_parser.y" + case 253: /* frame_bound: INTVAL FOLLOWING */ +#line 1200 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kFollowing, false}; } -#line 5070 "bison_parser.cpp" +#line 5168 "bison_parser.cpp" break; - case 250: /* frame_bound: CURRENT_ROW */ -#line 1132 "bison_parser.y" + case 254: /* frame_bound: CURRENT_ROW */ +#line 1201 "bison_parser.y" { (yyval.frame_bound) = new FrameBound{0, kCurrentRow, false}; } -#line 5076 "bison_parser.cpp" +#line 5174 "bison_parser.cpp" break; - case 251: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ -#line 1134 "bison_parser.y" + case 255: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ +#line 1203 "bison_parser.y" { (yyval.expr) = Expr::makeExtract((yyvsp[-3].datetime_field), (yyvsp[-1].expr)); } -#line 5082 "bison_parser.cpp" +#line 5180 "bison_parser.cpp" break; - case 252: /* cast_expr: CAST '(' expr AS column_type ')' */ -#line 1136 "bison_parser.y" + case 256: /* cast_expr: CAST '(' expr AS column_type ')' */ +#line 1205 "bison_parser.y" { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } -#line 5088 "bison_parser.cpp" +#line 5186 "bison_parser.cpp" break; - case 253: /* datetime_field: SECOND */ -#line 1138 "bison_parser.y" + case 257: /* datetime_field: SECOND */ +#line 1207 "bison_parser.y" { (yyval.datetime_field) = kDatetimeSecond; } -#line 5094 "bison_parser.cpp" +#line 5192 "bison_parser.cpp" break; - case 254: /* datetime_field: MINUTE */ -#line 1139 "bison_parser.y" + case 258: /* datetime_field: MINUTE */ +#line 1208 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMinute; } -#line 5100 "bison_parser.cpp" +#line 5198 "bison_parser.cpp" break; - case 255: /* datetime_field: HOUR */ -#line 1140 "bison_parser.y" + case 259: /* datetime_field: HOUR */ +#line 1209 "bison_parser.y" { (yyval.datetime_field) = kDatetimeHour; } -#line 5106 "bison_parser.cpp" +#line 5204 "bison_parser.cpp" break; - case 256: /* datetime_field: DAY */ -#line 1141 "bison_parser.y" + case 260: /* datetime_field: DAY */ +#line 1210 "bison_parser.y" { (yyval.datetime_field) = kDatetimeDay; } -#line 5112 "bison_parser.cpp" +#line 5210 "bison_parser.cpp" break; - case 257: /* datetime_field: MONTH */ -#line 1142 "bison_parser.y" + case 261: /* datetime_field: MONTH */ +#line 1211 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMonth; } -#line 5118 "bison_parser.cpp" +#line 5216 "bison_parser.cpp" break; - case 258: /* datetime_field: YEAR */ -#line 1143 "bison_parser.y" + case 262: /* datetime_field: YEAR */ +#line 1212 "bison_parser.y" { (yyval.datetime_field) = kDatetimeYear; } -#line 5124 "bison_parser.cpp" +#line 5222 "bison_parser.cpp" break; - case 259: /* datetime_field_plural: SECONDS */ -#line 1145 "bison_parser.y" + case 263: /* datetime_field_plural: SECONDS */ +#line 1214 "bison_parser.y" { (yyval.datetime_field) = kDatetimeSecond; } -#line 5130 "bison_parser.cpp" +#line 5228 "bison_parser.cpp" break; - case 260: /* datetime_field_plural: MINUTES */ -#line 1146 "bison_parser.y" + case 264: /* datetime_field_plural: MINUTES */ +#line 1215 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMinute; } -#line 5136 "bison_parser.cpp" +#line 5234 "bison_parser.cpp" break; - case 261: /* datetime_field_plural: HOURS */ -#line 1147 "bison_parser.y" + case 265: /* datetime_field_plural: HOURS */ +#line 1216 "bison_parser.y" { (yyval.datetime_field) = kDatetimeHour; } -#line 5142 "bison_parser.cpp" +#line 5240 "bison_parser.cpp" break; - case 262: /* datetime_field_plural: DAYS */ -#line 1148 "bison_parser.y" + case 266: /* datetime_field_plural: DAYS */ +#line 1217 "bison_parser.y" { (yyval.datetime_field) = kDatetimeDay; } -#line 5148 "bison_parser.cpp" +#line 5246 "bison_parser.cpp" break; - case 263: /* datetime_field_plural: MONTHS */ -#line 1149 "bison_parser.y" + case 267: /* datetime_field_plural: MONTHS */ +#line 1218 "bison_parser.y" { (yyval.datetime_field) = kDatetimeMonth; } -#line 5154 "bison_parser.cpp" +#line 5252 "bison_parser.cpp" break; - case 264: /* datetime_field_plural: YEARS */ -#line 1150 "bison_parser.y" + case 268: /* datetime_field_plural: YEARS */ +#line 1219 "bison_parser.y" { (yyval.datetime_field) = kDatetimeYear; } -#line 5160 "bison_parser.cpp" +#line 5258 "bison_parser.cpp" break; - case 267: /* array_expr: ARRAY '[' expr_list ']' */ -#line 1154 "bison_parser.y" + case 271: /* array_expr: ARRAY '[' expr_list ']' */ +#line 1223 "bison_parser.y" { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 5166 "bison_parser.cpp" +#line 5264 "bison_parser.cpp" break; - case 268: /* array_index: operand '[' int_literal ']' */ -#line 1156 "bison_parser.y" + case 272: /* array_index: operand '[' int_literal ']' */ +#line 1225 "bison_parser.y" { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 5172 "bison_parser.cpp" +#line 5270 "bison_parser.cpp" break; - case 269: /* between_expr: operand BETWEEN operand AND operand */ -#line 1158 "bison_parser.y" + case 273: /* between_expr: operand BETWEEN operand AND operand */ +#line 1227 "bison_parser.y" { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 5178 "bison_parser.cpp" +#line 5276 "bison_parser.cpp" break; - case 270: /* column_name: IDENTIFIER */ -#line 1160 "bison_parser.y" + case 274: /* column_name: IDENTIFIER */ +#line 1229 "bison_parser.y" { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 5184 "bison_parser.cpp" +#line 5282 "bison_parser.cpp" break; - case 271: /* column_name: IDENTIFIER '.' IDENTIFIER */ -#line 1161 "bison_parser.y" + case 275: /* column_name: IDENTIFIER '.' IDENTIFIER */ +#line 1230 "bison_parser.y" { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 5190 "bison_parser.cpp" +#line 5288 "bison_parser.cpp" break; - case 272: /* column_name: '*' */ -#line 1162 "bison_parser.y" + case 276: /* column_name: '*' */ +#line 1231 "bison_parser.y" { (yyval.expr) = Expr::makeStar(); } -#line 5196 "bison_parser.cpp" +#line 5294 "bison_parser.cpp" break; - case 273: /* column_name: IDENTIFIER '.' '*' */ -#line 1163 "bison_parser.y" + case 277: /* column_name: IDENTIFIER '.' '*' */ +#line 1232 "bison_parser.y" { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 5202 "bison_parser.cpp" +#line 5300 "bison_parser.cpp" break; - case 281: /* string_literal: STRING */ -#line 1167 "bison_parser.y" + case 285: /* string_literal: STRING */ +#line 1236 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 5208 "bison_parser.cpp" +#line 5306 "bison_parser.cpp" break; - case 282: /* bool_literal: TRUE */ -#line 1169 "bison_parser.y" + case 286: /* bool_literal: TRUE */ +#line 1238 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral(true); } -#line 5214 "bison_parser.cpp" +#line 5312 "bison_parser.cpp" break; - case 283: /* bool_literal: FALSE */ -#line 1170 "bison_parser.y" + case 287: /* bool_literal: FALSE */ +#line 1239 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral(false); } -#line 5220 "bison_parser.cpp" +#line 5318 "bison_parser.cpp" break; - case 284: /* num_literal: FLOATVAL */ -#line 1172 "bison_parser.y" + case 288: /* num_literal: FLOATVAL */ +#line 1241 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 5226 "bison_parser.cpp" +#line 5324 "bison_parser.cpp" break; - case 286: /* int_literal: INTVAL */ -#line 1175 "bison_parser.y" + case 290: /* int_literal: INTVAL */ +#line 1244 "bison_parser.y" { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 5232 "bison_parser.cpp" +#line 5330 "bison_parser.cpp" break; - case 287: /* null_literal: NULL */ -#line 1177 "bison_parser.y" + case 291: /* null_literal: NULL */ +#line 1246 "bison_parser.y" { (yyval.expr) = Expr::makeNullLiteral(); } -#line 5238 "bison_parser.cpp" +#line 5336 "bison_parser.cpp" break; - case 288: /* date_literal: DATE STRING */ -#line 1179 "bison_parser.y" + case 292: /* date_literal: DATE STRING */ +#line 1248 "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 @@ -5249,17 +5347,17 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = Expr::makeDateLiteral((yyvsp[0].sval)); } -#line 5253 "bison_parser.cpp" +#line 5351 "bison_parser.cpp" break; - case 289: /* interval_literal: INTVAL duration_field */ -#line 1190 "bison_parser.y" + case 293: /* interval_literal: INTVAL duration_field */ +#line 1259 "bison_parser.y" { (yyval.expr) = Expr::makeIntervalLiteral((yyvsp[-1].ival), (yyvsp[0].datetime_field)); } -#line 5259 "bison_parser.cpp" +#line 5357 "bison_parser.cpp" break; - case 290: /* interval_literal: INTERVAL STRING datetime_field */ -#line 1191 "bison_parser.y" + case 294: /* interval_literal: INTERVAL STRING datetime_field */ +#line 1260 "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 @@ -5271,11 +5369,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].sval)); (yyval.expr) = Expr::makeIntervalLiteral(duration, (yyvsp[0].datetime_field)); } -#line 5275 "bison_parser.cpp" +#line 5373 "bison_parser.cpp" break; - case 291: /* interval_literal: INTERVAL STRING */ -#line 1202 "bison_parser.y" + case 295: /* interval_literal: INTERVAL STRING */ +#line 1271 "bison_parser.y" { int duration{0}, chars_parsed{0}; // 'seconds' and 'minutes' are the longest accepted interval qualifiers (7 chars) + null byte @@ -5307,61 +5405,61 @@ YYLTYPE yylloc = yyloc_default; } (yyval.expr) = Expr::makeIntervalLiteral(duration, unit); } -#line 5311 "bison_parser.cpp" +#line 5409 "bison_parser.cpp" break; - case 292: /* param_expr: '?' */ -#line 1234 "bison_parser.y" + case 296: /* param_expr: '?' */ +#line 1303 "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 5321 "bison_parser.cpp" +#line 5419 "bison_parser.cpp" break; - case 294: /* table_ref: table_ref_commalist ',' table_ref_atomic */ -#line 1243 "bison_parser.y" + case 298: /* table_ref: table_ref_commalist ',' table_ref_atomic */ +#line 1312 "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 5332 "bison_parser.cpp" +#line 5430 "bison_parser.cpp" break; - case 298: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ -#line 1252 "bison_parser.y" + case 302: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ +#line 1321 "bison_parser.y" { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } -#line 5343 "bison_parser.cpp" +#line 5441 "bison_parser.cpp" break; - case 299: /* table_ref_commalist: table_ref_atomic */ -#line 1259 "bison_parser.y" + case 303: /* table_ref_commalist: table_ref_atomic */ +#line 1328 "bison_parser.y" { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 5352 "bison_parser.cpp" +#line 5450 "bison_parser.cpp" break; - case 300: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ -#line 1263 "bison_parser.y" + case 304: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ +#line 1332 "bison_parser.y" { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 5361 "bison_parser.cpp" +#line 5459 "bison_parser.cpp" break; - case 301: /* table_ref_name: table_name opt_table_alias */ -#line 1268 "bison_parser.y" + case 305: /* table_ref_name: table_name opt_table_alias */ +#line 1337 "bison_parser.y" { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; @@ -5369,215 +5467,215 @@ YYLTYPE yylloc = yyloc_default; tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } -#line 5373 "bison_parser.cpp" +#line 5471 "bison_parser.cpp" break; - case 302: /* table_ref_name_no_alias: table_name */ -#line 1276 "bison_parser.y" + case 306: /* table_ref_name_no_alias: table_name */ +#line 1345 "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 5383 "bison_parser.cpp" +#line 5481 "bison_parser.cpp" break; - case 303: /* table_name: IDENTIFIER */ -#line 1282 "bison_parser.y" + case 307: /* table_name: IDENTIFIER */ +#line 1351 "bison_parser.y" { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval); } -#line 5392 "bison_parser.cpp" +#line 5490 "bison_parser.cpp" break; - case 304: /* table_name: IDENTIFIER '.' IDENTIFIER */ -#line 1286 "bison_parser.y" + case 308: /* table_name: IDENTIFIER '.' IDENTIFIER */ +#line 1355 "bison_parser.y" { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } -#line 5401 "bison_parser.cpp" +#line 5499 "bison_parser.cpp" break; - case 305: /* opt_index_name: IDENTIFIER */ -#line 1291 "bison_parser.y" + case 309: /* opt_index_name: IDENTIFIER */ +#line 1360 "bison_parser.y" { (yyval.sval) = (yyvsp[0].sval); } -#line 5407 "bison_parser.cpp" +#line 5505 "bison_parser.cpp" break; - case 306: /* opt_index_name: %empty */ -#line 1292 "bison_parser.y" + case 310: /* opt_index_name: %empty */ +#line 1361 "bison_parser.y" { (yyval.sval) = nullptr; } -#line 5413 "bison_parser.cpp" +#line 5511 "bison_parser.cpp" break; - case 308: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ -#line 1294 "bison_parser.y" + case 312: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ +#line 1363 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[-3].sval), (yyvsp[-1].str_vec)); } -#line 5419 "bison_parser.cpp" +#line 5517 "bison_parser.cpp" break; - case 310: /* opt_table_alias: %empty */ -#line 1296 "bison_parser.y" + case 314: /* opt_table_alias: %empty */ +#line 1365 "bison_parser.y" { (yyval.alias_t) = nullptr; } -#line 5425 "bison_parser.cpp" +#line 5523 "bison_parser.cpp" break; - case 311: /* alias: AS IDENTIFIER */ -#line 1298 "bison_parser.y" + case 315: /* alias: AS IDENTIFIER */ +#line 1367 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } -#line 5431 "bison_parser.cpp" +#line 5529 "bison_parser.cpp" break; - case 312: /* alias: IDENTIFIER */ -#line 1299 "bison_parser.y" + case 316: /* alias: IDENTIFIER */ +#line 1368 "bison_parser.y" { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } -#line 5437 "bison_parser.cpp" +#line 5535 "bison_parser.cpp" break; - case 314: /* opt_alias: %empty */ -#line 1301 "bison_parser.y" + case 318: /* opt_alias: %empty */ +#line 1370 "bison_parser.y" { (yyval.alias_t) = nullptr; } -#line 5443 "bison_parser.cpp" +#line 5541 "bison_parser.cpp" break; - case 315: /* opt_locking_clause: opt_locking_clause_list */ -#line 1307 "bison_parser.y" + case 319: /* opt_locking_clause: opt_locking_clause_list */ +#line 1376 "bison_parser.y" { (yyval.locking_clause_vec) = (yyvsp[0].locking_clause_vec); } -#line 5449 "bison_parser.cpp" +#line 5547 "bison_parser.cpp" break; - case 316: /* opt_locking_clause: %empty */ -#line 1308 "bison_parser.y" + case 320: /* opt_locking_clause: %empty */ +#line 1377 "bison_parser.y" { (yyval.locking_clause_vec) = nullptr; } -#line 5455 "bison_parser.cpp" +#line 5553 "bison_parser.cpp" break; - case 317: /* opt_locking_clause_list: locking_clause */ -#line 1310 "bison_parser.y" + case 321: /* opt_locking_clause_list: locking_clause */ +#line 1379 "bison_parser.y" { (yyval.locking_clause_vec) = new std::vector(); (yyval.locking_clause_vec)->push_back((yyvsp[0].locking_t)); } -#line 5464 "bison_parser.cpp" +#line 5562 "bison_parser.cpp" break; - case 318: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ -#line 1314 "bison_parser.y" + case 322: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ +#line 1383 "bison_parser.y" { (yyvsp[-1].locking_clause_vec)->push_back((yyvsp[0].locking_t)); (yyval.locking_clause_vec) = (yyvsp[-1].locking_clause_vec); } -#line 5473 "bison_parser.cpp" +#line 5571 "bison_parser.cpp" break; - case 319: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ -#line 1319 "bison_parser.y" + case 323: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ +#line 1388 "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 5484 "bison_parser.cpp" +#line 5582 "bison_parser.cpp" break; - case 320: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ -#line 1325 "bison_parser.y" + case 324: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ +#line 1394 "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 5495 "bison_parser.cpp" +#line 5593 "bison_parser.cpp" break; - case 321: /* row_lock_mode: UPDATE */ -#line 1332 "bison_parser.y" + case 325: /* row_lock_mode: UPDATE */ +#line 1401 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForUpdate; } -#line 5501 "bison_parser.cpp" +#line 5599 "bison_parser.cpp" break; - case 322: /* row_lock_mode: NO KEY UPDATE */ -#line 1333 "bison_parser.y" + case 326: /* row_lock_mode: NO KEY UPDATE */ +#line 1402 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForNoKeyUpdate; } -#line 5507 "bison_parser.cpp" +#line 5605 "bison_parser.cpp" break; - case 323: /* row_lock_mode: SHARE */ -#line 1334 "bison_parser.y" + case 327: /* row_lock_mode: SHARE */ +#line 1403 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForShare; } -#line 5513 "bison_parser.cpp" +#line 5611 "bison_parser.cpp" break; - case 324: /* row_lock_mode: KEY SHARE */ -#line 1335 "bison_parser.y" + case 328: /* row_lock_mode: KEY SHARE */ +#line 1404 "bison_parser.y" { (yyval.lock_mode_t) = RowLockMode::ForKeyShare; } -#line 5519 "bison_parser.cpp" +#line 5617 "bison_parser.cpp" break; - case 325: /* opt_row_lock_policy: SKIP LOCKED */ -#line 1337 "bison_parser.y" + case 329: /* opt_row_lock_policy: SKIP LOCKED */ +#line 1406 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::SkipLocked; } -#line 5525 "bison_parser.cpp" +#line 5623 "bison_parser.cpp" break; - case 326: /* opt_row_lock_policy: NOWAIT */ -#line 1338 "bison_parser.y" + case 330: /* opt_row_lock_policy: NOWAIT */ +#line 1407 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::NoWait; } -#line 5531 "bison_parser.cpp" +#line 5629 "bison_parser.cpp" break; - case 327: /* opt_row_lock_policy: %empty */ -#line 1339 "bison_parser.y" + case 331: /* opt_row_lock_policy: %empty */ +#line 1408 "bison_parser.y" { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::None; } -#line 5537 "bison_parser.cpp" +#line 5635 "bison_parser.cpp" break; - case 329: /* opt_with_clause: %empty */ -#line 1345 "bison_parser.y" + case 333: /* opt_with_clause: %empty */ +#line 1414 "bison_parser.y" { (yyval.with_description_vec) = nullptr; } -#line 5543 "bison_parser.cpp" +#line 5641 "bison_parser.cpp" break; - case 330: /* with_clause: WITH with_description_list */ -#line 1347 "bison_parser.y" + case 334: /* with_clause: WITH with_description_list */ +#line 1416 "bison_parser.y" { (yyval.with_description_vec) = (yyvsp[0].with_description_vec); } -#line 5549 "bison_parser.cpp" +#line 5647 "bison_parser.cpp" break; - case 331: /* with_description_list: with_description */ -#line 1349 "bison_parser.y" + case 335: /* with_description_list: with_description */ +#line 1418 "bison_parser.y" { (yyval.with_description_vec) = new std::vector(); (yyval.with_description_vec)->push_back((yyvsp[0].with_description_t)); } -#line 5558 "bison_parser.cpp" +#line 5656 "bison_parser.cpp" break; - case 332: /* with_description_list: with_description_list ',' with_description */ -#line 1353 "bison_parser.y" + case 336: /* with_description_list: with_description_list ',' with_description */ +#line 1422 "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 5567 "bison_parser.cpp" +#line 5665 "bison_parser.cpp" break; - case 333: /* with_description: IDENTIFIER AS select_with_paren */ -#line 1358 "bison_parser.y" + case 337: /* with_description: IDENTIFIER AS select_with_paren */ +#line 1427 "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 5577 "bison_parser.cpp" +#line 5675 "bison_parser.cpp" break; - case 334: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ -#line 1368 "bison_parser.y" + case 338: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ +#line 1437 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5585,11 +5683,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 5589 "bison_parser.cpp" +#line 5687 "bison_parser.cpp" break; - case 335: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ -#line 1375 "bison_parser.y" + case 339: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ +#line 1444 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5598,11 +5696,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 5602 "bison_parser.cpp" +#line 5700 "bison_parser.cpp" break; - case 336: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' ident_commalist ')' */ -#line 1383 "bison_parser.y" + case 340: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' ident_commalist ')' */ +#line 1452 "bison_parser.y" { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -5611,89 +5709,89 @@ YYLTYPE yylloc = yyloc_default; (yyval.table)->join->right = (yyvsp[-4].table); (yyval.table)->join->namedColumns = (yyvsp[-1].str_vec); } -#line 5615 "bison_parser.cpp" +#line 5713 "bison_parser.cpp" break; - case 337: /* opt_join_type: INNER */ -#line 1392 "bison_parser.y" + case 341: /* opt_join_type: INNER */ +#line 1461 "bison_parser.y" { (yyval.join_type) = kJoinInner; } -#line 5621 "bison_parser.cpp" +#line 5719 "bison_parser.cpp" break; - case 338: /* opt_join_type: LEFT OUTER */ -#line 1393 "bison_parser.y" + case 342: /* opt_join_type: LEFT OUTER */ +#line 1462 "bison_parser.y" { (yyval.join_type) = kJoinLeft; } -#line 5627 "bison_parser.cpp" +#line 5725 "bison_parser.cpp" break; - case 339: /* opt_join_type: LEFT */ -#line 1394 "bison_parser.y" + case 343: /* opt_join_type: LEFT */ +#line 1463 "bison_parser.y" { (yyval.join_type) = kJoinLeft; } -#line 5633 "bison_parser.cpp" +#line 5731 "bison_parser.cpp" break; - case 340: /* opt_join_type: RIGHT OUTER */ -#line 1395 "bison_parser.y" + case 344: /* opt_join_type: RIGHT OUTER */ +#line 1464 "bison_parser.y" { (yyval.join_type) = kJoinRight; } -#line 5639 "bison_parser.cpp" +#line 5737 "bison_parser.cpp" break; - case 341: /* opt_join_type: RIGHT */ -#line 1396 "bison_parser.y" + case 345: /* opt_join_type: RIGHT */ +#line 1465 "bison_parser.y" { (yyval.join_type) = kJoinRight; } -#line 5645 "bison_parser.cpp" +#line 5743 "bison_parser.cpp" break; - case 342: /* opt_join_type: FULL OUTER */ -#line 1397 "bison_parser.y" + case 346: /* opt_join_type: FULL OUTER */ +#line 1466 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5651 "bison_parser.cpp" +#line 5749 "bison_parser.cpp" break; - case 343: /* opt_join_type: OUTER */ -#line 1398 "bison_parser.y" + case 347: /* opt_join_type: OUTER */ +#line 1467 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5657 "bison_parser.cpp" +#line 5755 "bison_parser.cpp" break; - case 344: /* opt_join_type: FULL */ -#line 1399 "bison_parser.y" + case 348: /* opt_join_type: FULL */ +#line 1468 "bison_parser.y" { (yyval.join_type) = kJoinFull; } -#line 5663 "bison_parser.cpp" +#line 5761 "bison_parser.cpp" break; - case 345: /* opt_join_type: CROSS */ -#line 1400 "bison_parser.y" + case 349: /* opt_join_type: CROSS */ +#line 1469 "bison_parser.y" { (yyval.join_type) = kJoinCross; } -#line 5669 "bison_parser.cpp" +#line 5767 "bison_parser.cpp" break; - case 346: /* opt_join_type: %empty */ -#line 1401 "bison_parser.y" + case 350: /* opt_join_type: %empty */ +#line 1470 "bison_parser.y" { (yyval.join_type) = kJoinInner; } -#line 5675 "bison_parser.cpp" +#line 5773 "bison_parser.cpp" break; - case 350: /* ident_commalist: IDENTIFIER */ -#line 1412 "bison_parser.y" + case 354: /* ident_commalist: IDENTIFIER */ +#line 1481 "bison_parser.y" { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 5684 "bison_parser.cpp" +#line 5782 "bison_parser.cpp" break; - case 351: /* ident_commalist: ident_commalist ',' IDENTIFIER */ -#line 1416 "bison_parser.y" + case 355: /* ident_commalist: ident_commalist ',' IDENTIFIER */ +#line 1485 "bison_parser.y" { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 5693 "bison_parser.cpp" +#line 5791 "bison_parser.cpp" break; -#line 5697 "bison_parser.cpp" +#line 5795 "bison_parser.cpp" default: break; } @@ -5922,7 +6020,7 @@ YYLTYPE yylloc = yyloc_default; return yyresult; } -#line 1422 "bison_parser.y" +#line 1491 "bison_parser.y" /********************************* diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h index aa56d392..20ab7635 100644 --- a/src/parser/bison_parser.h +++ b/src/parser/bison_parser.h @@ -345,10 +345,11 @@ union HSQL_STYPE hsql::RowLockWaitPolicy lock_wait_policy_t; hsql::ImportExportOptions* import_export_option_t; + std::pair* csv_option_t; // clang-format off -#line 352 "bison_parser.h" +#line 353 "bison_parser.h" }; typedef union HSQL_STYPE HSQL_STYPE; diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index 74b27660..73ed1fa1 100644 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -169,6 +169,7 @@ hsql::RowLockWaitPolicy lock_wait_policy_t; hsql::ImportExportOptions* import_export_option_t; + std::pair* csv_option_t; // clang-format off } @@ -199,6 +200,10 @@ } delete ($$); } +%destructor { + free($$->second); + delete ($$); +} %destructor { delete ($$); } <*> @@ -294,6 +299,7 @@ // ImportType is used for compatibility reasons %type file_type %type opt_import_export_options import_export_options +%type csv_option %type ident_commalist opt_column_list %type expr_list select_list opt_extended_literal_list extended_literal_list hint_list opt_hints opt_partition @@ -469,6 +475,10 @@ import_statement : IMPORT FROM file_type FILE file_path INTO table_name { $$->encoding = $5->encoding; $5->encoding = nullptr; } + if ($5->csv_options) { + $$->csv_options = $5->csv_options; + $5->csv_options = nullptr; + } delete $5; }; @@ -499,6 +509,11 @@ import_export_options : import_export_options ',' FORMAT file_type { yyerror(&yyloc, result, scanner, "File type must only be provided once."); YYERROR; } + if ($1->csv_options && $4 != kImportCSV && $4 != kImportAuto) { + delete $1; + yyerror(&yyloc, result, scanner, "CSV options (DELIMITER, NULL, QUOTE) are only allowed for CSV files."); + YYERROR; + } $1->format = $4; $$ = $1; } @@ -519,7 +534,53 @@ import_export_options : import_export_options ',' FORMAT file_type { | ENCODING STRING { $$ = new ImportExportOptions{}; $$->encoding = $2; -}; +} +| import_export_options ',' csv_option { + if ($1->format != kImportAuto && $1->format != kImportCSV) { + delete $1; + free($3->second); + delete $3; + yyerror(&yyloc, result, scanner, "CSV options (DELIMITER, NULL, QUOTE) are only allowed for CSV files."); + YYERROR; + } + + if ($1->csv_options == nullptr) { + $1->csv_options = new CsvOptions{}; + } + + if (!$1->csv_options->accept_csv_option($3)) { + free($3->second); + delete $3; + delete $1; + yyerror(&yyloc, result, scanner, "CSV options (DELIMITER, NULL, QUOTE) cannot be provided more than once."); + YYERROR; + } + + delete $3; + $$ = $1; +} +| csv_option { + $$ = new ImportExportOptions{}; + $$->csv_options = new CsvOptions{}; + $$->csv_options->accept_csv_option($1); + + delete $1; +} + +csv_option : IDENTIFIER STRING { + if (strcasecmp($1, "DELIMITER") == 0) { + $$ = new std::pair(CsvOptionType::Delimiter, $2); + } else if (strcasecmp($1, "QUOTE") == 0) { + $$ = new std::pair(CsvOptionType::Quote, $2); + } else { + free($1); + free($2); + yyerror(&yyloc, result, scanner, "Unknown CSV option."); + YYERROR; + } + free($1); +} +| NULL STRING { $$ = new std::pair(CsvOptionType::Null, $2); } /****************************** * Export Statement @@ -535,6 +596,10 @@ export_statement : COPY table_name TO file_path opt_import_export_options { $$->encoding = $5->encoding; $5->encoding = nullptr; } + if ($5->csv_options) { + $$->csv_options = $5->csv_options; + $5->csv_options = nullptr; + } delete $5; } | COPY select_with_paren TO file_path opt_import_export_options { @@ -545,6 +610,10 @@ export_statement : COPY table_name TO file_path opt_import_export_options { $$->encoding = $5->encoding; $5->encoding = nullptr; } + if ($5->csv_options) { + $$->csv_options = $5->csv_options; + $5->csv_options = nullptr; + } delete $5; }; diff --git a/src/sql/ExportStatement.h b/src/sql/ExportStatement.h index 8212c5ca..bd7ef3ac 100755 --- a/src/sql/ExportStatement.h +++ b/src/sql/ExportStatement.h @@ -18,6 +18,7 @@ struct ExportStatement : SQLStatement { char* tableName; SelectStatement* select; char* encoding; + CsvOptions* csv_options; }; } // namespace hsql diff --git a/src/sql/ImportExportOptions.h b/src/sql/ImportExportOptions.h index 4f51faad..cd0fa31f 100644 --- a/src/sql/ImportExportOptions.h +++ b/src/sql/ImportExportOptions.h @@ -1,6 +1,8 @@ #ifndef SQLPARSER_IMPORT_EXPORT_OPTIONS_H #define SQLPARSER_IMPORT_EXPORT_OPTIONS_H +#include + namespace hsql { // Name unchanged for compatibility. Historically, this was only used for import statements before we introduced export @@ -13,12 +15,30 @@ enum ImportType { kImportAuto }; +enum CsvOptionType { + Delimiter, + Null, + Quote, +}; + +struct CsvOptions { + CsvOptions(); + ~CsvOptions(); + + char* delimiter; + char* null; + char* quote; + + bool accept_csv_option(std::pair* option); +}; + struct ImportExportOptions { ImportExportOptions(); ~ImportExportOptions(); ImportType format; char* encoding; + CsvOptions* csv_options; }; } // namespace hsql diff --git a/src/sql/ImportStatement.h b/src/sql/ImportStatement.h index 214d1d84..b3119dec 100644 --- a/src/sql/ImportStatement.h +++ b/src/sql/ImportStatement.h @@ -17,6 +17,7 @@ struct ImportStatement : SQLStatement { char* tableName; Expr* whereClause; char* encoding; + CsvOptions* csv_options; }; } // namespace hsql diff --git a/src/sql/statements.cpp b/src/sql/statements.cpp index 63eb0dd7..69cfc709 100644 --- a/src/sql/statements.cpp +++ b/src/sql/statements.cpp @@ -140,7 +140,8 @@ ExportStatement::ExportStatement(ImportType type) schema(nullptr), tableName(nullptr), select(nullptr), - encoding(nullptr) {} + encoding(nullptr), + csv_options(nullptr) {} ExportStatement::~ExportStatement() { free(filePath); @@ -148,11 +149,47 @@ ExportStatement::~ExportStatement() { free(tableName); delete select; free(encoding); + delete csv_options; } -ImportExportOptions::ImportExportOptions() : format(kImportAuto), encoding(nullptr) {} +CsvOptions::CsvOptions() : delimiter(nullptr), null(nullptr), quote(nullptr) {} +CsvOptions::~CsvOptions() { + free(delimiter); + free(null); + free(quote); +} + +bool CsvOptions::accept_csv_option(std::pair* option) { + switch (option->first) { + case CsvOptionType::Delimiter: + if (delimiter != nullptr) { + return false; + } + delimiter = option->second; + break; + case CsvOptionType::Null: + if (null != nullptr) { + return false; + } + null = option->second; + break; + case CsvOptionType::Quote: + if (quote != nullptr) { + return false; + } + quote = option->second; + break; + } + + return true; +} -ImportExportOptions::~ImportExportOptions() { free(encoding); } +ImportExportOptions::ImportExportOptions() : format(kImportAuto), encoding(nullptr), csv_options(nullptr) {} + +ImportExportOptions::~ImportExportOptions() { + free(encoding); + delete csv_options; +} // ImportStatement ImportStatement::ImportStatement(ImportType type) @@ -162,7 +199,8 @@ ImportStatement::ImportStatement(ImportType type) schema(nullptr), tableName(nullptr), whereClause(nullptr), - encoding(nullptr) {} + encoding(nullptr), + csv_options(nullptr) {} ImportStatement::~ImportStatement() { free(filePath); @@ -170,6 +208,7 @@ ImportStatement::~ImportStatement() { free(tableName); delete whereClause; free(encoding); + delete csv_options; } // InsertStatement diff --git a/test/queries/queries-bad.sql b/test/queries/queries-bad.sql index 0159ceca..119d9320 100644 --- a/test/queries/queries-bad.sql +++ b/test/queries/queries-bad.sql @@ -102,3 +102,11 @@ !SELECT * FROM students ORDER BY name FIRST; !SELECT * FROM students ORDER BY name ASC LAST; !SELECT * FROM students ORDER BY name DESC NULLS gibberish; +# CSV options +!COPY students FROM 'file_path' WITH (FORMAT TBL, DELIMITER '|', NULL '', QUOTE '"'); +!COPY students FROM 'file_path' WITH (DELIMITER '|', NULL '', QUOTE '"', FORMAT TBL); +!COPY students FROM 'file_path' WITH (DELIMITER '|', NULL '', FORMAT TBL, QUOTE '"'); +!COPY students FROM 'file_path' WITH (DELIMITER '|', NULL '', QUOTE '"', NULL 'a'); +!COPY students FROM 'file_path' WITH (NULL '', QUOTE '"', DELIMITER '|', DELIMITER '/'); +!COPY students FROM 'file_path' WITH (QUOTE '"', NULL '', DELIMITER '/', QUOTE '_',); +!COPY students FROM 'file_path' WITH (FORMAT CSV, QUOTE '"', DELIMINIMITER '|'); diff --git a/test/queries/queries-good.sql b/test/queries/queries-good.sql index ca210875..1a45ff6b 100755 --- a/test/queries/queries-good.sql +++ b/test/queries/queries-good.sql @@ -74,6 +74,10 @@ COPY students FROM 'file_path' WITH (FORMAT TBL); COPY students FROM 'file_path' WITH (FORMAT CSV); COPY students FROM 'file_path' WITH (FORMAT BIN); COPY students FROM 'file_path' WITH (FORMAT BINARY); +COPY students FROM 'file_path' WITH (FORMAT CSV, DELIMITER '|', NULL '', QUOTE '"'); +COPY students FROM 'file_path' WITH (DELIMITER '|', NULL '', FORMAT CSV, QUOTE '"'); +COPY students FROM 'file_path' WITH (DELIMITER '|', NULL '', QUOTE '"'); +COPY students FROM 'file_path' WITH (DELIMITER '|', FORMAT CSV); COPY students FROM 'file_path' (FORMAT TBL); COPY good_students FROM 'file_path' WHERE grade > (SELECT AVG(grade) from alumni); COPY students TO 'student.tbl'; diff --git a/test/sql_tests.cpp b/test/sql_tests.cpp index df70b522..58264ba2 100644 --- a/test/sql_tests.cpp +++ b/test/sql_tests.cpp @@ -466,16 +466,23 @@ TEST(ImportStatementTest) { } TEST(CopyStatementTest) { - TEST_PARSE_SINGLE_SQL("COPY students FROM 'students_file' WITH (FORMAT BINARY);", kStmtImport, ImportStatement, - import_result, import_stmt); + TEST_PARSE_SINGLE_SQL("COPY students FROM 'students_file' WITH (FORMAT CSV, DELIMITER '|', NULL '', QUOTE '\"');", + kStmtImport, ImportStatement, import_result, import_stmt); - ASSERT_EQ(import_stmt->type, kImportBinary); + ASSERT_EQ(import_stmt->type, kImportCSV); ASSERT_NOTNULL(import_stmt->tableName); ASSERT_STREQ(import_stmt->tableName, "students"); ASSERT_NOTNULL(import_stmt->filePath); ASSERT_STREQ(import_stmt->filePath, "students_file"); ASSERT_NULL(import_stmt->whereClause); ASSERT_NULL(import_stmt->encoding); + ASSERT_NOTNULL(import_stmt->csv_options); + ASSERT_NOTNULL(import_stmt->csv_options->delimiter); + ASSERT_STREQ(import_stmt->csv_options->delimiter, "|"); + ASSERT_NOTNULL(import_stmt->csv_options->null); + ASSERT_STREQ(import_stmt->csv_options->null, ""); + ASSERT_NOTNULL(import_stmt->csv_options->quote); + ASSERT_STREQ(import_stmt->csv_options->quote, "\""); TEST_PARSE_SINGLE_SQL("COPY students FROM 'students_file' WHERE lastname = 'Potter';", kStmtImport, ImportStatement, import_filter_result, import_filter_stmt); @@ -492,17 +499,19 @@ TEST(CopyStatementTest) { ASSERT_EQ(import_filter_stmt->whereClause->expr2->type, kExprLiteralString); ASSERT_STREQ(import_filter_stmt->whereClause->expr2->name, "Potter"); ASSERT_NULL(import_filter_stmt->encoding); + ASSERT_NULL(import_filter_stmt->csv_options); - TEST_PARSE_SINGLE_SQL("COPY students TO 'students_file' WITH (ENCODING 'FSST', FORMAT CSV);", kStmtExport, + TEST_PARSE_SINGLE_SQL("COPY students TO 'students_file' WITH (ENCODING 'FSST', FORMAT BINARY);", kStmtExport, ExportStatement, export_table_result, export_table_stmt); - ASSERT_EQ(export_table_stmt->type, kImportCSV); + ASSERT_EQ(export_table_stmt->type, kImportBinary); ASSERT_NOTNULL(export_table_stmt->tableName); ASSERT_STREQ(export_table_stmt->tableName, "students"); ASSERT_NOTNULL(export_table_stmt->filePath); ASSERT_STREQ(export_table_stmt->filePath, "students_file"); ASSERT_NULL(export_table_stmt->select); ASSERT_STREQ(export_table_stmt->encoding, "FSST"); + ASSERT_NULL(export_table_stmt->csv_options); TEST_PARSE_SINGLE_SQL( "COPY (SELECT firstname, lastname FROM students) TO 'students_file' WITH (ENCODING 'Dictionary');", kStmtExport, @@ -513,6 +522,7 @@ TEST(CopyStatementTest) { ASSERT_NOTNULL(export_select_stmt->filePath); ASSERT_STREQ(export_select_stmt->filePath, "students_file"); ASSERT_STREQ(export_select_stmt->encoding, "Dictionary"); + ASSERT_NULL(export_select_stmt->csv_options); ASSERT_NOTNULL(export_select_stmt->select); const auto& select_stmt = export_select_stmt->select;