1 /* 2 * Copyright 2015-2018 HuntLabs.cn 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 module hunt.sql.dialect.mysql.visitor.MySqlSchemaStatVisitor; 17 18 import hunt.sql.ast.SQLExpr; 19 import hunt.sql.ast.SQLName; 20 import hunt.sql.ast.SQLObject; 21 import hunt.sql.ast.statement; 22 import hunt.sql.dialect.mysql.ast.MySqlForceIndexHint; 23 import hunt.sql.dialect.mysql.ast.MySqlIgnoreIndexHint; 24 import hunt.sql.dialect.mysql.ast.MySqlKey; 25 import hunt.sql.dialect.mysql.ast.MySqlPrimaryKey; 26 import hunt.sql.dialect.mysql.ast.MySqlUnique; 27 import hunt.sql.dialect.mysql.ast.MySqlUseIndexHint; 28 import hunt.sql.dialect.mysql.ast.MysqlForeignKey; 29 import hunt.sql.dialect.mysql.ast.clause.MySqlCaseStatement; 30 // import hunt.sql.dialect.mysql.ast.clause.MySqlCaseStatement.MySqlWhenStatement; 31 import hunt.sql.dialect.mysql.ast.clause.MySqlCursorDeclareStatement; 32 import hunt.sql.dialect.mysql.ast.clause.MySqlDeclareConditionStatement; 33 import hunt.sql.dialect.mysql.ast.clause.MySqlDeclareHandlerStatement; 34 import hunt.sql.dialect.mysql.ast.clause.MySqlDeclareStatement; 35 import hunt.sql.dialect.mysql.ast.clause.MySqlIterateStatement; 36 import hunt.sql.dialect.mysql.ast.clause.MySqlLeaveStatement; 37 import hunt.sql.dialect.mysql.ast.clause.MySqlRepeatStatement; 38 import hunt.sql.dialect.mysql.ast.clause.MySqlSelectIntoStatement; 39 import hunt.sql.dialect.mysql.ast.expr.MySqlCharExpr; 40 import hunt.sql.dialect.mysql.ast.expr.MySqlExtractExpr; 41 import hunt.sql.dialect.mysql.ast.expr.MySqlMatchAgainstExpr; 42 import hunt.sql.dialect.mysql.ast.expr.MySqlOrderingExpr; 43 import hunt.sql.dialect.mysql.ast.expr.MySqlOutFileExpr; 44 import hunt.sql.dialect.mysql.ast.expr.MySqlUserName; 45 import hunt.sql.dialect.mysql.ast.statement; 46 import hunt.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement; 47 import hunt.sql.ast.SQLObjectImpl; 48 import hunt.sql.ast.SQLStatement; 49 // import hunt.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement.TableSpaceOption; 50 // import hunt.sql.dialect.mysql.ast.statement.MySqlCreateUserStatement.UserSpecification; 51 import hunt.sql.visitor.SchemaStatVisitor; 52 import hunt.sql.stat.TableStat; 53 // import hunt.sql.stat.TableStat.Mode; 54 import hunt.sql.util.DBType; 55 import hunt.sql.dialect.mysql.ast.clause.MySqlCaseStatement; 56 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor; 57 import hunt.collection; 58 59 public class MySqlSchemaStatVisitor : SchemaStatVisitor , MySqlASTVisitor { 60 61 alias visit = SchemaStatVisitor.visit; 62 alias endVisit = SchemaStatVisitor.endVisit; 63 64 public this() { 65 super (DBType.MYSQL.name); 66 } 67 68 override public bool visit(SQLSelectStatement x) { 69 if (repository !is null 70 && x.getParent() is null) { 71 repository.resolve(x); 72 } 73 74 return true; 75 } 76 77 override 78 public string getDbType() { 79 return DBType.MYSQL.name; 80 } 81 82 // DUAL 83 public bool visit(MySqlDeleteStatement x) { 84 if (repository !is null 85 && x.getParent() is null) { 86 repository.resolve(x); 87 } 88 89 SQLTableSource from = x.getFrom(); 90 if (from !is null) { 91 from.accept(this); 92 } 93 94 SQLTableSource using = x.getUsing(); 95 if (using !is null) { 96 using.accept(this); 97 } 98 99 SQLTableSource tableSource = x.getTableSource(); 100 tableSource.accept(this); 101 102 if (cast(SQLExprTableSource)(tableSource) !is null) { 103 TableStat stat = this.getTableStat(cast(SQLExprTableSource) tableSource); 104 stat.incrementDeleteCount(); 105 } 106 107 accept(x.getWhere()); 108 109 accept(x.getOrderBy()); 110 accept(x.getLimit()); 111 112 return false; 113 } 114 115 public void endVisit(MySqlDeleteStatement x) { 116 } 117 118 override 119 public void endVisit(MySqlInsertStatement x) { 120 setModeOrigin(x); 121 } 122 123 override 124 public bool visit(MySqlInsertStatement x) { 125 if (repository !is null 126 && x.getParent() is null) { 127 repository.resolve(x); 128 } 129 130 setMode(x, TableStat.Mode.Insert); 131 132 TableStat stat = getTableStat(x.getTableSource()); 133 134 if (stat !is null) { 135 stat.incrementInsertCount(); 136 } 137 138 accept!(SQLExpr)((x.getColumns())); 139 accept!(ValuesClause)((x.getValuesList())); 140 accept(x.getQuery()); 141 accept!(SQLExpr)((x.getDuplicateKeyUpdate())); 142 143 return false; 144 } 145 146 override 147 public bool visit(MySqlTableIndex x) { 148 149 return false; 150 } 151 152 override 153 public void endVisit(MySqlTableIndex x) { 154 155 } 156 157 override 158 public bool visit(MySqlKey x) { 159 foreach(SQLSelectOrderByItem item ; x.getColumns()) { 160 item.accept(this); 161 } 162 return false; 163 } 164 165 override 166 public void endVisit(MySqlKey x) { 167 168 } 169 170 override 171 public bool visit(MySqlPrimaryKey x) { 172 foreach(SQLSelectOrderByItem item ; x.getColumns()) { 173 SQLExpr expr = item.getExpr(); 174 expr.accept(this); 175 } 176 return false; 177 } 178 179 override 180 public void endVisit(MySqlPrimaryKey x) { 181 182 } 183 184 override 185 public void endVisit(MySqlExtractExpr x) { 186 187 } 188 189 override 190 public bool visit(MySqlExtractExpr x) { 191 192 return true; 193 } 194 195 override 196 public void endVisit(MySqlMatchAgainstExpr x) { 197 198 } 199 200 override 201 public bool visit(MySqlMatchAgainstExpr x) { 202 203 return true; 204 } 205 206 override 207 public void endVisit(MySqlPrepareStatement x) { 208 209 } 210 211 override 212 public bool visit(MySqlPrepareStatement x) { 213 214 return true; 215 } 216 217 override 218 public void endVisit(MySqlExecuteStatement x) { 219 220 } 221 222 override 223 public bool visit(MySqlExecuteStatement x) { 224 225 return true; 226 } 227 228 override 229 public void endVisit(MysqlDeallocatePrepareStatement x) { 230 231 } 232 233 override 234 public bool visit(MysqlDeallocatePrepareStatement x) { 235 return true; 236 } 237 238 override 239 public void endVisit(MySqlLoadDataInFileStatement x) { 240 241 } 242 243 override 244 public bool visit(MySqlLoadDataInFileStatement x) { 245 246 return true; 247 } 248 249 override 250 public void endVisit(MySqlLoadXmlStatement x) { 251 252 } 253 254 override 255 public bool visit(MySqlLoadXmlStatement x) { 256 257 return true; 258 } 259 260 override 261 public void endVisit(SQLStartTransactionStatement x) { 262 263 } 264 265 override 266 public bool visit(SQLStartTransactionStatement x) { 267 268 return true; 269 } 270 271 override 272 public void endVisit(MySqlShowColumnsStatement x) { 273 274 } 275 276 override 277 public bool visit(MySqlShowColumnsStatement x) { 278 return false; 279 } 280 281 override 282 public void endVisit(MySqlShowDatabasesStatement x) { 283 284 } 285 286 override 287 public bool visit(MySqlShowDatabasesStatement x) { 288 return false; 289 } 290 291 override 292 public void endVisit(MySqlShowWarningsStatement x) { 293 294 } 295 296 override 297 public bool visit(MySqlShowWarningsStatement x) { 298 return true; 299 } 300 301 override 302 public void endVisit(MySqlShowStatusStatement x) { 303 304 } 305 306 override 307 public bool visit(MySqlShowStatusStatement x) { 308 return true; 309 } 310 311 override 312 public void endVisit(CobarShowStatus x) { 313 314 } 315 316 override 317 public bool visit(CobarShowStatus x) { 318 return true; 319 } 320 321 override 322 public void endVisit(MySqlKillStatement x) { 323 324 } 325 326 override 327 public bool visit(MySqlKillStatement x) { 328 return false; 329 } 330 331 override 332 public void endVisit(MySqlBinlogStatement x) { 333 334 } 335 336 override 337 public bool visit(MySqlBinlogStatement x) { 338 return true; 339 } 340 341 override 342 public void endVisit(MySqlResetStatement x) { 343 344 } 345 346 override 347 public bool visit(MySqlResetStatement x) { 348 return true; 349 } 350 351 override 352 public void endVisit(MySqlCreateUserStatement x) { 353 354 } 355 356 override 357 public bool visit(MySqlCreateUserStatement x) { 358 return false; 359 } 360 361 override 362 public void endVisit(MySqlCreateUserStatement.UserSpecification x) { 363 364 } 365 366 override 367 public bool visit(MySqlCreateUserStatement.UserSpecification x) { 368 return true; 369 } 370 371 override 372 public void endVisit(MySqlPartitionByKey x) { 373 374 } 375 376 override 377 public bool visit(MySqlPartitionByKey x) { 378 accept!SQLExpr((x.getColumns())); 379 return false; 380 } 381 382 override 383 public bool visit(MySqlSelectQueryBlock x) { 384 return this.visit(cast(SQLSelectQueryBlock) x); 385 } 386 387 override 388 public void endVisit(MySqlSelectQueryBlock x) { 389 super.endVisit(cast(SQLSelectQueryBlock) x); 390 } 391 392 override 393 public bool visit(MySqlOutFileExpr x) { 394 return false; 395 } 396 397 override 398 public void endVisit(MySqlOutFileExpr x) { 399 400 } 401 402 override 403 public bool visit(MySqlExplainStatement x) { 404 if (repository !is null 405 && x.getParent() is null) { 406 repository.resolve(x); 407 } 408 409 SQLName tableName = x.getTableName(); 410 if (tableName !is null) { 411 string table = (cast(Object)(tableName)).toString(); 412 getTableStat(tableName); 413 414 SQLName columnName = x.getColumnName(); 415 if (columnName !is null) { 416 addColumn(table, columnName.getSimpleName()); 417 } 418 } 419 420 if (x.getStatement() !is null) { 421 accept(x.getStatement()); 422 } 423 424 return false; 425 } 426 427 override 428 public void endVisit(MySqlExplainStatement x) { 429 430 } 431 432 override 433 public bool visit(MySqlUpdateStatement x) { 434 visit(cast(SQLUpdateStatement) x); 435 foreach(SQLExpr item ; x.getReturning()) { 436 item.accept(this); 437 } 438 439 return false; 440 } 441 442 override 443 public void endVisit(MySqlUpdateStatement x) { 444 445 } 446 447 override 448 public bool visit(MySqlSetTransactionStatement x) { 449 return false; 450 } 451 452 override 453 public void endVisit(MySqlSetTransactionStatement x) { 454 455 } 456 457 override 458 public bool visit(MySqlShowAuthorsStatement x) { 459 return false; 460 } 461 462 override 463 public void endVisit(MySqlShowAuthorsStatement x) { 464 465 } 466 467 override 468 public bool visit(MySqlShowBinaryLogsStatement x) { 469 return false; 470 } 471 472 override 473 public void endVisit(MySqlShowBinaryLogsStatement x) { 474 475 } 476 477 override 478 public bool visit(MySqlShowMasterLogsStatement x) { 479 return false; 480 } 481 482 override 483 public void endVisit(MySqlShowMasterLogsStatement x) { 484 485 } 486 487 override 488 public bool visit(MySqlShowCollationStatement x) { 489 return false; 490 } 491 492 override 493 public void endVisit(MySqlShowCollationStatement x) { 494 495 } 496 497 override 498 public bool visit(MySqlShowBinLogEventsStatement x) { 499 return false; 500 } 501 502 override 503 public void endVisit(MySqlShowBinLogEventsStatement x) { 504 505 } 506 507 override 508 public bool visit(MySqlShowCharacterSetStatement x) { 509 return false; 510 } 511 512 override 513 public void endVisit(MySqlShowCharacterSetStatement x) { 514 515 } 516 517 override 518 public bool visit(MySqlShowContributorsStatement x) { 519 return false; 520 } 521 522 override 523 public void endVisit(MySqlShowContributorsStatement x) { 524 525 } 526 527 override 528 public bool visit(MySqlShowCreateDatabaseStatement x) { 529 return false; 530 } 531 532 override 533 public void endVisit(MySqlShowCreateDatabaseStatement x) { 534 535 } 536 537 override 538 public bool visit(MySqlShowCreateEventStatement x) { 539 return false; 540 } 541 542 override 543 public void endVisit(MySqlShowCreateEventStatement x) { 544 545 } 546 547 override 548 public bool visit(MySqlShowCreateFunctionStatement x) { 549 return false; 550 } 551 552 override 553 public void endVisit(MySqlShowCreateFunctionStatement x) { 554 555 } 556 557 override 558 public bool visit(MySqlShowCreateProcedureStatement x) { 559 return false; 560 } 561 562 override 563 public void endVisit(MySqlShowCreateProcedureStatement x) { 564 565 } 566 567 override 568 public bool visit(MySqlShowCreateTableStatement x) { 569 return false; 570 } 571 572 override 573 public void endVisit(MySqlShowCreateTableStatement x) { 574 575 } 576 577 override 578 public bool visit(MySqlShowCreateTriggerStatement x) { 579 return false; 580 } 581 582 override 583 public void endVisit(MySqlShowCreateTriggerStatement x) { 584 585 } 586 587 override 588 public bool visit(MySqlShowCreateViewStatement x) { 589 return false; 590 } 591 592 override 593 public void endVisit(MySqlShowCreateViewStatement x) { 594 595 } 596 597 override 598 public bool visit(MySqlShowEngineStatement x) { 599 return false; 600 } 601 602 override 603 public void endVisit(MySqlShowEngineStatement x) { 604 605 } 606 607 override 608 public bool visit(MySqlShowEnginesStatement x) { 609 return false; 610 } 611 612 override 613 public void endVisit(MySqlShowEnginesStatement x) { 614 615 } 616 617 override 618 public bool visit(MySqlShowErrorsStatement x) { 619 return false; 620 } 621 622 override 623 public void endVisit(MySqlShowErrorsStatement x) { 624 625 } 626 627 override 628 public bool visit(MySqlShowEventsStatement x) { 629 return false; 630 } 631 632 override 633 public void endVisit(MySqlShowEventsStatement x) { 634 635 } 636 637 override 638 public bool visit(MySqlShowFunctionCodeStatement x) { 639 return false; 640 } 641 642 override 643 public void endVisit(MySqlShowFunctionCodeStatement x) { 644 645 } 646 647 override 648 public bool visit(MySqlShowFunctionStatusStatement x) { 649 return false; 650 } 651 652 override 653 public void endVisit(MySqlShowFunctionStatusStatement x) { 654 655 } 656 657 override 658 public bool visit(MySqlShowGrantsStatement x) { 659 return false; 660 } 661 662 override 663 public void endVisit(MySqlShowGrantsStatement x) { 664 665 } 666 667 override 668 public bool visit(MySqlUserName x) { 669 return false; 670 } 671 672 override 673 public void endVisit(MySqlUserName x) { 674 675 } 676 677 override 678 public bool visit(MySqlShowIndexesStatement x) { 679 return false; 680 } 681 682 override 683 public void endVisit(MySqlShowIndexesStatement x) { 684 685 } 686 687 override 688 public bool visit(MySqlShowKeysStatement x) { 689 return false; 690 } 691 692 override 693 public void endVisit(MySqlShowKeysStatement x) { 694 695 } 696 697 override 698 public bool visit(MySqlShowMasterStatusStatement x) { 699 return false; 700 } 701 702 override 703 public void endVisit(MySqlShowMasterStatusStatement x) { 704 705 } 706 707 override 708 public bool visit(MySqlShowOpenTablesStatement x) { 709 return false; 710 } 711 712 override 713 public void endVisit(MySqlShowOpenTablesStatement x) { 714 715 } 716 717 override 718 public bool visit(MySqlShowPluginsStatement x) { 719 return false; 720 } 721 722 override 723 public void endVisit(MySqlShowPluginsStatement x) { 724 725 } 726 727 override 728 public bool visit(MySqlShowPrivilegesStatement x) { 729 return false; 730 } 731 732 override 733 public void endVisit(MySqlShowPrivilegesStatement x) { 734 735 } 736 737 override 738 public bool visit(MySqlShowProcedureCodeStatement x) { 739 return false; 740 } 741 742 override 743 public void endVisit(MySqlShowProcedureCodeStatement x) { 744 745 } 746 747 override 748 public bool visit(MySqlShowProcedureStatusStatement x) { 749 return false; 750 } 751 752 override 753 public void endVisit(MySqlShowProcedureStatusStatement x) { 754 755 } 756 757 override 758 public bool visit(MySqlShowProcessListStatement x) { 759 return false; 760 } 761 762 override 763 public void endVisit(MySqlShowProcessListStatement x) { 764 765 } 766 767 override 768 public bool visit(MySqlShowProfileStatement x) { 769 return false; 770 } 771 772 override 773 public void endVisit(MySqlShowProfileStatement x) { 774 775 } 776 777 override 778 public bool visit(MySqlShowProfilesStatement x) { 779 return false; 780 } 781 782 override 783 public void endVisit(MySqlShowProfilesStatement x) { 784 785 } 786 787 override 788 public bool visit(MySqlShowRelayLogEventsStatement x) { 789 return false; 790 } 791 792 override 793 public void endVisit(MySqlShowRelayLogEventsStatement x) { 794 795 } 796 797 override 798 public bool visit(MySqlShowSlaveHostsStatement x) { 799 return false; 800 } 801 802 override 803 public void endVisit(MySqlShowSlaveHostsStatement x) { 804 805 } 806 807 override 808 public bool visit(MySqlShowSlaveStatusStatement x) { 809 return false; 810 } 811 812 override 813 public void endVisit(MySqlShowSlaveStatusStatement x) { 814 815 } 816 817 override 818 public bool visit(MySqlShowTableStatusStatement x) { 819 return false; 820 } 821 822 override 823 public void endVisit(MySqlShowTableStatusStatement x) { 824 825 } 826 827 override 828 public bool visit(MySqlShowTriggersStatement x) { 829 return false; 830 } 831 832 override 833 public void endVisit(MySqlShowTriggersStatement x) { 834 835 } 836 837 override 838 public bool visit(MySqlShowVariantsStatement x) { 839 return false; 840 } 841 842 override 843 public void endVisit(MySqlShowVariantsStatement x) { 844 845 } 846 847 override 848 public bool visit(MySqlRenameTableStatement.Item x) { 849 return false; 850 } 851 852 override 853 public void endVisit(MySqlRenameTableStatement.Item x) { 854 855 } 856 857 override 858 public bool visit(MySqlRenameTableStatement x) { 859 return false; 860 } 861 862 override 863 public void endVisit(MySqlRenameTableStatement x) { 864 865 } 866 867 override 868 public bool visit(MySqlUseIndexHint x) { 869 return false; 870 } 871 872 override 873 public void endVisit(MySqlUseIndexHint x) { 874 875 } 876 877 override 878 public bool visit(MySqlIgnoreIndexHint x) { 879 return false; 880 } 881 882 override 883 public void endVisit(MySqlIgnoreIndexHint x) { 884 885 } 886 887 override 888 public bool visit(MySqlLockTableStatement x) { 889 return false; 890 } 891 892 override 893 public void endVisit(MySqlLockTableStatement x) { 894 895 } 896 897 override 898 public bool visit(MySqlLockTableStatement.Item x) { 899 return false; 900 } 901 902 override 903 public void endVisit(MySqlLockTableStatement.Item x) { 904 905 } 906 907 override 908 public bool visit(MySqlUnlockTablesStatement x) { 909 return false; 910 } 911 912 override 913 public void endVisit(MySqlUnlockTablesStatement x) { 914 915 } 916 917 override 918 public bool visit(MySqlForceIndexHint x) { 919 return false; 920 } 921 922 override 923 public void endVisit(MySqlForceIndexHint x) { 924 925 } 926 927 override 928 public bool visit(MySqlAlterTableChangeColumn x) { 929 SQLAlterTableStatement stmt = cast(SQLAlterTableStatement) x.getParent(); 930 931 SQLName table = stmt.getName(); 932 string tableName = (cast(Object)(table)).toString(); 933 934 SQLName column = x.getColumnName(); 935 string columnName = (cast(Object)(column)).toString(); 936 addColumn(tableName, columnName); 937 return false; 938 } 939 940 override 941 public void endVisit(MySqlAlterTableChangeColumn x) { 942 943 } 944 945 override 946 public bool visit(MySqlAlterTableModifyColumn x) { 947 SQLAlterTableStatement stmt = cast(SQLAlterTableStatement) x.getParent(); 948 949 SQLName table = stmt.getName(); 950 string tableName = (cast(Object)(table)).toString(); 951 952 SQLName column = x.getNewColumnDefinition().getName(); 953 string columnName = (cast(Object)(column)).toString(); 954 addColumn(tableName, columnName); 955 956 return false; 957 } 958 959 override 960 public void endVisit(MySqlAlterTableModifyColumn x) { 961 962 } 963 964 override 965 public bool visit(SQLAlterCharacter x) { 966 return false; 967 } 968 969 override 970 public void endVisit(SQLAlterCharacter x) { 971 972 } 973 974 override 975 public bool visit(MySqlAlterTableOption x) { 976 return false; 977 } 978 979 override 980 public void endVisit(MySqlAlterTableOption x) { 981 982 } 983 984 override 985 public bool visit(MySqlCreateTableStatement x) { 986 if (repository !is null 987 && x.getParent() is null) { 988 repository.resolve(x); 989 } 990 991 bool val = super.visit(cast(SQLCreateTableStatement) x); 992 993 foreach(SQLObject option ; x.getTableOptions().values()) { 994 if (cast(SQLTableSource)(option) !is null) { 995 option.accept(this); 996 } 997 } 998 999 return val; 1000 } 1001 1002 override 1003 public void endVisit(MySqlCreateTableStatement x) { 1004 1005 } 1006 1007 override 1008 public bool visit(MySqlHelpStatement x) { 1009 return false; 1010 } 1011 1012 override 1013 public void endVisit(MySqlHelpStatement x) { 1014 1015 } 1016 1017 override 1018 public bool visit(MySqlCharExpr x) { 1019 return false; 1020 } 1021 1022 override 1023 public void endVisit(MySqlCharExpr x) { 1024 1025 } 1026 1027 override 1028 public bool visit(MySqlUnique x) { 1029 return false; 1030 } 1031 1032 override 1033 public void endVisit(MySqlUnique x) { 1034 1035 } 1036 1037 override 1038 public bool visit(MysqlForeignKey x) { 1039 return super.visit(cast(SQLForeignKeyImpl) x); 1040 } 1041 1042 override 1043 public void endVisit(MysqlForeignKey x) { 1044 1045 } 1046 1047 override 1048 public bool visit(MySqlAlterTableDiscardTablespace x) { 1049 return false; 1050 } 1051 1052 override 1053 public void endVisit(MySqlAlterTableDiscardTablespace x) { 1054 1055 } 1056 1057 override 1058 public bool visit(MySqlAlterTableImportTablespace x) { 1059 return false; 1060 } 1061 1062 override 1063 public void endVisit(MySqlAlterTableImportTablespace x) { 1064 1065 } 1066 1067 override 1068 public bool visit(MySqlCreateTableStatement.TableSpaceOption x) { 1069 return false; 1070 } 1071 1072 override 1073 public void endVisit(MySqlCreateTableStatement.TableSpaceOption x) { 1074 } 1075 1076 override 1077 public bool visit(MySqlAnalyzeStatement x) { 1078 return true; 1079 } 1080 1081 override 1082 public void endVisit(MySqlAnalyzeStatement x) { 1083 1084 } 1085 1086 override 1087 public bool visit(MySqlAlterUserStatement x) { 1088 return true; 1089 } 1090 1091 override 1092 public void endVisit(MySqlAlterUserStatement x) { 1093 1094 } 1095 1096 override 1097 public bool visit(MySqlOptimizeStatement x) { 1098 return true; 1099 } 1100 1101 override 1102 public void endVisit(MySqlOptimizeStatement x) { 1103 1104 } 1105 1106 override 1107 public bool visit(MySqlHintStatement x) { 1108 return true; 1109 } 1110 1111 override 1112 public void endVisit(MySqlHintStatement x) { 1113 1114 } 1115 1116 override 1117 public bool visit(MySqlOrderingExpr x) { 1118 return true; 1119 } 1120 1121 override 1122 public void endVisit(MySqlOrderingExpr x) { 1123 1124 } 1125 1126 override 1127 public bool visit(MySqlAlterTableAlterColumn x) { 1128 return false; 1129 } 1130 1131 override 1132 public void endVisit(MySqlAlterTableAlterColumn x) { 1133 1134 } 1135 1136 override 1137 public bool visit(MySqlCaseStatement x) { 1138 accept!(MySqlCaseStatement.MySqlWhenStatement)((x.getWhenList())); 1139 return false; 1140 } 1141 1142 override 1143 public void endVisit(MySqlCaseStatement x) { 1144 1145 } 1146 1147 override 1148 public bool visit(MySqlDeclareStatement x) { 1149 return true; 1150 } 1151 1152 override 1153 public void endVisit(MySqlDeclareStatement x) { 1154 1155 } 1156 1157 override 1158 public bool visit(MySqlSelectIntoStatement x) { 1159 return false; 1160 } 1161 1162 override 1163 public void endVisit(MySqlSelectIntoStatement x) { 1164 1165 } 1166 1167 override 1168 public bool visit(MySqlCaseStatement.MySqlWhenStatement x) { 1169 accept!SQLStatement((x.getStatements())); 1170 return false; 1171 } 1172 1173 override 1174 public void endVisit(MySqlCaseStatement.MySqlWhenStatement x) { 1175 1176 } 1177 1178 override 1179 public bool visit(MySqlLeaveStatement x) { 1180 return false; 1181 } 1182 1183 override 1184 public void endVisit(MySqlLeaveStatement x) { 1185 1186 } 1187 1188 override 1189 public bool visit(MySqlIterateStatement x) { 1190 return false; 1191 } 1192 1193 override 1194 public void endVisit(MySqlIterateStatement x) { 1195 1196 } 1197 1198 override 1199 public bool visit(MySqlRepeatStatement x) { 1200 accept!SQLStatement((x.getStatements())); 1201 return false; 1202 } 1203 1204 override 1205 public void endVisit(MySqlRepeatStatement x) { 1206 1207 } 1208 1209 override 1210 public bool visit(MySqlCursorDeclareStatement x) { 1211 accept(x.getSelect()); 1212 return false; 1213 } 1214 1215 override 1216 public void endVisit(MySqlCursorDeclareStatement x) { 1217 1218 } 1219 1220 override 1221 public bool visit(MySqlUpdateTableSource x) { 1222 if (x.getUpdate() !is null) { 1223 return this.visit(x.getUpdate()); 1224 } 1225 return false; 1226 } 1227 1228 override 1229 public void endVisit(MySqlUpdateTableSource x) { 1230 1231 } 1232 1233 override 1234 public bool visit(MySqlSubPartitionByKey x) { 1235 return false; 1236 } 1237 1238 override 1239 public void endVisit(MySqlSubPartitionByKey x) { 1240 1241 } 1242 1243 override 1244 public bool visit(MySqlSubPartitionByList x) { 1245 return false; 1246 } 1247 1248 override 1249 public void endVisit(MySqlSubPartitionByList x) { 1250 1251 } 1252 1253 override 1254 public bool visit(MySqlDeclareHandlerStatement x) { 1255 return false; 1256 } 1257 1258 override 1259 public void endVisit(MySqlDeclareHandlerStatement x) { 1260 1261 } 1262 1263 override 1264 public bool visit(MySqlDeclareConditionStatement x) { 1265 return false; 1266 } 1267 1268 override 1269 public void endVisit(MySqlDeclareConditionStatement x) { 1270 1271 } 1272 1273 override 1274 public bool visit(MySqlFlushStatement x) { 1275 return false; 1276 } 1277 1278 override 1279 public void endVisit(MySqlFlushStatement x) { 1280 1281 } 1282 1283 override 1284 public bool visit(MySqlEventSchedule x) { 1285 return false; 1286 } 1287 1288 override 1289 public void endVisit(MySqlEventSchedule x) { 1290 1291 } 1292 1293 override 1294 public bool visit(MySqlCreateEventStatement x) { 1295 return false; 1296 } 1297 1298 override 1299 public void endVisit(MySqlCreateEventStatement x) { 1300 1301 } 1302 1303 override 1304 public bool visit(MySqlCreateAddLogFileGroupStatement x) { 1305 return false; 1306 } 1307 1308 override 1309 public void endVisit(MySqlCreateAddLogFileGroupStatement x) { 1310 1311 } 1312 1313 override 1314 public bool visit(MySqlCreateServerStatement x) { 1315 return false; 1316 } 1317 1318 override 1319 public void endVisit(MySqlCreateServerStatement x) { 1320 1321 } 1322 1323 override 1324 public bool visit(MySqlCreateTableSpaceStatement x) { 1325 return false; 1326 } 1327 1328 override 1329 public void endVisit(MySqlCreateTableSpaceStatement x) { 1330 1331 } 1332 1333 override 1334 public bool visit(MySqlAlterEventStatement x) { 1335 return false; 1336 } 1337 1338 override 1339 public void endVisit(MySqlAlterEventStatement x) { 1340 1341 } 1342 1343 override 1344 public bool visit(MySqlAlterLogFileGroupStatement x) { 1345 return false; 1346 } 1347 1348 override 1349 public void endVisit(MySqlAlterLogFileGroupStatement x) { 1350 1351 } 1352 1353 override 1354 public bool visit(MySqlAlterServerStatement x) { 1355 return false; 1356 } 1357 1358 override 1359 public void endVisit(MySqlAlterServerStatement x) { 1360 1361 } 1362 1363 override 1364 public bool visit(MySqlAlterTablespaceStatement x) { 1365 return false; 1366 } 1367 1368 override 1369 public void endVisit(MySqlAlterTablespaceStatement x) { 1370 1371 } 1372 1373 override 1374 public bool visit(MySqlShowDatabasePartitionStatusStatement x) { 1375 return false; 1376 } 1377 1378 override 1379 public void endVisit(MySqlShowDatabasePartitionStatusStatement x) { 1380 1381 } 1382 1383 override 1384 public bool visit(MySqlChecksumTableStatement x) { 1385 return true; 1386 } 1387 1388 override 1389 public void endVisit(MySqlChecksumTableStatement x) { 1390 1391 } 1392 }