GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — vitess-sqlparser/sqlparser/sql.y at develop · blastrain/vitess-sqlparser Expand file tree/ Copy pathsql.yMore file actions 1872 lines (1733 loc) · 34.3 KB / Copy pathsql.yFile metadata and controls1872 lines (1733 loc) · 34.3 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 /* Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ %{ package sqlparser func setParseTree(yylex interface{}, stmt Statement) { yylex.(*Tokenizer).ParseTree = stmt } func setAllowComments(yylex interface{}, allow bool) { yylex.(*Tokenizer).AllowComments = allow } func incNesting(yylex interface{}) bool { yylex.(*Tokenizer).nesting++ if yylex.(*Tokenizer).nesting == 200 { return true } return false } func decNesting(yylex interface{}) { yylex.(*Tokenizer).nesting-- } func forceEOF(yylex interface{}) { yylex.(*Tokenizer).ForceEOF = true } %} %union { empty struct{} statement Statement selStmt SelectStatement ins *Insert byt byte bytes []byte bytes2 [][]byte str string selectExprs SelectExprs selectExpr SelectExpr columns Columns colName *ColName tableExprs TableExprs tableExpr TableExpr tableName TableName tableNames TableNames indexHints *IndexHints expr Expr exprs Exprs boolVal BoolVal colTuple ColTuple values Values valTuple ValTuple subquery *Subquery whens []*When when *When orderBy OrderBy order *Order limit *Limit updateExprs UpdateExprs updateExpr *UpdateExpr colIdent ColIdent colIdents []ColIdent tableIdent TableIdent convertType *ConvertType aliasedTableName *AliasedTableExpr } %token LEX_ERROR %left <bytes> UNION %token <bytes> SELECT INSERT UPDATE DELETE FROM WHERE GROUP HAVING ORDER BY LIMIT OFFSET FOR %token <bytes> ALL DISTINCT AS EXISTS ASC DESC INTO DUPLICATE KEY DEFAULT SET LOCK %token <bytes> VALUES LAST_INSERT_ID %token <bytes> NEXT VALUE SHARE MODE %token <bytes> SQL_NO_CACHE SQL_CACHE %left <bytes> JOIN STRAIGHT_JOIN LEFT RIGHT INNER OUTER CROSS NATURAL USE FORCE %left <bytes> ON %token <empty> '(' ',' ')' %token <bytes> ID HEX STRING INTEGRAL FLOAT HEXNUM VALUE_ARG LIST_ARG COMMENT %token <bytes> NULL TRUE FALSE // Precedence dictated by mysql. But the vitess grammar is simplified. // Some of these operators don't conflict in our situation. Nevertheless, // it's better to have these listed in the correct order. Also, we don't // support all operators yet. %left <bytes> OR %left <bytes> AND %right <bytes> NOT '!' %left <bytes> BETWEEN CASE WHEN THEN ELSE END %left <bytes> '=' '<' '>' LE GE NE NULL_SAFE_EQUAL IS LIKE REGEXP IN %left <bytes> '|' %left <bytes> '&' %left <bytes> SHIFT_LEFT SHIFT_RIGHT %left <bytes> '+' '-' %left <bytes> '*' '/' DIV '%' MOD %left <bytes> '^' %right <bytes> '~' UNARY %left <bytes> COLLATE %right <bytes> BINARY %right <bytes> INTERVAL %nonassoc <bytes> '.' // There is no need to define precedence for the JSON // operators because the syntax is restricted enough that // they don't cause conflicts. %token <empty> JSON_EXTRACT_OP JSON_UNQUOTE_EXTRACT_OP // DDL Tokens %token <bytes> CREATE ALTER DROP RENAME ANALYZE %token <bytes> TABLE INDEX VIEW TO IGNORE IF UNIQUE USING %token <bytes> SHOW DESCRIBE EXPLAIN DATE ESCAPE REPAIR OPTIMIZE TRUNCATE // Supported SHOW tokens %token <bytes> DATABASES TABLES VITESS_KEYSPACES VITESS_SHARDS VSCHEMA_TABLES // Convert Type Tokens %token <bytes> INTEGER CHARACTER // Functions %token <bytes> CURRENT_TIMESTAMP DATABASE CURRENT_DATE %token <bytes> CURRENT_TIME LOCALTIME LOCALTIMESTAMP %token <bytes> UTC_DATE UTC_TIME UTC_TIMESTAMP %token <bytes> REPLACE %token <bytes> CONVERT CAST %token <bytes> GROUP_CONCAT SEPARATOR // Match %token <bytes> MATCH AGAINST BOOLEAN LANGUAGE WITH QUERY EXPANSION // MySQL reserved words that are unused by this grammar will map to this token. %token <bytes> UNUSED %type <statement> command %type <selStmt> select_statement base_select union_lhs union_rhs %type <statement> insert_statement update_statement delete_statement set_statement %type <statement> create_statement alter_statement rename_statement drop_statement %type <statement> analyze_statement show_statement use_statement other_statement %type <bytes2> comment_opt comment_list %type <str> union_op insert_or_replace %type <str> distinct_opt straight_join_opt cache_opt match_option separator_opt %type <expr> like_escape_opt %type <selectExprs> select_expression_list select_expression_list_opt %type <selectExpr> select_expression %type <expr> expression %type <tableExprs> from_opt table_references %type <tableExpr> table_reference table_factor join_table %type <tableNames> table_name_list %type <str> inner_join outer_join natural_join %type <tableName> table_name into_table_name %type <aliasedTableName> aliased_table_name %type <indexHints> index_hint_list %type <colIdents> index_list %type <expr> where_expression_opt %type <expr> condition %type <boolVal> boolean_value %type <str> compare %type <ins> insert_data %type <expr> value value_expression num_val %type <expr> function_call_keyword function_call_nonkeyword function_call_generic function_call_conflict %type <str> is_suffix %type <colTuple> col_tuple %type <exprs> expression_list %type <values> tuple_list %type <valTuple> row_tuple tuple_or_empty %type <expr> tuple_expression %type <subquery> subquery %type <colName> column_name %type <whens> when_expression_list %type <when> when_expression %type <expr> expression_opt else_expression_opt %type <exprs> group_by_opt %type <expr> having_opt %type <orderBy> order_by_opt order_list %type <order> order %type <str> asc_desc_opt %type <limit> limit_opt %type <str> lock_opt %type <columns> ins_column_list %type <updateExprs> on_dup_opt %type <updateExprs> update_list %type <updateExpr> update_expression %type <bytes> for_from %type <str> ignore_opt %type <byt> exists_opt %type <empty> not_exists_opt non_rename_operation to_opt index_opt constraint_opt using_opt %type <bytes> reserved_keyword non_reserved_keyword %type <colIdent> sql_id reserved_sql_id col_alias as_ci_opt %type <tableIdent> table_id reserved_table_id table_alias as_opt_id %type <empty> as_opt %type <empty> force_eof ddl_force_eof %type <str> charset %type <convertType> convert_type %type <str> show_statement_type %start any_command %% any_command: command semicolon_opt { setParseTree(yylex, $1) } semicolon_opt: /*empty*/ {} | ';' {} command: select_statement { $$ = $1 } | insert_statement | update_statement | delete_statement | set_statement | create_statement | alter_statement | rename_statement | drop_statement | analyze_statement | show_statement | use_statement | other_statement select_statement: base_select order_by_opt limit_opt lock_opt { sel := $1.(*Select) sel.OrderBy = $2 sel.Limit = $3 sel.Lock = $4 $$ = sel } | union_lhs union_op union_rhs order_by_opt limit_opt lock_opt { $$ = &Union{Type: $2, Left: $1, Right: $3, OrderBy: $4, Limit: $5, Lock: $6} } | SELECT comment_opt cache_opt NEXT num_val for_from table_name { $$ = &Select{Comments: Comments($2), Cache: $3, SelectExprs: SelectExprs{Nextval{Expr: $5}}, From: TableExprs{&AliasedTableExpr{Expr: $7}}} } // base_select is an unparenthesized SELECT with no order by clause or beyond. base_select: SELECT comment_opt cache_opt distinct_opt straight_join_opt select_expression_list from_opt where_expression_opt group_by_opt having_opt { $$ = &Select{Comments: Comments($2), Cache: $3, Distinct: $4, Hints: $5, SelectExprs: $6, From: $7, Where: NewWhere(WhereStr, $8), GroupBy: GroupBy($9), Having: NewWhere(HavingStr, $10)} } union_lhs: select_statement { $$ = $1 } | openb select_statement closeb { $$ = &ParenSelect{Select: $2} } union_rhs: base_select { $$ = $1 } | openb select_statement closeb { $$ = &ParenSelect{Select: $2} } insert_statement: insert_or_replace comment_opt ignore_opt into_table_name insert_data on_dup_opt { // insert_data returns a *Insert pre-filled with Columns & Values ins := $5 ins.Action = $1 ins.Comments = $2 ins.Ignore = $3 ins.Table = $4 ins.OnDup = OnDup($6) $$ = ins } | insert_or_replace comment_opt ignore_opt into_table_name SET update_list on_dup_opt { cols := make(Columns, 0, len($6)) vals := make(ValTuple, 0, len($7)) for _, updateList := range $6 { cols = append(cols, updateList.Name.Name) vals = append(vals, updateList.Expr) } $$ = &Insert{Action: $1, Comments: Comments($2), Ignore: $3, Table: $4, Columns: cols, Rows: Values{vals}, OnDup: OnDup($7)} } insert_or_replace: INSERT { $$ = InsertStr } | REPLACE { $$ = ReplaceStr } update_statement: UPDATE comment_opt table_references SET update_list where_expression_opt order_by_opt limit_opt { $$ = &Update{Comments: Comments($2), TableExprs: $3, Exprs: $5, Where: NewWhere(WhereStr, $6), OrderBy: $7, Limit: $8} } delete_statement: DELETE comment_opt FROM table_name where_expression_opt order_by_opt limit_opt { $$ = &Delete{Comments: Comments($2), TableExprs: TableExprs{&AliasedTableExpr{Expr:$4}}, Where: NewWhere(WhereStr, $5), OrderBy: $6, Limit: $7} } | DELETE comment_opt table_name_list from_or_using table_references where_expression_opt { $$ = &Delete{Comments: Comments($2), Targets: $3, TableExprs: $5, Where: NewWhere(WhereStr, $6)} } from_or_using: FROM {} | USING {} table_name_list: table_name { $$ = TableNames{$1} } | table_name_list ',' table_name { $$ = append($$, $3) } set_statement: SET comment_opt update_list { $$ = &Set{Comments: Comments($2), Exprs: $3} } create_statement: CREATE TABLE not_exists_opt table_name ddl_force_eof { $$ = &DDL{Action: CreateStr, NewName: $4} } | CREATE constraint_opt INDEX ID using_opt ON table_name ddl_force_eof { // Change this to an alter statement $$ = &DDL{Action: AlterStr, Table: $7, NewName:$7} } | CREATE VIEW table_name ddl_force_eof { $$ = &DDL{Action: CreateStr, NewName: $3.ToViewName()} } | CREATE OR REPLACE VIEW table_name ddl_force_eof { $$ = &DDL{Action: CreateStr, NewName: $5.ToViewName()} } alter_statement: ALTER ignore_opt TABLE table_name non_rename_operation force_eof { $$ = &DDL{Action: AlterStr, Table: $4, NewName: $4} } | ALTER ignore_opt TABLE table_name RENAME to_opt table_name { // Change this to a rename statement $$ = &DDL{Action: RenameStr, Table: $4, NewName: $7} } | ALTER ignore_opt TABLE table_name RENAME index_opt force_eof { // Rename an index can just be an alter $$ = &DDL{Action: AlterStr, Table: $4, NewName: $4} } | ALTER VIEW table_name ddl_force_eof { $$ = &DDL{Action: AlterStr, Table: $3.ToViewName(), NewName: $3.ToViewName()} } rename_statement: RENAME TABLE table_name TO table_name { $$ = &DDL{Action: RenameStr, Table: $3, NewName: $5} } drop_statement: DROP TABLE exists_opt table_name { var exists bool if $3 != 0 { exists = true } $$ = &DDL{Action: DropStr, Table: $4, IfExists: exists} } | DROP INDEX ID ON table_name { // Change this to an alter statement $$ = &DDL{Action: AlterStr, Table: $5, NewName: $5} } | DROP VIEW exists_opt table_name ddl_force_eof { var exists bool if $3 != 0 { exists = true } $$ = &DDL{Action: DropStr, Table: $4.ToViewName(), IfExists: exists} } analyze_statement: ANALYZE TABLE table_name { $$ = &DDL{Action: AlterStr, Table: $3, NewName: $3} } show_statement_type: ID { $$ = ShowUnsupportedStr } | reserved_keyword { switch v := string($1); v { case ShowDatabasesStr, ShowTablesStr, ShowKeyspacesStr, ShowShardsStr, ShowVSchemaTablesStr: $$ = v default: $$ = ShowUnsupportedStr } } | non_reserved_keyword { $$ = ShowUnsupportedStr } show_statement: SHOW show_statement_type force_eof { $$ = &Show{Type: $2} } use_statement: USE table_id { $$ = &Use{DBName: $2} } other_statement: DESC force_eof { $$ = &OtherRead{} } | DESCRIBE force_eof { $$ = &OtherRead{} } | EXPLAIN force_eof { $$ = &OtherRead{} } | REPAIR force_eof { $$ = &OtherAdmin{} } | OPTIMIZE force_eof { $$ = &OtherAdmin{} } | TRUNCATE force_eof { $$ = &OtherAdmin{} } comment_opt: { setAllowComments(yylex, true) } comment_list { $$ = $2 setAllowComments(yylex, false) } comment_list: { $$ = nil } | comment_list COMMENT { $$ = append($1, $2) } union_op: UNION { $$ = UnionStr } | UNION ALL { $$ = UnionAllStr } | UNION DISTINCT { $$ = UnionDistinctStr } cache_opt: { $$ = "" } | SQL_NO_CACHE { $$ = SQLNoCacheStr } | SQL_CACHE { $$ = SQLCacheStr } distinct_opt: { $$ = "" } | DISTINCT { $$ = DistinctStr } straight_join_opt: { $$ = "" } | STRAIGHT_JOIN { $$ = StraightJoinHint } select_expression_list_opt: { $$ = nil } | select_expression_list { $$ = $1 } select_expression_list: select_expression { $$ = SelectExprs{$1} } | select_expression_list ',' select_expression { $$ = append($$, $3) } select_expression: '*' { $$ = &StarExpr{} } | expression as_ci_opt { $$ = &AliasedExpr{Expr: $1, As: $2} } | table_id '.' '*' { $$ = &StarExpr{TableName: TableName{Name: $1}} } | table_id '.' reserved_table_id '.' '*' { $$ = &StarExpr{TableName: TableName{Qualifier: $1, Name: $3}} } as_ci_opt: { $$ = ColIdent{} } | col_alias { $$ = $1 } | AS col_alias { $$ = $2 } col_alias: sql_id | STRING { $$ = NewColIdent(string($1)) } from_opt: { $$ = TableExprs{&AliasedTableExpr{Expr:TableName{Name: NewTableIdent("dual")}}} } | FROM table_references { $$ = $2 } table_references: table_reference { $$ = TableExprs{$1} } | table_references ',' table_reference { $$ = append($$, $3) } table_reference: table_factor | join_table table_factor: aliased_table_name { $$ = $1 } | subquery as_opt table_id { $$ = &AliasedTableExpr{Expr:$1, As: $3} } | openb table_references closeb { $$ = &ParenTableExpr{Exprs: $2} } aliased_table_name: table_name as_opt_id index_hint_list { $$ = &AliasedTableExpr{Expr:$1, As: $2, Hints: $3} } // There is a grammar conflict here: // 1: INSERT INTO a SELECT * FROM b JOIN c ON b.i = c.i // 2: INSERT INTO a SELECT * FROM b JOIN c ON DUPLICATE KEY UPDATE a.i = 1 // When yacc encounters the ON clause, it cannot determine which way to // resolve. The %prec override below makes the parser choose the // first construct, which automatically makes the second construct a // syntax error. This is the same behavior as MySQL. join_table: table_reference inner_join table_factor %prec JOIN { $$ = &JoinTableExpr{LeftExpr: $1, Join: $2, RightExpr: $3} } | table_reference inner_join table_factor ON expression { $$ = &JoinTableExpr{LeftExpr: $1, Join: $2, RightExpr: $3, On: $5} } | table_reference outer_join table_reference ON expression { $$ = &JoinTableExpr{LeftExpr: $1, Join: $2, RightExpr: $3, On: $5} } | table_reference natural_join table_factor { $$ = &JoinTableExpr{LeftExpr: $1, Join: $2, RightExpr: $3} } as_opt: { $$ = struct{}{} } | AS { $$ = struct{}{} } as_opt_id: { $$ = NewTableIdent("") } | table_alias { $$ = $1 } | AS table_alias { $$ = $2 } table_alias: table_id | STRING { $$ = NewTableIdent(string($1)) } inner_join: JOIN { $$ = JoinStr } | INNER JOIN { $$ = JoinStr } | CROSS JOIN { $$ = JoinStr } | STRAIGHT_JOIN { $$ = StraightJoinStr } outer_join: LEFT JOIN { $$ = LeftJoinStr } | LEFT OUTER JOIN { $$ = LeftJoinStr } | RIGHT JOIN { $$ = RightJoinStr } | RIGHT OUTER JOIN { $$ = RightJoinStr } natural_join: NATURAL JOIN { $$ = NaturalJoinStr } | NATURAL outer_join { if $2 == LeftJoinStr { $$ = NaturalLeftJoinStr } else { $$ = NaturalRightJoinStr } } into_table_name: INTO table_name { $$ = $2 } | table_name { $$ = $1 } table_name: table_id { $$ = TableName{Name: $1} } | table_id '.' reserved_table_id { $$ = TableName{Qualifier: $1, Name: $3} } index_hint_list: { $$ = nil } | USE INDEX openb index_list closeb { $$ = &IndexHints{Type: UseStr, Indexes: $4} } | IGNORE INDEX openb index_list closeb { $$ = &IndexHints{Type: IgnoreStr, Indexes: $4} } | FORCE INDEX openb index_list closeb { $$ = &IndexHints{Type: ForceStr, Indexes: $4} } index_list: sql_id { $$ = []ColIdent{$1} } | index_list ',' sql_id { $$ = append($1, $3) } where_expression_opt: { $$ = nil } | WHERE expression { $$ = $2 } expression: condition { $$ = $1 } | expression AND expression { $$ = &AndExpr{Left: $1, Right: $3} } | expression OR expression { $$ = &OrExpr{Left: $1, Right: $3} } | NOT expression { $$ = &NotExpr{Expr: $2} } | expression IS is_suffix { $$ = &IsExpr{Operator: $3, Expr: $1} } | value_expression { $$ = $1 } | DEFAULT { $$ = &Default{} } boolean_value: TRUE { $$ = BoolVal(true) } | FALSE { $$ = BoolVal(false) } condition: value_expression compare value_expression { $$ = &ComparisonExpr{Left: $1, Operator: $2, Right: $3} } | value_expression IN col_tuple { $$ = &ComparisonExpr{Left: $1, Operator: InStr, Right: $3} } | value_expression NOT IN col_tuple { $$ = &ComparisonExpr{Left: $1, Operator: NotInStr, Right: $4} } | value_expression LIKE value_expression like_escape_opt { $$ = &ComparisonExpr{Left: $1, Operator: LikeStr, Right: $3, Escape: $4} } | value_expression NOT LIKE value_expression like_escape_opt { $$ = &ComparisonExpr{Left: $1, Operator: NotLikeStr, Right: $4, Escape: $5} } | value_expression REGEXP value_expression { $$ = &ComparisonExpr{Left: $1, Operator: RegexpStr, Right: $3} } | value_expression NOT REGEXP value_expression { $$ = &ComparisonExpr{Left: $1, Operator: NotRegexpStr, Right: $4} } | value_expression BETWEEN value_expression AND value_expression { $$ = &RangeCond{Left: $1, Operator: BetweenStr, From: $3, To: $5} } | value_expression NOT BETWEEN value_expression AND value_expression { $$ = &RangeCond{Left: $1, Operator: NotBetweenStr, From: $4, To: $6} } | EXISTS subquery { $$ = &ExistsExpr{Subquery: $2} } is_suffix: NULL { $$ = IsNullStr } | NOT NULL { $$ = IsNotNullStr } | TRUE { $$ = IsTrueStr } | NOT TRUE { $$ = IsNotTrueStr } | FALSE { $$ = IsFalseStr } | NOT FALSE { $$ = IsNotFalseStr } compare: '=' { $$ = EqualStr } | '<' { $$ = LessThanStr } | '>' { $$ = GreaterThanStr } | LE { $$ = LessEqualStr } | GE { $$ = GreaterEqualStr } | NE { $$ = NotEqualStr } | NULL_SAFE_EQUAL { $$ = NullSafeEqualStr } like_escape_opt: { $$ = nil } | ESCAPE value_expression { $$ = $2 } col_tuple: row_tuple { $$ = $1 } | subquery { $$ = $1 } | LIST_ARG { $$ = ListArg($1) } subquery: openb select_statement closeb { $$ = &Subquery{$2} } expression_list: expression { $$ = Exprs{$1} } | expression_list ',' expression { $$ = append($1, $3) } charset: ID { $$ = string($1) } | STRING { $$ = string($1) } | BINARY { $$ = string($1) } | DATE { $$ = string($1) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |