Repository navigation
Commit efef378
authored
feat: parse PostgreSQL VACUUM, ANALYZE, CLUSTER and CHECKPOINT with shared utility options (#2890)
PostgreSQL maintenance scripts failed to parse: VACUUM, CLUSTER and
CHECKPOINT had no statement, and ANALYZE accepted only the MySQL form,
so option lists, ANALYZE VERBOSE, column lists and a bare ANALYZE
failed.
Add UtilityOption, one name [value] element of PostgreSQL's
utility_option_list with a typed value, and the shared
UtilityOptionList()/UtilityOptionArgument() productions. VACUUM,
ANALYZE and CLUSTER use them and, like PostgreSQL's grammar, accept any
option name and value but PostgreSQL's reserved words; the server
checks them when it runs the statement, and getKind() maps known names
to each statement's OptionKind. EXPLAIN reads its options through the same production and
accepts no more than before. The unparenthesized keywords (VACUUM FULL,
ANALYZE VERBOSE, CLUSTER VERBOSE) are kept as options with
isParenthesizedOptions() false.
Add VacuumStatement, ClusterStatement (also the pre-8.3 CLUSTER index
ON table) and CheckpointStatement, and extend Analyze with options,
the ANALYSE spelling and MaintenanceTarget tables
([ONLY] t [*] [(columns)]). Analyze keeps its MySQL form with the whole
histogram clause (bucket count, AUTO/MANUAL UPDATE, USING DATA); the
MySQL clauses and the PostgreSQL options and targets exclude each
other, and getTables() is derived from the targets. The statements,
options and targets carry AST nodes spanning their source.
VACUUM and CLUSTER become non-reserved keywords. The PostgreSQL forms
are read with Dialect.POSTGRESQL and without a dialect; other dialects
are unchanged. Wire the statements into the deparser, visitors, table
finder, validation (vacuum, cluster, checkpoint; analyze is now in the
MySQL, MariaDB and PostgreSQL capabilities) and feature analysis.
Signed-off-by: minleejae <mmj9808@gmail.com>1 parent aba25a4 commit efef378
32 files changed
Lines changed: 2879 additions & 38 deletions
File tree
- src
- main
- java/net/sf/jsqlparser
- parser/feature
- statement
- analyze
- maintenance
- util
- deparser
- validation
- feature
- validator
- jjtree/net/sf/jsqlparser/parser
- site/sphinx
- test/java/net/sf/jsqlparser
- parser
- statement
- analyze
- maintenance
- reindex
- securitylabel
- util/validation/validator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
485 | 488 | | |
486 | 489 | | |
487 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
488 | 512 | | |
489 | 513 | | |
490 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
778 | 781 | | |
779 | 782 | | |
780 | 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 | + | |
781 | 808 | | |
782 | 809 | | |
783 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| |||
371 | 374 | | |
372 | 375 | | |
373 | 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 | + | |
374 | 401 | | |
375 | 402 | | |
376 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
| |||
708 | 711 | | |
709 | 712 | | |
710 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
711 | 729 | | |
712 | 730 | | |
713 | 731 | | |
| |||
0 commit comments