From daf8fe7a45b23d5c9999f24c3c02605396a16328 Mon Sep 17 00:00:00 2001 From: javrucebo Date: Tue, 16 Jan 2018 00:45:55 +0100 Subject: [PATCH 1/5] Changing Grammar to extend CASE WHEN statement: - allow multiple WHEN statements - allow for syntax like `CASE x WHEN 1 THEN 2 WHEN 3 THEN 4 ELSE 5 END` NOTE: This changes also the way the CASE operator is stored: - CASE [expr] exprList [ELSE expr2] END - exprList holds each of the WHEN statements with: expr := WHEN, expr2 := THEN Added also tests in test/select_tests.cpp and adapted the existing one to reflect the new storage --- src/parser/bison_parser.y | 17 +++++++--- src/sql/Expr.cpp | 51 +++++++++++++++++++++++------ src/sql/Expr.h | 15 +++++++-- test/select_tests.cpp | 69 +++++++++++++++++++++++++++++++++++++-- 4 files changed, 132 insertions(+), 20 deletions(-) diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index 7d280a9..8163db2 100755 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -195,7 +195,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha %type expr operand scalar_expr unary_expr binary_expr logic_expr exists_expr %type function_expr between_expr expr_alias param_expr %type column_name literal int_literal num_literal string_literal -%type comp_expr opt_where join_condition opt_having case_expr in_expr hint +%type comp_expr opt_where join_condition opt_having case_expr case_list in_expr hint %type array_expr array_index null_literal %type opt_limit opt_top %type order_desc @@ -781,11 +781,18 @@ in_expr: | operand NOT IN '(' select_no_paren ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); } ; -// TODO: allow no else specified +// CASE grammar based on: flex & bison by John Levine +// https://www.safaribooksonline.com/library/view/flex-bison/9780596805418/ch04.html#id352665 case_expr: - CASE WHEN expr THEN operand END { $$ = Expr::makeCase($3, $5); } - | - CASE WHEN expr THEN operand ELSE operand END { $$ = Expr::makeCase($3, $5, $7); } + CASE expr case_list END { $$ = Expr::makeCaseExpr($2, $3); } + | CASE expr case_list ELSE expr END { $$ = Expr::makeCaseExpr($2, $3, $5); } + | CASE case_list END { $$ = Expr::makeCase($2); } + | CASE case_list ELSE expr END { $$ = Expr::makeCase($2, $4); } + ; + +case_list: + WHEN expr THEN expr { $$ = Expr::makeCaseCondition($2, $4); } + | case_list WHEN expr THEN expr { $$ = Expr::joinCaseCondition($1, Expr::makeCaseCondition($3, $5)); } ; exists_expr: diff --git a/src/sql/Expr.cpp b/src/sql/Expr.cpp index 51632e3..9cc05a4 100644 --- a/src/sql/Expr.cpp +++ b/src/sql/Expr.cpp @@ -68,22 +68,53 @@ namespace hsql { return e; } - Expr* Expr::makeCase(Expr* expr, Expr* then) { - Expr* e = new Expr(kExprOperator); + Expr* Expr::makeCaseCondition(Expr* expr, Expr* then) { + Expr* e = new Expr(kExprWhenCondition); e->expr = expr; - e->opType = kOpCase; - e->exprList = new std::vector(); - e->exprList->push_back(then); + e->expr2 = then; return e; } - Expr* Expr::makeCase(Expr* expr, Expr* then, Expr* other) { + Expr* Expr::joinCaseCondition(Expr* expr1, Expr* expr2) { + Expr* e = new Expr(kExprOperator); + e->opType = kOpPlus; + if (expr1->exprList != nullptr) { + e->exprList = expr1->exprList; + } else { + e->exprList = new std::vector(); + e->exprList->push_back(expr1); + } + e->exprList->push_back(expr2); + return e; + } + + Expr* Expr::makeCase(Expr* when) { Expr* e = new Expr(kExprOperator); - e->expr = expr; e->opType = kOpCase; - e->exprList = new std::vector(); - e->exprList->push_back(then); - e->exprList->push_back(other); + if (when->exprList != nullptr) { + e->exprList = when->exprList; + } else { + e->exprList = new std::vector(); + e->exprList->push_back(when); + } + return e; + } + + Expr* Expr::makeCase(Expr* when, Expr* other) { + Expr* e = Expr::makeCase(when); + e->expr2 = other; + return e; + } + + Expr* Expr::makeCaseExpr(Expr* expr, Expr* when) { + Expr* e = Expr::makeCase(when); + e->expr = expr; + return e; + } + + Expr* Expr::makeCaseExpr(Expr* expr, Expr* when, Expr* other) { + Expr* e = Expr::makeCase(when, other); + e->expr = expr; return e; } diff --git a/src/sql/Expr.h b/src/sql/Expr.h index dcaddee..e4ede07 100644 --- a/src/sql/Expr.h +++ b/src/sql/Expr.h @@ -25,7 +25,8 @@ namespace hsql { kExprSelect, kExprHint, kExprArray, - kExprArrayIndex + kExprArrayIndex, + kExprWhenCondition }; // Operator types. These are important for expressions of type kExprOperator. @@ -113,9 +114,17 @@ namespace hsql { static Expr* makeBetween(Expr* expr, Expr* left, Expr* right); - static Expr* makeCase(Expr* expr, Expr* then); + static Expr* makeCaseCondition(Expr* expr, Expr* then); - static Expr* makeCase(Expr* expr, Expr* then, Expr* other); + static Expr* joinCaseCondition(Expr* expr, Expr* then); + + static Expr* makeCase(Expr* when); + + static Expr* makeCase(Expr* when, Expr* other); + + static Expr* makeCaseExpr(Expr* expr, Expr* when); + + static Expr* makeCaseExpr(Expr* expr, Expr* when, Expr* other); static Expr* makeLiteral(int64_t val); diff --git a/test/select_tests.cpp b/test/select_tests.cpp index 2d25b92..5353201 100644 --- a/test/select_tests.cpp +++ b/test/select_tests.cpp @@ -214,9 +214,74 @@ TEST(SelectCaseWhen) { ASSERT_NOTNULL(caseExpr); ASSERT(caseExpr->isType(kExprOperator)); ASSERT_EQ(caseExpr->opType, kOpCase); - ASSERT(caseExpr->expr->isType(kExprOperator)); - ASSERT_EQ(caseExpr->expr->opType, kOpEquals); + ASSERT_NULL(caseExpr->expr); + ASSERT_NOTNULL(caseExpr->exprList); + ASSERT_NOTNULL(caseExpr->expr2); + ASSERT_EQ(caseExpr->exprList->size(), 1); + ASSERT(caseExpr->expr2->isType(kExprLiteralInt)); + + Expr* whenExpr = caseExpr->exprList->at(0); + ASSERT(whenExpr->expr->isType(kExprOperator)); + ASSERT_EQ(whenExpr->expr->opType, kOpEquals); + ASSERT(whenExpr->expr->expr->isType(kExprColumnRef)); + ASSERT(whenExpr->expr->expr2->isType(kExprLiteralString)); +} + +TEST(SelectCaseWhenWhen) { + TEST_PARSE_SINGLE_SQL( + "SELECT CASE WHEN x = 1 THEN 1 WHEN 1.25 < x THEN 2 END FROM test;", + kStmtSelect, + SelectStatement, + result, + stmt); + + ASSERT_EQ(stmt->selectList->size(), 1); + Expr* caseExpr = stmt->selectList->at(0); + ASSERT_NOTNULL(caseExpr); + ASSERT(caseExpr->isType(kExprOperator)); + ASSERT_EQ(caseExpr->opType, kOpCase); + // CASE [expr] [exprList] [expr2] + // [expr] [expr] + // [expr] [expr2] [expr] [expr2] + // CASE (null) WHEN X = 1 THEN 1 WHEN 1.25 < x THEN 2 (null) + ASSERT_NULL(caseExpr->expr); + ASSERT_NOTNULL(caseExpr->exprList); + ASSERT_NULL(caseExpr->expr2); ASSERT_EQ(caseExpr->exprList->size(), 2); + + Expr* whenExpr = caseExpr->exprList->at(0); + ASSERT_EQ(whenExpr->expr->opType, kOpEquals); + ASSERT(whenExpr->expr->expr->isType(kExprColumnRef)); + ASSERT(whenExpr->expr->expr2->isType(kExprLiteralInt)); + + Expr* whenExpr2 = caseExpr->exprList->at(1); + ASSERT_EQ(whenExpr2->expr->opType, kOpLess); + ASSERT(whenExpr2->expr->expr->isType(kExprLiteralFloat)); + ASSERT(whenExpr2->expr->expr2->isType(kExprColumnRef)); +} + +TEST(SelectCaseValueWhenWhenElse) { + TEST_PARSE_SINGLE_SQL( + "SELECT CASE x WHEN 1 THEN 0 WHEN 2 THEN 3 WHEN 8 THEN 7 ELSE 4 END FROM test;", + kStmtSelect, + SelectStatement, + result, + stmt); + + ASSERT_EQ(stmt->selectList->size(), 1); + Expr* caseExpr = stmt->selectList->at(0); + ASSERT_NOTNULL(caseExpr); + ASSERT(caseExpr->isType(kExprOperator)); + ASSERT_EQ(caseExpr->opType, kOpCase); + ASSERT_NOTNULL(caseExpr->expr); + ASSERT_NOTNULL(caseExpr->exprList); + ASSERT_NOTNULL(caseExpr->expr2); + ASSERT_EQ(caseExpr->exprList->size(), 3); + ASSERT(caseExpr->expr->isType(kExprColumnRef)); + + Expr* whenExpr = caseExpr->exprList->at(2); + ASSERT(whenExpr->expr->isType(kExprLiteralInt)); + ASSERT_EQ(whenExpr->expr2->ival, 7); } TEST(SelectJoin) { From 074bce4d901584a7f024783a0dacbaef57443736 Mon Sep 17 00:00:00 2001 From: Moritz Eyssen Date: Wed, 17 Jan 2018 13:11:39 +0100 Subject: [PATCH 2/5] dix and adapt casecasewhen --- src/parser/bison_parser.cpp | 1322 ++++++++++++++++++----------------- src/parser/bison_parser.y | 12 +- src/sql/Expr.cpp | 58 +- src/sql/Expr.h | 21 +- 4 files changed, 714 insertions(+), 699 deletions(-) diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 8aafc9b..6376771 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -619,16 +619,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 52 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 552 +#define YYLAST 541 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 151 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 87 +#define YYNNTS 88 /* YYNRULES -- Number of rules. */ -#define YYNRULES 201 +#define YYNRULES 205 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 371 +#define YYNSTATES 382 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -701,13 +701,13 @@ static const yytype_uint16 yyrline[] = 736, 737, 738, 739, 740, 741, 742, 746, 747, 751, 752, 753, 754, 755, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 773, 774, 778, 779, 780, - 781, 786, 788, 792, 793, 797, 798, 799, 800, 801, - 802, 806, 807, 811, 815, 819, 823, 824, 825, 826, - 830, 831, 832, 833, 837, 842, 843, 847, 851, 855, - 867, 868, 878, 879, 883, 884, 893, 894, 899, 910, - 919, 920, 925, 926, 930, 931, 939, 947, 957, 976, - 977, 978, 979, 980, 981, 982, 983, 988, 997, 998, - 1003, 1004 + 781, 787, 788, 789, 790, 794, 795, 799, 800, 804, + 805, 806, 807, 808, 809, 813, 814, 818, 822, 826, + 830, 831, 832, 833, 837, 838, 839, 840, 844, 849, + 850, 854, 858, 862, 874, 875, 885, 886, 890, 891, + 900, 901, 906, 917, 926, 927, 932, 933, 937, 938, + 946, 954, 964, 983, 984, 985, 986, 987, 988, 989, + 990, 995, 1004, 1005, 1010, 1011 }; #endif @@ -750,13 +750,14 @@ static const char *const yytname[] = "order_desc", "opt_order_type", "opt_top", "opt_limit", "expr_list", "literal_list", "expr_alias", "expr", "operand", "scalar_expr", "unary_expr", "binary_expr", "logic_expr", "in_expr", "case_expr", - "exists_expr", "comp_expr", "function_expr", "array_expr", "array_index", - "between_expr", "column_name", "literal", "string_literal", - "num_literal", "int_literal", "null_literal", "param_expr", "table_ref", - "table_ref_atomic", "nonjoin_table_ref_atomic", "table_ref_commalist", - "table_ref_name", "table_ref_name_no_alias", "table_name", "alias", - "opt_alias", "join_clause", "opt_join_type", "join_condition", - "opt_semicolon", "ident_commalist", YY_NULLPTR + "case_list", "exists_expr", "comp_expr", "function_expr", "array_expr", + "array_index", "between_expr", "column_name", "literal", + "string_literal", "num_literal", "int_literal", "null_literal", + "param_expr", "table_ref", "table_ref_atomic", + "nonjoin_table_ref_atomic", "table_ref_commalist", "table_ref_name", + "table_ref_name_no_alias", "table_name", "alias", "opt_alias", + "join_clause", "opt_join_type", "join_condition", "opt_semicolon", + "ident_commalist", YY_NULLPTR }; #endif @@ -784,58 +785,59 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -232 +#define YYPACT_NINF -295 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-232))) + (!!((Yystate) == (-295))) -#define YYTABLE_NINF -197 +#define YYTABLE_NINF -201 #define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-197))) + (!!((Yytable_value) == (-201))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - 268, 42, 35, 73, 110, -43, -30, 39, 41, 32, - 35, 30, 11, -39, 147, 3, -232, 82, 82, -232, - -232, -232, -232, -232, -232, -232, -232, -232, -232, 28, - -232, 27, 169, 49, -232, 56, 126, 100, 100, 35, - 117, 35, 226, 205, 123, -232, 128, 128, 35, -232, - 101, 103, -232, 268, -232, 170, -232, -232, -232, -232, - -232, -39, 152, 144, -39, 194, -232, 258, 14, 261, - 159, 35, 35, 196, -232, 190, 127, -232, -232, -232, - 151, 270, 231, 35, 35, -232, -232, -232, -232, 131, - -232, 212, -232, -232, -232, 151, 212, 226, -232, -232, - -232, -232, -232, -232, -44, -232, -232, -232, -232, -232, - -232, -232, -232, 241, -56, 127, 151, -232, 280, 279, - -16, -84, 140, 188, 155, 161, 75, -232, 113, 213, - 157, -232, 65, 211, -232, -232, -232, -232, -232, -232, - -232, -232, -232, -232, -232, -232, -232, -232, 181, -61, - -232, -232, -232, -232, 306, 194, 164, -232, -46, 194, - 264, -232, 14, -232, 202, 315, 207, -78, 234, -232, - -232, -37, 179, -232, 2, 5, 276, 151, 185, 75, - 381, 151, 99, 180, -86, 4, 196, 151, -232, 151, - 324, 151, -232, -232, 75, -232, 75, -47, 186, -62, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 226, 151, 270, -232, 187, 34, - -232, -232, 151, -232, -232, -232, -232, 226, -232, 253, - 7, 48, -232, -39, 35, -232, 331, 14, -232, 151, - -232, -232, 192, -50, 276, 254, 26, -232, -232, -39, - -232, 24, -232, -232, 10, -232, 283, -232, -232, -232, - 256, 322, 409, 75, 210, 113, -232, 266, 217, 409, - 409, 409, 235, 235, 235, 235, 99, 99, -95, -95, - -95, 50, 218, -78, -232, 14, -232, 306, -232, -232, - 280, -232, -232, -232, -232, -232, -232, 315, -232, -232, - -232, 53, 59, -232, 75, 224, -232, 233, 277, -232, - -232, -232, 309, 312, 4, 295, -232, 267, -232, 75, - 409, 113, 238, 60, -232, -232, 69, -232, -232, -232, - -232, -232, 278, -232, 10, 4, -232, -232, 229, 236, - 4, 151, 381, 240, 78, -232, -232, -232, 75, -232, - -232, -232, 4, 142, -27, -232, -232, 348, 229, 243, - 151, 151, -232, -232, 6, -78, -232, -78, 242, 244, - -232 + 226, 9, 41, 66, 91, -37, 23, 28, 46, 3, + 41, -17, 13, -32, 68, 27, -295, 87, 87, -295, + -295, -295, -295, -295, -295, -295, -295, -295, -295, 22, + -295, 31, 164, 45, -295, 52, 123, 102, 102, 41, + 115, 41, 224, 219, 139, -295, 116, 116, 41, -295, + 110, 111, -295, 226, -295, 178, -295, -295, -295, -295, + -295, -32, 170, 162, -32, 221, -295, 282, 10, 288, + 177, 41, 41, 220, -295, 218, 154, -295, -295, -295, + 165, 297, 265, 41, 41, -295, -295, -295, -295, 168, + -295, 247, -295, -295, -295, 165, 247, 224, -295, -295, + -295, -295, -295, -295, -67, -295, -295, -295, -295, -295, + -295, -295, -295, 283, -61, 154, 165, -295, 318, 322, + -10, 19, 182, 84, 241, 186, 197, -295, 145, 249, + 184, -295, 6, 272, -295, -295, -295, -295, -295, -295, + -295, -295, -295, -295, -295, -295, -295, -295, 210, -48, + -295, -295, -295, -295, 334, 221, 191, -295, -40, 221, + 295, -295, 10, -295, 231, 341, 232, 55, 260, -295, + -295, -28, 203, -295, 1, 8, 300, 165, 93, 82, + 206, 197, 342, 165, 72, 207, -74, 7, 220, 165, + -295, 165, 349, 165, -295, -295, 197, -295, 197, -62, + 209, 119, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 197, 224, 165, 297, -295, + 213, 90, -295, -295, 165, -295, -295, -295, -295, 224, + -295, 275, -2, 103, -295, -32, 41, -295, 359, 10, + -295, 165, -295, -295, 217, 63, 83, 165, 165, -295, + 300, 277, -98, -295, -295, -32, -295, -20, -295, -295, + 5, -295, 306, -295, -295, -295, 266, 316, 374, 197, + 222, 145, -295, 279, 227, 374, 374, 374, 398, 398, + 398, 398, 72, 72, 65, 65, 65, -21, 228, 55, + -295, 10, -295, 334, -295, -295, 318, -295, -295, -295, + -295, -295, -295, 341, -295, -295, -295, 117, 118, -295, + 165, 165, -295, 121, 77, 229, -295, 234, 287, -295, + -295, -295, 308, 309, 7, 296, -295, 259, -295, 197, + 374, 145, 237, 127, -295, -295, 163, -295, -295, -295, + -295, -295, 55, 122, -295, 165, -295, 5, 7, -295, + -295, 270, 235, 7, 165, 342, 242, 175, -295, -295, + -295, -295, 55, -295, -295, 7, 239, -24, -295, -295, + 270, 240, 165, 165, -295, 18, 55, -295, 55, 245, + 248, -295 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -844,71 +846,72 @@ static const yytype_int16 yypact[] = static const yytype_uint8 yydefact[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, - 0, 0, 0, 0, 0, 199, 3, 18, 18, 16, + 0, 0, 0, 0, 0, 203, 3, 18, 18, 16, 9, 7, 10, 15, 12, 13, 11, 14, 8, 59, - 60, 86, 0, 180, 50, 25, 0, 36, 36, 0, - 0, 0, 0, 76, 0, 179, 48, 48, 0, 30, - 0, 0, 1, 198, 2, 0, 6, 5, 70, 71, + 60, 86, 0, 184, 50, 25, 0, 36, 36, 0, + 0, 0, 0, 76, 0, 183, 48, 48, 0, 30, + 0, 0, 1, 202, 2, 0, 6, 5, 70, 71, 69, 0, 73, 0, 0, 97, 46, 0, 0, 0, - 0, 0, 0, 80, 28, 0, 54, 167, 93, 75, + 0, 0, 0, 80, 28, 0, 54, 171, 93, 75, 0, 0, 0, 0, 0, 31, 63, 62, 4, 0, - 64, 86, 65, 72, 68, 0, 86, 0, 66, 181, - 164, 165, 168, 169, 0, 100, 160, 161, 166, 162, - 163, 24, 23, 0, 0, 54, 0, 49, 0, 0, - 0, 156, 0, 0, 0, 0, 0, 158, 0, 0, - 77, 98, 185, 103, 110, 111, 112, 105, 107, 113, + 64, 86, 65, 72, 68, 0, 86, 0, 66, 185, + 168, 169, 172, 173, 0, 100, 164, 165, 170, 166, + 167, 24, 23, 0, 0, 54, 0, 49, 0, 0, + 0, 160, 0, 0, 0, 0, 0, 162, 0, 0, + 77, 98, 189, 103, 110, 111, 112, 105, 107, 113, 106, 124, 114, 115, 109, 104, 117, 118, 0, 80, 56, 47, 44, 45, 0, 97, 85, 87, 92, 97, 95, 26, 0, 35, 0, 0, 0, 79, 0, 29, - 200, 0, 0, 52, 76, 0, 0, 0, 0, 0, - 120, 0, 119, 0, 0, 0, 80, 0, 183, 0, - 0, 0, 184, 102, 0, 121, 0, 0, 0, 0, + 204, 0, 0, 52, 76, 0, 0, 0, 0, 0, + 0, 0, 120, 0, 119, 0, 0, 0, 80, 0, + 187, 0, 0, 0, 188, 102, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 55, 21, 0, - 19, 61, 0, 91, 90, 89, 67, 0, 101, 0, - 0, 0, 37, 0, 0, 53, 0, 0, 151, 0, - 157, 159, 0, 0, 0, 0, 0, 116, 108, 0, - 78, 170, 172, 174, 185, 173, 82, 99, 135, 182, - 136, 0, 131, 0, 0, 0, 122, 0, 134, 133, - 145, 146, 147, 148, 149, 150, 126, 125, 128, 127, - 129, 130, 0, 58, 57, 0, 17, 0, 88, 96, - 0, 41, 42, 43, 40, 39, 33, 0, 34, 27, - 201, 0, 0, 143, 0, 0, 153, 0, 0, 195, - 189, 190, 194, 193, 0, 0, 178, 0, 74, 0, - 132, 0, 0, 0, 123, 154, 0, 20, 32, 38, - 51, 152, 0, 144, 185, 0, 192, 191, 176, 171, - 0, 0, 155, 0, 0, 139, 137, 22, 0, 141, - 175, 186, 0, 196, 84, 140, 138, 0, 177, 0, - 0, 0, 81, 142, 0, 197, 187, 83, 156, 0, - 188 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, + 21, 0, 19, 61, 0, 91, 90, 89, 67, 0, + 101, 0, 0, 0, 37, 0, 0, 53, 0, 0, + 155, 0, 161, 163, 0, 0, 0, 0, 0, 143, + 0, 0, 0, 116, 108, 0, 78, 174, 176, 178, + 189, 177, 82, 99, 135, 186, 136, 0, 131, 0, + 0, 0, 122, 0, 134, 133, 149, 150, 151, 152, + 153, 154, 126, 125, 128, 127, 129, 130, 0, 58, + 57, 0, 17, 0, 88, 96, 0, 41, 42, 43, + 40, 39, 33, 0, 34, 27, 205, 0, 0, 147, + 0, 0, 141, 0, 0, 0, 157, 0, 0, 199, + 193, 194, 198, 197, 0, 0, 182, 0, 74, 0, + 132, 0, 0, 0, 123, 158, 0, 20, 32, 38, + 51, 156, 145, 0, 144, 0, 148, 189, 0, 196, + 195, 180, 175, 0, 0, 159, 0, 0, 139, 137, + 22, 142, 146, 179, 190, 0, 200, 84, 140, 138, + 181, 0, 0, 0, 81, 0, 201, 191, 83, 160, + 0, 192 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -232, -232, -232, 338, -232, 374, -232, 107, -232, -232, - -232, -232, -232, 105, -232, -232, 359, -232, 102, -232, - -232, 351, -232, -232, -232, 285, -232, -232, 189, -64, - 13, 337, -13, 378, -232, -232, 182, 246, -232, -232, - -128, -232, -232, 91, -232, 200, -232, -232, -68, -175, - -220, 245, -94, -71, -232, -232, -232, -232, -232, -232, - -232, -232, -232, -232, -232, -232, 61, -66, -113, -232, - -38, -232, -232, -232, -162, 88, -232, -232, -232, 1, - -232, -231, -232, -232, -232, -232, -232 + -295, -295, -295, 340, -295, 377, -295, 106, -295, -295, + -295, -295, -295, 107, -295, -295, 369, -295, 113, -295, + -295, 367, -295, -295, -295, 302, -295, -295, 202, -178, + 14, 357, -13, 391, -295, -295, 230, 250, -295, -295, + -97, -295, -295, 21, -295, 199, -295, -295, -45, -176, + -215, 238, -94, -70, -295, -295, -295, -295, -295, -295, + 251, -295, -295, -295, -295, -295, -295, 51, -66, -113, + -295, -39, -295, -295, -295, -294, 80, -295, -295, -295, + 2, -295, -241, -295, -295, -295, -295, -295 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 14, 15, 16, 17, 56, 219, 220, 18, 112, - 19, 20, 75, 168, 21, 22, 71, 231, 232, 295, + -1, 14, 15, 16, 17, 56, 221, 222, 18, 112, + 19, 20, 75, 168, 21, 22, 71, 233, 234, 301, 23, 83, 24, 25, 26, 120, 27, 149, 150, 28, - 29, 91, 30, 61, 62, 94, 31, 80, 129, 186, - 117, 318, 362, 65, 156, 157, 225, 43, 98, 130, + 29, 91, 30, 61, 62, 94, 31, 80, 129, 188, + 117, 328, 374, 65, 156, 157, 227, 43, 98, 130, 104, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 106, 107, - 108, 109, 110, 250, 251, 252, 339, 253, 44, 254, - 192, 193, 255, 315, 366, 54, 171 + 179, 140, 141, 142, 143, 144, 145, 146, 147, 106, + 107, 108, 109, 110, 256, 257, 258, 352, 259, 44, + 260, 194, 195, 261, 325, 377, 54, 171 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -916,122 +919,120 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 51, 158, 105, 34, 78, 169, 246, 33, 240, 368, - 9, 45, 116, 188, 79, 361, 189, 301, 100, 101, - 77, 217, 167, 316, 189, 164, 50, 37, 266, 200, - 48, 223, 291, 9, 184, 191, 58, 58, 33, 172, - 73, 263, 76, 191, 292, 304, 213, 267, 214, 85, - 308, 39, 189, 180, 38, 182, 189, 224, 256, 160, - 248, 174, 49, 175, 302, 326, 59, 59, 188, 32, - 264, 191, 114, 115, 90, 191, 35, 90, 121, 100, - 101, 77, 309, 243, 152, 153, 310, 221, 216, 165, - 323, 226, 311, 312, 63, 258, 228, 260, 60, 60, - 46, 293, 161, 350, 102, 162, 13, 173, 180, 235, - -196, 313, 236, 36, 294, 183, 121, 100, 101, 77, - 40, 283, 187, 261, 190, 262, 41, 47, 158, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 241, 127, 42, 344, 52, 238, 249, - 123, 53, 338, 122, 121, 100, 101, 77, 121, 100, - 101, 77, 9, 242, 103, 102, 354, 189, 308, 298, - 306, 105, 66, 314, 200, 187, 282, 169, 353, 190, - 286, 55, 155, 287, 179, 307, 191, 159, 123, 289, - 358, 122, 320, 214, 296, 178, 67, 297, 125, 330, - 309, 68, 162, 102, 310, 331, 346, 69, 187, 187, - 311, 312, 126, 127, 359, 347, 70, 79, 162, 105, - 128, 74, 124, 200, 356, 103, 123, 187, 194, 313, - 123, 305, 77, 332, 81, 299, 125, 210, 211, 212, - 213, 102, 214, 92, 82, 102, 92, 86, 342, 87, - 126, 127, 322, 93, 89, 308, 195, 97, 128, 95, - 124, 99, 360, 103, 179, 111, 365, 367, 113, 116, - 118, 151, 119, 148, 125, 1, 154, 357, 125, 63, - 195, 163, 170, 2, 100, 176, 177, 309, 126, 127, - 3, 310, 126, 127, 185, 4, 128, 311, 312, 196, - 128, 103, 5, 6, 181, 103, 187, 215, 343, 218, - 227, 7, 8, 222, 229, -196, 313, 9, 230, 234, - 197, 233, 10, 195, 237, 9, 247, 259, 198, 199, - 244, 265, 285, 290, 300, 200, 201, 202, 303, 203, - 204, 205, 263, 317, 206, 207, 11, 208, 209, 210, - 211, 212, 213, 199, 214, 321, 324, 348, 189, 200, - 214, 12, 325, 335, -197, -197, 196, 195, -197, -197, - 333, 208, 209, 210, 211, 212, 213, 336, 214, 334, - 337, 340, 341, 349, 345, 352, 355, 245, 364, 175, - 370, 88, 57, 195, 327, 328, 199, 72, 84, 329, - 166, 96, 200, 201, 202, 284, 203, 204, 205, 64, - 196, 206, 207, 13, 208, 209, 210, 211, 212, 213, - 239, 214, 288, 351, 319, 369, 195, 0, 0, 0, - 0, 245, 257, 0, 0, 0, 196, 0, 0, 0, - 199, 0, 0, 0, 0, 0, 200, 201, 202, 0, - 203, 204, 205, 363, 195, 206, 207, 245, 208, 209, - 210, 211, 212, 213, 0, 214, 199, 0, 0, 196, - 0, 0, 200, 201, 202, 0, 203, 204, 205, 0, - 0, 206, 207, 0, 208, 209, 210, 211, 212, 213, - 245, 214, 0, 0, 0, 0, 0, -197, 0, 199, - 0, 0, 0, 0, 0, 200, 201, 202, 0, 203, - 204, 205, 0, 0, 206, 207, 0, 208, 209, 210, - 211, 212, 213, 0, 214, 0, 0, 199, 0, 0, - 0, 0, 0, 200, -197, -197, 0, -197, 204, 205, - 0, 0, 206, 207, 0, 208, 209, 210, 211, 212, - 213, 0, 214 + 51, 158, 105, 78, 34, 169, 318, 252, 190, 190, + 33, 242, 45, 79, 100, 101, 77, 9, 373, 326, + 164, 379, 167, 297, 307, 116, 269, 50, 191, 178, + 351, 58, 48, 37, 186, 298, 32, 225, 319, 9, + 58, 73, 320, 76, 33, 172, 316, 193, 321, 322, + 85, 189, 219, 46, 182, 270, 184, 304, 160, 366, + 38, 59, 191, 226, 49, 308, -200, 323, 52, 35, + 59, 370, 254, 114, 115, 90, 336, 317, 90, 161, + 47, 193, 162, 245, 165, 152, 153, 121, 100, 101, + 77, 262, 299, 60, 36, 333, 230, 264, 63, 266, + 102, 218, 60, 202, 39, 300, 363, 173, 191, 40, + 223, 182, 155, 13, 228, 185, 42, 159, 237, 192, + 192, 238, 216, 289, 122, 189, 267, 193, 268, 324, + 158, 41, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 243, 240, 121, 100, + 101, 77, 255, 313, 314, 357, 127, 191, 310, 123, + 103, 247, 311, 244, 174, 191, 175, 66, 121, 100, + 101, 77, 345, 105, 102, 53, 193, 288, 367, 191, + 248, 248, 177, 169, 193, 122, 55, 249, 312, 202, + 295, 177, 67, 124, 9, 191, 202, 68, 193, 330, + 121, 100, 101, 77, 69, 122, 215, 125, 216, 272, + 212, 213, 214, 215, 193, 216, 342, 343, 70, 74, + 123, 126, 127, 191, 191, 105, 344, 361, 273, 128, + 77, 79, 82, 1, 103, 102, 292, 315, 305, 293, + 123, 2, 193, 193, 121, 100, 101, 77, 3, 302, + 81, 362, 303, 4, 124, 102, 86, 87, 332, 355, + 5, 6, 89, 340, 341, 318, 162, 189, 125, 7, + 8, 93, 123, 359, 124, 9, 189, 95, 376, 378, + 10, 180, 126, 127, 97, 99, 113, 102, 125, 196, + 128, 92, 111, 116, 92, 103, 318, 319, 118, 119, + 148, 320, 126, 127, 11, 151, 181, 321, 322, 360, + 128, 371, 162, 154, 63, 103, 123, 197, 356, 12, + 125, 369, 100, 163, 189, 170, 323, 176, 319, 183, + 187, 102, 320, 189, 126, 127, 217, 220, 321, 322, + 224, 229, 128, 231, 232, 236, 235, 103, 239, 9, + 181, 250, 265, 253, 271, 296, -200, 323, 291, 372, + 198, 197, 306, 309, 125, 269, 327, 331, 191, 334, + 216, 13, 335, 348, 354, 346, 349, 350, 126, 127, + 347, 199, 353, 358, 365, 375, 128, 197, 368, 200, + 201, 103, 175, 88, 381, 57, 202, 203, 204, 337, + 205, 206, 207, 338, 198, 208, 209, 72, 210, 211, + 212, 213, 214, 215, 84, 216, 339, 166, 329, 197, + 290, 96, 64, 294, 241, 251, 380, 263, 364, 246, + 198, 0, 0, 0, 201, 0, 0, 0, 0, 0, + 202, 203, 204, 197, 205, 206, 207, 0, 0, 208, + 209, 251, 210, 211, 212, 213, 214, 215, 0, 216, + 201, 0, -201, 0, 0, 0, 202, 203, 204, 0, + 205, 206, 207, 0, 0, 208, 209, 0, 210, 211, + 212, 213, 214, 215, 0, 216, 0, 0, 0, 0, + 0, 0, 201, 0, 0, 0, 0, 0, 202, -201, + -201, 0, -201, 206, 207, 0, 0, 208, 209, 0, + 210, 211, 212, 213, 214, 215, 201, 216, 0, 0, + 0, 0, 202, 0, 0, 0, 0, -201, -201, 0, + 0, -201, -201, 0, 210, 211, 212, 213, 214, 215, + 0, 216 }; static const yytype_int16 yycheck[] = { - 13, 95, 68, 2, 42, 118, 181, 3, 3, 3, - 49, 10, 73, 3, 12, 42, 102, 237, 4, 5, - 6, 149, 116, 254, 102, 81, 13, 70, 90, 124, - 19, 77, 25, 49, 128, 121, 9, 9, 3, 55, - 39, 88, 41, 121, 37, 95, 141, 109, 143, 48, - 26, 81, 102, 124, 97, 126, 102, 103, 186, 97, - 146, 145, 51, 147, 239, 285, 39, 39, 3, 27, - 117, 121, 71, 72, 61, 121, 3, 64, 3, 4, - 5, 6, 58, 177, 83, 84, 62, 155, 149, 145, - 265, 159, 68, 69, 67, 189, 162, 191, 71, 71, - 70, 94, 146, 334, 90, 149, 145, 120, 179, 146, - 86, 87, 149, 3, 107, 128, 3, 4, 5, 6, - 81, 215, 149, 194, 114, 196, 85, 97, 222, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 138, 138, 113, 321, 0, 146, 145, - 75, 148, 314, 40, 3, 4, 5, 6, 3, 4, - 5, 6, 49, 176, 150, 90, 341, 102, 26, 233, - 144, 237, 3, 149, 124, 149, 214, 290, 340, 114, - 146, 99, 91, 149, 109, 249, 121, 96, 75, 227, - 352, 40, 263, 143, 146, 40, 147, 149, 123, 146, - 58, 145, 149, 90, 62, 146, 146, 81, 149, 149, - 68, 69, 137, 138, 72, 146, 116, 12, 149, 285, - 145, 104, 109, 124, 146, 150, 75, 149, 17, 87, - 75, 244, 6, 304, 111, 234, 123, 138, 139, 140, - 141, 90, 143, 61, 116, 90, 64, 146, 319, 146, - 137, 138, 265, 101, 84, 26, 45, 63, 145, 115, - 109, 3, 120, 150, 109, 4, 360, 361, 109, 73, - 80, 40, 145, 3, 123, 7, 145, 348, 123, 67, - 45, 40, 3, 15, 4, 145, 98, 58, 137, 138, - 22, 62, 137, 138, 81, 27, 145, 68, 69, 88, - 145, 150, 34, 35, 143, 150, 149, 126, 321, 3, - 46, 43, 44, 149, 112, 86, 87, 49, 3, 85, - 109, 114, 54, 45, 145, 49, 146, 3, 117, 118, - 145, 145, 145, 80, 3, 124, 125, 126, 146, 128, - 129, 130, 88, 60, 133, 134, 78, 136, 137, 138, - 139, 140, 141, 118, 143, 145, 90, 79, 102, 124, - 143, 93, 144, 86, 129, 130, 88, 45, 133, 134, - 146, 136, 137, 138, 139, 140, 141, 68, 143, 146, - 68, 86, 115, 105, 146, 149, 146, 109, 145, 147, - 146, 53, 18, 45, 287, 290, 118, 38, 47, 297, - 115, 64, 124, 125, 126, 216, 128, 129, 130, 31, - 88, 133, 134, 145, 136, 137, 138, 139, 140, 141, - 174, 143, 222, 335, 102, 364, 45, -1, -1, -1, - -1, 109, 187, -1, -1, -1, 88, -1, -1, -1, - 118, -1, -1, -1, -1, -1, 124, 125, 126, -1, - 128, 129, 130, 105, 45, 133, 134, 109, 136, 137, - 138, 139, 140, 141, -1, 143, 118, -1, -1, 88, - -1, -1, 124, 125, 126, -1, 128, 129, 130, -1, + 13, 95, 68, 42, 2, 118, 26, 183, 3, 3, + 3, 3, 10, 12, 4, 5, 6, 49, 42, 260, + 81, 3, 116, 25, 239, 73, 88, 13, 102, 123, + 324, 9, 19, 70, 128, 37, 27, 77, 58, 49, + 9, 39, 62, 41, 3, 55, 144, 121, 68, 69, + 48, 149, 149, 70, 124, 117, 126, 235, 97, 353, + 97, 39, 102, 103, 51, 241, 86, 87, 0, 3, + 39, 365, 146, 71, 72, 61, 291, 255, 64, 146, + 97, 121, 149, 177, 145, 83, 84, 3, 4, 5, + 6, 188, 94, 71, 3, 271, 162, 191, 67, 193, + 90, 149, 71, 124, 81, 107, 347, 120, 102, 81, + 155, 181, 91, 145, 159, 128, 113, 96, 146, 114, + 114, 149, 143, 217, 40, 149, 196, 121, 198, 149, + 224, 85, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 138, 146, 3, 4, + 5, 6, 145, 247, 248, 331, 138, 102, 95, 75, + 150, 79, 79, 176, 145, 102, 147, 3, 3, 4, + 5, 6, 95, 239, 90, 148, 121, 216, 354, 102, + 98, 98, 98, 296, 121, 40, 99, 105, 105, 124, + 229, 98, 147, 109, 49, 102, 124, 145, 121, 269, + 3, 4, 5, 6, 81, 40, 141, 123, 143, 90, + 138, 139, 140, 141, 121, 143, 310, 311, 116, 104, + 75, 137, 138, 102, 102, 291, 105, 105, 109, 145, + 6, 12, 116, 7, 150, 90, 146, 250, 236, 149, + 75, 15, 121, 121, 3, 4, 5, 6, 22, 146, + 111, 345, 149, 27, 109, 90, 146, 146, 271, 329, + 34, 35, 84, 146, 146, 26, 149, 149, 123, 43, + 44, 101, 75, 146, 109, 49, 149, 115, 372, 373, + 54, 40, 137, 138, 63, 3, 109, 90, 123, 17, + 145, 61, 4, 73, 64, 150, 26, 58, 80, 145, + 3, 62, 137, 138, 78, 40, 109, 68, 69, 146, + 145, 72, 149, 145, 67, 150, 75, 45, 331, 93, + 123, 146, 4, 40, 149, 3, 87, 145, 58, 143, + 81, 90, 62, 149, 137, 138, 126, 3, 68, 69, + 149, 46, 145, 112, 3, 85, 114, 150, 145, 49, + 109, 145, 3, 146, 145, 80, 86, 87, 145, 120, + 88, 45, 3, 146, 123, 88, 60, 145, 102, 90, + 143, 145, 144, 86, 115, 146, 68, 68, 137, 138, + 146, 109, 86, 146, 149, 145, 145, 45, 146, 117, + 118, 150, 147, 53, 146, 18, 124, 125, 126, 293, + 128, 129, 130, 296, 88, 133, 134, 38, 136, 137, + 138, 139, 140, 141, 47, 143, 303, 115, 102, 45, + 218, 64, 31, 224, 174, 109, 375, 189, 348, 178, + 88, -1, -1, -1, 118, -1, -1, -1, -1, -1, + 124, 125, 126, 45, 128, 129, 130, -1, -1, 133, + 134, 109, 136, 137, 138, 139, 140, 141, -1, 143, + 118, -1, 88, -1, -1, -1, 124, 125, 126, -1, + 128, 129, 130, -1, -1, 133, 134, -1, 136, 137, + 138, 139, 140, 141, -1, 143, -1, -1, -1, -1, + -1, -1, 118, -1, -1, -1, -1, -1, 124, 125, + 126, -1, 128, 129, 130, -1, -1, 133, 134, -1, + 136, 137, 138, 139, 140, 141, 118, 143, -1, -1, + -1, -1, 124, -1, -1, -1, -1, 129, 130, -1, -1, 133, 134, -1, 136, 137, 138, 139, 140, 141, - 109, 143, -1, -1, -1, -1, -1, 88, -1, 118, - -1, -1, -1, -1, -1, 124, 125, 126, -1, 128, - 129, 130, -1, -1, 133, 134, -1, 136, 137, 138, - 139, 140, 141, -1, 143, -1, -1, 118, -1, -1, - -1, -1, -1, 124, 125, 126, -1, 128, 129, 130, - -1, -1, 133, 134, -1, 136, 137, 138, 139, 140, - 141, -1, 143 + -1, 143 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1041,41 +1042,42 @@ static const yytype_uint8 yystos[] = 0, 7, 15, 22, 27, 34, 35, 43, 44, 49, 54, 78, 93, 145, 152, 153, 154, 155, 159, 161, 162, 165, 166, 171, 173, 174, 175, 177, 180, 181, - 183, 187, 27, 3, 230, 3, 3, 70, 97, 81, - 81, 85, 113, 198, 229, 230, 70, 97, 19, 51, - 181, 183, 0, 148, 236, 99, 156, 156, 9, 39, + 183, 187, 27, 3, 231, 3, 3, 70, 97, 81, + 81, 85, 113, 198, 230, 231, 70, 97, 19, 51, + 181, 183, 0, 148, 237, 99, 156, 156, 9, 39, 71, 184, 185, 67, 184, 194, 3, 147, 145, 81, - 116, 167, 167, 230, 104, 163, 230, 6, 221, 12, - 188, 111, 116, 172, 172, 230, 146, 146, 154, 84, + 116, 167, 167, 231, 104, 163, 231, 6, 222, 12, + 188, 111, 116, 172, 172, 231, 146, 146, 154, 84, 181, 182, 187, 101, 186, 115, 182, 63, 199, 3, - 4, 5, 90, 150, 201, 218, 219, 220, 221, 222, - 223, 4, 160, 109, 230, 230, 73, 191, 80, 145, + 4, 5, 90, 150, 201, 219, 220, 221, 222, 223, + 224, 4, 160, 109, 231, 231, 73, 191, 80, 145, 176, 3, 40, 75, 109, 123, 137, 138, 145, 189, 200, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 3, 178, - 179, 40, 230, 230, 145, 194, 195, 196, 203, 194, - 221, 146, 149, 40, 81, 145, 176, 203, 164, 219, - 3, 237, 55, 183, 145, 147, 145, 98, 40, 109, - 204, 143, 204, 183, 203, 81, 190, 149, 3, 102, - 114, 121, 231, 232, 17, 45, 88, 109, 117, 118, - 124, 125, 126, 128, 129, 130, 133, 134, 136, 137, - 138, 139, 140, 141, 143, 126, 149, 191, 3, 157, - 158, 199, 149, 77, 103, 197, 199, 46, 218, 112, - 3, 168, 169, 114, 85, 146, 149, 145, 146, 188, - 3, 138, 183, 203, 145, 109, 200, 146, 146, 145, - 224, 225, 226, 228, 230, 233, 191, 202, 203, 3, - 203, 204, 204, 88, 117, 145, 90, 109, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 221, 203, 179, 145, 146, 149, 196, 221, - 80, 25, 37, 94, 107, 170, 146, 149, 180, 230, - 3, 201, 200, 146, 95, 183, 144, 180, 26, 58, - 62, 68, 69, 87, 149, 234, 232, 60, 192, 102, + 212, 213, 214, 215, 216, 217, 218, 219, 3, 178, + 179, 40, 231, 231, 145, 194, 195, 196, 203, 194, + 222, 146, 149, 40, 81, 145, 176, 203, 164, 220, + 3, 238, 55, 183, 145, 147, 145, 98, 203, 211, + 40, 109, 204, 143, 204, 183, 203, 81, 190, 149, + 3, 102, 114, 121, 232, 233, 17, 45, 88, 109, + 117, 118, 124, 125, 126, 128, 129, 130, 133, 134, + 136, 137, 138, 139, 140, 141, 143, 126, 149, 191, + 3, 157, 158, 199, 149, 77, 103, 197, 199, 46, + 219, 112, 3, 168, 169, 114, 85, 146, 149, 145, + 146, 188, 3, 138, 183, 203, 211, 79, 98, 105, + 145, 109, 200, 146, 146, 145, 225, 226, 227, 229, + 231, 234, 191, 202, 203, 3, 203, 204, 204, 88, + 117, 145, 90, 109, 204, 204, 204, 204, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 222, 203, + 179, 145, 146, 149, 196, 222, 80, 25, 37, 94, + 107, 170, 146, 149, 180, 231, 3, 201, 200, 146, + 95, 79, 105, 203, 203, 183, 144, 180, 26, 58, + 62, 68, 69, 87, 149, 235, 233, 60, 192, 102, 204, 145, 183, 200, 90, 144, 201, 158, 164, 169, - 146, 146, 204, 146, 146, 86, 68, 68, 225, 227, - 86, 115, 204, 183, 200, 146, 146, 146, 79, 105, - 232, 226, 149, 225, 200, 146, 146, 204, 225, 72, - 120, 42, 193, 105, 145, 203, 235, 203, 3, 217, - 146 + 146, 146, 203, 203, 105, 95, 146, 146, 86, 68, + 68, 226, 228, 86, 115, 204, 183, 200, 146, 146, + 146, 105, 203, 233, 227, 149, 226, 200, 146, 146, + 226, 72, 120, 42, 193, 145, 203, 236, 203, 3, + 218, 146 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -1095,13 +1097,13 @@ static const yytype_uint8 yyr1[] = 204, 204, 204, 204, 204, 204, 204, 205, 205, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, 209, 209, 209, - 209, 210, 210, 211, 211, 212, 212, 212, 212, 212, - 212, 213, 213, 214, 215, 216, 217, 217, 217, 217, - 218, 218, 218, 218, 219, 220, 220, 221, 222, 223, - 224, 224, 225, 225, 226, 226, 227, 227, 228, 229, - 230, 230, 231, 231, 232, 232, 233, 233, 233, 234, - 234, 234, 234, 234, 234, 234, 234, 235, 236, 236, - 237, 237 + 209, 210, 210, 210, 210, 211, 211, 212, 212, 213, + 213, 213, 213, 213, 213, 214, 214, 215, 216, 217, + 218, 218, 218, 218, 219, 219, 219, 219, 220, 221, + 221, 222, 223, 224, 225, 225, 226, 226, 227, 227, + 228, 228, 229, 230, 231, 231, 232, 232, 233, 233, + 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, + 235, 236, 237, 237, 238, 238 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1121,13 +1123,13 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, 2, 3, 4, 1, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 5, 6, 5, - 6, 6, 8, 4, 5, 3, 3, 3, 3, 3, - 3, 3, 5, 4, 4, 5, 1, 3, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 4, 1, 3, 2, 1, - 1, 3, 2, 1, 1, 0, 4, 6, 8, 1, - 1, 2, 2, 1, 1, 1, 0, 1, 1, 0, - 1, 3 + 6, 4, 6, 3, 5, 4, 5, 4, 5, 3, + 3, 3, 3, 3, 3, 3, 5, 4, 4, 5, + 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 1, 1, 4, + 1, 3, 2, 1, 1, 3, 2, 1, 1, 0, + 4, 6, 8, 1, 1, 2, 2, 1, 1, 1, + 0, 1, 1, 0, 1, 3 }; @@ -1626,25 +1628,25 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio case 3: /* IDENTIFIER */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1630 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1632 "bison_parser.cpp" /* yacc.c:1257 */ break; case 4: /* STRING */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1636 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1638 "bison_parser.cpp" /* yacc.c:1257 */ break; case 5: /* FLOATVAL */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1642 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1644 "bison_parser.cpp" /* yacc.c:1257 */ break; case 6: /* INTVAL */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1648 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1650 "bison_parser.cpp" /* yacc.c:1257 */ break; case 153: /* statement_list */ @@ -1657,19 +1659,19 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).stmt_vec)); } -#line 1661 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1663 "bison_parser.cpp" /* yacc.c:1257 */ break; case 154: /* statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1667 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1669 "bison_parser.cpp" /* yacc.c:1257 */ break; case 155: /* preparable_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1673 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1675 "bison_parser.cpp" /* yacc.c:1257 */ break; case 156: /* opt_hints */ @@ -1682,7 +1684,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1686 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1688 "bison_parser.cpp" /* yacc.c:1257 */ break; case 157: /* hint_list */ @@ -1695,67 +1697,67 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1699 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1701 "bison_parser.cpp" /* yacc.c:1257 */ break; case 158: /* hint */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1705 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1707 "bison_parser.cpp" /* yacc.c:1257 */ break; case 159: /* prepare_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).prep_stmt)); } -#line 1711 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1713 "bison_parser.cpp" /* yacc.c:1257 */ break; case 160: /* prepare_target_query */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1717 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1719 "bison_parser.cpp" /* yacc.c:1257 */ break; case 161: /* execute_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).exec_stmt)); } -#line 1723 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1725 "bison_parser.cpp" /* yacc.c:1257 */ break; case 162: /* import_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).import_stmt)); } -#line 1729 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1731 "bison_parser.cpp" /* yacc.c:1257 */ break; case 163: /* import_file_type */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1735 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1737 "bison_parser.cpp" /* yacc.c:1257 */ break; case 164: /* file_path */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1741 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1743 "bison_parser.cpp" /* yacc.c:1257 */ break; case 165: /* show_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).show_stmt)); } -#line 1747 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1749 "bison_parser.cpp" /* yacc.c:1257 */ break; case 166: /* create_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).create_stmt)); } -#line 1753 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1755 "bison_parser.cpp" /* yacc.c:1257 */ break; case 167: /* opt_not_exists */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1759 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1761 "bison_parser.cpp" /* yacc.c:1257 */ break; case 168: /* column_def_commalist */ @@ -1768,49 +1770,49 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).column_vec)); } -#line 1772 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1774 "bison_parser.cpp" /* yacc.c:1257 */ break; case 169: /* column_def */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).column_t)); } -#line 1778 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1780 "bison_parser.cpp" /* yacc.c:1257 */ break; case 170: /* column_type */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1784 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1786 "bison_parser.cpp" /* yacc.c:1257 */ break; case 171: /* drop_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).drop_stmt)); } -#line 1790 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1792 "bison_parser.cpp" /* yacc.c:1257 */ break; case 172: /* opt_exists */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1796 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1798 "bison_parser.cpp" /* yacc.c:1257 */ break; case 173: /* delete_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1802 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1804 "bison_parser.cpp" /* yacc.c:1257 */ break; case 174: /* truncate_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1808 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1810 "bison_parser.cpp" /* yacc.c:1257 */ break; case 175: /* insert_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).insert_stmt)); } -#line 1814 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1816 "bison_parser.cpp" /* yacc.c:1257 */ break; case 176: /* opt_column_list */ @@ -1823,13 +1825,13 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 1827 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1829 "bison_parser.cpp" /* yacc.c:1257 */ break; case 177: /* update_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_stmt)); } -#line 1833 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1835 "bison_parser.cpp" /* yacc.c:1257 */ break; case 178: /* update_clause_commalist */ @@ -1842,49 +1844,49 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).update_vec)); } -#line 1846 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1848 "bison_parser.cpp" /* yacc.c:1257 */ break; case 179: /* update_clause */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_t)); } -#line 1852 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1854 "bison_parser.cpp" /* yacc.c:1257 */ break; case 180: /* select_statement */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1858 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1860 "bison_parser.cpp" /* yacc.c:1257 */ break; case 181: /* select_with_paren */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1864 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1866 "bison_parser.cpp" /* yacc.c:1257 */ break; case 182: /* select_paren_or_clause */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1870 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1872 "bison_parser.cpp" /* yacc.c:1257 */ break; case 183: /* select_no_paren */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1876 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1878 "bison_parser.cpp" /* yacc.c:1257 */ break; case 187: /* select_clause */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1882 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1884 "bison_parser.cpp" /* yacc.c:1257 */ break; case 188: /* opt_distinct */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1888 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1890 "bison_parser.cpp" /* yacc.c:1257 */ break; case 189: /* select_list */ @@ -1897,31 +1899,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1901 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1903 "bison_parser.cpp" /* yacc.c:1257 */ break; case 190: /* from_clause */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 1907 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1909 "bison_parser.cpp" /* yacc.c:1257 */ break; case 191: /* opt_where */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1913 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1915 "bison_parser.cpp" /* yacc.c:1257 */ break; case 192: /* opt_group */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).group_t)); } -#line 1919 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1921 "bison_parser.cpp" /* yacc.c:1257 */ break; case 193: /* opt_having */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1925 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1927 "bison_parser.cpp" /* yacc.c:1257 */ break; case 194: /* opt_order */ @@ -1934,7 +1936,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1938 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1940 "bison_parser.cpp" /* yacc.c:1257 */ break; case 195: /* order_list */ @@ -1947,31 +1949,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1951 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1953 "bison_parser.cpp" /* yacc.c:1257 */ break; case 196: /* order_desc */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).order)); } -#line 1957 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1959 "bison_parser.cpp" /* yacc.c:1257 */ break; case 197: /* opt_order_type */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1963 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1965 "bison_parser.cpp" /* yacc.c:1257 */ break; case 198: /* opt_top */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1969 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1971 "bison_parser.cpp" /* yacc.c:1257 */ break; case 199: /* opt_limit */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1975 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1977 "bison_parser.cpp" /* yacc.c:1257 */ break; case 200: /* expr_list */ @@ -1984,7 +1986,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1988 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1990 "bison_parser.cpp" /* yacc.c:1257 */ break; case 201: /* literal_list */ @@ -1997,160 +1999,166 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 2001 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2003 "bison_parser.cpp" /* yacc.c:1257 */ break; case 202: /* expr_alias */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2007 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2009 "bison_parser.cpp" /* yacc.c:1257 */ break; case 203: /* expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2013 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2015 "bison_parser.cpp" /* yacc.c:1257 */ break; case 204: /* operand */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2019 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2021 "bison_parser.cpp" /* yacc.c:1257 */ break; case 205: /* scalar_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2025 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2027 "bison_parser.cpp" /* yacc.c:1257 */ break; case 206: /* unary_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2031 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2033 "bison_parser.cpp" /* yacc.c:1257 */ break; case 207: /* binary_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2037 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2039 "bison_parser.cpp" /* yacc.c:1257 */ break; case 208: /* logic_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2043 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2045 "bison_parser.cpp" /* yacc.c:1257 */ break; case 209: /* in_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2049 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2051 "bison_parser.cpp" /* yacc.c:1257 */ break; case 210: /* case_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2055 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2057 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 211: /* exists_expr */ + case 211: /* case_list */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2061 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2063 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 212: /* comp_expr */ + case 212: /* exists_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2067 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2069 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 213: /* function_expr */ + case 213: /* comp_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2073 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2075 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 214: /* array_expr */ + case 214: /* function_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2079 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2081 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 215: /* array_index */ + case 215: /* array_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2085 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2087 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 216: /* between_expr */ + case 216: /* array_index */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2091 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2093 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 217: /* column_name */ + case 217: /* between_expr */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2097 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2099 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 218: /* literal */ + case 218: /* column_name */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2103 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2105 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 219: /* string_literal */ + case 219: /* literal */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2109 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2111 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 220: /* num_literal */ + case 220: /* string_literal */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2115 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2117 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 221: /* int_literal */ + case 221: /* num_literal */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2121 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2123 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 222: /* null_literal */ + case 222: /* int_literal */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2127 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2129 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 223: /* param_expr */ + case 223: /* null_literal */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2133 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2135 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 224: /* table_ref */ + case 224: /* param_expr */ +#line 147 "bison_parser.y" /* yacc.c:1257 */ + { delete (((*yyvaluep).expr)); } +#line 2141 "bison_parser.cpp" /* yacc.c:1257 */ + break; + + case 225: /* table_ref */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2139 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2147 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 225: /* table_ref_atomic */ + case 226: /* table_ref_atomic */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2145 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2153 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 226: /* nonjoin_table_ref_atomic */ + case 227: /* nonjoin_table_ref_atomic */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2151 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2159 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 227: /* table_ref_commalist */ + case 228: /* table_ref_commalist */ #line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).table_vec)) != nullptr) { @@ -2160,58 +2168,58 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).table_vec)); } -#line 2164 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2172 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 228: /* table_ref_name */ + case 229: /* table_ref_name */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2170 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2178 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 229: /* table_ref_name_no_alias */ + case 230: /* table_ref_name_no_alias */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2176 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2184 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 230: /* table_name */ + case 231: /* table_name */ #line 137 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).table_name).name) ); free( (((*yyvaluep).table_name).schema) ); } -#line 2182 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2190 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 231: /* alias */ + case 232: /* alias */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 2188 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2196 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 232: /* opt_alias */ + case 233: /* opt_alias */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 2194 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2202 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 233: /* join_clause */ + case 234: /* join_clause */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2200 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2208 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 234: /* opt_join_type */ + case 235: /* opt_join_type */ #line 136 "bison_parser.y" /* yacc.c:1257 */ { } -#line 2206 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2214 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 235: /* join_condition */ + case 236: /* join_condition */ #line 147 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2212 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2220 "bison_parser.cpp" /* yacc.c:1257 */ break; - case 237: /* ident_commalist */ + case 238: /* ident_commalist */ #line 139 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { @@ -2221,7 +2229,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 2225 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2233 "bison_parser.cpp" /* yacc.c:1257 */ break; @@ -2339,7 +2347,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.total_column = 0; } -#line 2343 "bison_parser.cpp" /* yacc.c:1429 */ +#line 2351 "bison_parser.cpp" /* yacc.c:1429 */ yylsp[0] = yylloc; goto yysetstate; @@ -2544,19 +2552,19 @@ yyreduce: } delete (yyvsp[-1].stmt_vec); } -#line 2548 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2556 "bison_parser.cpp" /* yacc.c:1646 */ break; case 3: #line 266 "bison_parser.y" /* yacc.c:1646 */ { (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } -#line 2554 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2562 "bison_parser.cpp" /* yacc.c:1646 */ break; case 4: #line 267 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } -#line 2560 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2568 "bison_parser.cpp" /* yacc.c:1646 */ break; case 5: @@ -2565,7 +2573,7 @@ yyreduce: (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2569 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2577 "bison_parser.cpp" /* yacc.c:1646 */ break; case 6: @@ -2574,7 +2582,7 @@ yyreduce: (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2578 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2586 "bison_parser.cpp" /* yacc.c:1646 */ break; case 7: @@ -2582,85 +2590,85 @@ yyreduce: { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 2586 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2594 "bison_parser.cpp" /* yacc.c:1646 */ break; case 8: #line 286 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 2592 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2600 "bison_parser.cpp" /* yacc.c:1646 */ break; case 9: #line 287 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 2598 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2606 "bison_parser.cpp" /* yacc.c:1646 */ break; case 10: #line 288 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 2604 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2612 "bison_parser.cpp" /* yacc.c:1646 */ break; case 11: #line 289 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 2610 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2618 "bison_parser.cpp" /* yacc.c:1646 */ break; case 12: #line 290 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2616 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2624 "bison_parser.cpp" /* yacc.c:1646 */ break; case 13: #line 291 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2622 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2630 "bison_parser.cpp" /* yacc.c:1646 */ break; case 14: #line 292 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 2628 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2636 "bison_parser.cpp" /* yacc.c:1646 */ break; case 15: #line 293 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 2634 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2642 "bison_parser.cpp" /* yacc.c:1646 */ break; case 16: #line 294 "bison_parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 2640 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2648 "bison_parser.cpp" /* yacc.c:1646 */ break; case 17: #line 303 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 2646 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2654 "bison_parser.cpp" /* yacc.c:1646 */ break; case 18: #line 304 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = nullptr; } -#line 2652 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2660 "bison_parser.cpp" /* yacc.c:1646 */ break; case 19: #line 309 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 2658 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2666 "bison_parser.cpp" /* yacc.c:1646 */ break; case 20: #line 310 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 2664 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2672 "bison_parser.cpp" /* yacc.c:1646 */ break; case 21: @@ -2669,7 +2677,7 @@ yyreduce: (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 2673 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2681 "bison_parser.cpp" /* yacc.c:1646 */ break; case 22: @@ -2679,7 +2687,7 @@ yyreduce: (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 2683 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2691 "bison_parser.cpp" /* yacc.c:1646 */ break; case 23: @@ -2689,7 +2697,7 @@ yyreduce: (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 2693 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2701 "bison_parser.cpp" /* yacc.c:1646 */ break; case 25: @@ -2698,7 +2706,7 @@ yyreduce: (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 2702 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2710 "bison_parser.cpp" /* yacc.c:1646 */ break; case 26: @@ -2708,7 +2716,7 @@ yyreduce: (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 2712 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2720 "bison_parser.cpp" /* yacc.c:1646 */ break; case 27: @@ -2719,19 +2727,19 @@ yyreduce: (yyval.import_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.import_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2723 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2731 "bison_parser.cpp" /* yacc.c:1646 */ break; case 28: #line 365 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = kImportCSV; } -#line 2729 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2737 "bison_parser.cpp" /* yacc.c:1646 */ break; case 29: #line 369 "bison_parser.y" /* yacc.c:1646 */ { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } -#line 2735 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2743 "bison_parser.cpp" /* yacc.c:1646 */ break; case 30: @@ -2739,7 +2747,7 @@ yyreduce: { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 2743 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2751 "bison_parser.cpp" /* yacc.c:1646 */ break; case 31: @@ -2749,7 +2757,7 @@ yyreduce: (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } -#line 2753 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2761 "bison_parser.cpp" /* yacc.c:1646 */ break; case 32: @@ -2761,7 +2769,7 @@ yyreduce: (yyval.create_stmt)->tableName = (yyvsp[-4].table_name).name; (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 2765 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2773 "bison_parser.cpp" /* yacc.c:1646 */ break; case 33: @@ -2773,7 +2781,7 @@ yyreduce: (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); } -#line 2777 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2785 "bison_parser.cpp" /* yacc.c:1646 */ break; case 34: @@ -2786,31 +2794,31 @@ yyreduce: (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 2790 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2798 "bison_parser.cpp" /* yacc.c:1646 */ break; case 35: #line 421 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = true; } -#line 2796 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2804 "bison_parser.cpp" /* yacc.c:1646 */ break; case 36: #line 422 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = false; } -#line 2802 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2810 "bison_parser.cpp" /* yacc.c:1646 */ break; case 37: #line 426 "bison_parser.y" /* yacc.c:1646 */ { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } -#line 2808 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2816 "bison_parser.cpp" /* yacc.c:1646 */ break; case 38: #line 427 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } -#line 2814 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2822 "bison_parser.cpp" /* yacc.c:1646 */ break; case 39: @@ -2818,31 +2826,31 @@ yyreduce: { (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); } -#line 2822 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2830 "bison_parser.cpp" /* yacc.c:1646 */ break; case 40: #line 438 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2828 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2836 "bison_parser.cpp" /* yacc.c:1646 */ break; case 41: #line 439 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2834 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2842 "bison_parser.cpp" /* yacc.c:1646 */ break; case 42: #line 440 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::DOUBLE; } -#line 2840 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2848 "bison_parser.cpp" /* yacc.c:1646 */ break; case 43: #line 441 "bison_parser.y" /* yacc.c:1646 */ { (yyval.uval) = ColumnDefinition::TEXT; } -#line 2846 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2854 "bison_parser.cpp" /* yacc.c:1646 */ break; case 44: @@ -2853,7 +2861,7 @@ yyreduce: (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } -#line 2857 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2865 "bison_parser.cpp" /* yacc.c:1646 */ break; case 45: @@ -2864,7 +2872,7 @@ yyreduce: (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } -#line 2868 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2876 "bison_parser.cpp" /* yacc.c:1646 */ break; case 46: @@ -2874,19 +2882,19 @@ yyreduce: (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 2878 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2886 "bison_parser.cpp" /* yacc.c:1646 */ break; case 47: #line 471 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = true; } -#line 2884 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2892 "bison_parser.cpp" /* yacc.c:1646 */ break; case 48: #line 472 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = false; } -#line 2890 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2898 "bison_parser.cpp" /* yacc.c:1646 */ break; case 49: @@ -2897,7 +2905,7 @@ yyreduce: (yyval.delete_stmt)->tableName = (yyvsp[-1].table_name).name; (yyval.delete_stmt)->expr = (yyvsp[0].expr); } -#line 2901 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2909 "bison_parser.cpp" /* yacc.c:1646 */ break; case 50: @@ -2907,7 +2915,7 @@ yyreduce: (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2911 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2919 "bison_parser.cpp" /* yacc.c:1646 */ break; case 51: @@ -2919,7 +2927,7 @@ yyreduce: (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 2923 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2931 "bison_parser.cpp" /* yacc.c:1646 */ break; case 52: @@ -2931,19 +2939,19 @@ yyreduce: (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } -#line 2935 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2943 "bison_parser.cpp" /* yacc.c:1646 */ break; case 53: #line 521 "bison_parser.y" /* yacc.c:1646 */ { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 2941 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2949 "bison_parser.cpp" /* yacc.c:1646 */ break; case 54: #line 522 "bison_parser.y" /* yacc.c:1646 */ { (yyval.str_vec) = nullptr; } -#line 2947 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2955 "bison_parser.cpp" /* yacc.c:1646 */ break; case 55: @@ -2954,19 +2962,19 @@ yyreduce: (yyval.update_stmt)->updates = (yyvsp[-1].update_vec); (yyval.update_stmt)->where = (yyvsp[0].expr); } -#line 2958 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2966 "bison_parser.cpp" /* yacc.c:1646 */ break; case 56: #line 541 "bison_parser.y" /* yacc.c:1646 */ { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 2964 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2972 "bison_parser.cpp" /* yacc.c:1646 */ break; case 57: #line 542 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 2970 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2978 "bison_parser.cpp" /* yacc.c:1646 */ break; case 58: @@ -2976,7 +2984,7 @@ yyreduce: (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 2980 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2988 "bison_parser.cpp" /* yacc.c:1646 */ break; case 61: @@ -2995,19 +3003,19 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2999 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3007 "bison_parser.cpp" /* yacc.c:1646 */ break; case 62: #line 577 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 3005 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3013 "bison_parser.cpp" /* yacc.c:1646 */ break; case 63: #line 578 "bison_parser.y" /* yacc.c:1646 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 3011 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3019 "bison_parser.cpp" /* yacc.c:1646 */ break; case 66: @@ -3022,7 +3030,7 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3026 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3034 "bison_parser.cpp" /* yacc.c:1646 */ break; case 67: @@ -3041,7 +3049,7 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3045 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3053 "bison_parser.cpp" /* yacc.c:1646 */ break; case 74: @@ -3055,37 +3063,37 @@ yyreduce: (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 3059 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3067 "bison_parser.cpp" /* yacc.c:1646 */ break; case 75: #line 641 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = true; } -#line 3065 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3073 "bison_parser.cpp" /* yacc.c:1646 */ break; case 76: #line 642 "bison_parser.y" /* yacc.c:1646 */ { (yyval.bval) = false; } -#line 3071 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3079 "bison_parser.cpp" /* yacc.c:1646 */ break; case 78: #line 650 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = (yyvsp[0].table); } -#line 3077 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3085 "bison_parser.cpp" /* yacc.c:1646 */ break; case 79: #line 655 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 3083 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3091 "bison_parser.cpp" /* yacc.c:1646 */ break; case 80: #line 656 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = nullptr; } -#line 3089 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3097 "bison_parser.cpp" /* yacc.c:1646 */ break; case 81: @@ -3095,127 +3103,127 @@ yyreduce: (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 3099 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3107 "bison_parser.cpp" /* yacc.c:1646 */ break; case 82: #line 665 "bison_parser.y" /* yacc.c:1646 */ { (yyval.group_t) = nullptr; } -#line 3105 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3113 "bison_parser.cpp" /* yacc.c:1646 */ break; case 83: #line 669 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 3111 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3119 "bison_parser.cpp" /* yacc.c:1646 */ break; case 84: #line 670 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = nullptr; } -#line 3117 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3125 "bison_parser.cpp" /* yacc.c:1646 */ break; case 85: #line 673 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 3123 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3131 "bison_parser.cpp" /* yacc.c:1646 */ break; case 86: #line 674 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_vec) = nullptr; } -#line 3129 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3137 "bison_parser.cpp" /* yacc.c:1646 */ break; case 87: #line 678 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 3135 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3143 "bison_parser.cpp" /* yacc.c:1646 */ break; case 88: #line 679 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 3141 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3149 "bison_parser.cpp" /* yacc.c:1646 */ break; case 89: #line 683 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 3147 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3155 "bison_parser.cpp" /* yacc.c:1646 */ break; case 90: #line 687 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_type) = kOrderAsc; } -#line 3153 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3161 "bison_parser.cpp" /* yacc.c:1646 */ break; case 91: #line 688 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_type) = kOrderDesc; } -#line 3159 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3167 "bison_parser.cpp" /* yacc.c:1646 */ break; case 92: #line 689 "bison_parser.y" /* yacc.c:1646 */ { (yyval.order_type) = kOrderAsc; } -#line 3165 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3173 "bison_parser.cpp" /* yacc.c:1646 */ break; case 93: #line 695 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3171 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3179 "bison_parser.cpp" /* yacc.c:1646 */ break; case 94: #line 696 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = nullptr; } -#line 3177 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3185 "bison_parser.cpp" /* yacc.c:1646 */ break; case 95: #line 700 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3183 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3191 "bison_parser.cpp" /* yacc.c:1646 */ break; case 96: #line 701 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } -#line 3189 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3197 "bison_parser.cpp" /* yacc.c:1646 */ break; case 97: #line 702 "bison_parser.y" /* yacc.c:1646 */ { (yyval.limit) = nullptr; } -#line 3195 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3203 "bison_parser.cpp" /* yacc.c:1646 */ break; case 98: #line 709 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3201 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3209 "bison_parser.cpp" /* yacc.c:1646 */ break; case 99: #line 710 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3207 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3215 "bison_parser.cpp" /* yacc.c:1646 */ break; case 100: #line 714 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3213 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3221 "bison_parser.cpp" /* yacc.c:1646 */ break; case 101: #line 715 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3219 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3227 "bison_parser.cpp" /* yacc.c:1646 */ break; case 102: @@ -3224,331 +3232,355 @@ yyreduce: (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->alias = (yyvsp[0].sval); } -#line 3228 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3236 "bison_parser.cpp" /* yacc.c:1646 */ break; case 108: #line 734 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); } -#line 3234 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3242 "bison_parser.cpp" /* yacc.c:1646 */ break; case 116: #line 742 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 3240 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3248 "bison_parser.cpp" /* yacc.c:1646 */ break; case 119: #line 751 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 3246 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3254 "bison_parser.cpp" /* yacc.c:1646 */ break; case 120: #line 752 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 3252 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3260 "bison_parser.cpp" /* yacc.c:1646 */ break; case 121: #line 753 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 3258 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3266 "bison_parser.cpp" /* yacc.c:1646 */ break; case 122: #line 754 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 3264 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3272 "bison_parser.cpp" /* yacc.c:1646 */ break; case 123: #line 755 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 3270 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3278 "bison_parser.cpp" /* yacc.c:1646 */ break; case 125: #line 760 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 3276 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3284 "bison_parser.cpp" /* yacc.c:1646 */ break; case 126: #line 761 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 3282 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3290 "bison_parser.cpp" /* yacc.c:1646 */ break; case 127: #line 762 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 3288 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3296 "bison_parser.cpp" /* yacc.c:1646 */ break; case 128: #line 763 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 3294 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3302 "bison_parser.cpp" /* yacc.c:1646 */ break; case 129: #line 764 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 3300 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3308 "bison_parser.cpp" /* yacc.c:1646 */ break; case 130: #line 765 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 3306 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3314 "bison_parser.cpp" /* yacc.c:1646 */ break; case 131: #line 766 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 3312 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3320 "bison_parser.cpp" /* yacc.c:1646 */ break; case 132: #line 767 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 3318 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3326 "bison_parser.cpp" /* yacc.c:1646 */ break; case 133: #line 768 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 3324 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3332 "bison_parser.cpp" /* yacc.c:1646 */ break; case 134: #line 769 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 3330 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3338 "bison_parser.cpp" /* yacc.c:1646 */ break; case 135: #line 773 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 3336 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3344 "bison_parser.cpp" /* yacc.c:1646 */ break; case 136: #line 774 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 3342 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3350 "bison_parser.cpp" /* yacc.c:1646 */ break; case 137: #line 778 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 3348 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3356 "bison_parser.cpp" /* yacc.c:1646 */ break; case 138: #line 779 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 3354 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3362 "bison_parser.cpp" /* yacc.c:1646 */ break; case 139: #line 780 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 3360 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3368 "bison_parser.cpp" /* yacc.c:1646 */ break; case 140: #line 781 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 3366 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3374 "bison_parser.cpp" /* yacc.c:1646 */ break; case 141: -#line 786 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeCase((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3372 "bison_parser.cpp" /* yacc.c:1646 */ +#line 787 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } +#line 3380 "bison_parser.cpp" /* yacc.c:1646 */ break; case 142: #line 788 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeCase((yyvsp[-5].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3378 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } +#line 3386 "bison_parser.cpp" /* yacc.c:1646 */ break; case 143: -#line 792 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 3384 "bison_parser.cpp" /* yacc.c:1646 */ +#line 789 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } +#line 3392 "bison_parser.cpp" /* yacc.c:1646 */ break; case 144: -#line 793 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 3390 "bison_parser.cpp" /* yacc.c:1646 */ +#line 790 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } +#line 3398 "bison_parser.cpp" /* yacc.c:1646 */ break; case 145: -#line 797 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 3396 "bison_parser.cpp" /* yacc.c:1646 */ +#line 794 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } +#line 3404 "bison_parser.cpp" /* yacc.c:1646 */ break; case 146: -#line 798 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 3402 "bison_parser.cpp" /* yacc.c:1646 */ +#line 795 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } +#line 3410 "bison_parser.cpp" /* yacc.c:1646 */ break; case 147: #line 799 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 3408 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } +#line 3416 "bison_parser.cpp" /* yacc.c:1646 */ break; case 148: #line 800 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 3414 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } +#line 3422 "bison_parser.cpp" /* yacc.c:1646 */ break; case 149: -#line 801 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 3420 "bison_parser.cpp" /* yacc.c:1646 */ +#line 804 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } +#line 3428 "bison_parser.cpp" /* yacc.c:1646 */ break; case 150: -#line 802 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 3426 "bison_parser.cpp" /* yacc.c:1646 */ +#line 805 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } +#line 3434 "bison_parser.cpp" /* yacc.c:1646 */ break; case 151: #line 806 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } -#line 3432 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } +#line 3440 "bison_parser.cpp" /* yacc.c:1646 */ break; case 152: #line 807 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } -#line 3438 "bison_parser.cpp" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } +#line 3446 "bison_parser.cpp" /* yacc.c:1646 */ break; case 153: -#line 811 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 3444 "bison_parser.cpp" /* yacc.c:1646 */ +#line 808 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } +#line 3452 "bison_parser.cpp" /* yacc.c:1646 */ break; case 154: -#line 815 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 3450 "bison_parser.cpp" /* yacc.c:1646 */ +#line 809 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } +#line 3458 "bison_parser.cpp" /* yacc.c:1646 */ break; case 155: -#line 819 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3456 "bison_parser.cpp" /* yacc.c:1646 */ +#line 813 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } +#line 3464 "bison_parser.cpp" /* yacc.c:1646 */ break; case 156: -#line 823 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 3462 "bison_parser.cpp" /* yacc.c:1646 */ +#line 814 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } +#line 3470 "bison_parser.cpp" /* yacc.c:1646 */ break; case 157: -#line 824 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 3468 "bison_parser.cpp" /* yacc.c:1646 */ +#line 818 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } +#line 3476 "bison_parser.cpp" /* yacc.c:1646 */ break; case 158: -#line 825 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeStar(); } -#line 3474 "bison_parser.cpp" /* yacc.c:1646 */ +#line 822 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } +#line 3482 "bison_parser.cpp" /* yacc.c:1646 */ break; case 159: #line 826 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } +#line 3488 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 160: +#line 830 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } +#line 3494 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 161: +#line 831 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } +#line 3500 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 162: +#line 832 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeStar(); } +#line 3506 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 163: +#line 833 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 3480 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 164: -#line 837 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 3486 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 165: -#line 842 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 3492 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 167: -#line 847 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 3498 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3512 "bison_parser.cpp" /* yacc.c:1646 */ break; case 168: -#line 851 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.expr) = Expr::makeNullLiteral(); } -#line 3504 "bison_parser.cpp" /* yacc.c:1646 */ +#line 844 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } +#line 3518 "bison_parser.cpp" /* yacc.c:1646 */ break; case 169: -#line 855 "bison_parser.y" /* yacc.c:1646 */ +#line 849 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } +#line 3524 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 171: +#line 854 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } +#line 3530 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 172: +#line 858 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.expr) = Expr::makeNullLiteral(); } +#line 3536 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 173: +#line 862 "bison_parser.y" /* yacc.c:1646 */ { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } -#line 3514 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3546 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 171: -#line 868 "bison_parser.y" /* yacc.c:1646 */ + case 175: +#line 875 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[0].table_vec)->push_back((yyvsp[-2].table)); auto tbl = new TableRef(kTableCrossProduct); tbl->list = (yyvsp[0].table_vec); (yyval.table) = tbl; } -#line 3525 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3557 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 175: -#line 884 "bison_parser.y" /* yacc.c:1646 */ + case 179: +#line 891 "bison_parser.y" /* yacc.c:1646 */ { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3536 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3568 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 176: -#line 893 "bison_parser.y" /* yacc.c:1646 */ + case 180: +#line 900 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 3542 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3574 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 177: -#line 894 "bison_parser.y" /* yacc.c:1646 */ + case 181: +#line 901 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 3548 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3580 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 178: -#line 899 "bison_parser.y" /* yacc.c:1646 */ + case 182: +#line 906 "bison_parser.y" /* yacc.c:1646 */ { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; @@ -3556,45 +3588,45 @@ yyreduce: tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3560 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3592 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 179: -#line 910 "bison_parser.y" /* yacc.c:1646 */ + case 183: +#line 917 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableName); (yyval.table)->schema = (yyvsp[0].table_name).schema; (yyval.table)->name = (yyvsp[0].table_name).name; } -#line 3570 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3602 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 180: -#line 919 "bison_parser.y" /* yacc.c:1646 */ + case 184: +#line 926 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval);} -#line 3576 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 181: -#line 920 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } -#line 3582 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 182: -#line 925 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.sval) = (yyvsp[0].sval); } -#line 3588 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3608 "bison_parser.cpp" /* yacc.c:1646 */ break; case 185: -#line 931 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.sval) = nullptr; } -#line 3594 "bison_parser.cpp" /* yacc.c:1646 */ +#line 927 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } +#line 3614 "bison_parser.cpp" /* yacc.c:1646 */ break; case 186: -#line 940 "bison_parser.y" /* yacc.c:1646 */ +#line 932 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = (yyvsp[0].sval); } +#line 3620 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 189: +#line 938 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.sval) = nullptr; } +#line 3626 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 190: +#line 947 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3602,11 +3634,11 @@ yyreduce: (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 3606 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3638 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 187: -#line 948 "bison_parser.y" /* yacc.c:1646 */ + case 191: +#line 955 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3615,11 +3647,11 @@ yyreduce: (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 3619 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3651 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 188: -#line 958 "bison_parser.y" /* yacc.c:1646 */ + case 192: +#line 965 "bison_parser.y" /* yacc.c:1646 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3635,71 +3667,71 @@ yyreduce: (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } -#line 3639 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 189: -#line 976 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinInner; } -#line 3645 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 190: -#line 977 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinOuter; } -#line 3651 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 191: -#line 978 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinLeftOuter; } -#line 3657 "bison_parser.cpp" /* yacc.c:1646 */ - break; - - case 192: -#line 979 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinRightOuter; } -#line 3663 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3671 "bison_parser.cpp" /* yacc.c:1646 */ break; case 193: -#line 980 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinLeft; } -#line 3669 "bison_parser.cpp" /* yacc.c:1646 */ +#line 983 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 3677 "bison_parser.cpp" /* yacc.c:1646 */ break; case 194: -#line 981 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinRight; } -#line 3675 "bison_parser.cpp" /* yacc.c:1646 */ +#line 984 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinOuter; } +#line 3683 "bison_parser.cpp" /* yacc.c:1646 */ break; case 195: -#line 982 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinCross; } -#line 3681 "bison_parser.cpp" /* yacc.c:1646 */ +#line 985 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeftOuter; } +#line 3689 "bison_parser.cpp" /* yacc.c:1646 */ break; case 196: -#line 983 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.uval) = kJoinInner; } -#line 3687 "bison_parser.cpp" /* yacc.c:1646 */ +#line 986 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRightOuter; } +#line 3695 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 197: +#line 987 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinLeft; } +#line 3701 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 198: +#line 988 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinRight; } +#line 3707 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 199: +#line 989 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinCross; } +#line 3713 "bison_parser.cpp" /* yacc.c:1646 */ break; case 200: -#line 1003 "bison_parser.y" /* yacc.c:1646 */ +#line 990 "bison_parser.y" /* yacc.c:1646 */ + { (yyval.uval) = kJoinInner; } +#line 3719 "bison_parser.cpp" /* yacc.c:1646 */ + break; + + case 204: +#line 1010 "bison_parser.y" /* yacc.c:1646 */ { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 3693 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3725 "bison_parser.cpp" /* yacc.c:1646 */ break; - case 201: -#line 1004 "bison_parser.y" /* yacc.c:1646 */ + case 205: +#line 1011 "bison_parser.y" /* yacc.c:1646 */ { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 3699 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3731 "bison_parser.cpp" /* yacc.c:1646 */ break; -#line 3703 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3735 "bison_parser.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3934,7 +3966,7 @@ yyreturn: #endif return yyresult; } -#line 1007 "bison_parser.y" /* yacc.c:1906 */ +#line 1014 "bison_parser.y" /* yacc.c:1906 */ /********************************* ** Section 4: Additional C code diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index 8163db2..ea95125 100755 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -784,15 +784,15 @@ in_expr: // CASE grammar based on: flex & bison by John Levine // https://www.safaribooksonline.com/library/view/flex-bison/9780596805418/ch04.html#id352665 case_expr: - CASE expr case_list END { $$ = Expr::makeCaseExpr($2, $3); } - | CASE expr case_list ELSE expr END { $$ = Expr::makeCaseExpr($2, $3, $5); } - | CASE case_list END { $$ = Expr::makeCase($2); } - | CASE case_list ELSE expr END { $$ = Expr::makeCase($2, $4); } + CASE expr case_list END { $$ = Expr::makeCase($2, $3, nullptr); } + | CASE expr case_list ELSE expr END { $$ = Expr::makeCase($2, $3, $5); } + | CASE case_list END { $$ = Expr::makeCase(nullptr, $2, nullptr); } + | CASE case_list ELSE expr END { $$ = Expr::makeCase(nullptr, $2, $4); } ; case_list: - WHEN expr THEN expr { $$ = Expr::makeCaseCondition($2, $4); } - | case_list WHEN expr THEN expr { $$ = Expr::joinCaseCondition($1, Expr::makeCaseCondition($3, $5)); } + WHEN expr THEN expr { $$ = Expr::makeCaseList(Expr::makeCaseListElement($2, $4)); } + | case_list WHEN expr THEN expr { $$ = Expr::caseListAppend($1, Expr::makeCaseListElement($3, $5)); } ; exists_expr: diff --git a/src/sql/Expr.cpp b/src/sql/Expr.cpp index 9cc05a4..fde8661 100644 --- a/src/sql/Expr.cpp +++ b/src/sql/Expr.cpp @@ -68,53 +68,35 @@ namespace hsql { return e; } - Expr* Expr::makeCaseCondition(Expr* expr, Expr* then) { - Expr* e = new Expr(kExprWhenCondition); - e->expr = expr; + Expr* Expr::makeCaseList(Expr* caseListElement) { + Expr* e = new Expr(kExprOperator); + e->opType = kOpCaseList; + e->exprList = new std::vector(); + e->exprList->push_back(caseListElement); + return e; + } + + Expr* Expr::makeCaseListElement(Expr* when, Expr* then) { + Expr* e = new Expr(kExprOperator); + e->opType = kOpCaseListElement; + e->expr = when; e->expr2 = then; return e; } - Expr* Expr::joinCaseCondition(Expr* expr1, Expr* expr2) { - Expr* e = new Expr(kExprOperator); - e->opType = kOpPlus; - if (expr1->exprList != nullptr) { - e->exprList = expr1->exprList; - } else { - e->exprList = new std::vector(); - e->exprList->push_back(expr1); - } - e->exprList->push_back(expr2); - return e; + Expr* Expr::caseListAppend(Expr* caseList, Expr* caseListElement) { + caseList->exprList->push_back(caseListElement); + return caseList; } - Expr* Expr::makeCase(Expr* when) { + Expr* Expr::makeCase(Expr* expr, Expr* caseList, Expr* elseExpr) { Expr* e = new Expr(kExprOperator); e->opType = kOpCase; - if (when->exprList != nullptr) { - e->exprList = when->exprList; - } else { - e->exprList = new std::vector(); - e->exprList->push_back(when); - } - return e; - } - - Expr* Expr::makeCase(Expr* when, Expr* other) { - Expr* e = Expr::makeCase(when); - e->expr2 = other; - return e; - } - - Expr* Expr::makeCaseExpr(Expr* expr, Expr* when) { - Expr* e = Expr::makeCase(when); - e->expr = expr; - return e; - } - - Expr* Expr::makeCaseExpr(Expr* expr, Expr* when, Expr* other) { - Expr* e = Expr::makeCase(when, other); e->expr = expr; + e->expr2 = elseExpr; + e->exprList = caseList->exprList; + caseList->exprList = nullptr; + delete caseList; return e; } diff --git a/src/sql/Expr.h b/src/sql/Expr.h index e4ede07..89666d6 100644 --- a/src/sql/Expr.h +++ b/src/sql/Expr.h @@ -26,16 +26,21 @@ namespace hsql { kExprHint, kExprArray, kExprArrayIndex, - kExprWhenCondition + kExprCaseList, + kExprCaseListElement }; // Operator types. These are important for expressions of type kExprOperator. enum OperatorType { kOpNone, - // Ternary operators + // Ternary operator kOpBetween, + + // n-nary special case kOpCase, + kOpCaseList, // Contains n >= 1 kExprCaseListElement in its exprList + kOpCaseListElement, // `WHEN expr THEN expr` // Binary operators. kOpPlus, @@ -114,17 +119,13 @@ namespace hsql { static Expr* makeBetween(Expr* expr, Expr* left, Expr* right); - static Expr* makeCaseCondition(Expr* expr, Expr* then); + static Expr* makeCaseList(Expr* caseListElement); - static Expr* joinCaseCondition(Expr* expr, Expr* then); + static Expr* makeCaseListElement(Expr* when, Expr* then); - static Expr* makeCase(Expr* when); + static Expr* caseListAppend(Expr* caseList, Expr* caseListElement); - static Expr* makeCase(Expr* when, Expr* other); - - static Expr* makeCaseExpr(Expr* expr, Expr* when); - - static Expr* makeCaseExpr(Expr* expr, Expr* when, Expr* other); + static Expr* makeCase(Expr* expr, Expr* when, Expr* elseExpr); static Expr* makeLiteral(int64_t val); From 77e396703f1090485748b02ac70256a38efffa87 Mon Sep 17 00:00:00 2001 From: Lawrence Date: Wed, 17 Jan 2018 15:43:38 +0100 Subject: [PATCH 3/5] Add stringLength information to hsql::Statement --- Makefile | 2 +- src/parser/Makefile | 8 +- src/parser/bison_parser.cpp | 1052 ++++++++++++++++++----------------- src/parser/bison_parser.h | 11 +- src/parser/bison_parser.y | 24 +- src/parser/parser_typedef.h | 3 + src/sql/SQLStatement.h | 3 + test/sql_tests.cpp | 11 + 8 files changed, 579 insertions(+), 535 deletions(-) diff --git a/Makefile b/Makefile index 2f3d90e..5a9d3b7 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ $(LIB_BUILD): $(LIB_OBJ) $(LIBLINKER) $(LIB_LFLAGS) $(LIB_BUILD) $(LIB_OBJ) $(SRCPARSER)/flex_lexer.o: $(SRCPARSER)/flex_lexer.cpp $(SRCPARSER)/bison_parser.cpp - $(CXX) $(LIB_CFLAGS) -c -o $@ $< -Wno-sign-compare -Wno-unneeded-internal-declaration + $(CXX) $(LIB_CFLAGS) -c -o $@ $< -Wno-sign-compare -Wno-unneeded-internal-declaration -Wno-register %.o: %.cpp $(PARSER_CPP) $(LIB_H) $(CXX) $(LIB_CFLAGS) -c -o $@ $< diff --git a/src/parser/Makefile b/src/parser/Makefile index d8482b9..0494dce 100644 --- a/src/parser/Makefile +++ b/src/parser/Makefile @@ -1,9 +1,11 @@ +# bison's version is too old OSX, allow user to pass in custom path +BISON?=bison all: bison_parser.cpp flex_lexer.cpp bison_parser.cpp: bison_parser.y - @bison --version | head -n 1 - bison bison_parser.y --output=bison_parser.cpp --defines=bison_parser.h --verbose + @$(BISON) --version | head -n 1 + $(BISON) bison_parser.y --output=bison_parser.cpp --defines=bison_parser.h --verbose flex_lexer.cpp: flex_lexer.l @flex --version @@ -14,4 +16,4 @@ clean: # Tests if the parser builds correctly and doesn't contain conflicts. test: - ! bison bison_parser.y -v --output=conflict_test.cpp 2>&1 | grep "conflict" >&2 + ! $(BISON) bison_parser.y -v --output=conflict_test.cpp 2>&1 | grep "conflict" >&2 diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 8aafc9b..e8fc289 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -151,6 +151,7 @@ extern int hsql_debug; yylloc->first_column = yylloc->last_column; \ for(int i = 0; yytext[i] != '\0'; i++) { \ yylloc->total_column++; \ + yylloc->string_length++; \ if(yytext[i] == '\n') { \ yylloc->last_line++; \ yylloc->last_column = 0; \ @@ -160,7 +161,7 @@ extern int hsql_debug; } \ } -#line 164 "bison_parser.cpp" /* yacc.c:355 */ +#line 165 "bison_parser.cpp" /* yacc.c:355 */ /* Token type. */ #ifndef HSQL_TOKENTYPE @@ -306,7 +307,7 @@ extern int hsql_debug; union HSQL_STYPE { -#line 93 "bison_parser.y" /* yacc.c:355 */ +#line 95 "bison_parser.y" /* yacc.c:355 */ double fval; int64_t ival; @@ -325,7 +326,7 @@ union HSQL_STYPE hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; - + hsql::TableName table_name; hsql::TableRef* table; hsql::Expr* expr; @@ -345,7 +346,7 @@ union HSQL_STYPE std::vector* expr_vec; std::vector* order_vec; -#line 349 "bison_parser.cpp" /* yacc.c:355 */ +#line 350 "bison_parser.cpp" /* yacc.c:355 */ }; typedef union HSQL_STYPE HSQL_STYPE; @@ -375,7 +376,7 @@ int hsql_parse (hsql::SQLParserResult* result, yyscan_t scanner); /* Copy the second part of user declarations. */ -#line 379 "bison_parser.cpp" /* yacc.c:358 */ +#line 380 "bison_parser.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -687,27 +688,27 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 245, 245, 266, 267, 271, 275, 279, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 303, 304, 309, - 310, 314, 318, 330, 337, 340, 344, 356, 365, 369, - 379, 382, 396, 403, 410, 421, 422, 426, 427, 431, - 438, 439, 440, 441, 451, 457, 463, 471, 472, 481, - 490, 503, 510, 521, 522, 532, 541, 542, 546, 558, - 559, 560, 577, 578, 582, 583, 587, 597, 614, 618, - 619, 620, 624, 625, 629, 641, 642, 646, 650, 655, - 656, 660, 665, 669, 670, 673, 674, 678, 679, 683, - 687, 688, 689, 695, 696, 700, 701, 702, 709, 710, - 714, 715, 719, 726, 727, 728, 729, 730, 734, 735, - 736, 737, 738, 739, 740, 741, 742, 746, 747, 751, - 752, 753, 754, 755, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 773, 774, 778, 779, 780, - 781, 786, 788, 792, 793, 797, 798, 799, 800, 801, - 802, 806, 807, 811, 815, 819, 823, 824, 825, 826, - 830, 831, 832, 833, 837, 842, 843, 847, 851, 855, - 867, 868, 878, 879, 883, 884, 893, 894, 899, 910, - 919, 920, 925, 926, 930, 931, 939, 947, 957, 976, - 977, 978, 979, 980, 981, 982, 983, 988, 997, 998, - 1003, 1004 + 0, 247, 247, 268, 274, 283, 287, 291, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 315, 316, 321, + 322, 326, 330, 342, 349, 352, 356, 368, 377, 381, + 391, 394, 408, 415, 422, 433, 434, 438, 439, 443, + 450, 451, 452, 453, 463, 469, 475, 483, 484, 493, + 502, 515, 522, 533, 534, 544, 553, 554, 558, 570, + 571, 572, 589, 590, 594, 595, 599, 609, 626, 630, + 631, 632, 636, 637, 641, 653, 654, 658, 662, 667, + 668, 672, 677, 681, 682, 685, 686, 690, 691, 695, + 699, 700, 701, 707, 708, 712, 713, 714, 721, 722, + 726, 727, 731, 738, 739, 740, 741, 742, 746, 747, + 748, 749, 750, 751, 752, 753, 754, 758, 759, 763, + 764, 765, 766, 767, 771, 772, 773, 774, 775, 776, + 777, 778, 779, 780, 781, 785, 786, 790, 791, 792, + 793, 798, 800, 804, 805, 809, 810, 811, 812, 813, + 814, 818, 819, 823, 827, 831, 835, 836, 837, 838, + 842, 843, 844, 845, 849, 854, 855, 859, 863, 867, + 879, 880, 890, 891, 895, 896, 905, 906, 911, 922, + 931, 932, 937, 938, 942, 943, 951, 959, 969, 988, + 989, 990, 991, 992, 993, 994, 995, 1000, 1009, 1010, + 1015, 1016 }; #endif @@ -1624,31 +1625,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio switch (yytype) { case 3: /* IDENTIFIER */ -#line 138 "bison_parser.y" /* yacc.c:1257 */ +#line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1630 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1631 "bison_parser.cpp" /* yacc.c:1257 */ break; case 4: /* STRING */ -#line 138 "bison_parser.y" /* yacc.c:1257 */ +#line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1636 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1637 "bison_parser.cpp" /* yacc.c:1257 */ break; case 5: /* FLOATVAL */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1642 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1643 "bison_parser.cpp" /* yacc.c:1257 */ break; case 6: /* INTVAL */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1648 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1649 "bison_parser.cpp" /* yacc.c:1257 */ break; case 153: /* statement_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).stmt_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { @@ -1657,23 +1658,23 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).stmt_vec)); } -#line 1661 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1662 "bison_parser.cpp" /* yacc.c:1257 */ break; case 154: /* statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1667 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1668 "bison_parser.cpp" /* yacc.c:1257 */ break; case 155: /* preparable_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1673 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1674 "bison_parser.cpp" /* yacc.c:1257 */ break; case 156: /* opt_hints */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1682,11 +1683,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1686 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1687 "bison_parser.cpp" /* yacc.c:1257 */ break; case 157: /* hint_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1695,71 +1696,71 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1699 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1700 "bison_parser.cpp" /* yacc.c:1257 */ break; case 158: /* hint */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1705 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1706 "bison_parser.cpp" /* yacc.c:1257 */ break; case 159: /* prepare_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).prep_stmt)); } -#line 1711 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1712 "bison_parser.cpp" /* yacc.c:1257 */ break; case 160: /* prepare_target_query */ -#line 138 "bison_parser.y" /* yacc.c:1257 */ +#line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1717 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1718 "bison_parser.cpp" /* yacc.c:1257 */ break; case 161: /* execute_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).exec_stmt)); } -#line 1723 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1724 "bison_parser.cpp" /* yacc.c:1257 */ break; case 162: /* import_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).import_stmt)); } -#line 1729 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1730 "bison_parser.cpp" /* yacc.c:1257 */ break; case 163: /* import_file_type */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1735 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1736 "bison_parser.cpp" /* yacc.c:1257 */ break; case 164: /* file_path */ -#line 138 "bison_parser.y" /* yacc.c:1257 */ +#line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1741 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1742 "bison_parser.cpp" /* yacc.c:1257 */ break; case 165: /* show_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).show_stmt)); } -#line 1747 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1748 "bison_parser.cpp" /* yacc.c:1257 */ break; case 166: /* create_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).create_stmt)); } -#line 1753 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1754 "bison_parser.cpp" /* yacc.c:1257 */ break; case 167: /* opt_not_exists */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1759 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1760 "bison_parser.cpp" /* yacc.c:1257 */ break; case 168: /* column_def_commalist */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).column_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).column_vec))) { @@ -1768,53 +1769,53 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).column_vec)); } -#line 1772 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1773 "bison_parser.cpp" /* yacc.c:1257 */ break; case 169: /* column_def */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).column_t)); } -#line 1778 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1779 "bison_parser.cpp" /* yacc.c:1257 */ break; case 170: /* column_type */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1784 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1785 "bison_parser.cpp" /* yacc.c:1257 */ break; case 171: /* drop_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).drop_stmt)); } -#line 1790 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1791 "bison_parser.cpp" /* yacc.c:1257 */ break; case 172: /* opt_exists */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1796 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1797 "bison_parser.cpp" /* yacc.c:1257 */ break; case 173: /* delete_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1802 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1803 "bison_parser.cpp" /* yacc.c:1257 */ break; case 174: /* truncate_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1808 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1809 "bison_parser.cpp" /* yacc.c:1257 */ break; case 175: /* insert_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).insert_stmt)); } -#line 1814 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1815 "bison_parser.cpp" /* yacc.c:1257 */ break; case 176: /* opt_column_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -1823,17 +1824,17 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 1827 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1828 "bison_parser.cpp" /* yacc.c:1257 */ break; case 177: /* update_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_stmt)); } -#line 1833 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1834 "bison_parser.cpp" /* yacc.c:1257 */ break; case 178: /* update_clause_commalist */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).update_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).update_vec))) { @@ -1842,53 +1843,53 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).update_vec)); } -#line 1846 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1847 "bison_parser.cpp" /* yacc.c:1257 */ break; case 179: /* update_clause */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_t)); } -#line 1852 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1853 "bison_parser.cpp" /* yacc.c:1257 */ break; case 180: /* select_statement */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1858 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1859 "bison_parser.cpp" /* yacc.c:1257 */ break; case 181: /* select_with_paren */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1864 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1865 "bison_parser.cpp" /* yacc.c:1257 */ break; case 182: /* select_paren_or_clause */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1870 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1871 "bison_parser.cpp" /* yacc.c:1257 */ break; case 183: /* select_no_paren */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1876 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1877 "bison_parser.cpp" /* yacc.c:1257 */ break; case 187: /* select_clause */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1882 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1883 "bison_parser.cpp" /* yacc.c:1257 */ break; case 188: /* opt_distinct */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1888 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1889 "bison_parser.cpp" /* yacc.c:1257 */ break; case 189: /* select_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1897,35 +1898,35 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1901 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1902 "bison_parser.cpp" /* yacc.c:1257 */ break; case 190: /* from_clause */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 1907 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1908 "bison_parser.cpp" /* yacc.c:1257 */ break; case 191: /* opt_where */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1913 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1914 "bison_parser.cpp" /* yacc.c:1257 */ break; case 192: /* opt_group */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).group_t)); } -#line 1919 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1920 "bison_parser.cpp" /* yacc.c:1257 */ break; case 193: /* opt_having */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1925 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1926 "bison_parser.cpp" /* yacc.c:1257 */ break; case 194: /* opt_order */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -1934,11 +1935,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1938 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1939 "bison_parser.cpp" /* yacc.c:1257 */ break; case 195: /* order_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { @@ -1947,35 +1948,35 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1951 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1952 "bison_parser.cpp" /* yacc.c:1257 */ break; case 196: /* order_desc */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).order)); } -#line 1957 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1958 "bison_parser.cpp" /* yacc.c:1257 */ break; case 197: /* opt_order_type */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1963 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1964 "bison_parser.cpp" /* yacc.c:1257 */ break; case 198: /* opt_top */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1969 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1970 "bison_parser.cpp" /* yacc.c:1257 */ break; case 199: /* opt_limit */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1975 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1976 "bison_parser.cpp" /* yacc.c:1257 */ break; case 200: /* expr_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1984,11 +1985,11 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1988 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1989 "bison_parser.cpp" /* yacc.c:1257 */ break; case 201: /* literal_list */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { @@ -1997,161 +1998,161 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 2001 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2002 "bison_parser.cpp" /* yacc.c:1257 */ break; case 202: /* expr_alias */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2007 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2008 "bison_parser.cpp" /* yacc.c:1257 */ break; case 203: /* expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2013 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2014 "bison_parser.cpp" /* yacc.c:1257 */ break; case 204: /* operand */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2019 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2020 "bison_parser.cpp" /* yacc.c:1257 */ break; case 205: /* scalar_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2025 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2026 "bison_parser.cpp" /* yacc.c:1257 */ break; case 206: /* unary_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2031 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2032 "bison_parser.cpp" /* yacc.c:1257 */ break; case 207: /* binary_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2037 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2038 "bison_parser.cpp" /* yacc.c:1257 */ break; case 208: /* logic_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2043 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2044 "bison_parser.cpp" /* yacc.c:1257 */ break; case 209: /* in_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2049 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2050 "bison_parser.cpp" /* yacc.c:1257 */ break; case 210: /* case_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2055 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2056 "bison_parser.cpp" /* yacc.c:1257 */ break; case 211: /* exists_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2061 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2062 "bison_parser.cpp" /* yacc.c:1257 */ break; case 212: /* comp_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2067 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2068 "bison_parser.cpp" /* yacc.c:1257 */ break; case 213: /* function_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2073 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2074 "bison_parser.cpp" /* yacc.c:1257 */ break; case 214: /* array_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2079 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2080 "bison_parser.cpp" /* yacc.c:1257 */ break; case 215: /* array_index */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2085 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2086 "bison_parser.cpp" /* yacc.c:1257 */ break; case 216: /* between_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2091 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2092 "bison_parser.cpp" /* yacc.c:1257 */ break; case 217: /* column_name */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2097 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2098 "bison_parser.cpp" /* yacc.c:1257 */ break; case 218: /* literal */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2103 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2104 "bison_parser.cpp" /* yacc.c:1257 */ break; case 219: /* string_literal */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2109 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2110 "bison_parser.cpp" /* yacc.c:1257 */ break; case 220: /* num_literal */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2115 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2116 "bison_parser.cpp" /* yacc.c:1257 */ break; case 221: /* int_literal */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2121 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2122 "bison_parser.cpp" /* yacc.c:1257 */ break; case 222: /* null_literal */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2127 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2128 "bison_parser.cpp" /* yacc.c:1257 */ break; case 223: /* param_expr */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2133 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2134 "bison_parser.cpp" /* yacc.c:1257 */ break; case 224: /* table_ref */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2139 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2140 "bison_parser.cpp" /* yacc.c:1257 */ break; case 225: /* table_ref_atomic */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2145 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2146 "bison_parser.cpp" /* yacc.c:1257 */ break; case 226: /* nonjoin_table_ref_atomic */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2151 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2152 "bison_parser.cpp" /* yacc.c:1257 */ break; case 227: /* table_ref_commalist */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).table_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).table_vec))) { @@ -2160,59 +2161,59 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).table_vec)); } -#line 2164 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2165 "bison_parser.cpp" /* yacc.c:1257 */ break; case 228: /* table_ref_name */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2170 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2171 "bison_parser.cpp" /* yacc.c:1257 */ break; case 229: /* table_ref_name_no_alias */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2176 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2177 "bison_parser.cpp" /* yacc.c:1257 */ break; case 230: /* table_name */ -#line 137 "bison_parser.y" /* yacc.c:1257 */ +#line 139 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).table_name).name) ); free( (((*yyvaluep).table_name).schema) ); } -#line 2182 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2183 "bison_parser.cpp" /* yacc.c:1257 */ break; case 231: /* alias */ -#line 138 "bison_parser.y" /* yacc.c:1257 */ +#line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 2188 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2189 "bison_parser.cpp" /* yacc.c:1257 */ break; case 232: /* opt_alias */ -#line 138 "bison_parser.y" /* yacc.c:1257 */ +#line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 2194 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2195 "bison_parser.cpp" /* yacc.c:1257 */ break; case 233: /* join_clause */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2200 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2201 "bison_parser.cpp" /* yacc.c:1257 */ break; case 234: /* opt_join_type */ -#line 136 "bison_parser.y" /* yacc.c:1257 */ +#line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 2206 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2207 "bison_parser.cpp" /* yacc.c:1257 */ break; case 235: /* join_condition */ -#line 147 "bison_parser.y" /* yacc.c:1257 */ +#line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2212 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2213 "bison_parser.cpp" /* yacc.c:1257 */ break; case 237: /* ident_commalist */ -#line 139 "bison_parser.y" /* yacc.c:1257 */ +#line 141 "bison_parser.y" /* yacc.c:1257 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { @@ -2221,7 +2222,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 2225 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2226 "bison_parser.cpp" /* yacc.c:1257 */ break; @@ -2329,7 +2330,7 @@ YYLTYPE yylloc = yyloc_default; yychar = YYEMPTY; /* Cause a token to be read. */ /* User initialization code. */ -#line 72 "bison_parser.y" /* yacc.c:1429 */ +#line 73 "bison_parser.y" /* yacc.c:1436 */ { // Initialize yylloc.first_column = 0; @@ -2337,9 +2338,10 @@ YYLTYPE yylloc = yyloc_default; yylloc.first_line = 0; yylloc.last_line = 0; yylloc.total_column = 0; + yylloc.string_length = 0; } -#line 2343 "bison_parser.cpp" /* yacc.c:1429 */ +#line 2345 "bison_parser.cpp" /* yacc.c:1436 */ yylsp[0] = yylloc; goto yysetstate; @@ -2526,7 +2528,7 @@ yyreduce: switch (yyn) { case 2: -#line 245 "bison_parser.y" /* yacc.c:1646 */ +#line 247 "bison_parser.y" /* yacc.c:1661 */ { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. @@ -2544,216 +2546,226 @@ yyreduce: } delete (yyvsp[-1].stmt_vec); } -#line 2548 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2550 "bison_parser.cpp" /* yacc.c:1661 */ break; case 3: -#line 266 "bison_parser.y" /* yacc.c:1646 */ - { (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } -#line 2554 "bison_parser.cpp" /* yacc.c:1646 */ +#line 268 "bison_parser.y" /* yacc.c:1661 */ + { + (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 2561 "bison_parser.cpp" /* yacc.c:1661 */ break; case 4: -#line 267 "bison_parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } -#line 2560 "bison_parser.cpp" /* yacc.c:1646 */ +#line 274 "bison_parser.y" /* yacc.c:1661 */ + { + (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 2572 "bison_parser.cpp" /* yacc.c:1661 */ break; case 5: -#line 271 "bison_parser.y" /* yacc.c:1646 */ +#line 283 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2569 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2581 "bison_parser.cpp" /* yacc.c:1661 */ break; case 6: -#line 275 "bison_parser.y" /* yacc.c:1646 */ +#line 287 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2578 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2590 "bison_parser.cpp" /* yacc.c:1661 */ break; case 7: -#line 279 "bison_parser.y" /* yacc.c:1646 */ +#line 291 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 2586 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2598 "bison_parser.cpp" /* yacc.c:1661 */ break; case 8: -#line 286 "bison_parser.y" /* yacc.c:1646 */ +#line 298 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 2592 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2604 "bison_parser.cpp" /* yacc.c:1661 */ break; case 9: -#line 287 "bison_parser.y" /* yacc.c:1646 */ +#line 299 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 2598 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2610 "bison_parser.cpp" /* yacc.c:1661 */ break; case 10: -#line 288 "bison_parser.y" /* yacc.c:1646 */ +#line 300 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 2604 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2616 "bison_parser.cpp" /* yacc.c:1661 */ break; case 11: -#line 289 "bison_parser.y" /* yacc.c:1646 */ +#line 301 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 2610 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2622 "bison_parser.cpp" /* yacc.c:1661 */ break; case 12: -#line 290 "bison_parser.y" /* yacc.c:1646 */ +#line 302 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2616 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2628 "bison_parser.cpp" /* yacc.c:1661 */ break; case 13: -#line 291 "bison_parser.y" /* yacc.c:1646 */ +#line 303 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2622 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2634 "bison_parser.cpp" /* yacc.c:1661 */ break; case 14: -#line 292 "bison_parser.y" /* yacc.c:1646 */ +#line 304 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 2628 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2640 "bison_parser.cpp" /* yacc.c:1661 */ break; case 15: -#line 293 "bison_parser.y" /* yacc.c:1646 */ +#line 305 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 2634 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2646 "bison_parser.cpp" /* yacc.c:1661 */ break; case 16: -#line 294 "bison_parser.y" /* yacc.c:1646 */ +#line 306 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 2640 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2652 "bison_parser.cpp" /* yacc.c:1661 */ break; case 17: -#line 303 "bison_parser.y" /* yacc.c:1646 */ +#line 315 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 2646 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2658 "bison_parser.cpp" /* yacc.c:1661 */ break; case 18: -#line 304 "bison_parser.y" /* yacc.c:1646 */ +#line 316 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = nullptr; } -#line 2652 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2664 "bison_parser.cpp" /* yacc.c:1661 */ break; case 19: -#line 309 "bison_parser.y" /* yacc.c:1646 */ +#line 321 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 2658 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2670 "bison_parser.cpp" /* yacc.c:1661 */ break; case 20: -#line 310 "bison_parser.y" /* yacc.c:1646 */ +#line 322 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 2664 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2676 "bison_parser.cpp" /* yacc.c:1661 */ break; case 21: -#line 314 "bison_parser.y" /* yacc.c:1646 */ +#line 326 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 2673 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2685 "bison_parser.cpp" /* yacc.c:1661 */ break; case 22: -#line 318 "bison_parser.y" /* yacc.c:1646 */ +#line 330 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 2683 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2695 "bison_parser.cpp" /* yacc.c:1661 */ break; case 23: -#line 330 "bison_parser.y" /* yacc.c:1646 */ +#line 342 "bison_parser.y" /* yacc.c:1661 */ { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 2693 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2705 "bison_parser.cpp" /* yacc.c:1661 */ break; case 25: -#line 340 "bison_parser.y" /* yacc.c:1646 */ +#line 352 "bison_parser.y" /* yacc.c:1661 */ { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 2702 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2714 "bison_parser.cpp" /* yacc.c:1661 */ break; case 26: -#line 344 "bison_parser.y" /* yacc.c:1646 */ +#line 356 "bison_parser.y" /* yacc.c:1661 */ { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 2712 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2724 "bison_parser.cpp" /* yacc.c:1661 */ break; case 27: -#line 356 "bison_parser.y" /* yacc.c:1646 */ +#line 368 "bison_parser.y" /* yacc.c:1661 */ { (yyval.import_stmt) = new ImportStatement((ImportType) (yyvsp[-4].uval)); (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 2723 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2735 "bison_parser.cpp" /* yacc.c:1661 */ break; case 28: -#line 365 "bison_parser.y" /* yacc.c:1646 */ +#line 377 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kImportCSV; } -#line 2729 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2741 "bison_parser.cpp" /* yacc.c:1661 */ break; case 29: -#line 369 "bison_parser.y" /* yacc.c:1646 */ +#line 381 "bison_parser.y" /* yacc.c:1661 */ { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } -#line 2735 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2747 "bison_parser.cpp" /* yacc.c:1661 */ break; case 30: -#line 379 "bison_parser.y" /* yacc.c:1646 */ +#line 391 "bison_parser.y" /* yacc.c:1661 */ { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 2743 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2755 "bison_parser.cpp" /* yacc.c:1661 */ break; case 31: -#line 382 "bison_parser.y" /* yacc.c:1646 */ +#line 394 "bison_parser.y" /* yacc.c:1661 */ { (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 2753 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2765 "bison_parser.cpp" /* yacc.c:1661 */ break; case 32: -#line 396 "bison_parser.y" /* yacc.c:1646 */ +#line 408 "bison_parser.y" /* yacc.c:1661 */ { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); @@ -2761,11 +2773,11 @@ yyreduce: (yyval.create_stmt)->tableName = (yyvsp[-4].table_name).name; (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 2765 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2777 "bison_parser.cpp" /* yacc.c:1661 */ break; case 33: -#line 403 "bison_parser.y" /* yacc.c:1646 */ +#line 415 "bison_parser.y" /* yacc.c:1661 */ { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -2773,11 +2785,11 @@ yyreduce: (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); } -#line 2777 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2789 "bison_parser.cpp" /* yacc.c:1661 */ break; case 34: -#line 410 "bison_parser.y" /* yacc.c:1646 */ +#line 422 "bison_parser.y" /* yacc.c:1661 */ { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); @@ -2786,132 +2798,132 @@ yyreduce: (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 2790 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2802 "bison_parser.cpp" /* yacc.c:1661 */ break; case 35: -#line 421 "bison_parser.y" /* yacc.c:1646 */ +#line 433 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = true; } -#line 2796 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2808 "bison_parser.cpp" /* yacc.c:1661 */ break; case 36: -#line 422 "bison_parser.y" /* yacc.c:1646 */ +#line 434 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = false; } -#line 2802 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2814 "bison_parser.cpp" /* yacc.c:1661 */ break; case 37: -#line 426 "bison_parser.y" /* yacc.c:1646 */ +#line 438 "bison_parser.y" /* yacc.c:1661 */ { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } -#line 2808 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2820 "bison_parser.cpp" /* yacc.c:1661 */ break; case 38: -#line 427 "bison_parser.y" /* yacc.c:1646 */ +#line 439 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } -#line 2814 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2826 "bison_parser.cpp" /* yacc.c:1661 */ break; case 39: -#line 431 "bison_parser.y" /* yacc.c:1646 */ +#line 443 "bison_parser.y" /* yacc.c:1661 */ { (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); } -#line 2822 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2834 "bison_parser.cpp" /* yacc.c:1661 */ break; case 40: -#line 438 "bison_parser.y" /* yacc.c:1646 */ +#line 450 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2828 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2840 "bison_parser.cpp" /* yacc.c:1661 */ break; case 41: -#line 439 "bison_parser.y" /* yacc.c:1646 */ +#line 451 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2834 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2846 "bison_parser.cpp" /* yacc.c:1661 */ break; case 42: -#line 440 "bison_parser.y" /* yacc.c:1646 */ +#line 452 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::DOUBLE; } -#line 2840 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2852 "bison_parser.cpp" /* yacc.c:1661 */ break; case 43: -#line 441 "bison_parser.y" /* yacc.c:1646 */ +#line 453 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::TEXT; } -#line 2846 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2858 "bison_parser.cpp" /* yacc.c:1661 */ break; case 44: -#line 451 "bison_parser.y" /* yacc.c:1646 */ +#line 463 "bison_parser.y" /* yacc.c:1661 */ { (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 2857 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2869 "bison_parser.cpp" /* yacc.c:1661 */ break; case 45: -#line 457 "bison_parser.y" /* yacc.c:1646 */ +#line 469 "bison_parser.y" /* yacc.c:1661 */ { (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 2868 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2880 "bison_parser.cpp" /* yacc.c:1661 */ break; case 46: -#line 463 "bison_parser.y" /* yacc.c:1646 */ +#line 475 "bison_parser.y" /* yacc.c:1661 */ { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 2878 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2890 "bison_parser.cpp" /* yacc.c:1661 */ break; case 47: -#line 471 "bison_parser.y" /* yacc.c:1646 */ +#line 483 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = true; } -#line 2884 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2896 "bison_parser.cpp" /* yacc.c:1661 */ break; case 48: -#line 472 "bison_parser.y" /* yacc.c:1646 */ +#line 484 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = false; } -#line 2890 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2902 "bison_parser.cpp" /* yacc.c:1661 */ break; case 49: -#line 481 "bison_parser.y" /* yacc.c:1646 */ +#line 493 "bison_parser.y" /* yacc.c:1661 */ { (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 2901 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2913 "bison_parser.cpp" /* yacc.c:1661 */ break; case 50: -#line 490 "bison_parser.y" /* yacc.c:1646 */ +#line 502 "bison_parser.y" /* yacc.c:1661 */ { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2911 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2923 "bison_parser.cpp" /* yacc.c:1661 */ break; case 51: -#line 503 "bison_parser.y" /* yacc.c:1646 */ +#line 515 "bison_parser.y" /* yacc.c:1661 */ { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; @@ -2919,11 +2931,11 @@ yyreduce: (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 2923 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2935 "bison_parser.cpp" /* yacc.c:1661 */ break; case 52: -#line 510 "bison_parser.y" /* yacc.c:1646 */ +#line 522 "bison_parser.y" /* yacc.c:1661 */ { (yyval.insert_stmt) = new InsertStatement(kInsertSelect); (yyval.insert_stmt)->schema = (yyvsp[-2].table_name).schema; @@ -2931,56 +2943,56 @@ yyreduce: (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } -#line 2935 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2947 "bison_parser.cpp" /* yacc.c:1661 */ break; case 53: -#line 521 "bison_parser.y" /* yacc.c:1646 */ +#line 533 "bison_parser.y" /* yacc.c:1661 */ { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 2941 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2953 "bison_parser.cpp" /* yacc.c:1661 */ break; case 54: -#line 522 "bison_parser.y" /* yacc.c:1646 */ +#line 534 "bison_parser.y" /* yacc.c:1661 */ { (yyval.str_vec) = nullptr; } -#line 2947 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2959 "bison_parser.cpp" /* yacc.c:1661 */ break; case 55: -#line 532 "bison_parser.y" /* yacc.c:1646 */ +#line 544 "bison_parser.y" /* yacc.c:1661 */ { (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 2958 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2970 "bison_parser.cpp" /* yacc.c:1661 */ break; case 56: -#line 541 "bison_parser.y" /* yacc.c:1646 */ +#line 553 "bison_parser.y" /* yacc.c:1661 */ { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 2964 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2976 "bison_parser.cpp" /* yacc.c:1661 */ break; case 57: -#line 542 "bison_parser.y" /* yacc.c:1646 */ +#line 554 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 2970 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2982 "bison_parser.cpp" /* yacc.c:1661 */ break; case 58: -#line 546 "bison_parser.y" /* yacc.c:1646 */ +#line 558 "bison_parser.y" /* yacc.c:1661 */ { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 2980 "bison_parser.cpp" /* yacc.c:1646 */ +#line 2992 "bison_parser.cpp" /* yacc.c:1661 */ break; case 61: -#line 560 "bison_parser.y" /* yacc.c:1646 */ +#line 572 "bison_parser.y" /* yacc.c:1661 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator @@ -2995,23 +3007,23 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 2999 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3011 "bison_parser.cpp" /* yacc.c:1661 */ break; case 62: -#line 577 "bison_parser.y" /* yacc.c:1646 */ +#line 589 "bison_parser.y" /* yacc.c:1661 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 3005 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3017 "bison_parser.cpp" /* yacc.c:1661 */ break; case 63: -#line 578 "bison_parser.y" /* yacc.c:1646 */ +#line 590 "bison_parser.y" /* yacc.c:1661 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 3011 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3023 "bison_parser.cpp" /* yacc.c:1661 */ break; case 66: -#line 587 "bison_parser.y" /* yacc.c:1646 */ +#line 599 "bison_parser.y" /* yacc.c:1661 */ { (yyval.select_stmt) = (yyvsp[-2].select_stmt); (yyval.select_stmt)->order = (yyvsp[-1].order_vec); @@ -3022,11 +3034,11 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3026 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3038 "bison_parser.cpp" /* yacc.c:1661 */ break; case 67: -#line 597 "bison_parser.y" /* yacc.c:1646 */ +#line 609 "bison_parser.y" /* yacc.c:1661 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator @@ -3041,11 +3053,11 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3045 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3057 "bison_parser.cpp" /* yacc.c:1661 */ break; case 74: -#line 629 "bison_parser.y" /* yacc.c:1646 */ +#line 641 "bison_parser.y" /* yacc.c:1661 */ { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); @@ -3055,500 +3067,500 @@ yyreduce: (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 3059 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3071 "bison_parser.cpp" /* yacc.c:1661 */ break; case 75: -#line 641 "bison_parser.y" /* yacc.c:1646 */ +#line 653 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = true; } -#line 3065 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3077 "bison_parser.cpp" /* yacc.c:1661 */ break; case 76: -#line 642 "bison_parser.y" /* yacc.c:1646 */ +#line 654 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = false; } -#line 3071 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3083 "bison_parser.cpp" /* yacc.c:1661 */ break; case 78: -#line 650 "bison_parser.y" /* yacc.c:1646 */ +#line 662 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table) = (yyvsp[0].table); } -#line 3077 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3089 "bison_parser.cpp" /* yacc.c:1661 */ break; case 79: -#line 655 "bison_parser.y" /* yacc.c:1646 */ +#line 667 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 3083 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3095 "bison_parser.cpp" /* yacc.c:1661 */ break; case 80: -#line 656 "bison_parser.y" /* yacc.c:1646 */ +#line 668 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = nullptr; } -#line 3089 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3101 "bison_parser.cpp" /* yacc.c:1661 */ break; case 81: -#line 660 "bison_parser.y" /* yacc.c:1646 */ +#line 672 "bison_parser.y" /* yacc.c:1661 */ { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 3099 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3111 "bison_parser.cpp" /* yacc.c:1661 */ break; case 82: -#line 665 "bison_parser.y" /* yacc.c:1646 */ +#line 677 "bison_parser.y" /* yacc.c:1661 */ { (yyval.group_t) = nullptr; } -#line 3105 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3117 "bison_parser.cpp" /* yacc.c:1661 */ break; case 83: -#line 669 "bison_parser.y" /* yacc.c:1646 */ +#line 681 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 3111 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3123 "bison_parser.cpp" /* yacc.c:1661 */ break; case 84: -#line 670 "bison_parser.y" /* yacc.c:1646 */ +#line 682 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = nullptr; } -#line 3117 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3129 "bison_parser.cpp" /* yacc.c:1661 */ break; case 85: -#line 673 "bison_parser.y" /* yacc.c:1646 */ +#line 685 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 3123 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3135 "bison_parser.cpp" /* yacc.c:1661 */ break; case 86: -#line 674 "bison_parser.y" /* yacc.c:1646 */ +#line 686 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_vec) = nullptr; } -#line 3129 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3141 "bison_parser.cpp" /* yacc.c:1661 */ break; case 87: -#line 678 "bison_parser.y" /* yacc.c:1646 */ +#line 690 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 3135 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3147 "bison_parser.cpp" /* yacc.c:1661 */ break; case 88: -#line 679 "bison_parser.y" /* yacc.c:1646 */ +#line 691 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 3141 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3153 "bison_parser.cpp" /* yacc.c:1661 */ break; case 89: -#line 683 "bison_parser.y" /* yacc.c:1646 */ +#line 695 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 3147 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3159 "bison_parser.cpp" /* yacc.c:1661 */ break; case 90: -#line 687 "bison_parser.y" /* yacc.c:1646 */ +#line 699 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_type) = kOrderAsc; } -#line 3153 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3165 "bison_parser.cpp" /* yacc.c:1661 */ break; case 91: -#line 688 "bison_parser.y" /* yacc.c:1646 */ +#line 700 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_type) = kOrderDesc; } -#line 3159 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3171 "bison_parser.cpp" /* yacc.c:1661 */ break; case 92: -#line 689 "bison_parser.y" /* yacc.c:1646 */ +#line 701 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_type) = kOrderAsc; } -#line 3165 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3177 "bison_parser.cpp" /* yacc.c:1661 */ break; case 93: -#line 695 "bison_parser.y" /* yacc.c:1646 */ +#line 707 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3171 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3183 "bison_parser.cpp" /* yacc.c:1661 */ break; case 94: -#line 696 "bison_parser.y" /* yacc.c:1646 */ +#line 708 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = nullptr; } -#line 3177 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3189 "bison_parser.cpp" /* yacc.c:1661 */ break; case 95: -#line 700 "bison_parser.y" /* yacc.c:1646 */ +#line 712 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3183 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3195 "bison_parser.cpp" /* yacc.c:1661 */ break; case 96: -#line 701 "bison_parser.y" /* yacc.c:1646 */ +#line 713 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } -#line 3189 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3201 "bison_parser.cpp" /* yacc.c:1661 */ break; case 97: -#line 702 "bison_parser.y" /* yacc.c:1646 */ +#line 714 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = nullptr; } -#line 3195 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3207 "bison_parser.cpp" /* yacc.c:1661 */ break; case 98: -#line 709 "bison_parser.y" /* yacc.c:1646 */ +#line 721 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3201 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3213 "bison_parser.cpp" /* yacc.c:1661 */ break; case 99: -#line 710 "bison_parser.y" /* yacc.c:1646 */ +#line 722 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3207 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3219 "bison_parser.cpp" /* yacc.c:1661 */ break; case 100: -#line 714 "bison_parser.y" /* yacc.c:1646 */ +#line 726 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3213 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3225 "bison_parser.cpp" /* yacc.c:1661 */ break; case 101: -#line 715 "bison_parser.y" /* yacc.c:1646 */ +#line 727 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3219 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3231 "bison_parser.cpp" /* yacc.c:1661 */ break; case 102: -#line 719 "bison_parser.y" /* yacc.c:1646 */ +#line 731 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->alias = (yyvsp[0].sval); } -#line 3228 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3240 "bison_parser.cpp" /* yacc.c:1661 */ break; case 108: -#line 734 "bison_parser.y" /* yacc.c:1646 */ +#line 746 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[-1].expr); } -#line 3234 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3246 "bison_parser.cpp" /* yacc.c:1661 */ break; case 116: -#line 742 "bison_parser.y" /* yacc.c:1646 */ +#line 754 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 3240 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3252 "bison_parser.cpp" /* yacc.c:1661 */ break; case 119: -#line 751 "bison_parser.y" /* yacc.c:1646 */ +#line 763 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 3246 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3258 "bison_parser.cpp" /* yacc.c:1661 */ break; case 120: -#line 752 "bison_parser.y" /* yacc.c:1646 */ +#line 764 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 3252 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3264 "bison_parser.cpp" /* yacc.c:1661 */ break; case 121: -#line 753 "bison_parser.y" /* yacc.c:1646 */ +#line 765 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 3258 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3270 "bison_parser.cpp" /* yacc.c:1661 */ break; case 122: -#line 754 "bison_parser.y" /* yacc.c:1646 */ +#line 766 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 3264 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3276 "bison_parser.cpp" /* yacc.c:1661 */ break; case 123: -#line 755 "bison_parser.y" /* yacc.c:1646 */ +#line 767 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 3270 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3282 "bison_parser.cpp" /* yacc.c:1661 */ break; case 125: -#line 760 "bison_parser.y" /* yacc.c:1646 */ +#line 772 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 3276 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3288 "bison_parser.cpp" /* yacc.c:1661 */ break; case 126: -#line 761 "bison_parser.y" /* yacc.c:1646 */ +#line 773 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 3282 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3294 "bison_parser.cpp" /* yacc.c:1661 */ break; case 127: -#line 762 "bison_parser.y" /* yacc.c:1646 */ +#line 774 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 3288 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3300 "bison_parser.cpp" /* yacc.c:1661 */ break; case 128: -#line 763 "bison_parser.y" /* yacc.c:1646 */ +#line 775 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 3294 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3306 "bison_parser.cpp" /* yacc.c:1661 */ break; case 129: -#line 764 "bison_parser.y" /* yacc.c:1646 */ +#line 776 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 3300 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3312 "bison_parser.cpp" /* yacc.c:1661 */ break; case 130: -#line 765 "bison_parser.y" /* yacc.c:1646 */ +#line 777 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 3306 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3318 "bison_parser.cpp" /* yacc.c:1661 */ break; case 131: -#line 766 "bison_parser.y" /* yacc.c:1646 */ +#line 778 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 3312 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3324 "bison_parser.cpp" /* yacc.c:1661 */ break; case 132: -#line 767 "bison_parser.y" /* yacc.c:1646 */ +#line 779 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 3318 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3330 "bison_parser.cpp" /* yacc.c:1661 */ break; case 133: -#line 768 "bison_parser.y" /* yacc.c:1646 */ +#line 780 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 3324 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3336 "bison_parser.cpp" /* yacc.c:1661 */ break; case 134: -#line 769 "bison_parser.y" /* yacc.c:1646 */ +#line 781 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 3330 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3342 "bison_parser.cpp" /* yacc.c:1661 */ break; case 135: -#line 773 "bison_parser.y" /* yacc.c:1646 */ +#line 785 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 3336 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3348 "bison_parser.cpp" /* yacc.c:1661 */ break; case 136: -#line 774 "bison_parser.y" /* yacc.c:1646 */ +#line 786 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 3342 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3354 "bison_parser.cpp" /* yacc.c:1661 */ break; case 137: -#line 778 "bison_parser.y" /* yacc.c:1646 */ +#line 790 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 3348 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3360 "bison_parser.cpp" /* yacc.c:1661 */ break; case 138: -#line 779 "bison_parser.y" /* yacc.c:1646 */ +#line 791 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 3354 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3366 "bison_parser.cpp" /* yacc.c:1661 */ break; case 139: -#line 780 "bison_parser.y" /* yacc.c:1646 */ +#line 792 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 3360 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3372 "bison_parser.cpp" /* yacc.c:1661 */ break; case 140: -#line 781 "bison_parser.y" /* yacc.c:1646 */ +#line 793 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 3366 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3378 "bison_parser.cpp" /* yacc.c:1661 */ break; case 141: -#line 786 "bison_parser.y" /* yacc.c:1646 */ +#line 798 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCase((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3372 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3384 "bison_parser.cpp" /* yacc.c:1661 */ break; case 142: -#line 788 "bison_parser.y" /* yacc.c:1646 */ +#line 800 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCase((yyvsp[-5].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3378 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3390 "bison_parser.cpp" /* yacc.c:1661 */ break; case 143: -#line 792 "bison_parser.y" /* yacc.c:1646 */ +#line 804 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 3384 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3396 "bison_parser.cpp" /* yacc.c:1661 */ break; case 144: -#line 793 "bison_parser.y" /* yacc.c:1646 */ +#line 805 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 3390 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3402 "bison_parser.cpp" /* yacc.c:1661 */ break; case 145: -#line 797 "bison_parser.y" /* yacc.c:1646 */ +#line 809 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 3396 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3408 "bison_parser.cpp" /* yacc.c:1661 */ break; case 146: -#line 798 "bison_parser.y" /* yacc.c:1646 */ +#line 810 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 3402 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3414 "bison_parser.cpp" /* yacc.c:1661 */ break; case 147: -#line 799 "bison_parser.y" /* yacc.c:1646 */ +#line 811 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 3408 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3420 "bison_parser.cpp" /* yacc.c:1661 */ break; case 148: -#line 800 "bison_parser.y" /* yacc.c:1646 */ +#line 812 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 3414 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3426 "bison_parser.cpp" /* yacc.c:1661 */ break; case 149: -#line 801 "bison_parser.y" /* yacc.c:1646 */ +#line 813 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 3420 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3432 "bison_parser.cpp" /* yacc.c:1661 */ break; case 150: -#line 802 "bison_parser.y" /* yacc.c:1646 */ +#line 814 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 3426 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3438 "bison_parser.cpp" /* yacc.c:1661 */ break; case 151: -#line 806 "bison_parser.y" /* yacc.c:1646 */ +#line 818 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } -#line 3432 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3444 "bison_parser.cpp" /* yacc.c:1661 */ break; case 152: -#line 807 "bison_parser.y" /* yacc.c:1646 */ +#line 819 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } -#line 3438 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3450 "bison_parser.cpp" /* yacc.c:1661 */ break; case 153: -#line 811 "bison_parser.y" /* yacc.c:1646 */ +#line 823 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 3444 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3456 "bison_parser.cpp" /* yacc.c:1661 */ break; case 154: -#line 815 "bison_parser.y" /* yacc.c:1646 */ +#line 827 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 3450 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3462 "bison_parser.cpp" /* yacc.c:1661 */ break; case 155: -#line 819 "bison_parser.y" /* yacc.c:1646 */ +#line 831 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3456 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3468 "bison_parser.cpp" /* yacc.c:1661 */ break; case 156: -#line 823 "bison_parser.y" /* yacc.c:1646 */ +#line 835 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 3462 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3474 "bison_parser.cpp" /* yacc.c:1661 */ break; case 157: -#line 824 "bison_parser.y" /* yacc.c:1646 */ +#line 836 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 3468 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3480 "bison_parser.cpp" /* yacc.c:1661 */ break; case 158: -#line 825 "bison_parser.y" /* yacc.c:1646 */ +#line 837 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeStar(); } -#line 3474 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3486 "bison_parser.cpp" /* yacc.c:1661 */ break; case 159: -#line 826 "bison_parser.y" /* yacc.c:1646 */ +#line 838 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 3480 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3492 "bison_parser.cpp" /* yacc.c:1661 */ break; case 164: -#line 837 "bison_parser.y" /* yacc.c:1646 */ +#line 849 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 3486 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3498 "bison_parser.cpp" /* yacc.c:1661 */ break; case 165: -#line 842 "bison_parser.y" /* yacc.c:1646 */ +#line 854 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 3492 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3504 "bison_parser.cpp" /* yacc.c:1661 */ break; case 167: -#line 847 "bison_parser.y" /* yacc.c:1646 */ +#line 859 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 3498 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3510 "bison_parser.cpp" /* yacc.c:1661 */ break; case 168: -#line 851 "bison_parser.y" /* yacc.c:1646 */ +#line 863 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeNullLiteral(); } -#line 3504 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3516 "bison_parser.cpp" /* yacc.c:1661 */ break; case 169: -#line 855 "bison_parser.y" /* yacc.c:1646 */ +#line 867 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } -#line 3514 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3526 "bison_parser.cpp" /* yacc.c:1661 */ break; case 171: -#line 868 "bison_parser.y" /* yacc.c:1646 */ +#line 880 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[0].table_vec)->push_back((yyvsp[-2].table)); auto tbl = new TableRef(kTableCrossProduct); tbl->list = (yyvsp[0].table_vec); (yyval.table) = tbl; } -#line 3525 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3537 "bison_parser.cpp" /* yacc.c:1661 */ break; case 175: -#line 884 "bison_parser.y" /* yacc.c:1646 */ +#line 896 "bison_parser.y" /* yacc.c:1661 */ { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3536 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3548 "bison_parser.cpp" /* yacc.c:1661 */ break; case 176: -#line 893 "bison_parser.y" /* yacc.c:1646 */ +#line 905 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 3542 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3554 "bison_parser.cpp" /* yacc.c:1661 */ break; case 177: -#line 894 "bison_parser.y" /* yacc.c:1646 */ +#line 906 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 3548 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3560 "bison_parser.cpp" /* yacc.c:1661 */ break; case 178: -#line 899 "bison_parser.y" /* yacc.c:1646 */ +#line 911 "bison_parser.y" /* yacc.c:1661 */ { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; @@ -3556,45 +3568,45 @@ yyreduce: tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3560 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3572 "bison_parser.cpp" /* yacc.c:1661 */ break; case 179: -#line 910 "bison_parser.y" /* yacc.c:1646 */ +#line 922 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table) = new TableRef(kTableName); (yyval.table)->schema = (yyvsp[0].table_name).schema; (yyval.table)->name = (yyvsp[0].table_name).name; } -#line 3570 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3582 "bison_parser.cpp" /* yacc.c:1661 */ break; case 180: -#line 919 "bison_parser.y" /* yacc.c:1646 */ +#line 931 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval);} -#line 3576 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3588 "bison_parser.cpp" /* yacc.c:1661 */ break; case 181: -#line 920 "bison_parser.y" /* yacc.c:1646 */ +#line 932 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } -#line 3582 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3594 "bison_parser.cpp" /* yacc.c:1661 */ break; case 182: -#line 925 "bison_parser.y" /* yacc.c:1646 */ +#line 937 "bison_parser.y" /* yacc.c:1661 */ { (yyval.sval) = (yyvsp[0].sval); } -#line 3588 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3600 "bison_parser.cpp" /* yacc.c:1661 */ break; case 185: -#line 931 "bison_parser.y" /* yacc.c:1646 */ +#line 943 "bison_parser.y" /* yacc.c:1661 */ { (yyval.sval) = nullptr; } -#line 3594 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3606 "bison_parser.cpp" /* yacc.c:1661 */ break; case 186: -#line 940 "bison_parser.y" /* yacc.c:1646 */ +#line 952 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3602,11 +3614,11 @@ yyreduce: (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 3606 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3618 "bison_parser.cpp" /* yacc.c:1661 */ break; case 187: -#line 948 "bison_parser.y" /* yacc.c:1646 */ +#line 960 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3615,11 +3627,11 @@ yyreduce: (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 3619 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3631 "bison_parser.cpp" /* yacc.c:1661 */ break; case 188: -#line 958 "bison_parser.y" /* yacc.c:1646 */ +#line 970 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); @@ -3635,71 +3647,71 @@ yyreduce: (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } -#line 3639 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3651 "bison_parser.cpp" /* yacc.c:1661 */ break; case 189: -#line 976 "bison_parser.y" /* yacc.c:1646 */ +#line 988 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinInner; } -#line 3645 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3657 "bison_parser.cpp" /* yacc.c:1661 */ break; case 190: -#line 977 "bison_parser.y" /* yacc.c:1646 */ +#line 989 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinOuter; } -#line 3651 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3663 "bison_parser.cpp" /* yacc.c:1661 */ break; case 191: -#line 978 "bison_parser.y" /* yacc.c:1646 */ +#line 990 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinLeftOuter; } -#line 3657 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3669 "bison_parser.cpp" /* yacc.c:1661 */ break; case 192: -#line 979 "bison_parser.y" /* yacc.c:1646 */ +#line 991 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinRightOuter; } -#line 3663 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3675 "bison_parser.cpp" /* yacc.c:1661 */ break; case 193: -#line 980 "bison_parser.y" /* yacc.c:1646 */ +#line 992 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinLeft; } -#line 3669 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3681 "bison_parser.cpp" /* yacc.c:1661 */ break; case 194: -#line 981 "bison_parser.y" /* yacc.c:1646 */ +#line 993 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinRight; } -#line 3675 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3687 "bison_parser.cpp" /* yacc.c:1661 */ break; case 195: -#line 982 "bison_parser.y" /* yacc.c:1646 */ +#line 994 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinCross; } -#line 3681 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3693 "bison_parser.cpp" /* yacc.c:1661 */ break; case 196: -#line 983 "bison_parser.y" /* yacc.c:1646 */ +#line 995 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinInner; } -#line 3687 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3699 "bison_parser.cpp" /* yacc.c:1661 */ break; case 200: -#line 1003 "bison_parser.y" /* yacc.c:1646 */ +#line 1015 "bison_parser.y" /* yacc.c:1661 */ { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 3693 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3705 "bison_parser.cpp" /* yacc.c:1661 */ break; case 201: -#line 1004 "bison_parser.y" /* yacc.c:1646 */ +#line 1016 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 3699 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3711 "bison_parser.cpp" /* yacc.c:1661 */ break; -#line 3703 "bison_parser.cpp" /* yacc.c:1646 */ +#line 3715 "bison_parser.cpp" /* yacc.c:1661 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3934,7 +3946,7 @@ yyreturn: #endif return yyresult; } -#line 1007 "bison_parser.y" /* yacc.c:1906 */ +#line 1019 "bison_parser.y" /* yacc.c:1906 */ /********************************* ** Section 4: Additional C code diff --git a/src/parser/bison_parser.h b/src/parser/bison_parser.h index 314283e..7b6edc9 100644 --- a/src/parser/bison_parser.h +++ b/src/parser/bison_parser.h @@ -48,7 +48,7 @@ extern int hsql_debug; #endif /* "%code requires" blocks. */ -#line 35 "bison_parser.y" /* yacc.c:1909 */ +#line 35 "bison_parser.y" /* yacc.c:1915 */ // %code requires block @@ -62,6 +62,7 @@ extern int hsql_debug; yylloc->first_column = yylloc->last_column; \ for(int i = 0; yytext[i] != '\0'; i++) { \ yylloc->total_column++; \ + yylloc->string_length++; \ if(yytext[i] == '\n') { \ yylloc->last_line++; \ yylloc->last_column = 0; \ @@ -71,7 +72,7 @@ extern int hsql_debug; } \ } -#line 75 "bison_parser.h" /* yacc.c:1909 */ +#line 76 "bison_parser.h" /* yacc.c:1915 */ /* Token type. */ #ifndef HSQL_TOKENTYPE @@ -217,7 +218,7 @@ extern int hsql_debug; union HSQL_STYPE { -#line 93 "bison_parser.y" /* yacc.c:1909 */ +#line 95 "bison_parser.y" /* yacc.c:1915 */ double fval; int64_t ival; @@ -236,7 +237,7 @@ union HSQL_STYPE hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; - + hsql::TableName table_name; hsql::TableRef* table; hsql::Expr* expr; @@ -256,7 +257,7 @@ union HSQL_STYPE std::vector* expr_vec; std::vector* order_vec; -#line 260 "bison_parser.h" /* yacc.c:1909 */ +#line 261 "bison_parser.h" /* yacc.c:1915 */ }; typedef union HSQL_STYPE HSQL_STYPE; diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index 7d280a9..b0dbc7b 100755 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -45,6 +45,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha yylloc->first_column = yylloc->last_column; \ for(int i = 0; yytext[i] != '\0'; i++) { \ yylloc->total_column++; \ + yylloc->string_length++; \ if(yytext[i] == '\n') { \ yylloc->last_line++; \ yylloc->last_column = 0; \ @@ -76,6 +77,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha @$.first_line = 0; @$.last_line = 0; @$.total_column = 0; + @$.string_length = 0; }; @@ -108,7 +110,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha hsql::PrepareStatement* prep_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; - + hsql::TableName table_name; hsql::TableRef* table; hsql::Expr* expr; @@ -133,7 +135,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha /********************************* ** Descrutor symbols *********************************/ -%destructor { } +%destructor { } %destructor { free( ($$.name) ); free( ($$.schema) ); } %destructor { free( ($$) ); } %destructor { @@ -185,7 +187,7 @@ int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const cha %type delete_statement truncate_statement %type update_statement %type drop_statement -%type show_statement +%type show_statement %type table_name %type opt_alias alias file_path prepare_target_query %type opt_not_exists opt_exists opt_distinct @@ -263,8 +265,18 @@ input: statement_list: - statement { $$ = new std::vector(); $$->push_back($1); } - | statement_list ';' statement { $1->push_back($3); $$ = $1; } + statement { + $1->stringLength = yylloc.string_length; + yylloc.string_length = 0; + $$ = new std::vector(); + $$->push_back($1); + } + | statement_list ';' statement { + $3->stringLength = yylloc.string_length; + yylloc.string_length = 0; + $1->push_back($3); + $$ = $1; + } ; statement: @@ -471,7 +483,7 @@ opt_exists: IF EXISTS { $$ = true; } | /* empty */ { $$ = false; } ; - + /****************************** * Delete Statement / Truncate statement * DELETE FROM students WHERE grade > 3.0 diff --git a/src/parser/parser_typedef.h b/src/parser/parser_typedef.h index a16770e..de4854a 100644 --- a/src/parser/parser_typedef.h +++ b/src/parser/parser_typedef.h @@ -22,6 +22,9 @@ struct HSQL_CUST_LTYPE { int total_column; + // Length of the string in the SQL query string + int string_length; + // Parameters. // int param_id; std::vector param_list; diff --git a/src/sql/SQLStatement.h b/src/sql/SQLStatement.h index db7cbf1..c2c71fb 100644 --- a/src/sql/SQLStatement.h +++ b/src/sql/SQLStatement.h @@ -37,6 +37,9 @@ namespace hsql { // Shorthand for isType(type). bool is(StatementType type) const; + // Length of the string in the SQL query string + size_t stringLength; + std::vector* hints; private: diff --git a/test/sql_tests.cpp b/test/sql_tests.cpp index fd07aa9..e935fa5 100644 --- a/test/sql_tests.cpp +++ b/test/sql_tests.cpp @@ -213,4 +213,15 @@ TEST(HintTest) { ASSERT_EQ(10, stmt->hints->at(1)->exprList->at(0)->ival); } +TEST(StringLengthTest) { + TEST_PARSE_SQL_QUERY( + "SELECT * FROM bar; INSERT INTO foo VALUES (4);\t\n SELECT * FROM foo;", + result, + 3); + + ASSERT_EQ(result.getStatement(0)->stringLength, 18); + ASSERT_EQ(result.getStatement(1)->stringLength, 28); + ASSERT_EQ(result.getStatement(2)->stringLength, 21); +} + TEST_MAIN(); From 2f5502cb930baa68d24c834076d7a2745837ccd0 Mon Sep 17 00:00:00 2001 From: Lawrence Date: Wed, 17 Jan 2018 16:05:42 +0100 Subject: [PATCH 4/5] Fix typo --- src/parser/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/Makefile b/src/parser/Makefile index 0494dce..93db639 100644 --- a/src/parser/Makefile +++ b/src/parser/Makefile @@ -1,4 +1,4 @@ -# bison's version is too old OSX, allow user to pass in custom path +# bison's version is too old on OSX, allow user to pass in custom path BISON?=bison all: bison_parser.cpp flex_lexer.cpp From a578842117fa9f632c434d4038174cb6f7081779 Mon Sep 17 00:00:00 2001 From: Lawrence Date: Wed, 17 Jan 2018 16:47:57 +0100 Subject: [PATCH 5/5] Fix order of table_ref --- src/parser/bison_parser.cpp | 883 ++++++++++++++++++------------------ src/parser/bison_parser.y | 8 +- test/select_tests.cpp | 22 + 3 files changed, 461 insertions(+), 452 deletions(-) diff --git a/src/parser/bison_parser.cpp b/src/parser/bison_parser.cpp index 6735bf9..c723e00 100644 --- a/src/parser/bison_parser.cpp +++ b/src/parser/bison_parser.cpp @@ -620,7 +620,7 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 52 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 541 +#define YYLAST 494 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 151 @@ -629,7 +629,7 @@ union yyalloc /* YYNRULES -- Number of rules. */ #define YYNRULES 205 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 382 +#define YYNSTATES 380 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -786,10 +786,10 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -295 +#define YYPACT_NINF -285 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-295))) + (!!((Yystate) == (-285))) #define YYTABLE_NINF -201 @@ -800,45 +800,44 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 226, 9, 41, 66, 91, -37, 23, 28, 46, 3, - 41, -17, 13, -32, 68, 27, -295, 87, 87, -295, - -295, -295, -295, -295, -295, -295, -295, -295, -295, 22, - -295, 31, 164, 45, -295, 52, 123, 102, 102, 41, - 115, 41, 224, 219, 139, -295, 116, 116, 41, -295, - 110, 111, -295, 226, -295, 178, -295, -295, -295, -295, - -295, -32, 170, 162, -32, 221, -295, 282, 10, 288, - 177, 41, 41, 220, -295, 218, 154, -295, -295, -295, - 165, 297, 265, 41, 41, -295, -295, -295, -295, 168, - -295, 247, -295, -295, -295, 165, 247, 224, -295, -295, - -295, -295, -295, -295, -67, -295, -295, -295, -295, -295, - -295, -295, -295, 283, -61, 154, 165, -295, 318, 322, - -10, 19, 182, 84, 241, 186, 197, -295, 145, 249, - 184, -295, 6, 272, -295, -295, -295, -295, -295, -295, - -295, -295, -295, -295, -295, -295, -295, -295, 210, -48, - -295, -295, -295, -295, 334, 221, 191, -295, -40, 221, - 295, -295, 10, -295, 231, 341, 232, 55, 260, -295, - -295, -28, 203, -295, 1, 8, 300, 165, 93, 82, - 206, 197, 342, 165, 72, 207, -74, 7, 220, 165, - -295, 165, 349, 165, -295, -295, 197, -295, 197, -62, - 209, 119, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 197, 224, 165, 297, -295, - 213, 90, -295, -295, 165, -295, -295, -295, -295, 224, - -295, 275, -2, 103, -295, -32, 41, -295, 359, 10, - -295, 165, -295, -295, 217, 63, 83, 165, 165, -295, - 300, 277, -98, -295, -295, -32, -295, -20, -295, -295, - 5, -295, 306, -295, -295, -295, 266, 316, 374, 197, - 222, 145, -295, 279, 227, 374, 374, 374, 398, 398, - 398, 398, 72, 72, 65, 65, 65, -21, 228, 55, - -295, 10, -295, 334, -295, -295, 318, -295, -295, -295, - -295, -295, -295, 341, -295, -295, -295, 117, 118, -295, - 165, 165, -295, 121, 77, 229, -295, 234, 287, -295, - -295, -295, 308, 309, 7, 296, -295, 259, -295, 197, - 374, 145, 237, 127, -295, -295, 163, -295, -295, -295, - -295, -295, 55, 122, -295, 165, -295, 5, 7, -295, - -295, 270, 235, 7, 165, 342, 242, 175, -295, -295, - -295, -295, 55, -295, -295, 7, 239, -24, -295, -295, - 270, 240, 165, 165, -295, 18, 55, -295, 55, 245, - 248, -295 + 17, 6, 61, 91, 124, -22, 80, 85, 70, 95, + 61, -21, 40, -41, 220, 87, -285, 157, 157, -285, + -285, -285, -285, -285, -285, -285, -285, -285, -285, 31, + -285, 176, 230, 97, -285, 103, 182, 151, 151, 61, + 167, 61, 263, 273, 164, -285, 170, 170, 61, -285, + 150, 159, -285, 17, -285, 203, -285, -285, -285, -285, + -285, -41, 206, 196, -41, 253, -285, 328, 10, 332, + 228, 61, 61, 265, -285, 259, 199, -285, -285, -285, + 84, 338, 305, 61, 61, -285, -285, -285, -285, 202, + -285, 279, -285, -285, -285, 84, 279, 263, -285, -285, + -285, -285, -285, -285, 32, -285, -285, -285, -285, -285, + -285, -285, -285, 308, -61, 199, 84, -285, 348, 353, + 54, 57, 215, 74, 165, 224, 183, -285, 116, 288, + 221, -285, 4, 225, -285, -285, -285, -285, -285, -285, + -285, -285, -285, -285, -285, -285, -285, -285, 247, -48, + -285, -285, -285, -285, 371, 253, 226, -285, -40, 253, + 330, -285, 10, -285, 267, 374, 268, -9, 296, -285, + -285, 134, 239, -285, 1, 8, 336, 84, 143, -52, + 241, 183, 295, 84, 184, 242, -64, 3, 265, 84, + -285, 84, 386, 84, -285, -285, 183, -285, 183, -62, + 245, 105, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 263, 84, 338, -285, + 246, 135, -285, -285, 84, -285, -285, -285, -285, 263, + -285, 312, -2, 145, -285, -41, 61, -285, 397, 10, + -285, 84, -285, -285, 255, 55, 96, 84, 84, -285, + 336, 323, 102, -285, -285, -41, -285, 141, -285, 277, + -285, 15, -285, 354, -285, -285, -285, 314, 269, 327, + 183, 272, 116, -285, 337, 275, 327, 327, 327, 351, + 351, 351, 351, 184, 184, -96, -96, -96, 107, 278, + -9, -285, 10, -285, 371, -285, -285, 348, -285, -285, + -285, -285, -285, -285, 374, -285, -285, -285, 149, 155, + -285, 84, 84, -285, 77, 128, 284, -285, 291, 355, + -285, -285, -285, 372, 375, 356, 3, -285, 324, -285, + 183, 327, 116, 298, 163, -285, -285, 180, -285, -285, + -285, -285, -285, -9, 111, -285, 84, -285, 15, 3, + -285, -285, 3, 231, 84, 295, 300, 186, -285, -285, + -285, -285, -9, -285, -285, 210, -32, -285, -285, 302, + 84, 84, -285, 14, -9, -285, -9, 301, 303, -285 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -871,48 +870,47 @@ static const yytype_uint8 yydefact[] = 21, 0, 19, 61, 0, 91, 90, 89, 67, 0, 101, 0, 0, 0, 37, 0, 0, 53, 0, 0, 155, 0, 161, 163, 0, 0, 0, 0, 0, 143, - 0, 0, 0, 116, 108, 0, 78, 174, 176, 178, - 189, 177, 82, 99, 135, 186, 136, 0, 131, 0, - 0, 0, 122, 0, 134, 133, 149, 150, 151, 152, - 153, 154, 126, 125, 128, 127, 129, 130, 0, 58, - 57, 0, 17, 0, 88, 96, 0, 41, 42, 43, - 40, 39, 33, 0, 34, 27, 205, 0, 0, 147, - 0, 0, 141, 0, 0, 0, 157, 0, 0, 199, - 193, 194, 198, 197, 0, 0, 182, 0, 74, 0, - 132, 0, 0, 0, 123, 158, 0, 20, 32, 38, - 51, 156, 145, 0, 144, 0, 148, 189, 0, 196, - 195, 180, 175, 0, 0, 159, 0, 0, 139, 137, - 22, 142, 146, 179, 190, 0, 200, 84, 140, 138, - 181, 0, 0, 0, 81, 0, 201, 191, 83, 160, - 0, 192 + 0, 0, 0, 116, 108, 0, 78, 174, 176, 0, + 178, 189, 177, 82, 99, 135, 186, 136, 0, 131, + 0, 0, 0, 122, 0, 134, 133, 149, 150, 151, + 152, 153, 154, 126, 125, 128, 127, 129, 130, 0, + 58, 57, 0, 17, 0, 88, 96, 0, 41, 42, + 43, 40, 39, 33, 0, 34, 27, 205, 0, 0, + 147, 0, 0, 141, 0, 0, 0, 157, 0, 0, + 199, 193, 194, 198, 197, 0, 0, 182, 0, 74, + 0, 132, 0, 0, 0, 123, 158, 0, 20, 32, + 38, 51, 156, 145, 0, 144, 0, 148, 189, 0, + 196, 195, 0, 175, 0, 159, 0, 0, 139, 137, + 22, 142, 146, 179, 190, 200, 84, 140, 138, 0, + 0, 0, 81, 0, 201, 191, 83, 160, 0, 192 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -295, -295, -295, 340, -295, 377, -295, 106, -295, -295, - -295, -295, -295, 107, -295, -295, 369, -295, 113, -295, - -295, 367, -295, -295, -295, 302, -295, -295, 202, -178, - 14, 357, -13, 391, -295, -295, 230, 250, -295, -295, - -97, -295, -295, 21, -295, 199, -295, -295, -45, -176, - -215, 238, -94, -70, -295, -295, -295, -295, -295, -295, - 251, -295, -295, -295, -295, -295, -295, 51, -66, -113, - -295, -39, -295, -295, -295, -294, 80, -295, -295, -295, - 2, -295, -241, -295, -295, -295, -295, -295 + -285, -285, -285, 401, -285, 432, -285, 168, -285, -285, + -285, -285, -285, 161, -285, -285, 421, -285, 169, -285, + -285, 424, -285, -285, -285, 357, -285, -285, 256, -104, + 52, 412, -13, 446, -285, -285, 201, 304, -285, -285, + -119, -285, -285, -60, -285, 258, -285, -285, 37, -174, + -220, 290, -94, -70, -285, -285, -285, -285, -285, -285, + 315, -285, -285, -285, -285, -285, -285, 110, -66, -113, + -285, -39, -285, -285, -285, -284, 137, -285, -285, -285, + 2, -285, -240, -285, -285, -285, -285, -285 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 14, 15, 16, 17, 56, 221, 222, 18, 112, - 19, 20, 75, 168, 21, 22, 71, 233, 234, 301, + 19, 20, 75, 168, 21, 22, 71, 233, 234, 302, 23, 83, 24, 25, 26, 120, 27, 149, 150, 28, 29, 91, 30, 61, 62, 94, 31, 80, 129, 188, - 117, 328, 374, 65, 156, 157, 227, 43, 98, 130, + 117, 329, 372, 65, 156, 157, 227, 43, 98, 130, 104, 131, 132, 133, 134, 135, 136, 137, 138, 139, 179, 140, 141, 142, 143, 144, 145, 146, 147, 106, - 107, 108, 109, 110, 256, 257, 258, 352, 259, 44, - 260, 194, 195, 261, 325, 377, 54, 171 + 107, 108, 109, 110, 256, 257, 258, 259, 260, 44, + 261, 194, 195, 262, 325, 375, 54, 171 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -920,120 +918,110 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 51, 158, 105, 78, 34, 169, 318, 252, 190, 190, - 33, 242, 45, 79, 100, 101, 77, 9, 373, 326, - 164, 379, 167, 297, 307, 116, 269, 50, 191, 178, - 351, 58, 48, 37, 186, 298, 32, 225, 319, 9, - 58, 73, 320, 76, 33, 172, 316, 193, 321, 322, - 85, 189, 219, 46, 182, 270, 184, 304, 160, 366, - 38, 59, 191, 226, 49, 308, -200, 323, 52, 35, - 59, 370, 254, 114, 115, 90, 336, 317, 90, 161, - 47, 193, 162, 245, 165, 152, 153, 121, 100, 101, - 77, 262, 299, 60, 36, 333, 230, 264, 63, 266, - 102, 218, 60, 202, 39, 300, 363, 173, 191, 40, - 223, 182, 155, 13, 228, 185, 42, 159, 237, 192, - 192, 238, 216, 289, 122, 189, 267, 193, 268, 324, - 158, 41, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 243, 240, 121, 100, - 101, 77, 255, 313, 314, 357, 127, 191, 310, 123, - 103, 247, 311, 244, 174, 191, 175, 66, 121, 100, - 101, 77, 345, 105, 102, 53, 193, 288, 367, 191, - 248, 248, 177, 169, 193, 122, 55, 249, 312, 202, - 295, 177, 67, 124, 9, 191, 202, 68, 193, 330, - 121, 100, 101, 77, 69, 122, 215, 125, 216, 272, - 212, 213, 214, 215, 193, 216, 342, 343, 70, 74, - 123, 126, 127, 191, 191, 105, 344, 361, 273, 128, - 77, 79, 82, 1, 103, 102, 292, 315, 305, 293, - 123, 2, 193, 193, 121, 100, 101, 77, 3, 302, - 81, 362, 303, 4, 124, 102, 86, 87, 332, 355, - 5, 6, 89, 340, 341, 318, 162, 189, 125, 7, - 8, 93, 123, 359, 124, 9, 189, 95, 376, 378, - 10, 180, 126, 127, 97, 99, 113, 102, 125, 196, - 128, 92, 111, 116, 92, 103, 318, 319, 118, 119, - 148, 320, 126, 127, 11, 151, 181, 321, 322, 360, - 128, 371, 162, 154, 63, 103, 123, 197, 356, 12, - 125, 369, 100, 163, 189, 170, 323, 176, 319, 183, - 187, 102, 320, 189, 126, 127, 217, 220, 321, 322, - 224, 229, 128, 231, 232, 236, 235, 103, 239, 9, - 181, 250, 265, 253, 271, 296, -200, 323, 291, 372, - 198, 197, 306, 309, 125, 269, 327, 331, 191, 334, - 216, 13, 335, 348, 354, 346, 349, 350, 126, 127, - 347, 199, 353, 358, 365, 375, 128, 197, 368, 200, - 201, 103, 175, 88, 381, 57, 202, 203, 204, 337, - 205, 206, 207, 338, 198, 208, 209, 72, 210, 211, - 212, 213, 214, 215, 84, 216, 339, 166, 329, 197, - 290, 96, 64, 294, 241, 251, 380, 263, 364, 246, - 198, 0, 0, 0, 201, 0, 0, 0, 0, 0, - 202, 203, 204, 197, 205, 206, 207, 0, 0, 208, - 209, 251, 210, 211, 212, 213, 214, 215, 0, 216, - 201, 0, -201, 0, 0, 0, 202, 203, 204, 0, - 205, 206, 207, 0, 0, 208, 209, 0, 210, 211, - 212, 213, 214, 215, 0, 216, 0, 0, 0, 0, - 0, 0, 201, 0, 0, 0, 0, 0, 202, -201, - -201, 0, -201, 206, 207, 0, 0, 208, 209, 0, - 210, 211, 212, 213, 214, 215, 201, 216, 0, 0, - 0, 0, 202, 0, 0, 0, 0, -201, -201, 0, - 0, -201, -201, 0, 210, 211, 212, 213, 214, 215, - 0, 216 + 51, 158, 105, 78, 34, 169, 33, 190, 9, 252, + 371, 242, 45, 79, 100, 101, 77, 377, 190, 308, + 164, 327, 167, 298, 1, 116, 270, 247, 202, 178, + 219, 155, 2, 32, 186, 299, 159, 225, 191, 3, + 58, 73, 353, 76, 4, 215, 248, 216, 37, 46, + 85, 5, 6, 249, 182, 271, 184, 193, 160, 48, + 7, 8, 191, 226, 33, 50, 9, 309, 365, 263, + 59, 10, 337, 114, 115, 38, 47, 121, 100, 101, + 77, 193, 254, 245, 165, 152, 153, 121, 100, 101, + 77, 49, 300, 191, 35, 11, 230, 265, 334, 267, + 102, 218, 60, 9, 13, 301, 191, 173, 363, 172, + 12, 182, 193, 90, 122, 185, 90, 189, 192, 121, + 100, 101, 77, 290, 122, 193, 268, 36, 269, 192, + 158, 305, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 243, 240, 255, 123, + 311, 318, 127, 314, 315, 41, 122, 191, 357, 123, + 103, 39, 13, 244, 102, 9, 40, 319, 121, 100, + 101, 77, 177, 105, 102, 312, 193, 289, 161, 191, + 366, 162, 345, 124, 169, 58, 121, 100, 101, 77, + 296, 123, 223, 124, 248, 273, 228, 125, 193, 320, + 331, 313, 174, 321, 175, 180, 102, 125, 42, 322, + 323, 126, 127, 191, 274, 59, 361, 343, 344, 128, + 52, 126, 127, 346, 103, 124, 105, -200, 324, 128, + 191, 202, 193, 66, 103, 53, 319, 316, 306, 125, + 123, 177, 196, 63, 67, 191, 317, 60, 68, 193, + 216, 189, 362, 126, 127, 102, 55, 319, 123, 333, + 355, 128, 92, 69, 193, 92, 103, 70, 320, 77, + 197, 74, 321, 102, 181, 81, 374, 376, 322, 323, + 237, 293, 369, 238, 294, 79, 82, 89, 125, 320, + -180, 303, 181, 321, 304, 341, 86, 324, 162, 322, + 323, 342, 126, 127, 189, 87, 125, 93, 202, 359, + 128, 95, 189, 198, 197, 103, 97, -200, 324, 356, + 126, 127, 212, 213, 214, 215, 360, 216, 128, 162, + 370, 99, 368, 103, 199, 189, 111, 113, 116, 118, + 197, 148, 200, 201, 119, 151, 63, 154, 163, 202, + 203, 204, 100, 205, 206, 207, 170, 198, 208, 209, + 176, 210, 211, 212, 213, 214, 215, 183, 216, 187, + 189, 330, 197, 217, 220, 224, 229, 232, 251, 231, + -181, 236, 235, 198, 239, 9, 250, 201, 253, 266, + 272, 292, 297, 202, 203, 204, 197, 205, 206, 207, + 307, 310, 208, 209, 251, 210, 211, 212, 213, 214, + 215, 270, 216, 201, 328, -201, 191, 332, 216, 202, + 203, 204, 336, 205, 206, 207, 326, 335, 208, 209, + 347, 210, 211, 212, 213, 214, 215, 348, 216, 354, + 350, 349, 352, 351, 358, 201, 367, 373, 175, 379, + 57, 202, -201, -201, 88, -201, 206, 207, 339, 72, + 208, 209, 338, 210, 211, 212, 213, 214, 215, 201, + 216, 84, 166, 340, 291, 202, 96, 64, 241, 264, + -201, -201, 295, 378, -201, -201, 364, 210, 211, 212, + 213, 214, 215, 246, 216 }; -static const yytype_int16 yycheck[] = +static const yytype_uint16 yycheck[] = { - 13, 95, 68, 42, 2, 118, 26, 183, 3, 3, - 3, 3, 10, 12, 4, 5, 6, 49, 42, 260, - 81, 3, 116, 25, 239, 73, 88, 13, 102, 123, - 324, 9, 19, 70, 128, 37, 27, 77, 58, 49, - 9, 39, 62, 41, 3, 55, 144, 121, 68, 69, - 48, 149, 149, 70, 124, 117, 126, 235, 97, 353, - 97, 39, 102, 103, 51, 241, 86, 87, 0, 3, - 39, 365, 146, 71, 72, 61, 291, 255, 64, 146, - 97, 121, 149, 177, 145, 83, 84, 3, 4, 5, - 6, 188, 94, 71, 3, 271, 162, 191, 67, 193, - 90, 149, 71, 124, 81, 107, 347, 120, 102, 81, - 155, 181, 91, 145, 159, 128, 113, 96, 146, 114, - 114, 149, 143, 217, 40, 149, 196, 121, 198, 149, - 224, 85, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 138, 146, 3, 4, - 5, 6, 145, 247, 248, 331, 138, 102, 95, 75, - 150, 79, 79, 176, 145, 102, 147, 3, 3, 4, - 5, 6, 95, 239, 90, 148, 121, 216, 354, 102, - 98, 98, 98, 296, 121, 40, 99, 105, 105, 124, - 229, 98, 147, 109, 49, 102, 124, 145, 121, 269, - 3, 4, 5, 6, 81, 40, 141, 123, 143, 90, - 138, 139, 140, 141, 121, 143, 310, 311, 116, 104, - 75, 137, 138, 102, 102, 291, 105, 105, 109, 145, - 6, 12, 116, 7, 150, 90, 146, 250, 236, 149, - 75, 15, 121, 121, 3, 4, 5, 6, 22, 146, - 111, 345, 149, 27, 109, 90, 146, 146, 271, 329, - 34, 35, 84, 146, 146, 26, 149, 149, 123, 43, - 44, 101, 75, 146, 109, 49, 149, 115, 372, 373, - 54, 40, 137, 138, 63, 3, 109, 90, 123, 17, - 145, 61, 4, 73, 64, 150, 26, 58, 80, 145, - 3, 62, 137, 138, 78, 40, 109, 68, 69, 146, - 145, 72, 149, 145, 67, 150, 75, 45, 331, 93, - 123, 146, 4, 40, 149, 3, 87, 145, 58, 143, - 81, 90, 62, 149, 137, 138, 126, 3, 68, 69, - 149, 46, 145, 112, 3, 85, 114, 150, 145, 49, - 109, 145, 3, 146, 145, 80, 86, 87, 145, 120, - 88, 45, 3, 146, 123, 88, 60, 145, 102, 90, - 143, 145, 144, 86, 115, 146, 68, 68, 137, 138, - 146, 109, 86, 146, 149, 145, 145, 45, 146, 117, - 118, 150, 147, 53, 146, 18, 124, 125, 126, 293, - 128, 129, 130, 296, 88, 133, 134, 38, 136, 137, - 138, 139, 140, 141, 47, 143, 303, 115, 102, 45, - 218, 64, 31, 224, 174, 109, 375, 189, 348, 178, - 88, -1, -1, -1, 118, -1, -1, -1, -1, -1, - 124, 125, 126, 45, 128, 129, 130, -1, -1, 133, - 134, 109, 136, 137, 138, 139, 140, 141, -1, 143, - 118, -1, 88, -1, -1, -1, 124, 125, 126, -1, - 128, 129, 130, -1, -1, 133, 134, -1, 136, 137, - 138, 139, 140, 141, -1, 143, -1, -1, -1, -1, - -1, -1, 118, -1, -1, -1, -1, -1, 124, 125, - 126, -1, 128, 129, 130, -1, -1, 133, 134, -1, - 136, 137, 138, 139, 140, 141, 118, 143, -1, -1, - -1, -1, 124, -1, -1, -1, -1, 129, 130, -1, - -1, 133, 134, -1, 136, 137, 138, 139, 140, 141, - -1, 143 + 13, 95, 68, 42, 2, 118, 3, 3, 49, 183, + 42, 3, 10, 12, 4, 5, 6, 3, 3, 239, + 81, 261, 116, 25, 7, 73, 88, 79, 124, 123, + 149, 91, 15, 27, 128, 37, 96, 77, 102, 22, + 9, 39, 326, 41, 27, 141, 98, 143, 70, 70, + 48, 34, 35, 105, 124, 117, 126, 121, 97, 19, + 43, 44, 102, 103, 3, 13, 49, 241, 352, 188, + 39, 54, 292, 71, 72, 97, 97, 3, 4, 5, + 6, 121, 146, 177, 145, 83, 84, 3, 4, 5, + 6, 51, 94, 102, 3, 78, 162, 191, 272, 193, + 90, 149, 71, 49, 145, 107, 102, 120, 348, 55, + 93, 181, 121, 61, 40, 128, 64, 149, 114, 3, + 4, 5, 6, 217, 40, 121, 196, 3, 198, 114, + 224, 235, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 138, 146, 145, 75, + 95, 255, 138, 247, 248, 85, 40, 102, 332, 75, + 150, 81, 145, 176, 90, 49, 81, 26, 3, 4, + 5, 6, 98, 239, 90, 79, 121, 216, 146, 102, + 354, 149, 105, 109, 297, 9, 3, 4, 5, 6, + 229, 75, 155, 109, 98, 90, 159, 123, 121, 58, + 270, 105, 145, 62, 147, 40, 90, 123, 113, 68, + 69, 137, 138, 102, 109, 39, 105, 311, 312, 145, + 0, 137, 138, 95, 150, 109, 292, 86, 87, 145, + 102, 124, 121, 3, 150, 148, 26, 250, 236, 123, + 75, 98, 17, 67, 147, 102, 144, 71, 145, 121, + 143, 149, 346, 137, 138, 90, 99, 26, 75, 272, + 330, 145, 61, 81, 121, 64, 150, 116, 58, 6, + 45, 104, 62, 90, 109, 111, 370, 371, 68, 69, + 146, 146, 72, 149, 149, 12, 116, 84, 123, 58, + 149, 146, 109, 62, 149, 146, 146, 87, 149, 68, + 69, 146, 137, 138, 149, 146, 123, 101, 124, 146, + 145, 115, 149, 88, 45, 150, 63, 86, 87, 332, + 137, 138, 138, 139, 140, 141, 146, 143, 145, 149, + 120, 3, 146, 150, 109, 149, 4, 109, 73, 80, + 45, 3, 117, 118, 145, 40, 67, 145, 40, 124, + 125, 126, 4, 128, 129, 130, 3, 88, 133, 134, + 145, 136, 137, 138, 139, 140, 141, 143, 143, 81, + 149, 102, 45, 126, 3, 149, 46, 3, 109, 112, + 149, 85, 114, 88, 145, 49, 145, 118, 146, 3, + 145, 145, 80, 124, 125, 126, 45, 128, 129, 130, + 3, 146, 133, 134, 109, 136, 137, 138, 139, 140, + 141, 88, 143, 118, 60, 88, 102, 145, 143, 124, + 125, 126, 144, 128, 129, 130, 149, 90, 133, 134, + 146, 136, 137, 138, 139, 140, 141, 146, 143, 115, + 68, 86, 86, 68, 146, 118, 146, 145, 147, 146, + 18, 124, 125, 126, 53, 128, 129, 130, 297, 38, + 133, 134, 294, 136, 137, 138, 139, 140, 141, 118, + 143, 47, 115, 304, 218, 124, 64, 31, 174, 189, + 129, 130, 224, 373, 133, 134, 349, 136, 137, 138, + 139, 140, 141, 178, 143 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1065,20 +1053,19 @@ static const yytype_uint8 yystos[] = 3, 157, 158, 199, 149, 77, 103, 197, 199, 46, 219, 112, 3, 168, 169, 114, 85, 146, 149, 145, 146, 188, 3, 138, 183, 203, 211, 79, 98, 105, - 145, 109, 200, 146, 146, 145, 225, 226, 227, 229, - 231, 234, 191, 202, 203, 3, 203, 204, 204, 88, - 117, 145, 90, 109, 204, 204, 204, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 222, 203, - 179, 145, 146, 149, 196, 222, 80, 25, 37, 94, - 107, 170, 146, 149, 180, 231, 3, 201, 200, 146, - 95, 79, 105, 203, 203, 183, 144, 180, 26, 58, - 62, 68, 69, 87, 149, 235, 233, 60, 192, 102, - 204, 145, 183, 200, 90, 144, 201, 158, 164, 169, - 146, 146, 203, 203, 105, 95, 146, 146, 86, 68, - 68, 226, 228, 86, 115, 204, 183, 200, 146, 146, - 146, 105, 203, 233, 227, 149, 226, 200, 146, 146, - 226, 72, 120, 42, 193, 145, 203, 236, 203, 3, - 218, 146 + 145, 109, 200, 146, 146, 145, 225, 226, 227, 228, + 229, 231, 234, 191, 202, 203, 3, 203, 204, 204, + 88, 117, 145, 90, 109, 204, 204, 204, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 222, + 203, 179, 145, 146, 149, 196, 222, 80, 25, 37, + 94, 107, 170, 146, 149, 180, 231, 3, 201, 200, + 146, 95, 79, 105, 203, 203, 183, 144, 180, 26, + 58, 62, 68, 69, 87, 235, 149, 233, 60, 192, + 102, 204, 145, 183, 200, 90, 144, 201, 158, 164, + 169, 146, 146, 203, 203, 105, 95, 146, 146, 86, + 68, 68, 86, 226, 115, 204, 183, 200, 146, 146, + 146, 105, 203, 233, 227, 226, 200, 146, 146, 72, + 120, 42, 193, 145, 203, 236, 203, 3, 218, 146 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -1629,25 +1616,25 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio case 3: /* IDENTIFIER */ #line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1633 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1620 "bison_parser.cpp" /* yacc.c:1257 */ break; case 4: /* STRING */ #line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1639 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1626 "bison_parser.cpp" /* yacc.c:1257 */ break; case 5: /* FLOATVAL */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1645 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1632 "bison_parser.cpp" /* yacc.c:1257 */ break; case 6: /* INTVAL */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1651 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1638 "bison_parser.cpp" /* yacc.c:1257 */ break; case 153: /* statement_list */ @@ -1660,19 +1647,19 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).stmt_vec)); } -#line 1664 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1651 "bison_parser.cpp" /* yacc.c:1257 */ break; case 154: /* statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1670 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1657 "bison_parser.cpp" /* yacc.c:1257 */ break; case 155: /* preparable_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).statement)); } -#line 1676 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1663 "bison_parser.cpp" /* yacc.c:1257 */ break; case 156: /* opt_hints */ @@ -1685,7 +1672,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1689 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1676 "bison_parser.cpp" /* yacc.c:1257 */ break; case 157: /* hint_list */ @@ -1698,67 +1685,67 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1702 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1689 "bison_parser.cpp" /* yacc.c:1257 */ break; case 158: /* hint */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1708 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1695 "bison_parser.cpp" /* yacc.c:1257 */ break; case 159: /* prepare_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).prep_stmt)); } -#line 1714 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1701 "bison_parser.cpp" /* yacc.c:1257 */ break; case 160: /* prepare_target_query */ #line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1720 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1707 "bison_parser.cpp" /* yacc.c:1257 */ break; case 161: /* execute_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).exec_stmt)); } -#line 1726 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1713 "bison_parser.cpp" /* yacc.c:1257 */ break; case 162: /* import_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).import_stmt)); } -#line 1732 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1719 "bison_parser.cpp" /* yacc.c:1257 */ break; case 163: /* import_file_type */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1738 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1725 "bison_parser.cpp" /* yacc.c:1257 */ break; case 164: /* file_path */ #line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 1744 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1731 "bison_parser.cpp" /* yacc.c:1257 */ break; case 165: /* show_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).show_stmt)); } -#line 1750 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1737 "bison_parser.cpp" /* yacc.c:1257 */ break; case 166: /* create_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).create_stmt)); } -#line 1756 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1743 "bison_parser.cpp" /* yacc.c:1257 */ break; case 167: /* opt_not_exists */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1762 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1749 "bison_parser.cpp" /* yacc.c:1257 */ break; case 168: /* column_def_commalist */ @@ -1771,49 +1758,49 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).column_vec)); } -#line 1775 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1762 "bison_parser.cpp" /* yacc.c:1257 */ break; case 169: /* column_def */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).column_t)); } -#line 1781 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1768 "bison_parser.cpp" /* yacc.c:1257 */ break; case 170: /* column_type */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1787 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1774 "bison_parser.cpp" /* yacc.c:1257 */ break; case 171: /* drop_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).drop_stmt)); } -#line 1793 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1780 "bison_parser.cpp" /* yacc.c:1257 */ break; case 172: /* opt_exists */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1799 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1786 "bison_parser.cpp" /* yacc.c:1257 */ break; case 173: /* delete_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1805 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1792 "bison_parser.cpp" /* yacc.c:1257 */ break; case 174: /* truncate_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).delete_stmt)); } -#line 1811 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1798 "bison_parser.cpp" /* yacc.c:1257 */ break; case 175: /* insert_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).insert_stmt)); } -#line 1817 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1804 "bison_parser.cpp" /* yacc.c:1257 */ break; case 176: /* opt_column_list */ @@ -1826,13 +1813,13 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 1830 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1817 "bison_parser.cpp" /* yacc.c:1257 */ break; case 177: /* update_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_stmt)); } -#line 1836 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1823 "bison_parser.cpp" /* yacc.c:1257 */ break; case 178: /* update_clause_commalist */ @@ -1845,49 +1832,49 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).update_vec)); } -#line 1849 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1836 "bison_parser.cpp" /* yacc.c:1257 */ break; case 179: /* update_clause */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).update_t)); } -#line 1855 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1842 "bison_parser.cpp" /* yacc.c:1257 */ break; case 180: /* select_statement */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1861 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1848 "bison_parser.cpp" /* yacc.c:1257 */ break; case 181: /* select_with_paren */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1867 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1854 "bison_parser.cpp" /* yacc.c:1257 */ break; case 182: /* select_paren_or_clause */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1873 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1860 "bison_parser.cpp" /* yacc.c:1257 */ break; case 183: /* select_no_paren */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1879 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1866 "bison_parser.cpp" /* yacc.c:1257 */ break; case 187: /* select_clause */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).select_stmt)); } -#line 1885 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1872 "bison_parser.cpp" /* yacc.c:1257 */ break; case 188: /* opt_distinct */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1891 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1878 "bison_parser.cpp" /* yacc.c:1257 */ break; case 189: /* select_list */ @@ -1900,31 +1887,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1904 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1891 "bison_parser.cpp" /* yacc.c:1257 */ break; case 190: /* from_clause */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 1910 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1897 "bison_parser.cpp" /* yacc.c:1257 */ break; case 191: /* opt_where */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1916 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1903 "bison_parser.cpp" /* yacc.c:1257 */ break; case 192: /* opt_group */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).group_t)); } -#line 1922 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1909 "bison_parser.cpp" /* yacc.c:1257 */ break; case 193: /* opt_having */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 1928 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1915 "bison_parser.cpp" /* yacc.c:1257 */ break; case 194: /* opt_order */ @@ -1937,7 +1924,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1941 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1928 "bison_parser.cpp" /* yacc.c:1257 */ break; case 195: /* order_list */ @@ -1950,31 +1937,31 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).order_vec)); } -#line 1954 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1941 "bison_parser.cpp" /* yacc.c:1257 */ break; case 196: /* order_desc */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).order)); } -#line 1960 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1947 "bison_parser.cpp" /* yacc.c:1257 */ break; case 197: /* opt_order_type */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 1966 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1953 "bison_parser.cpp" /* yacc.c:1257 */ break; case 198: /* opt_top */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1972 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1959 "bison_parser.cpp" /* yacc.c:1257 */ break; case 199: /* opt_limit */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).limit)); } -#line 1978 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1965 "bison_parser.cpp" /* yacc.c:1257 */ break; case 200: /* expr_list */ @@ -1987,7 +1974,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 1991 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1978 "bison_parser.cpp" /* yacc.c:1257 */ break; case 201: /* literal_list */ @@ -2000,163 +1987,163 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).expr_vec)); } -#line 2004 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1991 "bison_parser.cpp" /* yacc.c:1257 */ break; case 202: /* expr_alias */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2010 "bison_parser.cpp" /* yacc.c:1257 */ +#line 1997 "bison_parser.cpp" /* yacc.c:1257 */ break; case 203: /* expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2016 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2003 "bison_parser.cpp" /* yacc.c:1257 */ break; case 204: /* operand */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2022 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2009 "bison_parser.cpp" /* yacc.c:1257 */ break; case 205: /* scalar_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2028 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2015 "bison_parser.cpp" /* yacc.c:1257 */ break; case 206: /* unary_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2034 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2021 "bison_parser.cpp" /* yacc.c:1257 */ break; case 207: /* binary_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2040 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2027 "bison_parser.cpp" /* yacc.c:1257 */ break; case 208: /* logic_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2046 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2033 "bison_parser.cpp" /* yacc.c:1257 */ break; case 209: /* in_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2052 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2039 "bison_parser.cpp" /* yacc.c:1257 */ break; case 210: /* case_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2058 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2045 "bison_parser.cpp" /* yacc.c:1257 */ break; case 211: /* case_list */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2064 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2051 "bison_parser.cpp" /* yacc.c:1257 */ break; case 212: /* exists_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2070 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2057 "bison_parser.cpp" /* yacc.c:1257 */ break; case 213: /* comp_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2076 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2063 "bison_parser.cpp" /* yacc.c:1257 */ break; case 214: /* function_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2082 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2069 "bison_parser.cpp" /* yacc.c:1257 */ break; case 215: /* array_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2088 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2075 "bison_parser.cpp" /* yacc.c:1257 */ break; case 216: /* array_index */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2094 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2081 "bison_parser.cpp" /* yacc.c:1257 */ break; case 217: /* between_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2100 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2087 "bison_parser.cpp" /* yacc.c:1257 */ break; case 218: /* column_name */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2106 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2093 "bison_parser.cpp" /* yacc.c:1257 */ break; case 219: /* literal */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2112 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2099 "bison_parser.cpp" /* yacc.c:1257 */ break; case 220: /* string_literal */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2118 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2105 "bison_parser.cpp" /* yacc.c:1257 */ break; case 221: /* num_literal */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2124 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2111 "bison_parser.cpp" /* yacc.c:1257 */ break; case 222: /* int_literal */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2130 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2117 "bison_parser.cpp" /* yacc.c:1257 */ break; case 223: /* null_literal */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2136 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2123 "bison_parser.cpp" /* yacc.c:1257 */ break; case 224: /* param_expr */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2142 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2129 "bison_parser.cpp" /* yacc.c:1257 */ break; case 225: /* table_ref */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2148 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2135 "bison_parser.cpp" /* yacc.c:1257 */ break; case 226: /* table_ref_atomic */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2154 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2141 "bison_parser.cpp" /* yacc.c:1257 */ break; case 227: /* nonjoin_table_ref_atomic */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2160 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2147 "bison_parser.cpp" /* yacc.c:1257 */ break; case 228: /* table_ref_commalist */ @@ -2169,55 +2156,55 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).table_vec)); } -#line 2173 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2160 "bison_parser.cpp" /* yacc.c:1257 */ break; case 229: /* table_ref_name */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2179 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2166 "bison_parser.cpp" /* yacc.c:1257 */ break; case 230: /* table_ref_name_no_alias */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2185 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2172 "bison_parser.cpp" /* yacc.c:1257 */ break; case 231: /* table_name */ #line 139 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).table_name).name) ); free( (((*yyvaluep).table_name).schema) ); } -#line 2191 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2178 "bison_parser.cpp" /* yacc.c:1257 */ break; case 232: /* alias */ #line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 2197 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2184 "bison_parser.cpp" /* yacc.c:1257 */ break; case 233: /* opt_alias */ #line 140 "bison_parser.y" /* yacc.c:1257 */ { free( (((*yyvaluep).sval)) ); } -#line 2203 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2190 "bison_parser.cpp" /* yacc.c:1257 */ break; case 234: /* join_clause */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).table)); } -#line 2209 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2196 "bison_parser.cpp" /* yacc.c:1257 */ break; case 235: /* opt_join_type */ #line 138 "bison_parser.y" /* yacc.c:1257 */ { } -#line 2215 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2202 "bison_parser.cpp" /* yacc.c:1257 */ break; case 236: /* join_condition */ #line 149 "bison_parser.y" /* yacc.c:1257 */ { delete (((*yyvaluep).expr)); } -#line 2221 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2208 "bison_parser.cpp" /* yacc.c:1257 */ break; case 238: /* ident_commalist */ @@ -2230,7 +2217,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio } delete (((*yyvaluep).str_vec)); } -#line 2234 "bison_parser.cpp" /* yacc.c:1257 */ +#line 2221 "bison_parser.cpp" /* yacc.c:1257 */ break; @@ -2349,7 +2336,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.string_length = 0; } -#line 2353 "bison_parser.cpp" /* yacc.c:1436 */ +#line 2340 "bison_parser.cpp" /* yacc.c:1436 */ yylsp[0] = yylloc; goto yysetstate; @@ -2554,7 +2541,7 @@ yyreduce: } delete (yyvsp[-1].stmt_vec); } -#line 2558 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2545 "bison_parser.cpp" /* yacc.c:1661 */ break; case 3: @@ -2565,7 +2552,7 @@ yyreduce: (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } -#line 2569 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2556 "bison_parser.cpp" /* yacc.c:1661 */ break; case 4: @@ -2576,7 +2563,7 @@ yyreduce: (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } -#line 2580 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2567 "bison_parser.cpp" /* yacc.c:1661 */ break; case 5: @@ -2585,7 +2572,7 @@ yyreduce: (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2589 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2576 "bison_parser.cpp" /* yacc.c:1661 */ break; case 6: @@ -2594,7 +2581,7 @@ yyreduce: (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } -#line 2598 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2585 "bison_parser.cpp" /* yacc.c:1661 */ break; case 7: @@ -2602,85 +2589,85 @@ yyreduce: { (yyval.statement) = (yyvsp[0].show_stmt); } -#line 2606 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2593 "bison_parser.cpp" /* yacc.c:1661 */ break; case 8: #line 298 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].select_stmt); } -#line 2612 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2599 "bison_parser.cpp" /* yacc.c:1661 */ break; case 9: #line 299 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].import_stmt); } -#line 2618 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2605 "bison_parser.cpp" /* yacc.c:1661 */ break; case 10: #line 300 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].create_stmt); } -#line 2624 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2611 "bison_parser.cpp" /* yacc.c:1661 */ break; case 11: #line 301 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].insert_stmt); } -#line 2630 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2617 "bison_parser.cpp" /* yacc.c:1661 */ break; case 12: #line 302 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2636 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2623 "bison_parser.cpp" /* yacc.c:1661 */ break; case 13: #line 303 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } -#line 2642 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2629 "bison_parser.cpp" /* yacc.c:1661 */ break; case 14: #line 304 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].update_stmt); } -#line 2648 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2635 "bison_parser.cpp" /* yacc.c:1661 */ break; case 15: #line 305 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].drop_stmt); } -#line 2654 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2641 "bison_parser.cpp" /* yacc.c:1661 */ break; case 16: #line 306 "bison_parser.y" /* yacc.c:1661 */ { (yyval.statement) = (yyvsp[0].exec_stmt); } -#line 2660 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2647 "bison_parser.cpp" /* yacc.c:1661 */ break; case 17: #line 315 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } -#line 2666 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2653 "bison_parser.cpp" /* yacc.c:1661 */ break; case 18: #line 316 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = nullptr; } -#line 2672 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2659 "bison_parser.cpp" /* yacc.c:1661 */ break; case 19: #line 321 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 2678 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2665 "bison_parser.cpp" /* yacc.c:1661 */ break; case 20: #line 322 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 2684 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2671 "bison_parser.cpp" /* yacc.c:1661 */ break; case 21: @@ -2689,7 +2676,7 @@ yyreduce: (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } -#line 2693 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2680 "bison_parser.cpp" /* yacc.c:1661 */ break; case 22: @@ -2699,7 +2686,7 @@ yyreduce: (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } -#line 2703 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2690 "bison_parser.cpp" /* yacc.c:1661 */ break; case 23: @@ -2709,7 +2696,7 @@ yyreduce: (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } -#line 2713 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2700 "bison_parser.cpp" /* yacc.c:1661 */ break; case 25: @@ -2718,7 +2705,7 @@ yyreduce: (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } -#line 2722 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2709 "bison_parser.cpp" /* yacc.c:1661 */ break; case 26: @@ -2728,7 +2715,7 @@ yyreduce: (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } -#line 2732 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2719 "bison_parser.cpp" /* yacc.c:1661 */ break; case 27: @@ -2739,19 +2726,19 @@ yyreduce: (yyval.import_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.import_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2743 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2730 "bison_parser.cpp" /* yacc.c:1661 */ break; case 28: #line 377 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kImportCSV; } -#line 2749 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2736 "bison_parser.cpp" /* yacc.c:1661 */ break; case 29: #line 381 "bison_parser.y" /* yacc.c:1661 */ { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } -#line 2755 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2742 "bison_parser.cpp" /* yacc.c:1661 */ break; case 30: @@ -2759,7 +2746,7 @@ yyreduce: { (yyval.show_stmt) = new ShowStatement(kShowTables); } -#line 2763 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2750 "bison_parser.cpp" /* yacc.c:1661 */ break; case 31: @@ -2769,7 +2756,7 @@ yyreduce: (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } -#line 2773 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2760 "bison_parser.cpp" /* yacc.c:1661 */ break; case 32: @@ -2781,7 +2768,7 @@ yyreduce: (yyval.create_stmt)->tableName = (yyvsp[-4].table_name).name; (yyval.create_stmt)->filePath = (yyvsp[0].sval); } -#line 2785 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2772 "bison_parser.cpp" /* yacc.c:1661 */ break; case 33: @@ -2793,7 +2780,7 @@ yyreduce: (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); } -#line 2797 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2784 "bison_parser.cpp" /* yacc.c:1661 */ break; case 34: @@ -2806,31 +2793,31 @@ yyreduce: (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } -#line 2810 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2797 "bison_parser.cpp" /* yacc.c:1661 */ break; case 35: #line 433 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = true; } -#line 2816 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2803 "bison_parser.cpp" /* yacc.c:1661 */ break; case 36: #line 434 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = false; } -#line 2822 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2809 "bison_parser.cpp" /* yacc.c:1661 */ break; case 37: #line 438 "bison_parser.y" /* yacc.c:1661 */ { (yyval.column_vec) = new std::vector(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } -#line 2828 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2815 "bison_parser.cpp" /* yacc.c:1661 */ break; case 38: #line 439 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } -#line 2834 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2821 "bison_parser.cpp" /* yacc.c:1661 */ break; case 39: @@ -2838,31 +2825,31 @@ yyreduce: { (yyval.column_t) = new ColumnDefinition((yyvsp[-1].sval), (ColumnDefinition::DataType) (yyvsp[0].uval)); } -#line 2842 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2829 "bison_parser.cpp" /* yacc.c:1661 */ break; case 40: #line 450 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2848 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2835 "bison_parser.cpp" /* yacc.c:1661 */ break; case 41: #line 451 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::INT; } -#line 2854 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2841 "bison_parser.cpp" /* yacc.c:1661 */ break; case 42: #line 452 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::DOUBLE; } -#line 2860 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2847 "bison_parser.cpp" /* yacc.c:1661 */ break; case 43: #line 453 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = ColumnDefinition::TEXT; } -#line 2866 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2853 "bison_parser.cpp" /* yacc.c:1661 */ break; case 44: @@ -2873,7 +2860,7 @@ yyreduce: (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } -#line 2877 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2864 "bison_parser.cpp" /* yacc.c:1661 */ break; case 45: @@ -2884,7 +2871,7 @@ yyreduce: (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } -#line 2888 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2875 "bison_parser.cpp" /* yacc.c:1661 */ break; case 46: @@ -2894,19 +2881,19 @@ yyreduce: (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } -#line 2898 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2885 "bison_parser.cpp" /* yacc.c:1661 */ break; case 47: #line 483 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = true; } -#line 2904 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2891 "bison_parser.cpp" /* yacc.c:1661 */ break; case 48: #line 484 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = false; } -#line 2910 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2897 "bison_parser.cpp" /* yacc.c:1661 */ break; case 49: @@ -2917,7 +2904,7 @@ yyreduce: (yyval.delete_stmt)->tableName = (yyvsp[-1].table_name).name; (yyval.delete_stmt)->expr = (yyvsp[0].expr); } -#line 2921 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2908 "bison_parser.cpp" /* yacc.c:1661 */ break; case 50: @@ -2927,7 +2914,7 @@ yyreduce: (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } -#line 2931 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2918 "bison_parser.cpp" /* yacc.c:1661 */ break; case 51: @@ -2939,7 +2926,7 @@ yyreduce: (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } -#line 2943 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2930 "bison_parser.cpp" /* yacc.c:1661 */ break; case 52: @@ -2951,19 +2938,19 @@ yyreduce: (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } -#line 2955 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2942 "bison_parser.cpp" /* yacc.c:1661 */ break; case 53: #line 533 "bison_parser.y" /* yacc.c:1661 */ { (yyval.str_vec) = (yyvsp[-1].str_vec); } -#line 2961 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2948 "bison_parser.cpp" /* yacc.c:1661 */ break; case 54: #line 534 "bison_parser.y" /* yacc.c:1661 */ { (yyval.str_vec) = nullptr; } -#line 2967 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2954 "bison_parser.cpp" /* yacc.c:1661 */ break; case 55: @@ -2974,19 +2961,19 @@ yyreduce: (yyval.update_stmt)->updates = (yyvsp[-1].update_vec); (yyval.update_stmt)->where = (yyvsp[0].expr); } -#line 2978 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2965 "bison_parser.cpp" /* yacc.c:1661 */ break; case 56: #line 553 "bison_parser.y" /* yacc.c:1661 */ { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } -#line 2984 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2971 "bison_parser.cpp" /* yacc.c:1661 */ break; case 57: #line 554 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } -#line 2990 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2977 "bison_parser.cpp" /* yacc.c:1661 */ break; case 58: @@ -2996,7 +2983,7 @@ yyreduce: (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } -#line 3000 "bison_parser.cpp" /* yacc.c:1661 */ +#line 2987 "bison_parser.cpp" /* yacc.c:1661 */ break; case 61: @@ -3015,19 +3002,19 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3019 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3006 "bison_parser.cpp" /* yacc.c:1661 */ break; case 62: #line 589 "bison_parser.y" /* yacc.c:1661 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 3025 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3012 "bison_parser.cpp" /* yacc.c:1661 */ break; case 63: #line 590 "bison_parser.y" /* yacc.c:1661 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 3031 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3018 "bison_parser.cpp" /* yacc.c:1661 */ break; case 66: @@ -3042,7 +3029,7 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3046 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3033 "bison_parser.cpp" /* yacc.c:1661 */ break; case 67: @@ -3061,7 +3048,7 @@ yyreduce: (yyval.select_stmt)->limit = (yyvsp[0].limit); } } -#line 3065 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3052 "bison_parser.cpp" /* yacc.c:1661 */ break; case 74: @@ -3075,37 +3062,37 @@ yyreduce: (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } -#line 3079 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3066 "bison_parser.cpp" /* yacc.c:1661 */ break; case 75: #line 653 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = true; } -#line 3085 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3072 "bison_parser.cpp" /* yacc.c:1661 */ break; case 76: #line 654 "bison_parser.y" /* yacc.c:1661 */ { (yyval.bval) = false; } -#line 3091 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3078 "bison_parser.cpp" /* yacc.c:1661 */ break; case 78: #line 662 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table) = (yyvsp[0].table); } -#line 3097 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3084 "bison_parser.cpp" /* yacc.c:1661 */ break; case 79: #line 667 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 3103 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3090 "bison_parser.cpp" /* yacc.c:1661 */ break; case 80: #line 668 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = nullptr; } -#line 3109 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3096 "bison_parser.cpp" /* yacc.c:1661 */ break; case 81: @@ -3115,127 +3102,127 @@ yyreduce: (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } -#line 3119 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3106 "bison_parser.cpp" /* yacc.c:1661 */ break; case 82: #line 677 "bison_parser.y" /* yacc.c:1661 */ { (yyval.group_t) = nullptr; } -#line 3125 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3112 "bison_parser.cpp" /* yacc.c:1661 */ break; case 83: #line 681 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 3131 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3118 "bison_parser.cpp" /* yacc.c:1661 */ break; case 84: #line 682 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = nullptr; } -#line 3137 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3124 "bison_parser.cpp" /* yacc.c:1661 */ break; case 85: #line 685 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_vec) = (yyvsp[0].order_vec); } -#line 3143 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3130 "bison_parser.cpp" /* yacc.c:1661 */ break; case 86: #line 686 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_vec) = nullptr; } -#line 3149 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3136 "bison_parser.cpp" /* yacc.c:1661 */ break; case 87: #line 690 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } -#line 3155 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3142 "bison_parser.cpp" /* yacc.c:1661 */ break; case 88: #line 691 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } -#line 3161 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3148 "bison_parser.cpp" /* yacc.c:1661 */ break; case 89: #line 695 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } -#line 3167 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3154 "bison_parser.cpp" /* yacc.c:1661 */ break; case 90: #line 699 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_type) = kOrderAsc; } -#line 3173 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3160 "bison_parser.cpp" /* yacc.c:1661 */ break; case 91: #line 700 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_type) = kOrderDesc; } -#line 3179 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3166 "bison_parser.cpp" /* yacc.c:1661 */ break; case 92: #line 701 "bison_parser.y" /* yacc.c:1661 */ { (yyval.order_type) = kOrderAsc; } -#line 3185 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3172 "bison_parser.cpp" /* yacc.c:1661 */ break; case 93: #line 707 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3191 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3178 "bison_parser.cpp" /* yacc.c:1661 */ break; case 94: #line 708 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = nullptr; } -#line 3197 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3184 "bison_parser.cpp" /* yacc.c:1661 */ break; case 95: #line 712 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } -#line 3203 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3190 "bison_parser.cpp" /* yacc.c:1661 */ break; case 96: #line 713 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } -#line 3209 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3196 "bison_parser.cpp" /* yacc.c:1661 */ break; case 97: #line 714 "bison_parser.y" /* yacc.c:1661 */ { (yyval.limit) = nullptr; } -#line 3215 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3202 "bison_parser.cpp" /* yacc.c:1661 */ break; case 98: #line 721 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3221 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3208 "bison_parser.cpp" /* yacc.c:1661 */ break; case 99: #line 722 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3227 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3214 "bison_parser.cpp" /* yacc.c:1661 */ break; case 100: #line 726 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } -#line 3233 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3220 "bison_parser.cpp" /* yacc.c:1661 */ break; case 101: #line 727 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } -#line 3239 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3226 "bison_parser.cpp" /* yacc.c:1661 */ break; case 102: @@ -3244,307 +3231,307 @@ yyreduce: (yyval.expr) = (yyvsp[-1].expr); (yyval.expr)->alias = (yyvsp[0].sval); } -#line 3248 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3235 "bison_parser.cpp" /* yacc.c:1661 */ break; case 108: #line 746 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = (yyvsp[-1].expr); } -#line 3254 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3241 "bison_parser.cpp" /* yacc.c:1661 */ break; case 116: #line 754 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } -#line 3260 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3247 "bison_parser.cpp" /* yacc.c:1661 */ break; case 119: #line 763 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } -#line 3266 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3253 "bison_parser.cpp" /* yacc.c:1661 */ break; case 120: #line 764 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } -#line 3272 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3259 "bison_parser.cpp" /* yacc.c:1661 */ break; case 121: #line 765 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } -#line 3278 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3265 "bison_parser.cpp" /* yacc.c:1661 */ break; case 122: #line 766 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } -#line 3284 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3271 "bison_parser.cpp" /* yacc.c:1661 */ break; case 123: #line 767 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } -#line 3290 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3277 "bison_parser.cpp" /* yacc.c:1661 */ break; case 125: #line 772 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } -#line 3296 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3283 "bison_parser.cpp" /* yacc.c:1661 */ break; case 126: #line 773 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } -#line 3302 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3289 "bison_parser.cpp" /* yacc.c:1661 */ break; case 127: #line 774 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } -#line 3308 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3295 "bison_parser.cpp" /* yacc.c:1661 */ break; case 128: #line 775 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } -#line 3314 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3301 "bison_parser.cpp" /* yacc.c:1661 */ break; case 129: #line 776 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } -#line 3320 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3307 "bison_parser.cpp" /* yacc.c:1661 */ break; case 130: #line 777 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } -#line 3326 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3313 "bison_parser.cpp" /* yacc.c:1661 */ break; case 131: #line 778 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } -#line 3332 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3319 "bison_parser.cpp" /* yacc.c:1661 */ break; case 132: #line 779 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } -#line 3338 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3325 "bison_parser.cpp" /* yacc.c:1661 */ break; case 133: #line 780 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } -#line 3344 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3331 "bison_parser.cpp" /* yacc.c:1661 */ break; case 134: #line 781 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } -#line 3350 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3337 "bison_parser.cpp" /* yacc.c:1661 */ break; case 135: #line 785 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } -#line 3356 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3343 "bison_parser.cpp" /* yacc.c:1661 */ break; case 136: #line 786 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } -#line 3362 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3349 "bison_parser.cpp" /* yacc.c:1661 */ break; case 137: #line 790 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } -#line 3368 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3355 "bison_parser.cpp" /* yacc.c:1661 */ break; case 138: #line 791 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } -#line 3374 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3361 "bison_parser.cpp" /* yacc.c:1661 */ break; case 139: #line 792 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } -#line 3380 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3367 "bison_parser.cpp" /* yacc.c:1661 */ break; case 140: #line 793 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } -#line 3386 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3373 "bison_parser.cpp" /* yacc.c:1661 */ break; case 141: #line 799 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } -#line 3392 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3379 "bison_parser.cpp" /* yacc.c:1661 */ break; case 142: #line 800 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3398 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3385 "bison_parser.cpp" /* yacc.c:1661 */ break; case 143: #line 801 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } -#line 3404 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3391 "bison_parser.cpp" /* yacc.c:1661 */ break; case 144: #line 802 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3410 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3397 "bison_parser.cpp" /* yacc.c:1661 */ break; case 145: #line 806 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 3416 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3403 "bison_parser.cpp" /* yacc.c:1661 */ break; case 146: #line 807 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } -#line 3422 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3409 "bison_parser.cpp" /* yacc.c:1661 */ break; case 147: #line 811 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } -#line 3428 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3415 "bison_parser.cpp" /* yacc.c:1661 */ break; case 148: #line 812 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } -#line 3434 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3421 "bison_parser.cpp" /* yacc.c:1661 */ break; case 149: #line 816 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } -#line 3440 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3427 "bison_parser.cpp" /* yacc.c:1661 */ break; case 150: #line 817 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } -#line 3446 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3433 "bison_parser.cpp" /* yacc.c:1661 */ break; case 151: #line 818 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } -#line 3452 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3439 "bison_parser.cpp" /* yacc.c:1661 */ break; case 152: #line 819 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } -#line 3458 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3445 "bison_parser.cpp" /* yacc.c:1661 */ break; case 153: #line 820 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } -#line 3464 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3451 "bison_parser.cpp" /* yacc.c:1661 */ break; case 154: #line 821 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } -#line 3470 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3457 "bison_parser.cpp" /* yacc.c:1661 */ break; case 155: #line 825 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector(), false); } -#line 3476 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3463 "bison_parser.cpp" /* yacc.c:1661 */ break; case 156: #line 826 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } -#line 3482 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3469 "bison_parser.cpp" /* yacc.c:1661 */ break; case 157: #line 830 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } -#line 3488 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3475 "bison_parser.cpp" /* yacc.c:1661 */ break; case 158: #line 834 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } -#line 3494 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3481 "bison_parser.cpp" /* yacc.c:1661 */ break; case 159: #line 838 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3500 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3487 "bison_parser.cpp" /* yacc.c:1661 */ break; case 160: #line 842 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } -#line 3506 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3493 "bison_parser.cpp" /* yacc.c:1661 */ break; case 161: #line 843 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } -#line 3512 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3499 "bison_parser.cpp" /* yacc.c:1661 */ break; case 162: #line 844 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeStar(); } -#line 3518 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3505 "bison_parser.cpp" /* yacc.c:1661 */ break; case 163: #line 845 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } -#line 3524 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3511 "bison_parser.cpp" /* yacc.c:1661 */ break; case 168: #line 856 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } -#line 3530 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3517 "bison_parser.cpp" /* yacc.c:1661 */ break; case 169: #line 861 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } -#line 3536 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3523 "bison_parser.cpp" /* yacc.c:1661 */ break; case 171: #line 866 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } -#line 3542 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3529 "bison_parser.cpp" /* yacc.c:1661 */ break; case 172: #line 870 "bison_parser.y" /* yacc.c:1661 */ { (yyval.expr) = Expr::makeNullLiteral(); } -#line 3548 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3535 "bison_parser.cpp" /* yacc.c:1661 */ break; case 173: @@ -3554,18 +3541,18 @@ yyreduce: (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } -#line 3558 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3545 "bison_parser.cpp" /* yacc.c:1661 */ break; case 175: #line 887 "bison_parser.y" /* yacc.c:1661 */ { - (yyvsp[0].table_vec)->push_back((yyvsp[-2].table)); + (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); auto tbl = new TableRef(kTableCrossProduct); - tbl->list = (yyvsp[0].table_vec); + tbl->list = (yyvsp[-2].table_vec); (yyval.table) = tbl; } -#line 3569 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3556 "bison_parser.cpp" /* yacc.c:1661 */ break; case 179: @@ -3576,19 +3563,19 @@ yyreduce: tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3580 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3567 "bison_parser.cpp" /* yacc.c:1661 */ break; case 180: #line 912 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } -#line 3586 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3573 "bison_parser.cpp" /* yacc.c:1661 */ break; case 181: #line 913 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } -#line 3592 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3579 "bison_parser.cpp" /* yacc.c:1661 */ break; case 182: @@ -3600,7 +3587,7 @@ yyreduce: tbl->alias = (yyvsp[0].sval); (yyval.table) = tbl; } -#line 3604 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3591 "bison_parser.cpp" /* yacc.c:1661 */ break; case 183: @@ -3610,31 +3597,31 @@ yyreduce: (yyval.table)->schema = (yyvsp[0].table_name).schema; (yyval.table)->name = (yyvsp[0].table_name).name; } -#line 3614 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3601 "bison_parser.cpp" /* yacc.c:1661 */ break; case 184: #line 938 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval);} -#line 3620 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3607 "bison_parser.cpp" /* yacc.c:1661 */ break; case 185: #line 939 "bison_parser.y" /* yacc.c:1661 */ { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } -#line 3626 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3613 "bison_parser.cpp" /* yacc.c:1661 */ break; case 186: #line 944 "bison_parser.y" /* yacc.c:1661 */ { (yyval.sval) = (yyvsp[0].sval); } -#line 3632 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3619 "bison_parser.cpp" /* yacc.c:1661 */ break; case 189: #line 950 "bison_parser.y" /* yacc.c:1661 */ { (yyval.sval) = nullptr; } -#line 3638 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3625 "bison_parser.cpp" /* yacc.c:1661 */ break; case 190: @@ -3646,7 +3633,7 @@ yyreduce: (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } -#line 3650 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3637 "bison_parser.cpp" /* yacc.c:1661 */ break; case 191: @@ -3659,7 +3646,7 @@ yyreduce: (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } -#line 3663 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3650 "bison_parser.cpp" /* yacc.c:1661 */ break; case 192: @@ -3679,71 +3666,71 @@ yyreduce: (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } -#line 3683 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3670 "bison_parser.cpp" /* yacc.c:1661 */ break; case 193: #line 995 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinInner; } -#line 3689 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3676 "bison_parser.cpp" /* yacc.c:1661 */ break; case 194: #line 996 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinOuter; } -#line 3695 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3682 "bison_parser.cpp" /* yacc.c:1661 */ break; case 195: #line 997 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinLeftOuter; } -#line 3701 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3688 "bison_parser.cpp" /* yacc.c:1661 */ break; case 196: #line 998 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinRightOuter; } -#line 3707 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3694 "bison_parser.cpp" /* yacc.c:1661 */ break; case 197: #line 999 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinLeft; } -#line 3713 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3700 "bison_parser.cpp" /* yacc.c:1661 */ break; case 198: #line 1000 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinRight; } -#line 3719 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3706 "bison_parser.cpp" /* yacc.c:1661 */ break; case 199: #line 1001 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinCross; } -#line 3725 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3712 "bison_parser.cpp" /* yacc.c:1661 */ break; case 200: #line 1002 "bison_parser.y" /* yacc.c:1661 */ { (yyval.uval) = kJoinInner; } -#line 3731 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3718 "bison_parser.cpp" /* yacc.c:1661 */ break; case 204: #line 1022 "bison_parser.y" /* yacc.c:1661 */ { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } -#line 3737 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3724 "bison_parser.cpp" /* yacc.c:1661 */ break; case 205: #line 1023 "bison_parser.y" /* yacc.c:1661 */ { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } -#line 3743 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3730 "bison_parser.cpp" /* yacc.c:1661 */ break; -#line 3747 "bison_parser.cpp" /* yacc.c:1661 */ +#line 3734 "bison_parser.cpp" /* yacc.c:1661 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/src/parser/bison_parser.y b/src/parser/bison_parser.y index 3e07179..0d98897 100755 --- a/src/parser/bison_parser.y +++ b/src/parser/bison_parser.y @@ -793,7 +793,7 @@ in_expr: | operand NOT IN '(' select_no_paren ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); } ; -// CASE grammar based on: flex & bison by John Levine +// CASE grammar based on: flex & bison by John Levine // https://www.safaribooksonline.com/library/view/flex-bison/9780596805418/ch04.html#id352665 case_expr: CASE expr case_list END { $$ = Expr::makeCase($2, $3, nullptr); } @@ -884,10 +884,10 @@ param_expr: ******************************/ table_ref: table_ref_atomic - | table_ref_atomic ',' table_ref_commalist { - $3->push_back($1); + | table_ref_commalist ',' table_ref_atomic { + $1->push_back($3); auto tbl = new TableRef(kTableCrossProduct); - tbl->list = $3; + tbl->list = $1; $$ = tbl; } ; diff --git a/test/select_tests.cpp b/test/select_tests.cpp index 5353201..3197a31 100644 --- a/test/select_tests.cpp +++ b/test/select_tests.cpp @@ -325,3 +325,25 @@ TEST(SelectJoin) { ASSERT_STREQ(inner_join->condition->expr2->table, "City"); ASSERT_STREQ(inner_join->condition->expr2->name, "id"); } + + +TEST(SelectColumnOrder) { + TEST_PARSE_SINGLE_SQL( + "SELECT *\ + FROM a,\ + (SELECT a AS b FROM a) b,\ + (SELECT a AS c FROM a) c,\ + (SELECT a AS d FROM a) d;", + kStmtSelect, + SelectStatement, + result, + stmt); + + ASSERT_EQ(stmt->fromTable->list->size(), 4); + + // Make sure the order of the table list is corrects + ASSERT_STREQ(stmt->fromTable->list->at(0)->name, "a"); + ASSERT_STREQ(stmt->fromTable->list->at(1)->alias, "b"); + ASSERT_STREQ(stmt->fromTable->list->at(2)->alias, "c"); + ASSERT_STREQ(stmt->fromTable->list->at(3)->alias, "d"); +}