From cd9f60f5d468b542621b50a00562325018401f50 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 28 Jan 2025 07:07:19 +0100 Subject: [PATCH 01/21] Disable smoke test for ppc64le for now It is quite flaky but not definitely broken. This causes issues for unrelated changes. --- .github/workflows/build-and-tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 5d8f0dba8..01ae027f6 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -393,10 +393,11 @@ jobs: # - arch: armv7 # distro: alpine_latest # target: armv7-unknown-linux-musleabihf - - arch: ppc64le - distro: ubuntu_latest - target: powerpc64le-unknown-linux-gnu - use-nvm: true +# This one has become very flaky as of late +# - arch: ppc64le +# distro: ubuntu_latest +# target: powerpc64le-unknown-linux-gnu +# use-nvm: true - arch: s390x distro: ubuntu_latest target: s390x-unknown-linux-gnu From 05c8094fda565ea41ec598d8d8f444980193109a Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Tue, 28 Jan 2025 14:04:49 +0800 Subject: [PATCH 02/21] fix: set hasDeoptimizedCache to true as early as possible (#5804) * Set hasDeoptimizedCache to true as early as possible * add test --- src/ast/nodes/LogicalExpression.ts | 2 +- .../samples/deoptimize-logical-expressions-2/_config.js | 3 +++ .../samples/deoptimize-logical-expressions-2/main.js | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/function/samples/deoptimize-logical-expressions-2/_config.js create mode 100644 test/function/samples/deoptimize-logical-expressions-2/main.js diff --git a/src/ast/nodes/LogicalExpression.ts b/src/ast/nodes/LogicalExpression.ts index 13d3addad..378fa4ab4 100644 --- a/src/ast/nodes/LogicalExpression.ts +++ b/src/ast/nodes/LogicalExpression.ts @@ -69,6 +69,7 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable deoptimizeCache(): void { if (this.hasDeoptimizedCache) return; + this.hasDeoptimizedCache = true; if (this.usedBranch) { const unusedBranch = this.usedBranch === this.left ? this.right : this.left; this.usedBranch = null; @@ -85,7 +86,6 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable // Request another pass because we need to ensure "include" runs again if // it is rendered context.requestTreeshakingPass(); - this.hasDeoptimizedCache = true; } deoptimizePath(path: ObjectPath): void { diff --git a/test/function/samples/deoptimize-logical-expressions-2/_config.js b/test/function/samples/deoptimize-logical-expressions-2/_config.js new file mode 100644 index 000000000..caecfee23 --- /dev/null +++ b/test/function/samples/deoptimize-logical-expressions-2/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'Successfully built despite the deoptimization of a logical expression' +}); diff --git a/test/function/samples/deoptimize-logical-expressions-2/main.js b/test/function/samples/deoptimize-logical-expressions-2/main.js new file mode 100644 index 000000000..13475f872 --- /dev/null +++ b/test/function/samples/deoptimize-logical-expressions-2/main.js @@ -0,0 +1,8 @@ +function foo() { + return bar || 'a'; +} +let bar = true; +export default function () { + bar = false; + return foo() !== 'b' || (foo() == 'c' && foo() == 'd'); +} From fd613036e8f289c1bf39ca6d8f15c72c1ffbc3e4 Mon Sep 17 00:00:00 2001 From: Henrikh Kantuni Date: Tue, 28 Jan 2025 01:31:57 -0500 Subject: [PATCH 03/21] Fix typo (#5813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "This remove" → "This removes" --- docs/configuration-options/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration-options/index.md b/docs/configuration-options/index.md index 8ead97cb2..f05e81643 100755 --- a/docs/configuration-options/index.md +++ b/docs/configuration-options/index.md @@ -129,7 +129,7 @@ import { fileURLToPath } from 'node:url'; export default { input: Object.fromEntries( globSync('src/**/*.js').map(file => [ - // This remove `src/` as well as the file extension from each + // This removes `src/` as well as the file extension from each // file, so e.g. src/nested/foo.js becomes nested/foo path.relative( 'src', From abcf4febe11f3d313fae41ddca35fc60670b9ff8 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 28 Jan 2025 09:01:29 +0100 Subject: [PATCH 04/21] 4.32.1 --- CHANGELOG.md | 13 +++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea4cdf1e7..80bdacb70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # rollup changelog +## 4.32.1 + +_2025-01-28_ + +### Bug Fixes + +- Fix possible crash when optimizing logical expressions (#5804) + +### Pull Requests + +- [#5804](https://github.com/rollup/rollup/pull/5804): fix: set hasDeoptimizedCache to true as early as possible (@TrickyPi) +- [#5813](https://github.com/rollup/rollup/pull/5813): Fix typo (@kantuni) + ## 4.32.0 _2025-01-24_ diff --git a/browser/package.json b/browser/package.json index 6a5dedbfd..04401c5ce 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.32.0", + "version": "4.32.1", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 0cade07e3..fbe30b30d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.32.0", + "version": "4.32.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.32.0", + "version": "4.32.1", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index 290c8b377..30da23a89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.32.0", + "version": "4.32.1", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 650b885429ac19df78d9ed26f9375db0810c6694 Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Fri, 31 Jan 2025 13:35:14 +0800 Subject: [PATCH 05/21] feat: optimize the literal value of unary expressions (#5812) * feat: optimize the literal value of unary expressions * correct the return value --- src/ast/nodes/UnaryExpression.ts | 16 ++++++++++++++-- .../samples/nested-member-access/_expected.js | 2 +- .../pure-comment-scenarios-complex/_expected.js | 2 +- .../unary-expressions-literal-value/_config.js | 3 +++ .../unary-expressions-literal-value/_expected.js | 5 +++++ .../unary-expressions-literal-value/main.js | 9 +++++++++ 6 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 test/form/samples/unary-expressions-literal-value/_config.js create mode 100644 test/form/samples/unary-expressions-literal-value/_expected.js create mode 100644 test/form/samples/unary-expressions-literal-value/main.js diff --git a/src/ast/nodes/UnaryExpression.ts b/src/ast/nodes/UnaryExpression.ts index 3f0c9d698..f770380fb 100644 --- a/src/ast/nodes/UnaryExpression.ts +++ b/src/ast/nodes/UnaryExpression.ts @@ -15,7 +15,12 @@ import type { LiteralValue } from './Literal'; import type * as NodeType from './NodeType'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import type { InclusionOptions } from './shared/Expression'; -import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; +import { + type LiteralValueOrUnknown, + UnknownFalsyValue, + UnknownTruthyValue, + UnknownValue +} from './shared/Expression'; import type { IncludeChildren } from './shared/Node'; import { type ExpressionNode, NodeBase } from './shared/Node'; @@ -55,7 +60,14 @@ export default class UnaryExpression extends NodeBase { ): LiteralValueOrUnknown { if (path.length > 0) return UnknownValue; const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin); - if (typeof argumentValue === 'symbol') return UnknownValue; + if (typeof argumentValue === 'symbol') { + if (this.operator === 'void') return undefined; + if (this.operator === '!') { + if (argumentValue === UnknownFalsyValue) return true; + if (argumentValue === UnknownTruthyValue) return false; + } + return UnknownValue; + } return unaryOperators[this.operator](argumentValue); } diff --git a/test/form/samples/nested-member-access/_expected.js b/test/form/samples/nested-member-access/_expected.js index 748859e2c..be8f7c2f7 100644 --- a/test/form/samples/nested-member-access/_expected.js +++ b/test/form/samples/nested-member-access/_expected.js @@ -4,7 +4,7 @@ retained1.foo.bar; const retained2 = new function () {}(); retained2.foo.bar; -const retained3 = void {}; +const retained3 = undefined; retained3.foo; const retained4b = undefined; retained4b.foo; diff --git a/test/form/samples/pure-comment-scenarios-complex/_expected.js b/test/form/samples/pure-comment-scenarios-complex/_expected.js index 49468bd31..56e6ef40c 100644 --- a/test/form/samples/pure-comment-scenarios-complex/_expected.js +++ b/test/form/samples/pure-comment-scenarios-complex/_expected.js @@ -19,4 +19,4 @@ bar(); "foo" + /* @__PURE__ */(function(){})() ? bar() : baz(); /* @__PURE__ */(function(){})() ? foo() : foo(); foo() ; -!{ foo: /* @__PURE__ */(function(){})() } ? bar() : baz(); +baz(); diff --git a/test/form/samples/unary-expressions-literal-value/_config.js b/test/form/samples/unary-expressions-literal-value/_config.js new file mode 100644 index 000000000..a51bbef3d --- /dev/null +++ b/test/form/samples/unary-expressions-literal-value/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'Optimize the literal value of unary expressions to remove the unused code' +}); diff --git a/test/form/samples/unary-expressions-literal-value/_expected.js b/test/form/samples/unary-expressions-literal-value/_expected.js new file mode 100644 index 000000000..55369b205 --- /dev/null +++ b/test/form/samples/unary-expressions-literal-value/_expected.js @@ -0,0 +1,5 @@ +bar(); + +bar(); + +bar(); diff --git a/test/form/samples/unary-expressions-literal-value/main.js b/test/form/samples/unary-expressions-literal-value/main.js new file mode 100644 index 000000000..6936d383e --- /dev/null +++ b/test/form/samples/unary-expressions-literal-value/main.js @@ -0,0 +1,9 @@ +void Symbol(1) ? foo() : bar(); + +!(Symbol(1) || true) ? foo() : bar(); + +quz() ? foo() : bar(); + +function quz() { + return !!(Symbol(1) && false); +} From f412abdb8033060e0aa69c57b0d06efea690b51d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:59:19 +0100 Subject: [PATCH 06/21] fix(deps): update swc monorepo (major) (#5816) * fix(deps): update swc monorepo * Manually update further --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson --- rust/Cargo.lock | 48 +++++++++++++++++++-------------------- rust/parse_ast/Cargo.toml | 4 ++-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 10e876449..3eeee2a98 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -307,9 +307,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hstr" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d6824358c0fd9a68bb23999ed2ef76c84f79408a26ef7ae53d5f370c94ad36" +checksum = "a1a26def229ea95a8709dad32868d975d0dd40235bd2ce82920e4a8fe692b5e0" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", @@ -1111,9 +1111,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec403702d532412d862e4a4ec0619022f05996a64876febe8ae5519146bdf0ce" +checksum = "31cf812d2f10fd40a9c11227fe0e2e09779113f6ae6f04bd396ac5da92b69c91" dependencies = [ "hstr", "once_cell", @@ -1137,9 +1137,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a521e8120dc0401580864a643b5bffa035c29fc3fc41697c972743d4f008ed22" +checksum = "29e67f0a373efdcbc1faebbb9ed7eaf7bcd7bc407cdd8b0fdd9475337c4364ce" dependencies = [ "ahash", "ast_node", @@ -1166,9 +1166,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "8.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac05e842e05893583b4152485bf8d001540d3825e3eb33bad690776f60d0ba7" +checksum = "1abc72f614a5501588c6eafb7d915bb5253d5a5042fe576061a3cfea20044a6f" dependencies = [ "anyhow", "base64", @@ -1219,9 +1219,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "5.0.3" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05e7518b3052102506969009cabb027a88259ccde64ed675aa4ea8703b651f5" +checksum = "f04d44a7edb591a66b9abc276ef306ab6d73d4ef189c1cb54423625ad236348f" dependencies = [ "bitflags", "is-macro", @@ -1270,9 +1270,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "7.5.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d303285f501b3f48818e896bf9c406de0639e8609ae0642628ad92d4d22bdab1" +checksum = "c4f6ff1fca2e025f3bd615d352b4f4e6045739f1e1dcaf52231b0e1a4628d2e0" dependencies = [ "arrayvec", "indexmap", @@ -1306,9 +1306,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "6.0.2" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92d3a25349d7f612c38d940f09f9c19c7b7aa3bf4d22fbe31ea44fd5354de02" +checksum = "8cf8a7677aa667eb2a629625cc4a5947eefcab717ee0feee5aadb1a4bf9d5888" dependencies = [ "either", "new_debug_unreachable", @@ -1328,9 +1328,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "7.1.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4596fe5bcb4ed0836c71e69fb4cbf0071bb832669ae57ba28aaa4b6a67b6ddfd" +checksum = "3c135c2def758a74bdaa2d2a77f68b495ac2965749772a942323571bf9845624" dependencies = [ "better_scoped_tls", "bitflags", @@ -1364,9 +1364,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "7.1.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445aa8dc0b03a875fd14dd9afdfbd774b223b1e37916dae96dd8d79f45421422" +checksum = "89cce1fc8676e89c36bd86fa11820ccdd135346f34fabf0fc50d1f991c632dc8" dependencies = [ "dashmap", "indexmap", @@ -1388,9 +1388,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "7.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15eb86aaa82d7ec4c1a6c3a8a824b1fdbbaace73c3ed81035a1fbbac49f8e0bd" +checksum = "289f228d757aa06792ef4bcef13877cbfb4a727cfff6f23be6f08a12a7454457" dependencies = [ "indexmap", "rustc-hash", @@ -1405,9 +1405,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "7.0.4" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "971099632f1a9117debf5ca8451615c3014eea519e9ad31e386396b6e0ac8fb5" +checksum = "229ad0ad13418aa0162fea9e9ed6eb48232f6e6043df1568d5a90125f0c9fe6d" dependencies = [ "indexmap", "num_cpus", @@ -1474,9 +1474,9 @@ dependencies = [ [[package]] name = "swc_parallel" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22c97eeb6cad7e98dd246769b740e7f724fee6dc752190f14ad2b361cbf565b" +checksum = "e5f75f1094d69174ef628e3665fff0f81d58e9f568802e3c90d332c72b0b6026" dependencies = [ "once_cell", ] diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index 59a055b4b..cbe61fc13 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -8,8 +8,8 @@ edition = "2021" [dependencies] anyhow = "1.0.95" swc_atoms = "3.0.3" -swc_compiler_base = "8.0.0" +swc_compiler_base = "10.0.0" swc_common = { version = "5.0.0", features = ["ahash", "parking_lot"] } swc_ecma_ast = "5.0.3" -swc_ecma_parser = "6.0.2" +swc_ecma_parser = "7.0.1" parking_lot = "0.12.3" From acd142c03a190c53f3eaae56c8639c7d80cdc5fb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 08:13:46 +0000 Subject: [PATCH 07/21] fix(deps): lock file maintenance minor/patch updates (#5817) * fix(deps): lock file maintenance minor/patch updates * Revert update as that needs to match the transitive dependency --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson --- .github/workflows/build-and-tests.yml | 2 +- package-lock.json | 946 +++++++++++++------------- package.json | 18 +- renovate.json | 2 +- rust/Cargo.lock | 16 +- rust/parse_ast/Cargo.toml | 6 +- 6 files changed, 509 insertions(+), 481 deletions(-) diff --git a/.github/workflows/build-and-tests.yml b/.github/workflows/build-and-tests.yml index 01ae027f6..9282e96d1 100644 --- a/.github/workflows/build-and-tests.yml +++ b/.github/workflows/build-and-tests.yml @@ -341,7 +341,7 @@ jobs: key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} restore-keys: node-modules-${{ runner.os }} - name: Build - uses: cross-platform-actions/action@v0.26.0 + uses: cross-platform-actions/action@v0.27.0 with: operating_system: ${{ matrix.settings.name }} architecture: ${{ matrix.settings.architecture }} diff --git a/package-lock.json b/package-lock.json index fbe30b30d..0beff4b89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@codemirror/search": "^6.5.8", "@codemirror/state": "^6.5.1", "@codemirror/view": "^6.36.2", - "@eslint/js": "^9.18.0", + "@eslint/js": "^9.19.0", "@inquirer/prompts": "^7.2.3", "@jridgewell/sourcemap-codec": "^1.5.0", "@mermaid-js/mermaid-cli": "^11.4.2", @@ -35,9 +35,9 @@ "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^12.1.2", "@rollup/pluginutils": "^5.1.4", - "@shikijs/vitepress-twoslash": "^2.0.3", + "@shikijs/vitepress-twoslash": "^2.1.0", "@types/mocha": "^10.0.10", - "@types/node": "^18.19.71", + "@types/node": "^18.19.74", "@types/semver": "^7.5.8", "@types/yargs-parser": "^21.0.3", "@vue/language-server": "^2.2.0", @@ -53,7 +53,7 @@ "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", - "eslint": "^9.18.0", + "eslint": "^9.19.0", "eslint-config-prettier": "^10.0.1", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-unicorn": "^56.0.1", @@ -65,7 +65,7 @@ "globals": "^15.14.0", "husky": "^9.1.7", "is-reference": "^3.0.3", - "lint-staged": "^15.4.1", + "lint-staged": "^15.4.3", "locate-character": "^3.0.0", "magic-string": "^0.30.17", "mocha": "^11.1.0", @@ -79,7 +79,7 @@ "pretty-bytes": "^6.1.1", "pretty-ms": "^9.2.0", "requirejs": "^2.3.7", - "rollup": "^4.31.0", + "rollup": "^4.32.0", "rollup-plugin-license": "^3.5.3", "rollup-plugin-string": "^3.0.0", "semver": "^7.6.3", @@ -91,9 +91,9 @@ "terser": "^5.37.0", "tslib": "^2.8.1", "typescript": "^5.7.3", - "typescript-eslint": "^8.21.0", - "vite": "^6.0.10", - "vitepress": "^1.6.1", + "typescript-eslint": "^8.22.0", + "vite": "^6.0.11", + "vitepress": "^1.6.3", "vue": "^3.5.13", "vue-tsc": "^2.2.0", "wasm-pack": "^0.13.1", @@ -426,22 +426,22 @@ } }, "node_modules/@babel/core": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", - "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.7.tgz", + "integrity": "sha512-SRijHmF0PSPgLIBYlWnG0hyeJLwXE2CgpsXaMOrtt2yp9/86ALw6oUlj9KYuZ0JN07T4eBMVIW4li/9S1j2BGA==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.26.0", - "@babel/generator": "^7.26.0", - "@babel/helper-compilation-targets": "^7.25.9", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/helper-compilation-targets": "^7.26.5", "@babel/helper-module-transforms": "^7.26.0", - "@babel/helpers": "^7.26.0", - "@babel/parser": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.7", "@babel/template": "^7.25.9", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", + "@babel/traverse": "^7.26.7", + "@babel/types": "^7.26.7", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -560,27 +560,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", - "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.7.tgz", + "integrity": "sha512-8NHiL98vsi0mbPQmYAGWwfcFaOy4j2HY49fXJCfuDcdE7fMIsH9a7GdaeXpIBsbT7307WU8KCMp5pUVDNL4f9A==", "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.25.9", - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.5.tgz", - "integrity": "sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.7.tgz", + "integrity": "sha512-kEvgGGgEjRUutvdVvZhbn/BxVt+5VSpwXz1j3WYXQbXDo8KzFOPNG2GQbdAiNq8g6wn1yKk7C/qrke03a84V+w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.26.5" + "@babel/types": "^7.26.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -605,17 +605,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.5.tgz", - "integrity": "sha512-rkOSPOw+AXbgtwUga3U4u8RpoK9FEFWBNAlTpcnkLFjL5CT+oyHNuUUC/xx6XefEJ16r38r8Bc/lfp6rYuHeJQ==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", "@babel/generator": "^7.26.5", - "@babel/parser": "^7.26.5", + "@babel/parser": "^7.26.7", "@babel/template": "^7.25.9", - "@babel/types": "^7.26.5", + "@babel/types": "^7.26.7", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -634,9 +634,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz", - "integrity": "sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz", + "integrity": "sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==", "dev": true, "license": "MIT", "dependencies": { @@ -1495,9 +1495,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", - "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==", + "version": "9.19.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.19.0.tgz", + "integrity": "sha512-rbq9/g38qjfqFLOVPvwjIvFFdNziEC5S65jmjPw5r6A//QH+W91akh9irMwjDN8zKUTak6W9EsAv4m/7Wnw0UQ==", "dev": true, "license": "MIT", "engines": { @@ -1680,9 +1680,9 @@ } }, "node_modules/@iconify-json/simple-icons": { - "version": "1.2.21", - "resolved": "https://registry.npmjs.org/@iconify-json/simple-icons/-/simple-icons-1.2.21.tgz", - "integrity": "sha512-aqbIuVshMZ2fNEhm25//9DoKudboXF3CpoEQJJlHl9gVSVNOTr4cgaCIZvgSEYmys2HHEfmhcpoZIhoEFZS8SQ==", + "version": "1.2.22", + "resolved": "https://registry.npmjs.org/@iconify-json/simple-icons/-/simple-icons-1.2.22.tgz", + "integrity": "sha512-0UzThRMwHuOJfgpp+tyV/y2uEBLjFVrxC4igv9iWjSEQEBK4tNjWZNTRCBCYyv/FwWVYyKAsA8tZQ8vUYzvFnw==", "dev": true, "license": "CC0-1.0", "dependencies": { @@ -1714,15 +1714,15 @@ } }, "node_modules/@inquirer/checkbox": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.6.tgz", - "integrity": "sha512-PgP35JfmGjHU0LSXOyRew0zHuA9N6OJwOlos1fZ20b7j8ISeAdib3L+n0jIxBtX958UeEpte6xhG/gxJ5iUqMw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.7.tgz", + "integrity": "sha512-lyoF4uYdBBTnqeB1gjPdYkiQ++fz/iYKaP9DON1ZGlldkvAEJsjaOBRdbl5UW1pOSslBRd701jxhAG0MlhHd2w==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/figures": "^1.0.9", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/figures": "^1.0.10", + "@inquirer/type": "^3.0.3", "ansi-escapes": "^4.3.2", "yoctocolors-cjs": "^2.1.2" }, @@ -1734,14 +1734,14 @@ } }, "node_modules/@inquirer/confirm": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.3.tgz", - "integrity": "sha512-fuF9laMmHoOgWapF9h9hv6opA5WvmGFHsTYGCmuFxcghIhEhb3dN0CdQR4BUMqa2H506NCj8cGX4jwMsE4t6dA==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.4.tgz", + "integrity": "sha512-EsiT7K4beM5fN5Mz6j866EFA9+v9d5o9VUra3hrg8zY4GHmCS8b616FErbdo5eyKoVotBQkHzMIeeKYsKDStDw==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2" + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3" }, "engines": { "node": ">=18" @@ -1751,19 +1751,18 @@ } }, "node_modules/@inquirer/core": { - "version": "10.1.4", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.4.tgz", - "integrity": "sha512-5y4/PUJVnRb4bwWY67KLdebWOhOc7xj5IP2J80oWXa64mVag24rwQ1VAdnj7/eDY/odhguW0zQ1Mp1pj6fO/2w==", + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.5.tgz", + "integrity": "sha512-/vyCWhET0ktav/mUeBqJRYTwmjFPIKPRYb3COAw7qORULgipGSUO2vL32lQKki3UxDKJ8BvuEbokaoyCA6YlWw==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/figures": "^1.0.9", - "@inquirer/type": "^3.0.2", + "@inquirer/figures": "^1.0.10", + "@inquirer/type": "^3.0.3", "ansi-escapes": "^4.3.2", "cli-width": "^4.1.0", "mute-stream": "^2.0.0", "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", "wrap-ansi": "^6.2.0", "yoctocolors-cjs": "^2.1.2" }, @@ -1772,14 +1771,14 @@ } }, "node_modules/@inquirer/editor": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.3.tgz", - "integrity": "sha512-S9KnIOJuTZpb9upeRSBBhoDZv7aSV3pG9TECrBj0f+ZsFwccz886hzKBrChGrXMJwd4NKY+pOA9Vy72uqnd6Eg==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.2.4.tgz", + "integrity": "sha512-S8b6+K9PLzxiFGGc02m4syhEu5JsH0BukzRsuZ+tpjJ5aDsDX1WfNfOil2fmsO36Y1RMcpJGxlfQ1yh4WfU28Q==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3", "external-editor": "^3.1.0" }, "engines": { @@ -1790,14 +1789,14 @@ } }, "node_modules/@inquirer/expand": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.6.tgz", - "integrity": "sha512-TRTfi1mv1GeIZGyi9PQmvAaH65ZlG4/FACq6wSzs7Vvf1z5dnNWsAAXBjWMHt76l+1hUY8teIqJFrWBk5N6gsg==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.7.tgz", + "integrity": "sha512-PsUQ5t7r+DPjW0VVEHzssOTBM2UPHnvBNse7hzuki7f6ekRL94drjjfBLrGEDe7cgj3pguufy/cuFwMeWUWHXw==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3", "yoctocolors-cjs": "^2.1.2" }, "engines": { @@ -1808,9 +1807,9 @@ } }, "node_modules/@inquirer/figures": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.9.tgz", - "integrity": "sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.10.tgz", + "integrity": "sha512-Ey6176gZmeqZuY/W/nZiUyvmb1/qInjcpiZjXWi6nON+nxJpD1bxtSoBxNliGISae32n6OwbY+TSXPZ1CfS4bw==", "dev": true, "license": "MIT", "engines": { @@ -1818,14 +1817,14 @@ } }, "node_modules/@inquirer/input": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.1.3.tgz", - "integrity": "sha512-zeo++6f7hxaEe7OjtMzdGZPHiawsfmCZxWB9X1NpmYgbeoyerIbWemvlBxxl+sQIlHC0WuSAG19ibMq3gbhaqQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.1.4.tgz", + "integrity": "sha512-CKKF8otRBdIaVnRxkFLs00VNA9HWlEh3x4SqUfC3A8819TeOZpTYG/p+4Nqu3hh97G+A0lxkOZNYE7KISgU8BA==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2" + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3" }, "engines": { "node": ">=18" @@ -1835,14 +1834,14 @@ } }, "node_modules/@inquirer/number": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.6.tgz", - "integrity": "sha512-xO07lftUHk1rs1gR0KbqB+LJPhkUNkyzV/KhH+937hdkMazmAYHLm1OIrNKpPelppeV1FgWrgFDjdUD8mM+XUg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.7.tgz", + "integrity": "sha512-uU2nmXGC0kD8+BLgwZqcgBD1jcw2XFww2GmtP6b4504DkOp+fFAhydt7JzRR1TAI2dmj175p4SZB0lxVssNreA==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2" + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3" }, "engines": { "node": ">=18" @@ -1852,14 +1851,14 @@ } }, "node_modules/@inquirer/password": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.6.tgz", - "integrity": "sha512-QLF0HmMpHZPPMp10WGXh6F+ZPvzWE7LX6rNoccdktv/Rov0B+0f+eyXkAcgqy5cH9V+WSpbLxu2lo3ysEVK91w==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.7.tgz", + "integrity": "sha512-DFpqWLx+C5GV5zeFWuxwDYaeYnTWYphO07pQ2VnP403RIqRIpwBG0ATWf7pF+3IDbaXEtWatCJWxyDrJ+rkj2A==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3", "ansi-escapes": "^4.3.2" }, "engines": { @@ -1870,22 +1869,22 @@ } }, "node_modules/@inquirer/prompts": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.2.3.tgz", - "integrity": "sha512-hzfnm3uOoDySDXfDNOm9usOuYIaQvTgKp/13l1uJoe6UNY+Zpcn2RYt0jXz3yA+yemGHvDOxVzqWl3S5sQq53Q==", + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.2.4.tgz", + "integrity": "sha512-Zn2XZL2VZl76pllUjeDnS6Poz2Oiv9kmAZdSZw1oFya985+/JXZ3GZ2JUWDokAPDhvuhkv9qz0Z7z/U80G8ztA==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/checkbox": "^4.0.6", - "@inquirer/confirm": "^5.1.3", - "@inquirer/editor": "^4.2.3", - "@inquirer/expand": "^4.0.6", - "@inquirer/input": "^4.1.3", - "@inquirer/number": "^3.0.6", - "@inquirer/password": "^4.0.6", - "@inquirer/rawlist": "^4.0.6", - "@inquirer/search": "^3.0.6", - "@inquirer/select": "^4.0.6" + "@inquirer/checkbox": "^4.0.7", + "@inquirer/confirm": "^5.1.4", + "@inquirer/editor": "^4.2.4", + "@inquirer/expand": "^4.0.7", + "@inquirer/input": "^4.1.4", + "@inquirer/number": "^3.0.7", + "@inquirer/password": "^4.0.7", + "@inquirer/rawlist": "^4.0.7", + "@inquirer/search": "^3.0.7", + "@inquirer/select": "^4.0.7" }, "engines": { "node": ">=18" @@ -1895,14 +1894,14 @@ } }, "node_modules/@inquirer/rawlist": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.6.tgz", - "integrity": "sha512-QoE4s1SsIPx27FO4L1b1mUjVcoHm1pWE/oCmm4z/Hl+V1Aw5IXl8FYYzGmfXaBT0l/sWr49XmNSiq7kg3Kd/Lg==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.7.tgz", + "integrity": "sha512-ZeBca+JCCtEIwQMvhuROT6rgFQWWvAImdQmIIP3XoyDFjrp2E0gZlEn65sWIoR6pP2EatYK96pvx0887OATWQQ==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/type": "^3.0.3", "yoctocolors-cjs": "^2.1.2" }, "engines": { @@ -1913,15 +1912,15 @@ } }, "node_modules/@inquirer/search": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.0.6.tgz", - "integrity": "sha512-eFZ2hiAq0bZcFPuFFBmZEtXU1EarHLigE+ENCtpO+37NHCl4+Yokq1P/d09kUblObaikwfo97w+0FtG/EXl5Ng==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.0.7.tgz", + "integrity": "sha512-Krq925SDoLh9AWSNee8mbSIysgyWtcPnSAp5YtPBGCQ+OCO+5KGC8FwLpyxl8wZ2YAov/8Tp21stTRK/fw5SGg==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/figures": "^1.0.9", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/figures": "^1.0.10", + "@inquirer/type": "^3.0.3", "yoctocolors-cjs": "^2.1.2" }, "engines": { @@ -1932,15 +1931,15 @@ } }, "node_modules/@inquirer/select": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.6.tgz", - "integrity": "sha512-yANzIiNZ8fhMm4NORm+a74+KFYHmf7BZphSOBovIzYPVLquseTGEkU5l2UTnBOf5k0VLmTgPighNDLE9QtbViQ==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.7.tgz", + "integrity": "sha512-ejGBMDSD+Iqk60u5t0Zf2UQhGlJWDM78Ep70XpNufIfc+f4VOTeybYKXu9pDjz87FkRzLiVsGpQG2SzuGlhaJw==", "dev": true, "license": "MIT", "dependencies": { - "@inquirer/core": "^10.1.4", - "@inquirer/figures": "^1.0.9", - "@inquirer/type": "^3.0.2", + "@inquirer/core": "^10.1.5", + "@inquirer/figures": "^1.0.10", + "@inquirer/type": "^3.0.3", "ansi-escapes": "^4.3.2", "yoctocolors-cjs": "^2.1.2" }, @@ -1952,9 +1951,9 @@ } }, "node_modules/@inquirer/type": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz", - "integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.3.tgz", + "integrity": "sha512-I4VIHFxUuY1bshGbXZTxCmhwaaEst9s/lll3ekok+o1Z26/ZUKdx8y1b7lsoG6rtsBDwEGfiBJ2SfirjoISLpg==", "dev": true, "license": "MIT", "engines": { @@ -1982,19 +1981,6 @@ "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2020,22 +2006,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2683,9 +2653,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.31.0.tgz", - "integrity": "sha512-9NrR4033uCbUBRgvLcBrJofa2KY9DzxL2UKZ1/4xA/mnTNyhZCWBuD8X3tPm1n4KxcgaraOYgrFKSgwjASfmlA==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.32.1.tgz", + "integrity": "sha512-/pqA4DmqyCm8u5YIDzIdlLcEmuvxb0v8fZdFhVMszSpDTgbQKdw3/mB3eMUHIbubtJ6F9j+LtmyCnHTEqIHyzA==", "cpu": [ "arm" ], @@ -2697,9 +2667,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.31.0.tgz", - "integrity": "sha512-iBbODqT86YBFHajxxF8ebj2hwKm1k8PTBQSojSt3d1FFt1gN+xf4CowE47iN0vOSdnd+5ierMHBbu/rHc7nq5g==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.32.1.tgz", + "integrity": "sha512-If3PDskT77q7zgqVqYuj7WG3WC08G1kwXGVFi9Jr8nY6eHucREHkfpX79c0ACAjLj3QIWKPJR7w4i+f5EdLH5Q==", "cpu": [ "arm64" ], @@ -2711,9 +2681,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.31.0.tgz", - "integrity": "sha512-WHIZfXgVBX30SWuTMhlHPXTyN20AXrLH4TEeH/D0Bolvx9PjgZnn4H677PlSGvU6MKNsjCQJYczkpvBbrBnG6g==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.32.1.tgz", + "integrity": "sha512-zCpKHioQ9KgZToFp5Wvz6zaWbMzYQ2LJHQ+QixDKq52KKrF65ueu6Af4hLlLWHjX1Wf/0G5kSJM9PySW9IrvHA==", "cpu": [ "arm64" ], @@ -2725,9 +2695,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.31.0.tgz", - "integrity": "sha512-hrWL7uQacTEF8gdrQAqcDy9xllQ0w0zuL1wk1HV8wKGSGbKPVjVUv/DEwT2+Asabf8Dh/As+IvfdU+H8hhzrQQ==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.32.1.tgz", + "integrity": "sha512-sFvF+t2+TyUo/ZQqUcifrJIgznx58oFZbdHS9TvHq3xhPVL9nOp+yZ6LKrO9GWTP+6DbFtoyLDbjTpR62Mbr3Q==", "cpu": [ "x64" ], @@ -2739,9 +2709,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.31.0.tgz", - "integrity": "sha512-S2oCsZ4hJviG1QjPY1h6sVJLBI6ekBeAEssYKad1soRFv3SocsQCzX6cwnk6fID6UQQACTjeIMB+hyYrFacRew==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.32.1.tgz", + "integrity": "sha512-NbOa+7InvMWRcY9RG+B6kKIMD/FsnQPH0MWUvDlQB1iXnF/UcKSudCXZtv4lW+C276g3w5AxPbfry5rSYvyeYA==", "cpu": [ "arm64" ], @@ -2753,9 +2723,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.31.0.tgz", - "integrity": "sha512-pCANqpynRS4Jirn4IKZH4tnm2+2CqCNLKD7gAdEjzdLGbH1iO0zouHz4mxqg0uEMpO030ejJ0aA6e1PJo2xrPA==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.32.1.tgz", + "integrity": "sha512-JRBRmwvHPXR881j2xjry8HZ86wIPK2CcDw0EXchE1UgU0ubWp9nvlT7cZYKc6bkypBt745b4bglf3+xJ7hXWWw==", "cpu": [ "x64" ], @@ -2767,9 +2737,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.31.0.tgz", - "integrity": "sha512-0O8ViX+QcBd3ZmGlcFTnYXZKGbFu09EhgD27tgTdGnkcYXLat4KIsBBQeKLR2xZDCXdIBAlWLkiXE1+rJpCxFw==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.32.1.tgz", + "integrity": "sha512-PKvszb+9o/vVdUzCCjL0sKHukEQV39tD3fepXxYrHE3sTKrRdCydI7uldRLbjLmDA3TFDmh418XH19NOsDRH8g==", "cpu": [ "arm" ], @@ -2781,9 +2751,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.31.0.tgz", - "integrity": "sha512-w5IzG0wTVv7B0/SwDnMYmbr2uERQp999q8FMkKG1I+j8hpPX2BYFjWe69xbhbP6J9h2gId/7ogesl9hwblFwwg==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.32.1.tgz", + "integrity": "sha512-9WHEMV6Y89eL606ReYowXuGF1Yb2vwfKWKdD1A5h+OYnPZSJvxbEjxTRKPgi7tkP2DSnW0YLab1ooy+i/FQp/Q==", "cpu": [ "arm" ], @@ -2795,9 +2765,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.31.0.tgz", - "integrity": "sha512-JyFFshbN5xwy6fulZ8B/8qOqENRmDdEkcIMF0Zz+RsfamEW+Zabl5jAb0IozP/8UKnJ7g2FtZZPEUIAlUSX8cA==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.32.1.tgz", + "integrity": "sha512-tZWc9iEt5fGJ1CL2LRPw8OttkCBDs+D8D3oEM8mH8S1ICZCtFJhD7DZ3XMGM8kpqHvhGUTvNUYVDnmkj4BDXnw==", "cpu": [ "arm64" ], @@ -2809,9 +2779,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.31.0.tgz", - "integrity": "sha512-kpQXQ0UPFeMPmPYksiBL9WS/BDiQEjRGMfklVIsA0Sng347H8W2iexch+IEwaR7OVSKtr2ZFxggt11zVIlZ25g==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.32.1.tgz", + "integrity": "sha512-FTYc2YoTWUsBz5GTTgGkRYYJ5NGJIi/rCY4oK/I8aKowx1ToXeoVVbIE4LGAjsauvlhjfl0MYacxClLld1VrOw==", "cpu": [ "arm64" ], @@ -2823,9 +2793,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.31.0.tgz", - "integrity": "sha512-pMlxLjt60iQTzt9iBb3jZphFIl55a70wexvo8p+vVFK+7ifTRookdoXX3bOsRdmfD+OKnMozKO6XM4zR0sHRrQ==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.32.1.tgz", + "integrity": "sha512-F51qLdOtpS6P1zJVRzYM0v6MrBNypyPEN1GfMiz0gPu9jN8ScGaEFIZQwteSsGKg799oR5EaP7+B2jHgL+d+Kw==", "cpu": [ "loong64" ], @@ -2837,9 +2807,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.31.0.tgz", - "integrity": "sha512-D7TXT7I/uKEuWiRkEFbed1UUYZwcJDU4vZQdPTcepK7ecPhzKOYk4Er2YR4uHKme4qDeIh6N3XrLfpuM7vzRWQ==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.32.1.tgz", + "integrity": "sha512-wO0WkfSppfX4YFm5KhdCCpnpGbtgQNj/tgvYzrVYFKDpven8w2N6Gg5nB6w+wAMO3AIfSTWeTjfVe+uZ23zAlg==", "cpu": [ "ppc64" ], @@ -2851,9 +2821,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.31.0.tgz", - "integrity": "sha512-wal2Tc8O5lMBtoePLBYRKj2CImUCJ4UNGJlLwspx7QApYny7K1cUYlzQ/4IGQBLmm+y0RS7dwc3TDO/pmcneTw==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.32.1.tgz", + "integrity": "sha512-iWswS9cIXfJO1MFYtI/4jjlrGb/V58oMu4dYJIKnR5UIwbkzR0PJ09O0PDZT0oJ3LYWXBSWahNf/Mjo6i1E5/g==", "cpu": [ "riscv64" ], @@ -2865,9 +2835,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.31.0.tgz", - "integrity": "sha512-O1o5EUI0+RRMkK9wiTVpk2tyzXdXefHtRTIjBbmFREmNMy7pFeYXCFGbhKFwISA3UOExlo5GGUuuj3oMKdK6JQ==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.32.1.tgz", + "integrity": "sha512-RKt8NI9tebzmEthMnfVgG3i/XeECkMPS+ibVZjZ6mNekpbbUmkNWuIN2yHsb/mBPyZke4nlI4YqIdFPgKuoyQQ==", "cpu": [ "s390x" ], @@ -2879,9 +2849,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.31.0.tgz", - "integrity": "sha512-zSoHl356vKnNxwOWnLd60ixHNPRBglxpv2g7q0Cd3Pmr561gf0HiAcUBRL3S1vPqRC17Zo2CX/9cPkqTIiai1g==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.32.1.tgz", + "integrity": "sha512-WQFLZ9c42ECqEjwg/GHHsouij3pzLXkFdz0UxHa/0OM12LzvX7DzedlY0SIEly2v18YZLRhCRoHZDxbBSWoGYg==", "cpu": [ "x64" ], @@ -2893,9 +2863,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.31.0.tgz", - "integrity": "sha512-ypB/HMtcSGhKUQNiFwqgdclWNRrAYDH8iMYH4etw/ZlGwiTVxBz2tDrGRrPlfZu6QjXwtd+C3Zib5pFqID97ZA==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.32.1.tgz", + "integrity": "sha512-BLoiyHDOWoS3uccNSADMza6V6vCNiphi94tQlVIL5de+r6r/CCQuNnerf+1g2mnk2b6edp5dk0nhdZ7aEjOBsA==", "cpu": [ "x64" ], @@ -2907,9 +2877,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.31.0.tgz", - "integrity": "sha512-JuhN2xdI/m8Hr+aVO3vspO7OQfUFO6bKLIRTAy0U15vmWjnZDLrEgCZ2s6+scAYaQVpYSh9tZtRijApw9IXyMw==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.32.1.tgz", + "integrity": "sha512-w2l3UnlgYTNNU+Z6wOR8YdaioqfEnwPjIsJ66KxKAf0p+AuL2FHeTX6qvM+p/Ue3XPBVNyVSfCrfZiQh7vZHLQ==", "cpu": [ "arm64" ], @@ -2921,9 +2891,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.31.0.tgz", - "integrity": "sha512-U1xZZXYkvdf5MIWmftU8wrM5PPXzyaY1nGCI4KI4BFfoZxHamsIe+BtnPLIvvPykvQWlVbqUXdLa4aJUuilwLQ==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.32.1.tgz", + "integrity": "sha512-Am9H+TGLomPGkBnaPWie4F3x+yQ2rr4Bk2jpwy+iV+Gel9jLAu/KqT8k3X4jxFPW6Zf8OMnehyutsd+eHoq1WQ==", "cpu": [ "ia32" ], @@ -2935,9 +2905,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.31.0.tgz", - "integrity": "sha512-ul8rnCsUumNln5YWwz0ted2ZHFhzhRRnkpBZ+YRuHoRAlUji9KChpOUOndY7uykrPEPXVbHLlsdo6v5yXo/TXw==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.32.1.tgz", + "integrity": "sha512-ar80GhdZb4DgmW3myIS9nRFYcpJRSME8iqWgzH2i44u+IdrzmiXVxeFnExQ5v4JYUSpg94bWjevMG8JHf1Da5Q==", "cpu": [ "x64" ], @@ -2949,90 +2919,90 @@ ] }, "node_modules/@shikijs/core": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-2.1.0.tgz", - "integrity": "sha512-v795KDmvs+4oV0XD05YLzfDMe9ISBgNjtFxP4PAEv5DqyeghO1/TwDqs9ca5/E6fuO95IcAcWqR6cCX9TnqLZA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-2.2.0.tgz", + "integrity": "sha512-U+vpKdsQDWuX3fPTCkSc8XPX9dCaS+r+qEP1XhnU30yxRFo2OxHJmY2H5rO1q+v0zB5R2vobsxEFt5uPf31CGQ==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/engine-javascript": "2.1.0", - "@shikijs/engine-oniguruma": "2.1.0", - "@shikijs/types": "2.1.0", + "@shikijs/engine-javascript": "2.2.0", + "@shikijs/engine-oniguruma": "2.2.0", + "@shikijs/types": "2.2.0", "@shikijs/vscode-textmate": "^10.0.1", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.4" } }, "node_modules/@shikijs/engine-javascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-2.1.0.tgz", - "integrity": "sha512-cgIUdAliOsoaa0rJz/z+jvhrpRd+fVAoixVFEVxUq5FA+tHgBZAIfVJSgJNVRj2hs/wZ1+4hMe82eKAThVh0nQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-2.2.0.tgz", + "integrity": "sha512-96SpZ4V3UVMtpSPR5QpmU395CNrQiRPszXK62m8gKR2HMA0653ruce7omS5eX6EyAyFSYHvBWtTuspiIsHpu4A==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "2.1.0", + "@shikijs/types": "2.2.0", "@shikijs/vscode-textmate": "^10.0.1", "oniguruma-to-es": "^2.3.0" } }, "node_modules/@shikijs/engine-oniguruma": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-2.1.0.tgz", - "integrity": "sha512-Ujik33wEDqgqY2WpjRDUBECGcKPv3eGGkoXPujIXvokLaRmGky8NisSk8lHUGeSFxo/Cz5sgFej9sJmA9yeepg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-2.2.0.tgz", + "integrity": "sha512-wowCKwkvPFFMXFkiKK/a2vs5uTCc0W9+O9Xcu/oqFP6VoDFe14T8u/D+Rl4dCJJSOyeynP9mxNPJ82T5JHTNCw==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "2.1.0", + "@shikijs/types": "2.2.0", "@shikijs/vscode-textmate": "^10.0.1" } }, "node_modules/@shikijs/langs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-2.1.0.tgz", - "integrity": "sha512-Jn0gS4rPgerMDPj1ydjgFzZr5fAIoMYz4k7ZT3LJxWWBWA6lokK0pumUwVtb+MzXtlpjxOaQejLprmLbvMZyww==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-2.2.0.tgz", + "integrity": "sha512-RSWLH3bnoyG6O1kZ2msh5jOkKKp8eENwyT30n62vUtXfp5cxkF/bpWPpO+p4+GAPhL2foBWR2kOerwkKG0HXlQ==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "2.1.0" + "@shikijs/types": "2.2.0" } }, "node_modules/@shikijs/themes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-2.1.0.tgz", - "integrity": "sha512-oS2mU6+bz+8TKutsjBxBA7Z3vrQk21RCmADLpnu8cy3tZD6Rw0FKqDyXNtwX52BuIDKHxZNmRlTdG3vtcYv3NQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-2.2.0.tgz", + "integrity": "sha512-8Us9ZF2mV9kuh+4ySJ9MzrUDIpc2RIkRfKBZclkliW1z9a0PlGU2U7fCkItZZHpR5e4/ft5BzuO+GDqombC6Aw==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "2.1.0" + "@shikijs/types": "2.2.0" } }, "node_modules/@shikijs/transformers": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/transformers/-/transformers-2.1.0.tgz", - "integrity": "sha512-3sfvh6OKUVkT5wZFU1xxiq1qqNIuCwUY3yOb9ZGm19y80UZ/eoroLE2orGNzfivyTxR93GfXXZC/ghPR0/SBow==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/transformers/-/transformers-2.2.0.tgz", + "integrity": "sha512-zrj7OcSKAh3KL4Jgv45aKS6lSPXZWq61/DyXJJ5gsBMUIE5Ojmnvmseit7H8zQ/xPQOgJP+XqEzy7utScv0N9w==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/core": "2.1.0", - "@shikijs/types": "2.1.0" + "@shikijs/core": "2.2.0", + "@shikijs/types": "2.2.0" } }, "node_modules/@shikijs/twoslash": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/twoslash/-/twoslash-2.1.0.tgz", - "integrity": "sha512-tgZEk78/g1ceC/mS3xA50aIc2rArl+oiphZEdAXaoioLVNebDChhV93NzcXu4NAq4pCogfBbD5HV8qO38+fQyQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/twoslash/-/twoslash-2.2.0.tgz", + "integrity": "sha512-3yKtFjlsgLceqyz9qfGLOyvxp7aL10bEWwZNy39su2rT81sRSo8QKhSfYgb1aysnOkPHIeaIl3AfJzJTTMhJfg==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/core": "2.1.0", - "@shikijs/types": "2.1.0", + "@shikijs/core": "2.2.0", + "@shikijs/types": "2.2.0", "twoslash": "^0.2.12" } }, "node_modules/@shikijs/types": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-2.1.0.tgz", - "integrity": "sha512-OFOdHA6VEVbiQvepJ8yqicC6VmBrKxFFhM2EsHHrZESqLVAXOSeRDiuSYV185lIgp15TVic5vYBYNhTsk1xHLg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-2.2.0.tgz", + "integrity": "sha512-wkZZKs80NtW5Jp/7ONI1j7EdXSatX2BKMS7I01wliDa09gJKHkZyVqlEMRka/mjT5Qk9WgAyitoCKgGgbsP/9g==", "dev": true, "license": "MIT", "dependencies": { @@ -3041,9 +3011,9 @@ } }, "node_modules/@shikijs/vitepress-twoslash": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@shikijs/vitepress-twoslash/-/vitepress-twoslash-2.1.0.tgz", - "integrity": "sha512-Z3JdLGMoI/SFmiaFy/eemIMRUnsHAwBKB5f3HhX6yNrVDTFNRfMTpEzVLYkBn3qj9+96mJnJVdbotAswi9QRog==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@shikijs/vitepress-twoslash/-/vitepress-twoslash-2.2.0.tgz", + "integrity": "sha512-B9bWj6IzSY5lmvzN1DwmrU/4D4Ay6Ds9JAodVGRI8PcpT0DQ+5FpECg9B8ybyz4DWTo+4h/8IsMDrbM8TVHMQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3052,7 +3022,7 @@ "mdast-util-from-markdown": "^2.0.2", "mdast-util-gfm": "^3.0.0", "mdast-util-to-hast": "^13.2.0", - "shiki": "2.1.0", + "shiki": "2.2.0", "twoslash": "^0.2.12", "twoslash-vue": "^0.2.12", "vue": "^3.5.13" @@ -3066,9 +3036,9 @@ "license": "MIT" }, "node_modules/@tanstack/virtual-core": { - "version": "3.11.2", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.11.2.tgz", - "integrity": "sha512-vTtpNt7mKCiZ1pwU9hfKPhpdVO2sVzFQsxoVBGtOSHxlrRRzYr8iQ2TlwbAcRYCcEiZ9ECAM8kBzH0v2+VzfKw==", + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.11.3.tgz", + "integrity": "sha512-v2mrNSnMwnPJtcVqNvV0c5roGCBqeogN8jDtgtuHCphdwBasOZ17x8UV8qpHUh+u0MLfX43c0uUHKje0s+Zb0w==", "dev": true, "license": "MIT", "funding": { @@ -3077,13 +3047,13 @@ } }, "node_modules/@tanstack/vue-virtual": { - "version": "3.11.2", - "resolved": "https://registry.npmjs.org/@tanstack/vue-virtual/-/vue-virtual-3.11.2.tgz", - "integrity": "sha512-y0b1p1FTlzxcSt/ZdGWY1AZ52ddwSU69pvFRYAELUSdLLxV8QOPe9dyT/KATO43UCb3DAwiyzi96h2IoYstBOQ==", + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/@tanstack/vue-virtual/-/vue-virtual-3.11.3.tgz", + "integrity": "sha512-BVZ00i5XBucetRj2doVd32jOPtJthvZSVJvx9GL4gSQsyngliSCtzlP1Op7TFrEtmebRKT8QUQE1tRhOQzWecQ==", "dev": true, "license": "MIT", "dependencies": { - "@tanstack/virtual-core": "3.11.2" + "@tanstack/virtual-core": "3.11.3" }, "funding": { "type": "github", @@ -3630,17 +3600,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.21.0.tgz", - "integrity": "sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.22.0.tgz", + "integrity": "sha512-4Uta6REnz/xEJMvwf72wdUnC3rr4jAQf5jnTkeRQ9b6soxLxhDEbS/pfMPoJLDfFPNVRdryqWUIV/2GZzDJFZw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.21.0", - "@typescript-eslint/type-utils": "8.21.0", - "@typescript-eslint/utils": "8.21.0", - "@typescript-eslint/visitor-keys": "8.21.0", + "@typescript-eslint/scope-manager": "8.22.0", + "@typescript-eslint/type-utils": "8.22.0", + "@typescript-eslint/utils": "8.22.0", + "@typescript-eslint/visitor-keys": "8.22.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -3660,16 +3630,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.21.0.tgz", - "integrity": "sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.22.0.tgz", + "integrity": "sha512-MqtmbdNEdoNxTPzpWiWnqNac54h8JDAmkWtJExBVVnSrSmi9z+sZUt0LfKqk9rjqmKOIeRhO4fHHJ1nQIjduIQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.21.0", - "@typescript-eslint/types": "8.21.0", - "@typescript-eslint/typescript-estree": "8.21.0", - "@typescript-eslint/visitor-keys": "8.21.0", + "@typescript-eslint/scope-manager": "8.22.0", + "@typescript-eslint/types": "8.22.0", + "@typescript-eslint/typescript-estree": "8.22.0", + "@typescript-eslint/visitor-keys": "8.22.0", "debug": "^4.3.4" }, "engines": { @@ -3685,14 +3655,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.21.0.tgz", - "integrity": "sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.22.0.tgz", + "integrity": "sha512-/lwVV0UYgkj7wPSw0o8URy6YI64QmcOdwHuGuxWIYznO6d45ER0wXUbksr9pYdViAofpUCNJx/tAzNukgvaaiQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.21.0", - "@typescript-eslint/visitor-keys": "8.21.0" + "@typescript-eslint/types": "8.22.0", + "@typescript-eslint/visitor-keys": "8.22.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3703,14 +3673,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.21.0.tgz", - "integrity": "sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.22.0.tgz", + "integrity": "sha512-NzE3aB62fDEaGjaAYZE4LH7I1MUwHooQ98Byq0G0y3kkibPJQIXVUspzlFOmOfHhiDLwKzMlWxaNv+/qcZurJA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.21.0", - "@typescript-eslint/utils": "8.21.0", + "@typescript-eslint/typescript-estree": "8.22.0", + "@typescript-eslint/utils": "8.22.0", "debug": "^4.3.4", "ts-api-utils": "^2.0.0" }, @@ -3727,9 +3697,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.21.0.tgz", - "integrity": "sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.22.0.tgz", + "integrity": "sha512-0S4M4baNzp612zwpD4YOieP3VowOARgK2EkN/GBn95hpyF8E2fbMT55sRHWBq+Huaqk3b3XK+rxxlM8sPgGM6A==", "dev": true, "license": "MIT", "engines": { @@ -3741,14 +3711,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.21.0.tgz", - "integrity": "sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.22.0.tgz", + "integrity": "sha512-SJX99NAS2ugGOzpyhMza/tX+zDwjvwAtQFLsBo3GQxiGcvaKlqGBkmZ+Y1IdiSi9h4Q0Lr5ey+Cp9CGWNY/F/w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.21.0", - "@typescript-eslint/visitor-keys": "8.21.0", + "@typescript-eslint/types": "8.22.0", + "@typescript-eslint/visitor-keys": "8.22.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -3768,16 +3738,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.21.0.tgz", - "integrity": "sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.22.0.tgz", + "integrity": "sha512-T8oc1MbF8L+Bk2msAvCUzjxVB2Z2f+vXYfcucE2wOmYs7ZUwco5Ep0fYZw8quNwOiw9K8GYVL+Kgc2pETNTLOg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.21.0", - "@typescript-eslint/types": "8.21.0", - "@typescript-eslint/typescript-estree": "8.21.0" + "@typescript-eslint/scope-manager": "8.22.0", + "@typescript-eslint/types": "8.22.0", + "@typescript-eslint/typescript-estree": "8.22.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3792,13 +3762,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.21.0.tgz", - "integrity": "sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.22.0.tgz", + "integrity": "sha512-AWpYAXnUgvLNabGTy3uBylkgZoosva/miNd1I8Bz3SjotmQPbVqhO4Cczo8AsZ44XVErEBPr/CRSgaj8sG7g0w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/types": "8.22.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -4465,13 +4435,16 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -5109,9 +5082,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001695", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz", - "integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==", + "version": "1.0.30001696", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001696.tgz", + "integrity": "sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==", "dev": true, "funding": [ { @@ -5388,6 +5361,16 @@ "node": ">=12" } }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/cliui/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -5449,6 +5432,19 @@ "node": ">=8" } }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -6620,9 +6616,9 @@ "license": "MIT" }, "node_modules/dompurify": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz", - "integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.4.tgz", + "integrity": "sha512-ysFSFEDVduQpyhzAob/kkuJjf5zWkZD8/A9ywSp1byueyuCfHamrCBa14/Oc2iiB0e51B+NpxSl5gmzn+Ms/mg==", "dev": true, "license": "(MPL-2.0 OR Apache-2.0)", "optionalDependencies": { @@ -6652,9 +6648,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.87", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.87.tgz", - "integrity": "sha512-mPFwmEWmRivw2F8x3w3l2m6htAUN97Gy0kwpO++2m9iT1Gt8RCFVUfv9U/sIbHJ6rY4P6/ooqFL/eL7ock+pPg==", + "version": "1.5.90", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.90.tgz", + "integrity": "sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==", "dev": true, "license": "ISC" }, @@ -6911,9 +6907,9 @@ } }, "node_modules/eslint": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", - "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", + "version": "9.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.19.0.tgz", + "integrity": "sha512-ug92j0LepKlbbEv6hD911THhoRHmbdXt2gX+VDABAW/Ir7D3nqKdv5Pf5vtlyY6HQMTEP2skXY43ueqTCWssEA==", "dev": true, "license": "MIT", "dependencies": { @@ -6922,7 +6918,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.10.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.18.0", + "@eslint/js": "9.19.0", "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -7460,9 +7456,9 @@ } }, "node_modules/fastq": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", - "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", + "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", "dev": true, "license": "ISC", "dependencies": { @@ -9097,9 +9093,9 @@ "license": "MIT" }, "node_modules/lint-staged": { - "version": "15.4.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.4.2.tgz", - "integrity": "sha512-gCqzB/Li281uZJgReNci+oXXqUEdrFAQAzTE/LwoxxiEuP41vozNe4BATS+4ehdqkWn+Z6bGc3EDcBja3npBVw==", + "version": "15.4.3", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.4.3.tgz", + "integrity": "sha512-FoH1vOeouNh1pw+90S+cnuoFwRfUD9ijY2GKy5h7HS3OR7JVir2N2xrsa0+Twc1B7cW72L+88geG5cW4wIhn7g==", "dev": true, "license": "MIT", "dependencies": { @@ -9152,35 +9148,6 @@ "node": ">=18.0.0" } }, - "node_modules/listr2/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/listr2/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/listr2/node_modules/wrap-ansi": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", @@ -9379,19 +9346,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-update/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/log-update/node_modules/is-fullwidth-code-point": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", @@ -9425,22 +9379,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/log-update/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", @@ -10968,6 +10906,16 @@ "node": ">=18" } }, + "node_modules/nyc/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -11131,6 +11079,19 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -11386,9 +11347,9 @@ "license": "BlueOak-1.0.0" }, "node_modules/package-manager-detector": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.8.tgz", - "integrity": "sha512-ts9KSdroZisdvKMWVAVCXiKqnqNfXz4+IbrBG8/BWx/TR5le+jfenvoBuIZ6UWM9nz47W7AbD9qYfAwfWMIwzA==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.9.tgz", + "integrity": "sha512-+vYvA/Y31l8Zk8dwxHhL3JfTuHPm6tlxM2A3GeQyl7ovYnSp1+mzAxClxaOr0qO1TtPxbQxetI7v5XqKLJZk7Q==", "dev": true, "license": "MIT" }, @@ -12222,14 +12183,6 @@ ], "license": "MIT" }, - "node_modules/queue-tick": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", - "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", - "dev": true, - "license": "MIT", - "peer": true - }, "node_modules/quick-format-unescaped": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", @@ -12788,9 +12741,9 @@ "license": "Unlicense" }, "node_modules/rollup": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.31.0.tgz", - "integrity": "sha512-9cCE8P4rZLx9+PjoyqHLs31V9a9Vpvfo4qNcs6JCiGWYhw2gijSetFbH6SSy1whnkgcefnUwr8sad7tgqsGvnw==", + "version": "4.32.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.32.1.tgz", + "integrity": "sha512-z+aeEsOeEa3mEbS1Tjl6sAZ8NE3+AalQz1RJGj81M+fizusbdDMoEJwdJNHfaB40Scr4qNu+welOfes7maKonA==", "dev": true, "license": "MIT", "dependencies": { @@ -12804,25 +12757,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.31.0", - "@rollup/rollup-android-arm64": "4.31.0", - "@rollup/rollup-darwin-arm64": "4.31.0", - "@rollup/rollup-darwin-x64": "4.31.0", - "@rollup/rollup-freebsd-arm64": "4.31.0", - "@rollup/rollup-freebsd-x64": "4.31.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.31.0", - "@rollup/rollup-linux-arm-musleabihf": "4.31.0", - "@rollup/rollup-linux-arm64-gnu": "4.31.0", - "@rollup/rollup-linux-arm64-musl": "4.31.0", - "@rollup/rollup-linux-loongarch64-gnu": "4.31.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.31.0", - "@rollup/rollup-linux-riscv64-gnu": "4.31.0", - "@rollup/rollup-linux-s390x-gnu": "4.31.0", - "@rollup/rollup-linux-x64-gnu": "4.31.0", - "@rollup/rollup-linux-x64-musl": "4.31.0", - "@rollup/rollup-win32-arm64-msvc": "4.31.0", - "@rollup/rollup-win32-ia32-msvc": "4.31.0", - "@rollup/rollup-win32-x64-msvc": "4.31.0", + "@rollup/rollup-android-arm-eabi": "4.32.1", + "@rollup/rollup-android-arm64": "4.32.1", + "@rollup/rollup-darwin-arm64": "4.32.1", + "@rollup/rollup-darwin-x64": "4.32.1", + "@rollup/rollup-freebsd-arm64": "4.32.1", + "@rollup/rollup-freebsd-x64": "4.32.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.32.1", + "@rollup/rollup-linux-arm-musleabihf": "4.32.1", + "@rollup/rollup-linux-arm64-gnu": "4.32.1", + "@rollup/rollup-linux-arm64-musl": "4.32.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.32.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.32.1", + "@rollup/rollup-linux-riscv64-gnu": "4.32.1", + "@rollup/rollup-linux-s390x-gnu": "4.32.1", + "@rollup/rollup-linux-x64-gnu": "4.32.1", + "@rollup/rollup-linux-x64-musl": "4.32.1", + "@rollup/rollup-win32-arm64-msvc": "4.32.1", + "@rollup/rollup-win32-ia32-msvc": "4.32.1", + "@rollup/rollup-win32-x64-msvc": "4.32.1", "fsevents": "~2.3.2" } }, @@ -12992,9 +12945,9 @@ "peer": true }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-DrfFnPzblFmNrIZzg5RzHegbiRWg7KMR7btwi2yjHwx06zsUbO5g613sVwEV7FTwmzJu+Io0lJe2GJ3LxqpvBQ==", "dev": true, "license": "ISC", "bin": { @@ -13122,18 +13075,18 @@ } }, "node_modules/shiki": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-2.1.0.tgz", - "integrity": "sha512-yvKPdNGLXZv7WC4bl7JBbU3CEcUxnBanvMez8MG3gZXKpClGL4bHqFyLhTx+2zUvbjClUANs/S22HXb7aeOgmA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-2.2.0.tgz", + "integrity": "sha512-3uoZBmc+zpd2JOEeTvKP/vK5UVDDe8YiigkT9flq+MV5Z1MKFiUXfbLIvHfqcJ+V90StDiP1ckN97z1WlhC6cQ==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/core": "2.1.0", - "@shikijs/engine-javascript": "2.1.0", - "@shikijs/engine-oniguruma": "2.1.0", - "@shikijs/langs": "2.1.0", - "@shikijs/themes": "2.1.0", - "@shikijs/types": "2.1.0", + "@shikijs/core": "2.2.0", + "@shikijs/engine-javascript": "2.2.0", + "@shikijs/engine-oniguruma": "2.2.0", + "@shikijs/langs": "2.2.0", + "@shikijs/themes": "2.2.0", + "@shikijs/types": "2.2.0", "@shikijs/vscode-textmate": "^10.0.1", "@types/hast": "^3.0.4" } @@ -13519,15 +13472,14 @@ "peer": true }, "node_modules/streamx": { - "version": "2.21.1", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz", - "integrity": "sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==", + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", + "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", "dev": true, "license": "MIT", "peer": true, "dependencies": { "fast-fifo": "^1.3.2", - "queue-tick": "^1.0.1", "text-decoder": "^1.1.0" }, "optionalDependencies": { @@ -13578,6 +13530,16 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/string-width-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -13595,33 +13557,17 @@ "node": ">=8" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "node": ">=8" } }, "node_modules/stringify-entities": { @@ -13640,16 +13586,19 @@ } }, "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/strip-ansi-cjs": { @@ -13666,6 +13615,16 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -14364,15 +14323,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.21.0.tgz", - "integrity": "sha512-txEKYY4XMKwPXxNkN8+AxAdX6iIJAPiJbHE/FpQccs/sxw8Lf26kqwC3cn0xkHlW8kEbLhkhCsjWuMveaY9Rxw==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.22.0.tgz", + "integrity": "sha512-Y2rj210FW1Wb6TWXzQc5+P+EWI9/zdS57hLEc0gnyuvdzWo8+Y8brKlbj0muejonhMI/xAZCnZZwjbIfv1CkOw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.21.0", - "@typescript-eslint/parser": "8.21.0", - "@typescript-eslint/utils": "8.21.0" + "@typescript-eslint/eslint-plugin": "8.22.0", + "@typescript-eslint/parser": "8.22.0", + "@typescript-eslint/utils": "8.22.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -15452,9 +15411,9 @@ } }, "node_modules/vscode-json-languageservice": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-5.4.2.tgz", - "integrity": "sha512-2qujUseKRbLEwLXvEOFAxaz3y1ssdNCXXi95LRdG8AFchJHSnmI2qCg9ixoYxbJtSehIrXOmkhV87Y9lIivOgQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-5.4.3.tgz", + "integrity": "sha512-NVSEQDloP9NYccuqKg4eI46kutZpwucBY4csBB6FCxbM7AZVoBt0oxTItPVA+ZwhnG1bg/fmiBRAwcGJyNQoPA==", "dev": true, "license": "MIT", "dependencies": { @@ -15831,6 +15790,16 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -15892,6 +15861,29 @@ "node": ">=8" } }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -15953,6 +15945,19 @@ "node": ">=8" } }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -16124,6 +16129,16 @@ "node": ">=8" } }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/yargs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -16156,6 +16171,19 @@ "node": ">=8" } }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/package.json b/package.json index 30da23a89..106331573 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@codemirror/search": "^6.5.8", "@codemirror/state": "^6.5.1", "@codemirror/view": "^6.36.2", - "@eslint/js": "^9.18.0", + "@eslint/js": "^9.19.0", "@inquirer/prompts": "^7.2.3", "@jridgewell/sourcemap-codec": "^1.5.0", "@mermaid-js/mermaid-cli": "^11.4.2", @@ -138,9 +138,9 @@ "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^12.1.2", "@rollup/pluginutils": "^5.1.4", - "@shikijs/vitepress-twoslash": "^2.0.3", + "@shikijs/vitepress-twoslash": "^2.1.0", "@types/mocha": "^10.0.10", - "@types/node": "^18.19.71", + "@types/node": "^18.19.74", "@types/semver": "^7.5.8", "@types/yargs-parser": "^21.0.3", "@vue/language-server": "^2.2.0", @@ -156,7 +156,7 @@ "date-time": "^4.0.0", "es5-shim": "^4.6.7", "es6-shim": "^0.35.8", - "eslint": "^9.18.0", + "eslint": "^9.19.0", "eslint-config-prettier": "^10.0.1", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-unicorn": "^56.0.1", @@ -168,7 +168,7 @@ "globals": "^15.14.0", "husky": "^9.1.7", "is-reference": "^3.0.3", - "lint-staged": "^15.4.1", + "lint-staged": "^15.4.3", "locate-character": "^3.0.0", "magic-string": "^0.30.17", "mocha": "^11.1.0", @@ -182,7 +182,7 @@ "pretty-bytes": "^6.1.1", "pretty-ms": "^9.2.0", "requirejs": "^2.3.7", - "rollup": "^4.31.0", + "rollup": "^4.32.0", "rollup-plugin-license": "^3.5.3", "rollup-plugin-string": "^3.0.0", "semver": "^7.6.3", @@ -194,9 +194,9 @@ "terser": "^5.37.0", "tslib": "^2.8.1", "typescript": "^5.7.3", - "typescript-eslint": "^8.21.0", - "vite": "^6.0.10", - "vitepress": "^1.6.1", + "typescript-eslint": "^8.22.0", + "vite": "^6.0.11", + "vitepress": "^1.6.3", "vue": "^3.5.13", "vue-tsc": "^2.2.0", "wasm-pack": "^0.13.1", diff --git a/renovate.json b/renovate.json index 12666f7ee..8285cf79f 100644 --- a/renovate.json +++ b/renovate.json @@ -26,7 +26,7 @@ "npm", "fsevents", "core-js", - "unicode-width" + "getrandom" ], "enabled": false }, diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3eeee2a98..d80af7ca5 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" dependencies = [ "allocator-api2", ] @@ -921,9 +921,9 @@ checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "ryu-js" @@ -986,9 +986,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -1599,9 +1599,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-segmentation" diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index cbe61fc13..33130064e 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" [dependencies] anyhow = "1.0.95" -swc_atoms = "3.0.3" +swc_atoms = "3.0.4" swc_compiler_base = "10.0.0" -swc_common = { version = "5.0.0", features = ["ahash", "parking_lot"] } -swc_ecma_ast = "5.0.3" +swc_common = { version = "5.0.1", features = ["ahash", "parking_lot"] } +swc_ecma_ast = "5.1.0" swc_ecma_parser = "7.0.1" parking_lot = "0.12.3" From caeffb3f9e0869449a74089ccadd42b6eef7efba Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Sat, 1 Feb 2025 14:03:40 +0800 Subject: [PATCH 08/21] Return UnknownValue if getLiteralValueAtPath is called recursively within logical expressions (#5819) * return UnknownValue if getLiteralValueAtPath is called recursively within logical expressions * tweak test --- src/ast/nodes/LogicalExpression.ts | 1 + .../samples/logical-expressions-literal-value/_config.js | 4 ++++ .../samples/logical-expressions-literal-value/main.js | 9 +++++++++ 3 files changed, 14 insertions(+) create mode 100644 test/function/samples/logical-expressions-literal-value/_config.js create mode 100644 test/function/samples/logical-expressions-literal-value/main.js diff --git a/src/ast/nodes/LogicalExpression.ts b/src/ast/nodes/LogicalExpression.ts index 378fa4ab4..999146cd4 100644 --- a/src/ast/nodes/LogicalExpression.ts +++ b/src/ast/nodes/LogicalExpression.ts @@ -103,6 +103,7 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable recursionTracker: PathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { + if (origin === this) return UnknownValue; const usedBranch = this.getUsedBranch(); if (usedBranch) { this.expressionsToBeDeoptimized.push(origin); diff --git a/test/function/samples/logical-expressions-literal-value/_config.js b/test/function/samples/logical-expressions-literal-value/_config.js new file mode 100644 index 000000000..32b911036 --- /dev/null +++ b/test/function/samples/logical-expressions-literal-value/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: 'keep logical expressions', + context: { unknownGlobal: 1 } +}); diff --git a/test/function/samples/logical-expressions-literal-value/main.js b/test/function/samples/logical-expressions-literal-value/main.js new file mode 100644 index 000000000..0bc3ca4a6 --- /dev/null +++ b/test/function/samples/logical-expressions-literal-value/main.js @@ -0,0 +1,9 @@ +var MyEnum = + (unknownGlobal, + (MyEnum2 => { + MyEnum2['foo'] = 'FOO'; + MyEnum2['bar'] = 'BAR'; + return MyEnum2; + })(MyEnum || {})); + +assert.strictEqual(MyEnum.foo, 'FOO'); From 93c9c0e1b6dd882994d4a5f05fc72e21acc7f89a Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Sat, 1 Feb 2025 14:06:36 +0800 Subject: [PATCH 09/21] support for changing the attributes key for dynamic imports (#5818) --- src/Chunk.ts | 32 +++++++++++++------ src/ExternalChunk.ts | 2 +- src/ast/nodes/ImportExpression.ts | 5 +-- src/utils/renderHelpers.ts | 3 +- .../keep-dynamic-attributes-assert/_config.js | 31 ++++++++++++++++++ .../_expected/amd.js | 0 .../_expected/cjs.js | 0 .../_expected/es.js | 0 .../_expected/iife.js | 0 .../_expected/system.js | 0 .../_expected/umd.js | 0 .../main.js | 4 +-- .../_config.js | 0 .../_expected/amd.js | 0 .../_expected/cjs.js | 4 +-- .../_expected/es.js | 4 +-- .../_expected/iife.js | 0 .../_expected/system.js | 0 .../_expected/umd.js | 0 .../keep-dynamic-attributes-default/main.js | 6 ++++ .../_config.js | 5 ++- .../_expected/amd.js | 27 ++++++++++++++++ .../_expected/cjs.js | 8 +++++ .../_expected/es.js | 6 ++++ .../_expected/iife.js | 11 +++++++ .../_expected/system.js | 15 +++++++++ .../_expected/umd.js | 13 ++++++++ .../keep-dynamic-attributes-with/main.js | 6 ++++ .../keep-dynamic-attributes/main.js | 6 ---- 29 files changed, 161 insertions(+), 27 deletions(-) create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-assert/_config.js rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/_expected/amd.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/_expected/cjs.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/_expected/es.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/_expected/iife.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/_expected/system.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/_expected/umd.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-assert}/main.js (63%) rename test/form/samples/import-attributes/{keep-dynamic-assertions => keep-dynamic-attributes-default}/_config.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-default}/_expected/amd.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-default}/_expected/cjs.js (66%) rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-default}/_expected/es.js (65%) rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-default}/_expected/iife.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-default}/_expected/system.js (100%) rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-default}/_expected/umd.js (100%) create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-default/main.js rename test/form/samples/import-attributes/{keep-dynamic-attributes => keep-dynamic-attributes-with}/_config.js (83%) create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/amd.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/cjs.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/es.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/iife.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/system.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/umd.js create mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes-with/main.js delete mode 100644 test/form/samples/import-attributes/keep-dynamic-attributes/main.js diff --git a/src/Chunk.ts b/src/Chunk.ts index 794e30c8e..46e35bd25 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -10,7 +10,7 @@ import LocalVariable from './ast/variables/LocalVariable'; import NamespaceVariable from './ast/variables/NamespaceVariable'; import SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable'; import type Variable from './ast/variables/Variable'; -import ExternalChunk from './ExternalChunk'; +import ExternalChunk, { formatAttributes } from './ExternalChunk'; import ExternalModule from './ExternalModule'; import finalisers from './finalisers/index'; import Module from './Module'; @@ -27,6 +27,7 @@ import type { RenderedModule } from './rollup/types'; import { createAddons } from './utils/addons'; +import { EMPTY_OBJECT } from './utils/blank'; import { deconflictChunk, type DependenciesToBeDeconflicted } from './utils/deconflictChunk'; import { escapeId } from './utils/escapeId'; import { assignExportsToMangledNames, assignExportsToNames } from './utils/exportNames'; @@ -56,6 +57,7 @@ import { } from './utils/logs'; import type { OutputBundleWithPlaceholders } from './utils/outputBundle'; import { FILE_PLACEHOLDER } from './utils/outputBundle'; +import { getAttributesFromImportExpression } from './utils/parseImportAttributes'; import { basename, extname, isAbsolute, normalize, resolve } from './utils/path'; import type { PluginDriver } from './utils/PluginDriver'; import { getAliasName, getImportPath } from './utils/relativeId'; @@ -958,18 +960,25 @@ export default class Chunk { private getDynamicImportStringAndAttributes( resolution: ExternalModule | string | null, - fileName: string + fileName: string, + node: ImportExpression ): [importPath: string, attributes: string | null | true] { if (resolution instanceof ExternalModule) { const chunk = this.externalChunkByModule.get(resolution)!; return [`'${chunk.getImportPath(fileName)}'`, chunk.getImportAttributes(this.snippets)]; } - return [ - resolution || '', - (['es', 'cjs'].includes(this.outputOptions.format) && - this.outputOptions.externalImportAttributes) || - null - ]; + let attributes: string | true | null = null; + if ( + ['es', 'cjs'].includes(this.outputOptions.format) && + this.outputOptions.externalImportAttributes + ) { + const attributesFromImportAttributes = getAttributesFromImportExpression(node); + attributes = + attributesFromImportAttributes === EMPTY_OBJECT + ? true + : formatAttributes(attributesFromImportAttributes, this.snippets); + } + return [resolution || '', attributes]; } private getFallbackChunkName(): string { @@ -1216,7 +1225,8 @@ export default class Chunk { compact, format, freeze, - generatedCode: { symbols } + generatedCode: { symbols }, + importAttributesKey } = outputOptions; const { _, cnst, n } = snippets; this.setDynamicImportResolutions(fileName); @@ -1235,6 +1245,7 @@ export default class Chunk { exportNamesByVariable, format, freeze, + importAttributesKey, indent, pluginDriver, snippets, @@ -1326,7 +1337,8 @@ export default class Chunk { const { node, resolution } = resolvedDynamicImport; const [resolutionString, attributes] = this.getDynamicImportStringAndAttributes( resolution, - fileName + fileName, + node ); node.setExternalResolution( 'external', diff --git a/src/ExternalChunk.ts b/src/ExternalChunk.ts index 5955d704f..24583fdff 100644 --- a/src/ExternalChunk.ts +++ b/src/ExternalChunk.ts @@ -56,7 +56,7 @@ export default class ExternalChunk { } } -function formatAttributes( +export function formatAttributes( attributes: Record | null | void | false, { getObject }: GenerateCodeSnippets ): string | null { diff --git a/src/ast/nodes/ImportExpression.ts b/src/ast/nodes/ImportExpression.ts index 785d6b679..c16ad8303 100644 --- a/src/ast/nodes/ImportExpression.ts +++ b/src/ast/nodes/ImportExpression.ts @@ -172,7 +172,8 @@ export default class ImportExpression extends NodeBase { render(code: MagicString, options: RenderOptions): void { const { - snippets: { _, getDirectReturnFunction, getObject, getPropertyAccess } + snippets: { _, getDirectReturnFunction, getObject, getPropertyAccess }, + importAttributesKey } = options; if (this.inlineNamespace) { const [left, right] = getDirectReturnFunction([], { @@ -215,7 +216,7 @@ export default class ImportExpression extends NodeBase { if (this.attributes) { code.appendLeft( this.end - 1, - `,${_}${getObject([['assert', this.attributes]], { + `,${_}${getObject([[importAttributesKey, this.attributes]], { lineBreakIndent: null })}` ); diff --git a/src/utils/renderHelpers.ts b/src/utils/renderHelpers.ts index 28613d3df..0041b43cd 100644 --- a/src/utils/renderHelpers.ts +++ b/src/utils/renderHelpers.ts @@ -1,7 +1,7 @@ import type MagicString from 'magic-string'; import type { Node, StatementNode } from '../ast/nodes/shared/Node'; import type Variable from '../ast/variables/Variable'; -import type { InternalModuleFormat } from '../rollup/types'; +import type { ImportAttributesKey, InternalModuleFormat } from '../rollup/types'; import type { GenerateCodeSnippets } from './generateCodeSnippets'; import type { PluginDriver } from './PluginDriver'; import { treeshakeNode } from './treeshakeNode'; @@ -12,6 +12,7 @@ export interface RenderOptions { format: InternalModuleFormat; freeze: boolean; indent: string; + importAttributesKey: ImportAttributesKey; pluginDriver: PluginDriver; snippets: GenerateCodeSnippets; symbols: boolean; diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_config.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_config.js new file mode 100644 index 000000000..ba397d8be --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_config.js @@ -0,0 +1,31 @@ +module.exports = defineTest({ + description: 'keep import attributes for dynamic imports with "assert" key', + expectedWarnings: ['UNRESOLVED_IMPORT'], + options: { + output: { + importAttributesKey: 'assert' + }, + external: id => { + if (id === 'unresolved') return null; + return true; + }, + plugins: [ + { + name: 'test', + resolveDynamicImport(specifier) { + if (typeof specifier === 'object') { + if (specifier.type === 'TemplateLiteral') { + return "'resolvedString'"; + } + if (specifier.type === 'BinaryExpression') { + return { id: 'resolved-id', external: true }; + } + } else if (specifier === 'external-resolved') { + return { id: 'resolved-different', external: true }; + } + return null; + } + } + ] + } +}); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/amd.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/amd.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_expected/amd.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/amd.js diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/cjs.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/cjs.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_expected/cjs.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/cjs.js diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/es.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/es.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_expected/es.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/es.js diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/iife.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/iife.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_expected/iife.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/iife.js diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/system.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/system.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_expected/system.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/system.js diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_expected/umd.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/umd.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_expected/umd.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/_expected/umd.js diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/main.js b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/main.js similarity index 63% rename from test/form/samples/import-attributes/keep-dynamic-assertions/main.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-assert/main.js index 38bfed638..95a0320bd 100644 --- a/test/form/samples/import-attributes/keep-dynamic-assertions/main.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-assert/main.js @@ -1,6 +1,6 @@ import('external', { assert: { type: 'special' } }); import(globalThis.unknown, { assert: { type: 'special' } }); -import(`external-${globalThis.unknown}`, { assert: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); import('external' + globalThis.unknown, { assert: { type: 'special' } }); -import('external-resolved', { assert: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-assertions/_config.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_config.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-assertions/_config.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_config.js diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/amd.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/amd.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_expected/amd.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/amd.js diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/cjs.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/cjs.js similarity index 66% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_expected/cjs.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/cjs.js index d1d3d3f0e..b282bbbc6 100644 --- a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/cjs.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/cjs.js @@ -1,8 +1,8 @@ 'use strict'; import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { with: { type: 'special' } }); -import('resolvedString', { with: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import('resolvedString', { assert: { type: 'special' } }); import('resolved-id', { assert: { type: 'special' } }); import('resolved-different', { assert: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/es.js similarity index 65% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/es.js index 511aa8d86..87164b787 100644 --- a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/es.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/es.js @@ -1,6 +1,6 @@ import('external', { assert: { type: 'special' } }); -import(globalThis.unknown, { with: { type: 'special' } }); -import('resolvedString', { with: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import('resolvedString', { assert: { type: 'special' } }); import('resolved-id', { assert: { type: 'special' } }); import('resolved-different', { assert: { type: 'special' } }); import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/iife.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/iife.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_expected/iife.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/iife.js diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/system.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/system.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_expected/system.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/system.js diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_expected/umd.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/umd.js similarity index 100% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_expected/umd.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-default/_expected/umd.js diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-default/main.js b/test/form/samples/import-attributes/keep-dynamic-attributes-default/main.js new file mode 100644 index 000000000..95a0320bd --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-default/main.js @@ -0,0 +1,6 @@ +import('external', { assert: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); +import('external' + globalThis.unknown, { assert: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); +import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/_config.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_config.js similarity index 83% rename from test/form/samples/import-attributes/keep-dynamic-attributes/_config.js rename to test/form/samples/import-attributes/keep-dynamic-attributes-with/_config.js index a75f18189..d17b4f3df 100644 --- a/test/form/samples/import-attributes/keep-dynamic-attributes/_config.js +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_config.js @@ -1,7 +1,10 @@ module.exports = defineTest({ - description: 'keep import attributes for dynamic imports', + description: 'keep import attributes for dynamic imports with "with" key', expectedWarnings: ['UNRESOLVED_IMPORT'], options: { + output: { + importAttributesKey: 'with' + }, external: id => { if (id === 'unresolved') return null; return true; diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/amd.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/amd.js new file mode 100644 index 000000000..e9478c8fc --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/amd.js @@ -0,0 +1,27 @@ +define(['require'], (function (require) { 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })(globalThis.unknown); + (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); })('resolvedString'); + new Promise(function (resolve, reject) { require(['resolved-id'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + new Promise(function (resolve, reject) { require(['resolved-different'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + new Promise(function (resolve, reject) { require(['unresolved'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefault(m)); }, reject); }); + +})); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/cjs.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/cjs.js new file mode 100644 index 000000000..fdd4e6ff1 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/cjs.js @@ -0,0 +1,8 @@ +'use strict'; + +import('external', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import('resolvedString', { with: { type: 'special' } }); +import('resolved-id', { with: { type: 'special' } }); +import('resolved-different', { with: { type: 'special' } }); +import('unresolved', { with: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/es.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/es.js new file mode 100644 index 000000000..eb0be1c17 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/es.js @@ -0,0 +1,6 @@ +import('external', { with: { type: 'special' } }); +import(globalThis.unknown, { with: { type: 'special' } }); +import('resolvedString', { with: { type: 'special' } }); +import('resolved-id', { with: { type: 'special' } }); +import('resolved-different', { with: { type: 'special' } }); +import('unresolved', { with: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/iife.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/iife.js new file mode 100644 index 000000000..0da800282 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/iife.js @@ -0,0 +1,11 @@ +(function () { + 'use strict'; + + import('external'); + import(globalThis.unknown); + import('resolvedString'); + import('resolved-id'); + import('resolved-different'); + import('unresolved'); + +})(); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/system.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/system.js new file mode 100644 index 000000000..44c758c29 --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/system.js @@ -0,0 +1,15 @@ +System.register([], (function (exports, module) { + 'use strict'; + return { + execute: (function () { + + module.import('external'); + module.import(globalThis.unknown); + module.import('resolvedString'); + module.import('resolved-id'); + module.import('resolved-different'); + module.import('unresolved'); + + }) + }; +})); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/umd.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/umd.js new file mode 100644 index 000000000..cd9d7642d --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/_expected/umd.js @@ -0,0 +1,13 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +})((function () { 'use strict'; + + import('external'); + import(globalThis.unknown); + import('resolvedString'); + import('resolved-id'); + import('resolved-different'); + import('unresolved'); + +})); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes-with/main.js b/test/form/samples/import-attributes/keep-dynamic-attributes-with/main.js new file mode 100644 index 000000000..95a0320bd --- /dev/null +++ b/test/form/samples/import-attributes/keep-dynamic-attributes-with/main.js @@ -0,0 +1,6 @@ +import('external', { assert: { type: 'special' } }); +import(globalThis.unknown, { assert: { type: 'special' } }); +import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); +import('external' + globalThis.unknown, { assert: { type: 'special' } }); +import('external-resolved', { with: { type: 'special' } }); +import('unresolved', { assert: { type: 'special' } }); diff --git a/test/form/samples/import-attributes/keep-dynamic-attributes/main.js b/test/form/samples/import-attributes/keep-dynamic-attributes/main.js deleted file mode 100644 index 025b60451..000000000 --- a/test/form/samples/import-attributes/keep-dynamic-attributes/main.js +++ /dev/null @@ -1,6 +0,0 @@ -import('external', { with: { type: 'special' } }); -import(globalThis.unknown, { with: { type: 'special' } }); -import(`external-${globalThis.unknown}`, { with: { type: 'special' } }); -import('external' + globalThis.unknown, { with: { type: 'special' } }); -import('external-resolved', { with: { type: 'special' } }); -import('unresolved', { with: { type: 'special' } }); From 74a251fd46fd299b8de20d94a6565a024852d387 Mon Sep 17 00:00:00 2001 From: Johannes Kingma <50140049+kingma-sbw@users.noreply.github.com> Date: Sat, 1 Feb 2025 07:21:27 +0100 Subject: [PATCH 10/21] return null (#5820) Required to add default chunking --- docs/configuration-options/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuration-options/index.md b/docs/configuration-options/index.md index f05e81643..539b7f6c9 100755 --- a/docs/configuration-options/index.md +++ b/docs/configuration-options/index.md @@ -1465,6 +1465,8 @@ function manualChunks(id) { if (id.includes('node_modules')) { return 'vendor'; } + + return null; } ``` From 494483e8df7b5d04796b30e37f54d7e96fa91a97 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 1 Feb 2025 07:50:41 +0100 Subject: [PATCH 11/21] 4.33.0 --- CHANGELOG.md | 22 ++++++++++++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80bdacb70..14cab86cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # rollup changelog +## 4.33.0 + +_2025-02-01_ + +### Features + +- Correctly detect literal value of more negated expressions (#5812) + +### Bug Fixes + +- Use the correct with/assert attribute key in dynamic imports (#5818) +- Fix an issue where logical expressions were considered to have the wrong value (#5819) + +### Pull Requests + +- [#5812](https://github.com/rollup/rollup/pull/5812): feat: optimize the literal value of unary expressions (@TrickyPi) +- [#5816](https://github.com/rollup/rollup/pull/5816): fix(deps): update swc monorepo (major) (@renovate[bot], @lukastaegert) +- [#5817](https://github.com/rollup/rollup/pull/5817): fix(deps): lock file maintenance minor/patch updates (@renovate[bot], @lukastaegert) +- [#5818](https://github.com/rollup/rollup/pull/5818): support for changing the attributes key for dynamic imports (@TrickyPi) +- [#5819](https://github.com/rollup/rollup/pull/5819): Return UnknownValue if getLiteralValueAtPath is called recursively within logical expressions (@TrickyPi) +- [#5820](https://github.com/rollup/rollup/pull/5820): return null (@kingma-sbw) + ## 4.32.1 _2025-01-28_ diff --git a/browser/package.json b/browser/package.json index 04401c5ce..a64a072c1 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.32.1", + "version": "4.33.0", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 0beff4b89..c5d187e10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.32.1", + "version": "4.33.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.32.1", + "version": "4.33.0", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index 106331573..eea6458ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.32.1", + "version": "4.33.0", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From d7062ef6ab36e8741fc698c8c7219f48e5ef8c4b Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 1 Feb 2025 09:17:18 +0100 Subject: [PATCH 12/21] Reapply object tree-shaking (#5737) * Reapply object tree-shaking This reverts commit 10bc15096ffe3c155fe5e81f1e474f208adbc667. * Only rely on stable property paths when deoptimizing member expressions Literal values may be deoptimized later. At that point, we would otherwise need to deoptimize again. For hasEffects, we can use dynamic literal values as those checks are repeatedly executed. Resolves #5735 * Do not mark unused rest parameters as undefined resolves #5739 * add an test for issue 5734 * update linting * reduce the count of includePath for ClassBody * Split includePath into include, includeNode, includePath - include is for re-including on every pass - includePath is only for including specific non-empty paths once - includeNode is for triggering logic on first include, like includePath. * update test * Test if using a shared prototype function can improve performance * Use trivial includeNode method where possible * Remove unnecessary applyDeoptimizations calls * Move applyDeoptimizations check from include to includeNode This should avoid an unnecessary check. * Only deoptimize body for ArrowFunctionExpression For block scopes, this is not needed. * Handle accessed outside variables on includeNode rather than applyDeoptimizations * If a node has not special logic on include or deoptimize, replace check * See if we can reduce the number of tree-shaking passes The idea is to again eagerly include variable inits, but not in a nested call but in a loop at the end of the regular pass. * Ensure that deoptimizing a MemberExpression does not crash * Ensure the "in" operators includes is second operand * When including all children of a CallExpression, also include all paths * 4.30.0-0 * Make sure to use builtins when building for Node Solves an issue when linking with pnpm. * Revert making objects truthy for now This solves an issue with TypeScript enums. A proper solution should be to improve tracking of uninitialized vars. * 4.30.0-1 * Include variable inits per module instead of per pass This should reduce peak memory consumption. * Skip checking for effects in functions with side effects * Do not cache known paramter value as frozen Adding the fallback on each call is not more expensive. * Limit number of tracked deoptimized fields for parameters * 4.31.0-0 * Remove unnecessary array conversion * Only track top-level inclusions for parameters This is a massive performance improvement especially in scenarios with recursive calls where different properties of a function argument are passed to the same function. * Only track arguments in the ArgumentsVariable if referenced This should save some memory which is rarely needed. * 4.33.0-0 --------- Co-authored-by: XiaoPi <530257315@qq.com> --- rollup.config.ts | 2 +- scripts/ast-types.js | 6 +- scripts/generate-buffer-parsers.js | 1 + scripts/prepare-release.js | 6 +- src/Graph.ts | 12 +- src/Module.ts | 59 +- src/ast/ExecutionContext.ts | 10 +- src/ast/bufferParsers.ts | 12 +- src/ast/nodes/ArrayExpression.ts | 24 +- src/ast/nodes/ArrayPattern.ts | 80 +- src/ast/nodes/ArrowFunctionExpression.ts | 28 +- src/ast/nodes/AssignmentExpression.ts | 23 +- src/ast/nodes/AssignmentPattern.ts | 56 +- src/ast/nodes/AwaitExpression.ts | 35 +- src/ast/nodes/BinaryExpression.ts | 20 +- src/ast/nodes/BlockStatement.ts | 12 +- src/ast/nodes/BreakStatement.ts | 7 +- src/ast/nodes/CallExpression.ts | 43 +- src/ast/nodes/CatchClause.ts | 12 +- src/ast/nodes/ChainExpression.ts | 23 +- src/ast/nodes/ClassBody.ts | 18 +- src/ast/nodes/ClassDeclaration.ts | 2 +- src/ast/nodes/ConditionalExpression.ts | 44 +- src/ast/nodes/ContinueStatement.ts | 7 +- src/ast/nodes/DebuggerStatement.ts | 4 +- src/ast/nodes/Decorator.ts | 4 +- src/ast/nodes/DoWhileStatement.ts | 7 +- src/ast/nodes/EmptyStatement.ts | 4 +- src/ast/nodes/ExportAllDeclaration.ts | 6 +- src/ast/nodes/ExportDefaultDeclaration.ts | 24 +- src/ast/nodes/ExportNamedDeclaration.ts | 6 +- src/ast/nodes/ExportSpecifier.ts | 7 +- src/ast/nodes/ExpressionStatement.ts | 12 +- src/ast/nodes/ForInStatement.ts | 19 +- src/ast/nodes/ForOfStatement.ts | 17 +- src/ast/nodes/ForStatement.ts | 13 +- src/ast/nodes/Identifier.ts | 128 +- src/ast/nodes/IfStatement.ts | 7 +- src/ast/nodes/ImportDeclaration.ts | 6 +- src/ast/nodes/ImportDefaultSpecifier.ts | 7 +- src/ast/nodes/ImportExpression.ts | 49 +- src/ast/nodes/ImportNamespaceSpecifier.ts | 7 +- src/ast/nodes/ImportSpecifier.ts | 7 +- src/ast/nodes/JSXAttribute.ts | 4 +- src/ast/nodes/JSXElement.ts | 8 + src/ast/nodes/JSXEmptyExpression.ts | 4 +- src/ast/nodes/JSXExpressionContainer.ts | 8 + src/ast/nodes/JSXFragment.ts | 8 + src/ast/nodes/JSXIdentifier.ts | 26 + src/ast/nodes/JSXMemberExpression.ts | 13 + src/ast/nodes/JSXNamespacedName.ts | 4 +- src/ast/nodes/JSXOpeningElement.ts | 4 +- src/ast/nodes/JSXOpeningFragment.ts | 45 +- src/ast/nodes/JSXText.ts | 4 +- src/ast/nodes/LabeledStatement.ts | 21 +- src/ast/nodes/Literal.ts | 4 +- src/ast/nodes/LogicalExpression.ts | 102 +- src/ast/nodes/MemberExpression.ts | 194 +- src/ast/nodes/MetaProperty.ts | 26 +- src/ast/nodes/MethodDefinition.ts | 2 +- src/ast/nodes/NewExpression.ts | 20 +- src/ast/nodes/ObjectExpression.ts | 63 +- src/ast/nodes/ObjectPattern.ts | 81 +- src/ast/nodes/PrivateIdentifier.ts | 4 +- src/ast/nodes/Program.ts | 13 +- src/ast/nodes/Property.ts | 110 +- src/ast/nodes/PropertyDefinition.ts | 23 +- src/ast/nodes/RestElement.ts | 70 +- src/ast/nodes/ReturnStatement.ts | 17 +- src/ast/nodes/SequenceExpression.ts | 25 +- src/ast/nodes/SpreadElement.ts | 19 +- src/ast/nodes/StaticBlock.ts | 11 +- src/ast/nodes/Super.ts | 19 +- src/ast/nodes/SwitchCase.ts | 4 + src/ast/nodes/SwitchStatement.ts | 7 +- src/ast/nodes/TaggedTemplateExpression.ts | 15 +- src/ast/nodes/TemplateElement.ts | 8 +- src/ast/nodes/TemplateLiteral.ts | 13 +- src/ast/nodes/ThisExpression.ts | 23 +- src/ast/nodes/ThrowStatement.ts | 11 +- src/ast/nodes/TryStatement.ts | 11 +- src/ast/nodes/UnaryExpression.ts | 10 +- src/ast/nodes/UpdateExpression.ts | 9 +- src/ast/nodes/VariableDeclaration.ts | 21 +- src/ast/nodes/VariableDeclarator.ts | 41 +- src/ast/nodes/WhileStatement.ts | 7 +- src/ast/nodes/YieldExpression.ts | 14 +- src/ast/nodes/shared/BitFlags.ts | 4 +- src/ast/nodes/shared/CallExpressionBase.ts | 10 +- src/ast/nodes/shared/ClassNode.ts | 27 +- src/ast/nodes/shared/Expression.ts | 33 +- src/ast/nodes/shared/FunctionBase.ts | 129 +- src/ast/nodes/shared/FunctionNode.ts | 56 +- src/ast/nodes/shared/IdentifierBase.ts | 35 +- src/ast/nodes/shared/JSXClosingBase.ts | 4 +- src/ast/nodes/shared/JSXElementBase.ts | 34 +- src/ast/nodes/shared/MethodBase.ts | 24 +- src/ast/nodes/shared/MultiExpression.ts | 4 +- src/ast/nodes/shared/Node.ts | 58 +- src/ast/nodes/shared/ObjectEntity.ts | 52 +- src/ast/nodes/shared/ObjectMember.ts | 20 +- src/ast/nodes/shared/Pattern.ts | 28 +- src/ast/nodes/shared/chainElements.ts | 4 +- src/ast/nodes/shared/jsxHelpers.ts | 9 +- src/ast/scopes/BlockScope.ts | 12 +- src/ast/scopes/CatchBodyScope.ts | 13 +- src/ast/scopes/ClassBodyScope.ts | 3 +- src/ast/scopes/FunctionBodyScope.ts | 11 +- src/ast/scopes/FunctionScope.ts | 23 +- src/ast/scopes/ModuleScope.ts | 7 +- src/ast/scopes/ParameterScope.ts | 66 +- src/ast/scopes/ReturnValueScope.ts | 57 + src/ast/scopes/Scope.ts | 14 +- src/ast/scopes/TrackingScope.ts | 4 +- src/ast/utils/PathTracker.ts | 124 +- src/ast/values.ts | 8 +- src/ast/variables/ArgumentsVariable.ts | 36 +- src/ast/variables/ExportDefaultVariable.ts | 12 +- src/ast/variables/ExportShimVariable.ts | 6 +- src/ast/variables/ExternalVariable.ts | 7 +- src/ast/variables/GlobalVariable.ts | 6 +- src/ast/variables/LocalVariable.ts | 110 +- src/ast/variables/NamespaceVariable.ts | 10 +- src/ast/variables/ParameterVariable.ts | 131 +- .../variables/SyntheticNamedExportVariable.ts | 8 +- src/ast/variables/ThisVariable.ts | 4 +- src/ast/variables/Variable.ts | 6 +- .../dynamic-import-with-namespace/_config.js | 22 + .../_expected/amd/generated-module1.js | 13 + .../_expected/amd/generated-module10.js | 13 + .../_expected/amd/generated-module2.js | 13 + .../_expected/amd/generated-module3.js | 7 + .../_expected/amd/generated-module4.js | 13 + .../_expected/amd/generated-module5.js | 13 + .../_expected/amd/generated-module6.js | 7 + .../_expected/amd/generated-module7.js | 13 + .../_expected/amd/generated-module8.js | 13 + .../_expected/amd/generated-module9.js | 7 + .../_expected/amd/main.js | 87 + .../_expected/cjs/generated-module1.js | 11 + .../_expected/cjs/generated-module10.js | 11 + .../_expected/cjs/generated-module2.js | 11 + .../_expected/cjs/generated-module3.js | 5 + .../_expected/cjs/generated-module4.js | 11 + .../_expected/cjs/generated-module5.js | 11 + .../_expected/cjs/generated-module6.js | 5 + .../_expected/cjs/generated-module7.js | 11 + .../_expected/cjs/generated-module8.js | 11 + .../_expected/cjs/generated-module9.js | 5 + .../_expected/cjs/main.js | 85 + .../_expected/es/generated-module1.js | 6 + .../_expected/es/generated-module10.js | 6 + .../_expected/es/generated-module2.js | 6 + .../_expected/es/generated-module3.js | 3 + .../_expected/es/generated-module4.js | 6 + .../_expected/es/generated-module5.js | 6 + .../_expected/es/generated-module6.js | 3 + .../_expected/es/generated-module7.js | 6 + .../_expected/es/generated-module8.js | 6 + .../_expected/es/generated-module9.js | 3 + .../_expected/es/main.js | 83 + .../_expected/system/generated-module1.js | 13 + .../_expected/system/generated-module10.js | 13 + .../_expected/system/generated-module2.js | 13 + .../_expected/system/generated-module3.js | 10 + .../_expected/system/generated-module4.js | 13 + .../_expected/system/generated-module5.js | 13 + .../_expected/system/generated-module6.js | 10 + .../_expected/system/generated-module7.js | 13 + .../_expected/system/generated-module8.js | 13 + .../_expected/system/generated-module9.js | 10 + .../_expected/system/main.js | 92 + .../dynamic-import-with-namespace/main.js | 83 + .../dynamic-import-with-namespace/module.js | 4 + .../_expected/amd/generated-main2.js | 14 + .../_expected/amd/main1alias.js | 6 +- .../_expected/amd/main2alias.js | 10 +- .../_expected/cjs/generated-main2.js | 12 + .../_expected/cjs/main1alias.js | 6 +- .../_expected/cjs/main2alias.js | 10 +- .../_expected/es/generated-main2.js | 9 + .../_expected/es/main1alias.js | 4 +- .../_expected/es/main2alias.js | 8 +- .../_expected/system/generated-main2.js} | 6 +- .../_expected/system/main1alias.js | 9 +- .../_expected/system/main2alias.js | 21 +- .../_expected/amd/generated-main2.js | 14 + .../entrypoint-facade/_expected/amd/main1.js | 6 +- .../entrypoint-facade/_expected/amd/main2.js | 10 +- .../_expected/cjs/generated-main2.js | 12 + .../entrypoint-facade/_expected/cjs/main1.js | 6 +- .../entrypoint-facade/_expected/cjs/main2.js | 10 +- .../_expected/es/generated-main2.js | 9 + .../entrypoint-facade/_expected/es/main1.js | 4 +- .../entrypoint-facade/_expected/es/main2.js | 8 +- .../_expected/system/generated-main2.js | 18 + .../_expected/system/main1.js | 9 +- .../_expected/system/main2.js | 21 +- .../_expected/amd/chunk-main2-BeN-_z3e-amd.js | 14 + .../_expected/amd/entry-main1-DBBrcOFA-amd.js | 7 - .../_expected/amd/entry-main1-DMJ9vLw5-amd.js | 5 + .../_expected/amd/entry-main2-DHcdu15H-amd.js | 11 - .../_expected/amd/entry-main2-SEc5gjvu-amd.js | 7 + .../_expected/cjs/chunk-main2-DB987Lh4-cjs.js | 12 + .../_expected/cjs/entry-main1-DBCWfg7v-cjs.js | 7 - .../_expected/cjs/entry-main1-m802XraR-cjs.js | 5 + .../_expected/cjs/entry-main2-BVjYoW06-cjs.js | 9 - .../_expected/cjs/entry-main2-CDyYOEPK-cjs.js | 7 + .../_expected/es/chunk-main2-CPMnlUsH-es.js | 9 + .../_expected/es/entry-main1-DCmtsuTI-es.js | 3 + .../_expected/es/entry-main1-WTHxIjMp-es.js | 5 - .../_expected/es/entry-main2-BNtK1lo1-es.js | 7 - .../_expected/es/entry-main2-CO3mT8jT-es.js | 1 + .../system/chunk-main2-BRXsWtDg-system.js | 18 + .../system/entry-main1-Biq2O0X--system.js | 15 + .../system/entry-main1-bvYFOXPm-system.js | 16 - .../system/entry-main2-D_RLirM0-system.js | 13 + .../no-default-deoptimization/_expected.js | 2 +- .../{_expected/es.js => _expected.js} | 0 .../computed-properties/_expected/amd.js | 19 - .../computed-properties/_expected/cjs.js | 17 - .../computed-properties/_expected/iife.js | 22 - .../computed-properties/_expected/system.js | 21 - .../computed-properties/_expected/umd.js | 23 - .../destructured-known-arguments/_config.js | 3 + .../destructured-known-arguments/_expected.js | 28 + .../destructured-known-arguments/main.js | 32 + .../_expected.js | 2 +- .../_expected/amd.js | 2 +- .../_expected/cjs.js | 2 +- .../mutate-logical-expression/_expected/es.js | 2 +- .../_expected/iife.js | 2 +- .../_expected/system.js | 2 +- .../_expected/umd.js | 2 +- .../_config.js | 4 + .../_expected.js | 4 + .../ignore-property-read-side-effects/main.js | 8 + .../_config.js | 3 + .../_expected.js | 7 + .../main.js | 9 + .../remove-props-via-destructuring/_config.js | 3 + .../_expected.js | 9 + .../remove-props-via-destructuring/main.js | 9 + .../remove-unused-nested-props/_config.js | 3 + .../remove-unused-nested-props/_expected.js | 2 + .../remove-unused-nested-props/main.js | 2 + .../_config.js | 4 + .../_expected.js | 6 + .../main.js | 8 + .../remove-unused-parameter-props/_config.js | 3 + .../_expected.js | 18 + .../remove-unused-parameter-props/main.js | 22 + .../remove-unused-props/_config.js | 3 + .../remove-unused-props/_expected.js | 5 + .../remove-unused-props/main.js | 5 + .../_config.js | 3 + .../_expected.js | 3 + .../track-through-chain-expressions/main.js | 3 + .../tree-shake-jsx-namespace/_config.js | 4 + .../tree-shake-jsx-namespace/_expected.js | 7 + .../tree-shake-jsx-namespace/main.js | 6 + .../_expected.js | 10 +- .../object-tree-shaking-issue-5734/_config.js | 3 + .../_expected.js | 45586 ++++++++++++++++ .../object-tree-shaking-issue-5734/main.js | 1 + .../object-tree-shaking-issue-5734/module.js | 45586 ++++++++++++++++ .../optional-chaining-namespace/_expected.js | 2 +- .../_expected.js | 4 +- .../recursive-destructuring/_config.js | 3 + .../recursive-destructuring/_expected.js | 1 + .../samples/recursive-destructuring/main.js | 1 + .../side-effect-default-reexport/_expected.js | 6 +- .../_expected/amd.js | 4 +- .../_expected/cjs.js | 4 +- .../_expected/es.js | 4 +- .../_expected/iife.js | 4 +- .../_expected/system.js | 4 +- .../_expected/umd.js | 4 +- .../_expected.js | 2 +- .../_expected.js | 20 + .../{_expected/es.js => _expected.js} | 0 .../_expected/amd.js | 14 - .../_expected/cjs.js | 12 - .../_expected/iife.js | 15 - .../_expected/system.js | 19 - .../_expected/umd.js | 17 - .../main.js | 1 - .../system-export-declarations/_expected.js | 2 +- .../_expected.js | 27 +- .../main.js | 4 + .../deoptimize-nested-function-arg/_config.js | 3 + .../deoptimize-nested-function-arg/main.js | 8 + .../samples/deoptimize-via-arguments/main.js | 4 +- .../_config.js | 3 + .../dep.js | 2 + .../main.js | 9 + .../_config.js | 3 + .../main.js | 13 + .../_config.js | 3 + .../main.js | 9 + .../deoptimized-argument-value/_config.js | 4 + .../deoptimized-argument-value/main.js | 9 + .../do-not-destructure-unused/_config.js | 3 + .../do-not-destructure-unused/main.js | 17 + .../exports/_config.js | 13 + .../exports/main.js | 4 + .../_config.js | 3 + .../main.js | 6 + .../_config.js | 3 + .../main.js | 6 + .../handle-try-catch/_config.js | 11 + .../handle-try-catch/main.js | 21 + .../in-operator/_config.js | 3 + .../in-operator/main.js | 1 + .../include-call-arguments-path/_config.js | 3 + .../include-call-arguments-path/main.js | 9 + .../include-destructuring-rest/_config.js | 3 + .../include-destructuring-rest/main.js | 15 + .../_config.js | 6 + .../dep.js | 1 + .../main.js | 4 + .../_config.js | 3 + .../main.js | 5 + .../include-this-unknown-function/_config.js | 8 + .../include-this-unknown-function/main.js | 11 + .../_config.js | 3 + .../main.js | 36 + .../_config.js | 3 + .../main.js | 34 + .../_config.js | 3 + .../main.js | 33 + .../object-side-effects/_config.js | 3 + .../object-side-effects/main.js | 22 + .../_config.js | 3 + .../retain-property-definition-paths/main.js | 5 + .../_config.js | 3 + .../main.js | 14 + .../_config.js | 3 + .../main.js | 13 + .../_config.js | 3 + .../main.js | 13 + .../track-destructured-setter/_config.js | 3 + .../track-destructured-setter/main.js | 8 + .../try-statement-arguments/_config.js | 3 + .../try-statement-arguments/main.js | 14 + .../_config.js | 6 + .../main.js | 6 + .../_config.js | 8 + .../object-tree-shaking-for-parameter/main.js | 15 + .../_config.js | 3 + .../main.js | 7 + .../_config.js | 3 + .../main.js | 3 + .../module.js | 2 + .../_config.js | 3 + .../main.js | 6 + .../_config.js | 3 + .../main.js | 2 + .../module.js | 1 + .../preserve-var-declaration/_config.js | 3 + .../samples/preserve-var-declaration/main.js | 5 + .../_config.js | 6 + .../recursive-calls-without-treeshake/main.js | 10 + .../recursive-property-access/_config.js | 8 + .../samples/recursive-property-access/main.js | 29 + .../track-rest-parameter-value/_config.js | 4 + .../track-rest-parameter-value/main.js | 9 + .../_config.js | 8 + .../dep.js | 12 + .../main.js | 3 + .../_config.js | 3 + .../main.js | 2 + 372 files changed, 95491 insertions(+), 1310 deletions(-) create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_config.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module1.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module10.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module2.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module3.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module4.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module5.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module6.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module7.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module8.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module9.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/main.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module1.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module10.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module2.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module3.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module4.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module5.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module6.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module7.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module8.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module9.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/main.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module1.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module10.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module2.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module3.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module4.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module5.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module6.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module7.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module8.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module9.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/main.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module1.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module10.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module2.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module3.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module4.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module5.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module6.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module7.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module8.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module9.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/main.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/main.js create mode 100644 test/chunking-form/samples/dynamic-import-with-namespace/module.js create mode 100644 test/chunking-form/samples/entrypoint-aliasing/_expected/amd/generated-main2.js create mode 100644 test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/generated-main2.js create mode 100644 test/chunking-form/samples/entrypoint-aliasing/_expected/es/generated-main2.js rename test/chunking-form/samples/{filenames-patterns/_expected/system/entry-main2-um8DK13a-system.js => entrypoint-aliasing/_expected/system/generated-main2.js} (68%) create mode 100644 test/chunking-form/samples/entrypoint-facade/_expected/amd/generated-main2.js create mode 100644 test/chunking-form/samples/entrypoint-facade/_expected/cjs/generated-main2.js create mode 100644 test/chunking-form/samples/entrypoint-facade/_expected/es/generated-main2.js create mode 100644 test/chunking-form/samples/entrypoint-facade/_expected/system/generated-main2.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-BeN-_z3e-amd.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DBBrcOFA-amd.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DMJ9vLw5-amd.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-DHcdu15H-amd.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-SEc5gjvu-amd.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-DB987Lh4-cjs.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-DBCWfg7v-cjs.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-m802XraR-cjs.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-BVjYoW06-cjs.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-CDyYOEPK-cjs.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-CPMnlUsH-es.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-DCmtsuTI-es.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-WTHxIjMp-es.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-BNtK1lo1-es.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-CO3mT8jT-es.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-BRXsWtDg-system.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-Biq2O0X--system.js delete mode 100644 test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-bvYFOXPm-system.js create mode 100644 test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-D_RLirM0-system.js rename test/form/samples/computed-properties/{_expected/es.js => _expected.js} (100%) delete mode 100644 test/form/samples/computed-properties/_expected/amd.js delete mode 100644 test/form/samples/computed-properties/_expected/cjs.js delete mode 100644 test/form/samples/computed-properties/_expected/iife.js delete mode 100644 test/form/samples/computed-properties/_expected/system.js delete mode 100644 test/form/samples/computed-properties/_expected/umd.js create mode 100644 test/form/samples/destructured-known-arguments/_config.js create mode 100644 test/form/samples/destructured-known-arguments/_expected.js create mode 100644 test/form/samples/destructured-known-arguments/main.js create mode 100644 test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/main.js create mode 100644 test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/main.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-nested-props/main.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/main.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/main.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-props/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-props/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/remove-unused-props/main.js create mode 100644 test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/track-through-chain-expressions/main.js create mode 100644 test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_config.js create mode 100644 test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_expected.js create mode 100644 test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/main.js create mode 100644 test/form/samples/object-tree-shaking-issue-5734/_config.js create mode 100644 test/form/samples/object-tree-shaking-issue-5734/_expected.js create mode 100644 test/form/samples/object-tree-shaking-issue-5734/main.js create mode 100644 test/form/samples/object-tree-shaking-issue-5734/module.js create mode 100644 test/form/samples/recursive-destructuring/_config.js create mode 100644 test/form/samples/recursive-destructuring/_expected.js create mode 100644 test/form/samples/recursive-destructuring/main.js rename test/form/samples/side-effects-prototype-assignments/{_expected/es.js => _expected.js} (100%) delete mode 100644 test/form/samples/side-effects-prototype-assignments/_expected/amd.js delete mode 100644 test/form/samples/side-effects-prototype-assignments/_expected/cjs.js delete mode 100644 test/form/samples/side-effects-prototype-assignments/_expected/iife.js delete mode 100644 test/form/samples/side-effects-prototype-assignments/_expected/system.js delete mode 100644 test/form/samples/side-effects-prototype-assignments/_expected/umd.js create mode 100644 test/function/samples/deoptimize-nested-function-arg/_config.js create mode 100644 test/function/samples/deoptimize-nested-function-arg/main.js create mode 100644 test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/dep.js create mode 100644 test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/main.js create mode 100644 test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/main.js create mode 100644 test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/main.js create mode 100644 test/function/samples/object-expression-treeshaking/deoptimized-argument-value/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/deoptimized-argument-value/main.js create mode 100644 test/function/samples/object-expression-treeshaking/do-not-destructure-unused/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/do-not-destructure-unused/main.js create mode 100644 test/function/samples/object-expression-treeshaking/exports/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/exports/main.js create mode 100644 test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/main.js create mode 100644 test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/main.js create mode 100644 test/function/samples/object-expression-treeshaking/handle-try-catch/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/handle-try-catch/main.js create mode 100644 test/function/samples/object-expression-treeshaking/in-operator/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/in-operator/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-call-arguments-path/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-call-arguments-path/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-destructuring-rest/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-destructuring-rest/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/dep.js create mode 100644 test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-this-unknown-function/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-this-unknown-function/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/main.js create mode 100644 test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/main.js create mode 100644 test/function/samples/object-expression-treeshaking/object-side-effects/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/object-side-effects/main.js create mode 100644 test/function/samples/object-expression-treeshaking/retain-property-definition-paths/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/retain-property-definition-paths/main.js create mode 100644 test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/main.js create mode 100644 test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/main.js create mode 100644 test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/main.js create mode 100644 test/function/samples/object-expression-treeshaking/track-destructured-setter/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/track-destructured-setter/main.js create mode 100644 test/function/samples/object-expression-treeshaking/try-statement-arguments/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/try-statement-arguments/main.js create mode 100644 test/function/samples/object-tree-shaking-for-global-assignment/_config.js create mode 100644 test/function/samples/object-tree-shaking-for-global-assignment/main.js create mode 100644 test/function/samples/object-tree-shaking-for-parameter/_config.js create mode 100644 test/function/samples/object-tree-shaking-for-parameter/main.js create mode 100644 test/function/samples/object-tree-shaking-in-function-self-call/_config.js create mode 100644 test/function/samples/object-tree-shaking-in-function-self-call/main.js create mode 100644 test/function/samples/object-tree-shaking-with-destructed-export/_config.js create mode 100644 test/function/samples/object-tree-shaking-with-destructed-export/main.js create mode 100644 test/function/samples/object-tree-shaking-with-destructed-export/module.js create mode 100644 test/function/samples/object-tree-shaking-with-duplicated-function-call/_config.js create mode 100644 test/function/samples/object-tree-shaking-with-duplicated-function-call/main.js create mode 100644 test/function/samples/preserve-exported-object-in-namespace/_config.js create mode 100644 test/function/samples/preserve-exported-object-in-namespace/main.js create mode 100644 test/function/samples/preserve-exported-object-in-namespace/module.js create mode 100644 test/function/samples/preserve-var-declaration/_config.js create mode 100644 test/function/samples/preserve-var-declaration/main.js create mode 100644 test/function/samples/recursive-calls-without-treeshake/_config.js create mode 100644 test/function/samples/recursive-calls-without-treeshake/main.js create mode 100644 test/function/samples/recursive-property-access/_config.js create mode 100644 test/function/samples/recursive-property-access/main.js create mode 100644 test/function/samples/track-rest-parameter-value/_config.js create mode 100644 test/function/samples/track-rest-parameter-value/main.js create mode 100644 test/function/samples/typescript-enum-no-module-side-effects/_config.js create mode 100644 test/function/samples/typescript-enum-no-module-side-effects/dep.js create mode 100644 test/function/samples/typescript-enum-no-module-side-effects/main.js create mode 100644 test/function/samples/wrap-empty-object-with-double-brackets/_config.js create mode 100644 test/function/samples/wrap-empty-object-with-double-brackets/main.js diff --git a/rollup.config.ts b/rollup.config.ts index 109a8f116..78f608e12 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -40,7 +40,7 @@ const treeshake = { const nodePlugins: readonly Plugin[] = [ replace(fsEventsReplacement), alias(moduleAliases), - nodeResolve(), + nodeResolve({ preferBuiltins: true }), json(), string({ include: '**/*.md' }), commonjs({ diff --git a/scripts/ast-types.js b/scripts/ast-types.js index d69c45d9d..831cfc556 100644 --- a/scripts/ast-types.js +++ b/scripts/ast-types.js @@ -88,7 +88,7 @@ export const AST_NODES = { 'parameters', `scope.addParameterVariables( parameters.map( - parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] + parameter => parameter.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION) as ParameterVariable[] ), parameters[parameters.length - 1] instanceof RestElement );` @@ -153,7 +153,7 @@ export const AST_NODES = { ['body', 'Node'] ], postProcessFields: { - param: ['parameter', "parameter?.declare('parameter', UNKNOWN_EXPRESSION)"] + param: ['parameter', "parameter?.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION)"] }, scopes: { body: 'scope.bodyScope' @@ -310,7 +310,7 @@ export const AST_NODES = { 'parameters', `scope.addParameterVariables( parameters.map( - parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] + parameter => parameter.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION) as ParameterVariable[] ), parameters[parameters.length - 1] instanceof RestElement );` diff --git a/scripts/generate-buffer-parsers.js b/scripts/generate-buffer-parsers.js index 801079f5b..051151e05 100644 --- a/scripts/generate-buffer-parsers.js +++ b/scripts/generate-buffer-parsers.js @@ -178,6 +178,7 @@ import type { Node, NodeBase } from './nodes/shared/Node'; import type ChildScope from './scopes/ChildScope'; import type ModuleScope from './scopes/ModuleScope'; import TrackingScope from './scopes/TrackingScope'; +import { EMPTY_PATH } from './utils/PathTracker'; import type ParameterVariable from './variables/ParameterVariable'; export function convertProgram( diff --git a/scripts/prepare-release.js b/scripts/prepare-release.js index 87eb2834c..720bcd68e 100755 --- a/scripts/prepare-release.js +++ b/scripts/prepare-release.js @@ -192,10 +192,8 @@ function getDummyLogSection(headline, pr) { * @return {Promise} */ async function installDependenciesAndLint() { - await Promise.all([ - runWithEcho('npm', ['ci', '--ignore-scripts']), - runWithEcho('npm', ['run', 'check-audit']) - ]); + await runWithEcho('npm', ['ci', '--ignore-scripts']); + await runWithEcho('npm', ['run', 'check-audit']); await runWithEcho('npm', ['run', 'ci:lint']); } diff --git a/src/Graph.ts b/src/Graph.ts index 367818212..8b6595a88 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -1,6 +1,8 @@ import flru from 'flru'; +import { createInclusionContext } from './ast/ExecutionContext'; +import type { ExpressionEntity } from './ast/nodes/shared/Expression'; import GlobalScope from './ast/scopes/GlobalScope'; -import { PathTracker } from './ast/utils/PathTracker'; +import { EntityPathTracker } from './ast/utils/PathTracker'; import type ExternalModule from './ExternalModule'; import Module from './Module'; import { ModuleLoader, type UnresolvedModule } from './ModuleLoader'; @@ -54,12 +56,13 @@ function normalizeEntryModules( export default class Graph { readonly astLru = flru(5); readonly cachedModules = new Map(); - readonly deoptimizationTracker = new PathTracker(); + readonly deoptimizationTracker = new EntityPathTracker(); entryModules: Module[] = []; readonly fileOperationQueue: Queue; readonly moduleLoader: ModuleLoader; readonly modulesById = new Map(); needsTreeshakingPass = false; + readonly newlyIncludedVariableInits = new Set(); phase: BuildPhase = BuildPhase.LOAD_AND_PARSE; readonly pluginDriver: PluginDriver; readonly pureFunctions: PureFunctions; @@ -167,6 +170,7 @@ export default class Graph { } if (this.options.treeshake) { let treeshakingPass = 1; + this.newlyIncludedVariableInits.clear(); do { timeStart(`treeshaking pass ${treeshakingPass}`, 3); this.needsTreeshakingPass = false; @@ -178,6 +182,10 @@ export default class Graph { } else { module.include(); } + for (const entity of this.newlyIncludedVariableInits) { + this.newlyIncludedVariableInits.delete(entity); + entity.include(createInclusionContext(), false); + } } } if (treeshakingPass === 1) { diff --git a/src/Module.ts b/src/Module.ts index 3e91e863c..3e4cda8fe 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -3,6 +3,7 @@ import { locate } from 'locate-character'; import MagicString from 'magic-string'; import { parseAsync } from '../native'; import { convertProgram } from './ast/bufferParsers'; +import type { InclusionContext } from './ast/ExecutionContext'; import { createInclusionContext } from './ast/ExecutionContext'; import { nodeConstructors } from './ast/nodes'; import ExportAllDeclaration from './ast/nodes/ExportAllDeclaration'; @@ -17,10 +18,12 @@ import Literal from './ast/nodes/Literal'; import type MetaProperty from './ast/nodes/MetaProperty'; import * as NodeType from './ast/nodes/NodeType'; import type Program from './ast/nodes/Program'; +import type { ExpressionEntity } from './ast/nodes/shared/Expression'; import type { NodeBase } from './ast/nodes/shared/Node'; import VariableDeclaration from './ast/nodes/VariableDeclaration'; import ModuleScope from './ast/scopes/ModuleScope'; -import { type PathTracker, UNKNOWN_PATH } from './ast/utils/PathTracker'; +import type { ObjectPath } from './ast/utils/PathTracker'; +import { type EntityPathTracker, UNKNOWN_PATH } from './ast/utils/PathTracker'; import ExportDefaultVariable from './ast/variables/ExportDefaultVariable'; import ExportShimVariable from './ast/variables/ExportShimVariable'; import ExternalVariable from './ast/variables/ExternalVariable'; @@ -116,7 +119,7 @@ export interface AstContext { addImportMeta: (node: MetaProperty) => void; addImportSource: (importSource: string) => void; code: string; - deoptimizationTracker: PathTracker; + deoptimizationTracker: EntityPathTracker; error: (properties: RollupLog, pos: number) => never; fileName: string; getExports: () => string[]; @@ -128,12 +131,17 @@ export interface AstContext { importDescriptions: Map; includeAllExports: () => void; includeDynamicImport: (node: ImportExpression) => void; - includeVariableInModule: (variable: Variable) => void; + includeVariableInModule: ( + variable: Variable, + path: ObjectPath, + context: InclusionContext + ) => void; log: (level: LogLevel, properties: RollupLog, pos: number) => void; magicString: MagicString; manualPureFunctions: PureFunctions; module: Module; // not to be used for tree-shaking moduleContext: string; + newlyIncludedVariableInits: Set; options: NormalizedInputOptions; requestTreeshakingPass: () => void; traceExport: (name: string) => Variable | null; @@ -708,16 +716,15 @@ export default class Module { this.graph.needsTreeshakingPass = true; } + const inclusionContext = createInclusionContext(); for (const exportName of this.exports.keys()) { if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) { const variable = this.getVariableForExportName(exportName)[0]; if (!variable) { return error(logMissingEntryExport(exportName, this.id)); } + this.includeVariable(variable, UNKNOWN_PATH, inclusionContext); variable.deoptimizePath(UNKNOWN_PATH); - if (!variable.included) { - this.includeVariable(variable); - } } } @@ -726,7 +733,7 @@ export default class Module { if (variable) { variable.deoptimizePath(UNKNOWN_PATH); if (!variable.included) { - this.includeVariable(variable); + this.includeVariable(variable, UNKNOWN_PATH, inclusionContext); } if (variable instanceof ExternalVariable) { variable.module.reexported = true; @@ -752,13 +759,12 @@ export default class Module { let includeNamespaceMembers = false; + const inclusionContext = createInclusionContext(); for (const name of names) { const variable = this.getVariableForExportName(name)[0]; if (variable) { variable.deoptimizePath(UNKNOWN_PATH); - if (!variable.included) { - this.includeVariable(variable); - } + this.includeVariable(variable, UNKNOWN_PATH, inclusionContext); } if (!this.exports.has(name) && !this.reexportDescriptions.has(name)) { @@ -892,6 +898,7 @@ export default class Module { manualPureFunctions: this.graph.pureFunctions, module: this, moduleContext: this.context, + newlyIncludedVariableInits: this.graph.newlyIncludedVariableInits, options: this.options, requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true), traceExport: (name: string) => this.getVariableForExportName(name)[0], @@ -1336,12 +1343,12 @@ export default class Module { for (const module of [this, ...this.exportAllModules]) { if (module instanceof ExternalModule) { const [externalVariable] = module.getVariableForExportName('*'); - externalVariable.include(); + externalVariable.includePath(UNKNOWN_PATH, createInclusionContext()); this.includedImports.add(externalVariable); externalNamespaces.add(externalVariable); } else if (module.info.syntheticNamedExports) { const syntheticNamespace = module.getSyntheticNamespace(); - syntheticNamespace.include(); + syntheticNamespace.includePath(UNKNOWN_PATH, createInclusionContext()); this.includedImports.add(syntheticNamespace); syntheticNamespaces.add(syntheticNamespace); } @@ -1350,14 +1357,14 @@ export default class Module { } private includeDynamicImport(node: ImportExpression): void { - const resolution = ( - this.dynamicImports.find(dynamicImport => dynamicImport.node === node) as { - resolution: string | Module | ExternalModule | undefined; - } - ).resolution; + const resolution = this.dynamicImports.find( + dynamicImport => dynamicImport.node === node + )!.resolution; if (resolution instanceof Module) { - resolution.includedDynamicImporters.push(this); + if (!resolution.includedDynamicImporters.includes(this)) { + resolution.includedDynamicImporters.push(this); + } const importedNames = this.options.treeshake ? node.getDeterministicImportedNames() @@ -1371,14 +1378,14 @@ export default class Module { } } - private includeVariable(variable: Variable): void { - const variableModule = variable.module; - if (variable.included) { + private includeVariable(variable: Variable, path: ObjectPath, context: InclusionContext): void { + const { included, module: variableModule } = variable; + variable.includePath(path, context); + if (included) { if (variableModule instanceof Module && variableModule !== this) { getAndExtendSideEffectModules(variable, this); } } else { - variable.include(); this.graph.needsTreeshakingPass = true; if (variableModule instanceof Module) { if (!variableModule.isExecuted) { @@ -1396,8 +1403,12 @@ export default class Module { } } - private includeVariableInModule(variable: Variable): void { - this.includeVariable(variable); + private includeVariableInModule( + variable: Variable, + path: ObjectPath, + context: InclusionContext + ): void { + this.includeVariable(variable, path, context); const variableModule = variable.module; if (variableModule && variableModule !== this) { this.includedImports.add(variable); diff --git a/src/ast/ExecutionContext.ts b/src/ast/ExecutionContext.ts index 3906fb7b9..df7bb3637 100644 --- a/src/ast/ExecutionContext.ts +++ b/src/ast/ExecutionContext.ts @@ -1,6 +1,6 @@ import type { Entity } from './Entity'; import type { ExpressionEntity } from './nodes/shared/Expression'; -import { DiscriminatedPathTracker, PathTracker } from './utils/PathTracker'; +import { DiscriminatedPathTracker, EntityPathTracker } from './utils/PathTracker'; import type ThisVariable from './variables/ThisVariable'; interface ExecutionContextIgnore { @@ -23,8 +23,8 @@ export interface InclusionContext extends ControlFlowContext { } export interface HasEffectsContext extends ControlFlowContext { - accessed: PathTracker; - assigned: PathTracker; + accessed: EntityPathTracker; + assigned: EntityPathTracker; brokenFlow: boolean; called: DiscriminatedPathTracker; ignore: ExecutionContextIgnore; @@ -44,8 +44,8 @@ export function createInclusionContext(): InclusionContext { export function createHasEffectsContext(): HasEffectsContext { return { - accessed: new PathTracker(), - assigned: new PathTracker(), + accessed: new EntityPathTracker(), + assigned: new EntityPathTracker(), brokenFlow: false, called: new DiscriminatedPathTracker(), hasBreak: false, diff --git a/src/ast/bufferParsers.ts b/src/ast/bufferParsers.ts index 8a7b8128f..385610ed3 100644 --- a/src/ast/bufferParsers.ts +++ b/src/ast/bufferParsers.ts @@ -103,6 +103,7 @@ import type { Node, NodeBase } from './nodes/shared/Node'; import type ChildScope from './scopes/ChildScope'; import type ModuleScope from './scopes/ModuleScope'; import TrackingScope from './scopes/TrackingScope'; +import { EMPTY_PATH } from './utils/PathTracker'; import type ParameterVariable from './variables/ParameterVariable'; export function convertProgram( @@ -335,7 +336,8 @@ const bufferParsers: ((node: any, position: number, buffer: AstBuffer) => void)[ const parameters = (node.params = convertNodeList(node, scope, buffer[position + 2], buffer)); scope.addParameterVariables( parameters.map( - parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] + parameter => + parameter.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION) as ParameterVariable[] ), parameters[parameters.length - 1] instanceof RestElement ); @@ -384,7 +386,7 @@ const bufferParsers: ((node: any, position: number, buffer: AstBuffer) => void)[ const parameterPosition = buffer[position]; const parameter = (node.param = parameterPosition === 0 ? null : convertNode(node, scope, parameterPosition, buffer)); - parameter?.declare('parameter', UNKNOWN_EXPRESSION); + parameter?.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION); node.body = convertNode(node, scope.bodyScope, buffer[position + 1], buffer); }, function chainExpression(node: ChainExpression, position, buffer) { @@ -528,7 +530,8 @@ const bufferParsers: ((node: any, position: number, buffer: AstBuffer) => void)[ const parameters = (node.params = convertNodeList(node, scope, buffer[position + 3], buffer)); scope.addParameterVariables( parameters.map( - parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] + parameter => + parameter.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION) as ParameterVariable[] ), parameters[parameters.length - 1] instanceof RestElement ); @@ -546,7 +549,8 @@ const bufferParsers: ((node: any, position: number, buffer: AstBuffer) => void)[ const parameters = (node.params = convertNodeList(node, scope, buffer[position + 3], buffer)); scope.addParameterVariables( parameters.map( - parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] + parameter => + parameter.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION) as ParameterVariable[] ), parameters[parameters.length - 1] instanceof RestElement ); diff --git a/src/ast/nodes/ArrayExpression.ts b/src/ast/nodes/ArrayExpression.ts index 1d731e364..87897b87c 100644 --- a/src/ast/nodes/ArrayExpression.ts +++ b/src/ast/nodes/ArrayExpression.ts @@ -1,19 +1,19 @@ import type { DeoptimizableEntity } from '../DeoptimizableEntity'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { + type EntityPathTracker, type ObjectPath, - type PathTracker, UNKNOWN_PATH, UnknownInteger } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION, UNKNOWN_LITERAL_NUMBER } from '../values'; import type * as NodeType from './NodeType'; -import SpreadElement from './SpreadElement'; import { ARRAY_PROTOTYPE } from './shared/ArrayPrototype'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; import { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity'; +import SpreadElement from './SpreadElement'; export default class ArrayExpression extends NodeBase { declare elements: readonly (ExpressionNode | SpreadElement | null)[]; @@ -23,7 +23,7 @@ export default class ArrayExpression extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, @@ -38,7 +38,7 @@ export default class ArrayExpression extends NodeBase { getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); @@ -47,7 +47,7 @@ export default class ArrayExpression extends NodeBase { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( @@ -66,7 +66,17 @@ export default class ArrayExpression extends NodeBase { return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } - protected applyDeoptimizations(): void { + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + for (const element of this.elements) { + if (element) { + element?.includePath(UNKNOWN_PATH, context); + } + } + } + + applyDeoptimizations() { this.deoptimized = true; let hasSpread = false; for (let index = 0; index < this.elements.length; index++) { diff --git a/src/ast/nodes/ArrayPattern.ts b/src/ast/nodes/ArrayPattern.ts index 1cbb302b8..811a94670 100644 --- a/src/ast/nodes/ArrayPattern.ts +++ b/src/ast/nodes/ArrayPattern.ts @@ -1,15 +1,15 @@ -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; -import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH, type ObjectPath, UnknownInteger, UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; -import { UNKNOWN_EXPRESSION } from './shared/Expression'; -import { NodeBase } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import type { ExpressionEntity } from './shared/Expression'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; +import type { DeclarationPatternNode, PatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; -export default class ArrayPattern extends NodeBase implements PatternNode { +export default class ArrayPattern extends NodeBase implements DeclarationPatternNode { declare elements: (PatternNode | null)[]; declare type: NodeType.tArrayPattern; @@ -22,16 +22,30 @@ export default class ArrayPattern extends NodeBase implements PatternNode { } } - declare(kind: VariableKind): LocalVariable[] { + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[] { const variables: LocalVariable[] = []; + const includedPatternPath = getIncludedPatternPath(destructuredInitPath); for (const element of this.elements) { if (element !== null) { - variables.push(...element.declare(kind, UNKNOWN_EXPRESSION)); + variables.push( + ...(element as DeclarationPatternNode).declare(kind, includedPatternPath, init) + ); } } return variables; } + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity): void { + const includedPatternPath = getIncludedPatternPath(destructuredInitPath); + for (const element of this.elements) { + element?.deoptimizeAssignment(includedPatternPath, init); + } + } + // Patterns can only be deoptimized at the empty path at the moment deoptimizePath(): void { for (const element of this.elements) { @@ -39,6 +53,20 @@ export default class ArrayPattern extends NodeBase implements PatternNode { } } + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + const includedPatternPath = getIncludedPatternPath(destructuredInitPath); + for (const element of this.elements) { + if (element?.hasEffectsWhenDestructuring(context, includedPatternPath, init)) { + return true; + } + } + return false; + } + // Patterns are only checked at the empty path at the moment hasEffectsOnInteractionAtPath( _path: ObjectPath, @@ -51,9 +79,43 @@ export default class ArrayPattern extends NodeBase implements PatternNode { return false; } + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + let included = false; + const includedPatternPath = getIncludedPatternPath(destructuredInitPath); + for (const element of this.elements) { + if (element) { + element.included ||= included; + included = + element.includeDestructuredIfNecessary(context, includedPatternPath, init) || included; + } + } + if (included) { + // This is necessary so that if any pattern element is included, all are + // included for proper deconflicting + for (const element of this.elements) { + if (element && !element.included) { + element.included = true; + element.includeDestructuredIfNecessary(context, includedPatternPath, init); + } + } + } + return (this.included ||= included); + } + markDeclarationReached(): void { for (const element of this.elements) { - element?.markDeclarationReached(); + (element as DeclarationPatternNode)?.markDeclarationReached(); } } } + +ArrayPattern.prototype.includeNode = onlyIncludeSelf; + +const getIncludedPatternPath = (destructuredInitPath: ObjectPath): ObjectPath => + destructuredInitPath.at(-1) === UnknownKey + ? destructuredInitPath + : [...destructuredInitPath, UnknownInteger]; diff --git a/src/ast/nodes/ArrowFunctionExpression.ts b/src/ast/nodes/ArrowFunctionExpression.ts index c99578c87..55ddffe42 100644 --- a/src/ast/nodes/ArrowFunctionExpression.ts +++ b/src/ast/nodes/ArrowFunctionExpression.ts @@ -3,7 +3,7 @@ import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_CALLED } from '../NodeInteractions'; import type ChildScope from '../scopes/ChildScope'; import ReturnValueScope from '../scopes/ReturnValueScope'; -import { type ObjectPath } from '../utils/PathTracker'; +import { type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker'; import type BlockStatement from './BlockStatement'; import type CallExpression from './CallExpression'; import Identifier from './Identifier'; @@ -13,11 +13,11 @@ import FunctionBase from './shared/FunctionBase'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; import { ObjectEntity } from './shared/ObjectEntity'; import { OBJECT_PROTOTYPE } from './shared/ObjectPrototype'; -import type { PatternNode } from './shared/Pattern'; +import type { DeclarationPatternNode } from './shared/Pattern'; export default class ArrowFunctionExpression extends FunctionBase { declare body: BlockStatement | ExpressionNode; - declare params: PatternNode[]; + declare params: DeclarationPatternNode[]; declare preventChildBlockScope: true; declare scope: ReturnValueScope; declare type: NodeType.tArrowFunctionExpression; @@ -35,7 +35,6 @@ export default class ArrowFunctionExpression extends FunctionBase { } hasEffects(): boolean { - if (!this.deoptimized) this.applyDeoptimizations(); return false; } @@ -44,14 +43,17 @@ export default class ArrowFunctionExpression extends FunctionBase { interaction: NodeInteraction, context: HasEffectsContext ): boolean { + if ( + this.annotationNoSideEffects && + path.length === 0 && + interaction.type === INTERACTION_CALLED + ) { + return false; + } if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) { return true; } - if (this.annotationNoSideEffects) { - return false; - } - if (interaction.type === INTERACTION_CALLED) { const { ignore, brokenFlow } = context; context.ignore = { @@ -84,6 +86,16 @@ export default class ArrowFunctionExpression extends FunctionBase { } } + includeNode(context: InclusionContext) { + this.included = true; + this.body.includePath(UNKNOWN_PATH, context); + for (const parameter of this.params) { + if (!(parameter instanceof Identifier)) { + parameter.includePath(UNKNOWN_PATH, context); + } + } + } + protected getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; diff --git a/src/ast/nodes/AssignmentExpression.ts b/src/ast/nodes/AssignmentExpression.ts index aecdf927e..f6e395699 100644 --- a/src/ast/nodes/AssignmentExpression.ts +++ b/src/ast/nodes/AssignmentExpression.ts @@ -28,7 +28,7 @@ import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/No import type { PatternNode } from './shared/Pattern'; export default class AssignmentExpression extends NodeBase { - declare left: ExpressionNode | PatternNode; + declare left: PatternNode; declare operator: | '=' | '+=' @@ -55,7 +55,9 @@ export default class AssignmentExpression extends NodeBase { // MemberExpressions do not access the property before assignments if the // operator is '='. return ( - right.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, operator !== '=') + right.hasEffects(context) || + left.hasEffectsAsAssignmentTarget(context, operator !== '=') || + this.left.hasEffectsWhenDestructuring?.(context, EMPTY_PATH, right) ); } @@ -70,18 +72,26 @@ export default class AssignmentExpression extends NodeBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { deoptimized, left, right, operator } = this; if (!deoptimized) this.applyDeoptimizations(); - this.included = true; + if (!this.included) this.includeNode(context); + const hasEffectsContext = createHasEffectsContext(); if ( includeChildrenRecursively || operator !== '=' || left.included || - left.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false) + left.hasEffectsAsAssignmentTarget(hasEffectsContext, false) || + left.hasEffectsWhenDestructuring?.(hasEffectsContext, EMPTY_PATH, right) ) { left.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '='); } right.include(context, includeChildrenRecursively); } + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.right.includePath(UNKNOWN_PATH, context); + } + initialise(): void { super.initialise(); if (this.left instanceof Identifier) { @@ -162,10 +172,9 @@ export default class AssignmentExpression extends NodeBase { } } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; - this.left.deoptimizePath(EMPTY_PATH); - this.right.deoptimizePath(UNKNOWN_PATH); + this.left.deoptimizeAssignment(EMPTY_PATH, this.right); this.scope.context.requestTreeshakingPass(); } } diff --git a/src/ast/nodes/AssignmentPattern.ts b/src/ast/nodes/AssignmentPattern.ts index a67646b90..16669ef9f 100644 --- a/src/ast/nodes/AssignmentPattern.ts +++ b/src/ast/nodes/AssignmentPattern.ts @@ -1,7 +1,7 @@ import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; @@ -9,10 +9,10 @@ import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import type { ExpressionEntity } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import type { DeclarationPatternNode, PatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; -export default class AssignmentPattern extends NodeBase implements PatternNode { +export default class AssignmentPattern extends NodeBase implements DeclarationPatternNode { declare left: PatternNode; declare right: ExpressionNode; declare type: NodeType.tAssignmentPattern; @@ -24,8 +24,16 @@ export default class AssignmentPattern extends NodeBase implements PatternNode { this.left.addExportedVariables(variables, exportNamesByVariable); } - declare(kind: VariableKind, init: ExpressionEntity): LocalVariable[] { - return this.left.declare(kind, init); + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[] { + return (this.left as DeclarationPatternNode).declare(kind, destructuredInitPath, init); + } + + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity): void { + this.left.deoptimizeAssignment(destructuredInitPath, init); } deoptimizePath(path: ObjectPath): void { @@ -44,8 +52,42 @@ export default class AssignmentPattern extends NodeBase implements PatternNode { ); } + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + return this.left.hasEffectsWhenDestructuring(context, destructuredInitPath, init); + } + + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + let included = + this.left.includeDestructuredIfNecessary(context, destructuredInitPath, init) || + this.included; + if ((included ||= this.right.shouldBeIncluded(context))) { + this.right.include(context, false); + if (!this.left.included) { + this.left.included = true; + // Unfortunately, we need to include the left side again now, so that + // any declared variables are properly included. + this.left.includeDestructuredIfNecessary(context, destructuredInitPath, init); + } + } + return (this.included = included); + } + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.right.includePath(UNKNOWN_PATH, context); + } + markDeclarationReached(): void { - this.left.markDeclarationReached(); + (this.left as DeclarationPatternNode).markDeclarationReached(); } render( @@ -57,7 +99,7 @@ export default class AssignmentPattern extends NodeBase implements PatternNode { this.right.render(code, options); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); diff --git a/src/ast/nodes/AwaitExpression.ts b/src/ast/nodes/AwaitExpression.ts index 25f262c0e..912cdf02e 100644 --- a/src/ast/nodes/AwaitExpression.ts +++ b/src/ast/nodes/AwaitExpression.ts @@ -1,4 +1,5 @@ import type { InclusionContext } from '../ExecutionContext'; +import type { ObjectPath } from '../utils/PathTracker'; import ArrowFunctionExpression from './ArrowFunctionExpression'; import type * as NodeType from './NodeType'; import FunctionNode from './shared/FunctionNode'; @@ -14,18 +15,30 @@ export default class AwaitExpression extends NodeBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { + if (!this.included) this.includeNode(context); + this.argument.include(context, includeChildrenRecursively); + } + + includeNode(context: InclusionContext) { + this.included = true; if (!this.deoptimized) this.applyDeoptimizations(); - if (!this.included) { - this.included = true; - checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) { - let parent = this.parent; - do { - if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) - break checkTopLevelAwait; - } while ((parent = (parent as Node).parent as Node)); - this.scope.context.usesTopLevelAwait = true; - } + checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) { + let parent = this.parent; + do { + if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression) + break checkTopLevelAwait; + } while ((parent = (parent as Node).parent as Node)); + this.scope.context.usesTopLevelAwait = true; } - this.argument.include(context, includeChildrenRecursively); + // Thenables need to be included + this.argument.includePath(THEN_PATH, context); + } + + includePath(path: ObjectPath, context: InclusionContext): void { + if (!this.deoptimized) this.applyDeoptimizations(); + if (!this.included) this.includeNode(context); + this.argument.includePath(path, context); } } + +const THEN_PATH = ['then']; diff --git a/src/ast/nodes/BinaryExpression.ts b/src/ast/nodes/BinaryExpression.ts index 7c969f3b6..9981e6c50 100644 --- a/src/ast/nodes/BinaryExpression.ts +++ b/src/ast/nodes/BinaryExpression.ts @@ -2,20 +2,21 @@ import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, - SHARED_RECURSION_TRACKER + SHARED_RECURSION_TRACKER, + UNKNOWN_PATH } from '../utils/PathTracker'; import ExpressionStatement from './ExpressionStatement'; import type { LiteralValue } from './Literal'; import type * as NodeType from './NodeType'; import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; -import { type ExpressionNode, NodeBase } from './shared/Node'; +import { doNotDeoptimize, type ExpressionNode, NodeBase } from './shared/Node'; type Operator = | '!=' @@ -80,7 +81,7 @@ export default class BinaryExpression extends NodeBase implements DeoptimizableE getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (path.length > 0) return UnknownValue; @@ -112,6 +113,13 @@ export default class BinaryExpression extends NodeBase implements DeoptimizableE return type !== INTERACTION_ACCESSED || path.length > 1; } + includeNode(context: InclusionContext) { + this.included = true; + if (this.operator === 'in') { + this.right.includePath(UNKNOWN_PATH, context); + } + } + removeAnnotations(code: MagicString) { this.left.removeAnnotations(code); } @@ -125,3 +133,5 @@ export default class BinaryExpression extends NodeBase implements DeoptimizableE this.right.render(code, options); } } + +BinaryExpression.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/BlockStatement.ts b/src/ast/nodes/BlockStatement.ts index 22c332f9b..f636281e3 100644 --- a/src/ast/nodes/BlockStatement.ts +++ b/src/ast/nodes/BlockStatement.ts @@ -7,7 +7,14 @@ import ExpressionStatement from './ExpressionStatement'; import * as NodeType from './NodeType'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; -import { type IncludeChildren, type Node, StatementBase, type StatementNode } from './shared/Node'; +import { + doNotDeoptimize, + type IncludeChildren, + type Node, + onlyIncludeSelfNoDeoptimize, + StatementBase, + type StatementNode +} from './shared/Node'; export default class BlockStatement extends StatementBase { declare body: readonly StatementNode[]; @@ -77,3 +84,6 @@ export default class BlockStatement extends StatementBase { } } } + +BlockStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +BlockStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/BreakStatement.ts b/src/ast/nodes/BreakStatement.ts index 836fb356c..72cb40405 100644 --- a/src/ast/nodes/BreakStatement.ts +++ b/src/ast/nodes/BreakStatement.ts @@ -1,7 +1,7 @@ import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; -import { StatementBase } from './shared/Node'; +import { doNotDeoptimize, onlyIncludeSelfNoDeoptimize, StatementBase } from './shared/Node'; export default class BreakStatement extends StatementBase { declare label: Identifier | null; @@ -22,7 +22,7 @@ export default class BreakStatement extends StatementBase { include(context: InclusionContext): void { this.included = true; if (this.label) { - this.label.include(); + this.label.include(context); context.includedLabels.add(this.label.name); } else { context.hasBreak = true; @@ -30,3 +30,6 @@ export default class BreakStatement extends StatementBase { context.brokenFlow = true; } } + +BreakStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +BreakStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/CallExpression.ts b/src/ast/nodes/CallExpression.ts index ae18f8758..f34cb0675 100644 --- a/src/ast/nodes/CallExpression.ts +++ b/src/ast/nodes/CallExpression.ts @@ -8,20 +8,20 @@ import { type NodeRenderOptions, type RenderOptions } from '../../utils/renderHe import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { INTERACTION_CALLED } from '../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; -import { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH, SHARED_RECURSION_TRACKER, UNKNOWN_PATH } from '../utils/PathTracker'; import Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; -import type SpreadElement from './SpreadElement'; -import type Super from './Super'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import CallExpressionBase from './shared/CallExpressionBase'; +import { getChainElementLiteralValueAtPath } from './shared/chainElements'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { UNKNOWN_RETURN_EXPRESSION } from './shared/Expression'; import type { ChainElement, ExpressionNode, IncludeChildren, SkippedChain } from './shared/Node'; import { INCLUDE_PARAMETERS, IS_SKIPPED_CHAIN } from './shared/Node'; -import { getChainElementLiteralValueAtPath } from './shared/chainElements'; +import type SpreadElement from './SpreadElement'; +import type Super from './Super'; export default class CallExpression extends CallExpressionBase @@ -67,7 +67,7 @@ export default class CallExpression getLiteralValueAtPathAsChainElement( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown | SkippedChain { return getChainElementLiteralValueAtPath(this, this.callee, path, recursionTracker, origin); @@ -112,9 +112,13 @@ export default class CallExpression } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - if (!this.deoptimized) this.applyDeoptimizations(); + if (!this.included) this.includeNode(context); if (includeChildrenRecursively) { - super.include(context, includeChildrenRecursively); + this.callee.include(context, true); + for (const argument of this.arguments) { + argument.includePath(UNKNOWN_PATH, context); + argument.include(context, true); + } if ( includeChildrenRecursively === INCLUDE_PARAMETERS && this.callee instanceof Identifier && @@ -123,10 +127,23 @@ export default class CallExpression this.callee.variable.markCalledFromTryStatement(); } } else { - this.included = true; - this.callee.include(context, false); + // If the callee is a member expression and does not have a variable, its + // object will already be included via the first argument of the + // interaction in includeCallArguments. Including it again can lead to + // severe performance problems. + if (this.callee instanceof MemberExpression && !this.callee.variable) { + this.callee.property.include(context, false); + } else { + this.callee.include(context, false); + } + this.callee.includeCallArguments(context, this.interaction); } - this.callee.includeCallArguments(context, this.arguments); + } + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.callee.includePath(UNKNOWN_PATH, context); } initialise() { @@ -151,7 +168,7 @@ export default class CallExpression renderCallArguments(code, options, this); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.callee.deoptimizeArgumentsOnInteractionAtPath( this.interaction, @@ -162,7 +179,7 @@ export default class CallExpression } protected getReturnExpression( - recursionTracker: PathTracker = SHARED_RECURSION_TRACKER + recursionTracker: EntityPathTracker = SHARED_RECURSION_TRACKER ): [expression: ExpressionEntity, isPure: boolean] { if (this.returnExpression === null) { this.returnExpression = UNKNOWN_RETURN_EXPRESSION; diff --git a/src/ast/nodes/CatchClause.ts b/src/ast/nodes/CatchClause.ts index ae9743c2f..7224a9a8b 100644 --- a/src/ast/nodes/CatchClause.ts +++ b/src/ast/nodes/CatchClause.ts @@ -1,14 +1,15 @@ import type ChildScope from '../scopes/ChildScope'; import ParameterScope from '../scopes/ParameterScope'; +import { EMPTY_PATH } from '../utils/PathTracker'; import BlockStatement from './BlockStatement'; import type * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; -import { type GenericEsTreeNode, NodeBase } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import { type GenericEsTreeNode, NodeBase, onlyIncludeSelf } from './shared/Node'; +import type { DeclarationPatternNode } from './shared/Pattern'; export default class CatchClause extends NodeBase { declare body: BlockStatement; - declare param: PatternNode | null; + declare param: DeclarationPatternNode | null; declare preventChildBlockScope: true; declare scope: ParameterScope; declare type: NodeType.tCatchClause; @@ -24,8 +25,8 @@ export default class CatchClause extends NodeBase { this.param = new (this.scope.context.getNodeConstructor(param.type))( this, this.scope - ).parseNode(param) as unknown as PatternNode; - this.param!.declare('parameter', UNKNOWN_EXPRESSION); + ).parseNode(param) as unknown as DeclarationPatternNode; + this.param!.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION); } this.body = new BlockStatement(this, this.scope.bodyScope).parseNode(body); return super.parseNode(esTreeNode); @@ -33,3 +34,4 @@ export default class CatchClause extends NodeBase { } CatchClause.prototype.preventChildBlockScope = true; +CatchClause.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/ChainExpression.ts b/src/ast/nodes/ChainExpression.ts index 28b583332..e4c02e15e 100644 --- a/src/ast/nodes/ChainExpression.ts +++ b/src/ast/nodes/ChainExpression.ts @@ -1,12 +1,17 @@ import type MagicString from 'magic-string'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; -import type { HasEffectsContext } from '../ExecutionContext'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; import type CallExpression from './CallExpression'; import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import type { LiteralValueOrUnknown } from './shared/Expression'; -import { IS_SKIPPED_CHAIN, NodeBase } from './shared/Node'; +import { + doNotDeoptimize, + IS_SKIPPED_CHAIN, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './shared/Node'; export default class ChainExpression extends NodeBase implements DeoptimizableEntity { declare expression: CallExpression | MemberExpression; @@ -17,7 +22,7 @@ export default class ChainExpression extends NodeBase implements DeoptimizableEn getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { const literalValue = this.expression.getLiteralValueAtPathAsChainElement( @@ -32,9 +37,15 @@ export default class ChainExpression extends NodeBase implements DeoptimizableEn return this.expression.hasEffectsAsChainElement(context) === true; } + includePath(path: ObjectPath, context: InclusionContext) { + this.included = true; + this.expression.includePath(path, context); + } + removeAnnotations(code: MagicString) { this.expression.removeAnnotations(code); } - - protected applyDeoptimizations() {} } + +ChainExpression.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ChainExpression.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ClassBody.ts b/src/ast/nodes/ClassBody.ts index 845f21b15..900e5bca9 100644 --- a/src/ast/nodes/ClassBody.ts +++ b/src/ast/nodes/ClassBody.ts @@ -1,13 +1,20 @@ import type { InclusionContext } from '../ExecutionContext'; import type ChildScope from '../scopes/ChildScope'; import ClassBodyScope from '../scopes/ClassBodyScope'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type MethodDefinition from './MethodDefinition'; import type * as NodeType from './NodeType'; import type PropertyDefinition from './PropertyDefinition'; -import type StaticBlock from './StaticBlock'; import type ClassNode from './shared/ClassNode'; -import { type GenericEsTreeNode, type IncludeChildren, NodeBase } from './shared/Node'; +import { + doNotDeoptimize, + type GenericEsTreeNode, + type IncludeChildren, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './shared/Node'; +import type StaticBlock from './StaticBlock'; export default class ClassBody extends NodeBase { declare body: (MethodDefinition | PropertyDefinition | StaticBlock)[]; @@ -20,7 +27,7 @@ export default class ClassBody extends NodeBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; - this.scope.context.includeVariableInModule(this.scope.thisVariable); + this.scope.context.includeVariableInModule(this.scope.thisVariable, UNKNOWN_PATH, context); for (const definition of this.body) { definition.include(context, includeChildrenRecursively); } @@ -37,6 +44,7 @@ export default class ClassBody extends NodeBase { } return super.parseNode(esTreeNode); } - - protected applyDeoptimizations() {} } + +ClassBody.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ClassBody.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ClassDeclaration.ts b/src/ast/nodes/ClassDeclaration.ts index 76b1465cc..fdb0bd576 100644 --- a/src/ast/nodes/ClassDeclaration.ts +++ b/src/ast/nodes/ClassDeclaration.ts @@ -55,7 +55,7 @@ export default class ClassDeclaration extends ClassNode { super.render(code, options); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { super.applyDeoptimizations(); const { id, scope } = this; if (id) { diff --git a/src/ast/nodes/ConditionalExpression.ts b/src/ast/nodes/ConditionalExpression.ts index 1cb7219f7..cb8ff5f0e 100644 --- a/src/ast/nodes/ConditionalExpression.ts +++ b/src/ast/nodes/ConditionalExpression.ts @@ -8,18 +8,18 @@ import { } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { createInclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER, UNKNOWN_PATH } from '../utils/PathTracker'; import { tryCastLiteralValueToBoolean } from '../utils/tryCastLiteralValueToBoolean'; import type * as NodeType from './NodeType'; -import type SpreadElement from './SpreadElement'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { UnknownValue } from './shared/Expression'; import { MultiExpression } from './shared/MultiExpression'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ConditionalExpression extends NodeBase implements DeoptimizableEntity { declare alternate: ExpressionNode; @@ -40,7 +40,7 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.consequent.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); this.alternate.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); @@ -51,6 +51,9 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent; this.usedBranch = null; unusedBranch.deoptimizePath(UNKNOWN_PATH); + if (this.included) { + unusedBranch.includePath(UNKNOWN_PATH, createInclusionContext()); + } const { expressionsToBeDeoptimized } = this; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; for (const expression of expressionsToBeDeoptimized) { @@ -71,7 +74,7 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { const usedBranch = this.getUsedBranch(); @@ -83,7 +86,7 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const usedBranch = this.getUsedBranch(); @@ -141,7 +144,7 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; const usedBranch = this.getUsedBranch(); - if (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) { + if (usedBranch === null || includeChildrenRecursively || this.test.shouldBeIncluded(context)) { this.test.include(context, includeChildrenRecursively); this.consequent.include(context, includeChildrenRecursively); this.alternate.include(context, includeChildrenRecursively); @@ -150,16 +153,24 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz } } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { + includePath(path: ObjectPath, context: InclusionContext): void { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (usedBranch === null || this.test.shouldBeIncluded(context)) { + this.consequent.includePath(path, context); + this.alternate.includePath(path, context); + } else { + usedBranch.includePath(path, context); + } + } + + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { const usedBranch = this.getUsedBranch(); if (usedBranch) { - usedBranch.includeCallArguments(context, parameters); + usedBranch.includeCallArguments(context, interaction); } else { - this.consequent.includeCallArguments(context, parameters); - this.alternate.includeCallArguments(context, parameters); + this.consequent.includeCallArguments(context, interaction); + this.alternate.includeCallArguments(context, interaction); } } @@ -177,12 +188,12 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { - const usedBranch = this.getUsedBranch(); if (this.test.included) { this.test.render(code, options, { renderedSurroundingElement }); this.consequent.render(code, options); this.alternate.render(code, options); } else { + const usedBranch = this.getUsedBranch(); const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end); const inclusionStart = findNonWhiteSpace( code.original, @@ -220,3 +231,6 @@ export default class ConditionalExpression extends NodeBase implements Deoptimiz : (this.usedBranch = testValue ? this.consequent : this.alternate); } } + +ConditionalExpression.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ConditionalExpression.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ContinueStatement.ts b/src/ast/nodes/ContinueStatement.ts index 9e137e1af..8f8a27b4b 100644 --- a/src/ast/nodes/ContinueStatement.ts +++ b/src/ast/nodes/ContinueStatement.ts @@ -1,7 +1,7 @@ import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; -import { StatementBase } from './shared/Node'; +import { doNotDeoptimize, onlyIncludeSelfNoDeoptimize, StatementBase } from './shared/Node'; export default class ContinueStatement extends StatementBase { declare label: Identifier | null; @@ -22,7 +22,7 @@ export default class ContinueStatement extends StatementBase { include(context: InclusionContext): void { this.included = true; if (this.label) { - this.label.include(); + this.label.include(context); context.includedLabels.add(this.label.name); } else { context.hasContinue = true; @@ -30,3 +30,6 @@ export default class ContinueStatement extends StatementBase { context.brokenFlow = true; } } + +ContinueStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ContinueStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/DebuggerStatement.ts b/src/ast/nodes/DebuggerStatement.ts index e0e42deef..cffa29436 100644 --- a/src/ast/nodes/DebuggerStatement.ts +++ b/src/ast/nodes/DebuggerStatement.ts @@ -1,5 +1,5 @@ import type * as NodeType from './NodeType'; -import { StatementBase } from './shared/Node'; +import { onlyIncludeSelf, StatementBase } from './shared/Node'; export default class DebuggerStatement extends StatementBase { declare type: NodeType.tDebuggerStatement; @@ -8,3 +8,5 @@ export default class DebuggerStatement extends StatementBase { return true; } } + +DebuggerStatement.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/Decorator.ts b/src/ast/nodes/Decorator.ts index 67dfe97c9..c6cf5329d 100644 --- a/src/ast/nodes/Decorator.ts +++ b/src/ast/nodes/Decorator.ts @@ -2,7 +2,7 @@ import type { HasEffectsContext } from '../ExecutionContext'; import { NODE_INTERACTION_UNKNOWN_CALL } from '../NodeInteractions'; import { EMPTY_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; -import { type ExpressionNode, NodeBase } from './shared/Node'; +import { type ExpressionNode, NodeBase, onlyIncludeSelf } from './shared/Node'; export default class Decorator extends NodeBase { declare type: NodeType.tDecorator; @@ -18,3 +18,5 @@ export default class Decorator extends NodeBase { ); } } + +Decorator.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/DoWhileStatement.ts b/src/ast/nodes/DoWhileStatement.ts index 7b74b9ad7..1878ca42a 100644 --- a/src/ast/nodes/DoWhileStatement.ts +++ b/src/ast/nodes/DoWhileStatement.ts @@ -1,12 +1,14 @@ import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; +import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; import { + doNotDeoptimize, type ExpressionNode, type IncludeChildren, + onlyIncludeSelfNoDeoptimize, StatementBase, type StatementNode } from './shared/Node'; -import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; export default class DoWhileStatement extends StatementBase { declare body: StatementNode; @@ -24,3 +26,6 @@ export default class DoWhileStatement extends StatementBase { includeLoopBody(context, this.body, includeChildrenRecursively); } } + +DoWhileStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +DoWhileStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/EmptyStatement.ts b/src/ast/nodes/EmptyStatement.ts index 464157b1c..bfe36c368 100644 --- a/src/ast/nodes/EmptyStatement.ts +++ b/src/ast/nodes/EmptyStatement.ts @@ -1,5 +1,5 @@ import type * as NodeType from './NodeType'; -import { StatementBase } from './shared/Node'; +import { onlyIncludeSelf, StatementBase } from './shared/Node'; export default class EmptyStatement extends StatementBase { declare type: NodeType.tEmptyStatement; @@ -8,3 +8,5 @@ export default class EmptyStatement extends StatementBase { return false; } } + +EmptyStatement.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/ExportAllDeclaration.ts b/src/ast/nodes/ExportAllDeclaration.ts index bd4bd6db3..19b97ec26 100644 --- a/src/ast/nodes/ExportAllDeclaration.ts +++ b/src/ast/nodes/ExportAllDeclaration.ts @@ -4,7 +4,7 @@ import type Identifier from './Identifier'; import type ImportAttribute from './ImportAttribute'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ExportAllDeclaration extends NodeBase { declare attributes: ImportAttribute[]; @@ -25,8 +25,8 @@ export default class ExportAllDeclaration extends NodeBase { render(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { code.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!); } - - protected applyDeoptimizations() {} } ExportAllDeclaration.prototype.needsBoundaries = true; +ExportAllDeclaration.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ExportAllDeclaration.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ExportDefaultDeclaration.ts b/src/ast/nodes/ExportDefaultDeclaration.ts index 843a8385a..bf62838d9 100644 --- a/src/ast/nodes/ExportDefaultDeclaration.ts +++ b/src/ast/nodes/ExportDefaultDeclaration.ts @@ -9,12 +9,20 @@ import { getSystemExportStatement } from '../../utils/systemJsRendering'; import { treeshakeNode } from '../../utils/treeshakeNode'; import type { InclusionContext } from '../ExecutionContext'; import type ModuleScope from '../scopes/ModuleScope'; +import type { ObjectPath } from '../utils/PathTracker'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type ExportDefaultVariable from '../variables/ExportDefaultVariable'; import ClassDeclaration from './ClassDeclaration'; import FunctionDeclaration from './FunctionDeclaration'; import type Identifier from './Identifier'; import * as NodeType from './NodeType'; -import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; +import { + doNotDeoptimize, + type ExpressionNode, + type IncludeChildren, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './shared/Node'; // The header ends at the first non-white-space after "default" function getDeclarationStart(code: string, start: number): number { @@ -42,12 +50,18 @@ export default class ExportDefaultDeclaration extends NodeBase { declare private declarationName: string | undefined; include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - super.include(context, includeChildrenRecursively); + this.included = true; + this.declaration.include(context, includeChildrenRecursively); if (includeChildrenRecursively) { - this.scope.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable, UNKNOWN_PATH, context); } } + includePath(path: ObjectPath, context: InclusionContext): void { + this.included = true; + this.declaration.includePath(path, context); + } + initialise(): void { super.initialise(); const declaration = this.declaration as FunctionDeclaration | ClassDeclaration; @@ -106,8 +120,6 @@ export default class ExportDefaultDeclaration extends NodeBase { this.declaration.render(code, options); } - protected applyDeoptimizations() {} - private renderNamedDeclaration( code: MagicString, declarationStart: number, @@ -169,3 +181,5 @@ export default class ExportDefaultDeclaration extends NodeBase { } ExportDefaultDeclaration.prototype.needsBoundaries = true; +ExportDefaultDeclaration.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ExportDefaultDeclaration.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ExportNamedDeclaration.ts b/src/ast/nodes/ExportNamedDeclaration.ts index 332de1d0c..7b53d090b 100644 --- a/src/ast/nodes/ExportNamedDeclaration.ts +++ b/src/ast/nodes/ExportNamedDeclaration.ts @@ -7,8 +7,8 @@ import type FunctionDeclaration from './FunctionDeclaration'; import type ImportAttribute from './ImportAttribute'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; +import { doNotDeoptimize, type Node, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; import type VariableDeclaration from './VariableDeclaration'; -import { type Node, NodeBase } from './shared/Node'; export default class ExportNamedDeclaration extends NodeBase { declare attributes: ImportAttribute[]; @@ -45,8 +45,8 @@ export default class ExportNamedDeclaration extends NodeBase { (this.declaration as Node).render(code, options, { end, start }); } } - - protected applyDeoptimizations() {} } ExportNamedDeclaration.prototype.needsBoundaries = true; +ExportNamedDeclaration.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ExportNamedDeclaration.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ExportSpecifier.ts b/src/ast/nodes/ExportSpecifier.ts index f4dc7a91f..793756132 100644 --- a/src/ast/nodes/ExportSpecifier.ts +++ b/src/ast/nodes/ExportSpecifier.ts @@ -1,12 +1,13 @@ import type Identifier from './Identifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ExportSpecifier extends NodeBase { declare exported: Identifier | Literal; declare local: Identifier | Literal; declare type: NodeType.tExportSpecifier; - - protected applyDeoptimizations() {} } + +ExportSpecifier.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ExportSpecifier.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ExpressionStatement.ts b/src/ast/nodes/ExpressionStatement.ts index cf1880e94..2aecbf6f4 100644 --- a/src/ast/nodes/ExpressionStatement.ts +++ b/src/ast/nodes/ExpressionStatement.ts @@ -4,7 +4,12 @@ import { logModuleLevelDirective } from '../../utils/logs'; import type { RenderOptions } from '../../utils/renderHelpers'; import type { InclusionContext } from '../ExecutionContext'; import * as NodeType from './NodeType'; -import { type ExpressionNode, StatementBase } from './shared/Node'; +import { + doNotDeoptimize, + type ExpressionNode, + onlyIncludeSelfNoDeoptimize, + StatementBase +} from './shared/Node'; export default class ExpressionStatement extends StatementBase { declare directive?: string; @@ -43,6 +48,7 @@ export default class ExpressionStatement extends StatementBase { return super.shouldBeIncluded(context); } - - protected applyDeoptimizations() {} } + +ExpressionStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ExpressionStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ForInStatement.ts b/src/ast/nodes/ForInStatement.ts index c078d09e5..8cd8e4538 100644 --- a/src/ast/nodes/ForInStatement.ts +++ b/src/ast/nodes/ForInStatement.ts @@ -3,11 +3,10 @@ import { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; -import { EMPTY_PATH } from '../utils/PathTracker'; -import type MemberExpression from './MemberExpression'; +import { EMPTY_PATH, UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; -import type VariableDeclaration from './VariableDeclaration'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; +import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; import { type ExpressionNode, type IncludeChildren, @@ -15,11 +14,11 @@ import { type StatementNode } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; -import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; +import type VariableDeclaration from './VariableDeclaration'; export default class ForInStatement extends StatementBase { declare body: StatementNode; - declare left: VariableDeclaration | PatternNode | MemberExpression; + declare left: VariableDeclaration | PatternNode; declare right: ExpressionNode; declare type: NodeType.tForInStatement; @@ -37,12 +36,18 @@ export default class ForInStatement extends StatementBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { body, deoptimized, left, right } = this; if (!deoptimized) this.applyDeoptimizations(); - this.included = true; + if (!this.included) this.includeNode(context); left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); right.include(context, includeChildrenRecursively); includeLoopBody(context, body, includeChildrenRecursively); } + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.right.includePath(UNKNOWN_PATH, context); + } + initialise() { super.initialise(); this.left.setAssignedValue(UNKNOWN_EXPRESSION); @@ -58,7 +63,7 @@ export default class ForInStatement extends StatementBase { this.body.render(code, options); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.scope.context.requestTreeshakingPass(); diff --git a/src/ast/nodes/ForOfStatement.ts b/src/ast/nodes/ForOfStatement.ts index 227075a69..100f3742a 100644 --- a/src/ast/nodes/ForOfStatement.ts +++ b/src/ast/nodes/ForOfStatement.ts @@ -4,11 +4,10 @@ import type { InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; import { EMPTY_PATH, UNKNOWN_PATH } from '../utils/PathTracker'; -import type MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; -import type VariableDeclaration from './VariableDeclaration'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; +import { includeLoopBody } from './shared/loops'; import { type ExpressionNode, type IncludeChildren, @@ -16,11 +15,11 @@ import { type StatementNode } from './shared/Node'; import type { PatternNode } from './shared/Pattern'; -import { includeLoopBody } from './shared/loops'; +import type VariableDeclaration from './VariableDeclaration'; export default class ForOfStatement extends StatementBase { declare body: StatementNode; - declare left: VariableDeclaration | PatternNode | MemberExpression; + declare left: VariableDeclaration | PatternNode; declare right: ExpressionNode; declare type: NodeType.tForOfStatement; @@ -44,12 +43,18 @@ export default class ForOfStatement extends StatementBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { const { body, deoptimized, left, right } = this; if (!deoptimized) this.applyDeoptimizations(); - this.included = true; + if (!this.included) this.includeNode(context); left.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false); right.include(context, includeChildrenRecursively); includeLoopBody(context, body, includeChildrenRecursively); } + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.right.includePath(UNKNOWN_PATH, context); + } + initialise() { super.initialise(); this.left.setAssignedValue(UNKNOWN_EXPRESSION); @@ -65,7 +70,7 @@ export default class ForOfStatement extends StatementBase { this.body.render(code, options); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.left.deoptimizePath(EMPTY_PATH); this.right.deoptimizePath(UNKNOWN_PATH); diff --git a/src/ast/nodes/ForStatement.ts b/src/ast/nodes/ForStatement.ts index 1fe86e73e..748ec5a60 100644 --- a/src/ast/nodes/ForStatement.ts +++ b/src/ast/nodes/ForStatement.ts @@ -4,14 +4,16 @@ import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; import type * as NodeType from './NodeType'; -import type VariableDeclaration from './VariableDeclaration'; +import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; import { + doNotDeoptimize, type ExpressionNode, type IncludeChildren, + onlyIncludeSelfNoDeoptimize, StatementBase, type StatementNode } from './shared/Node'; -import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; +import type VariableDeclaration from './VariableDeclaration'; export default class ForStatement extends StatementBase { declare body: StatementNode; @@ -37,7 +39,9 @@ export default class ForStatement extends StatementBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { this.included = true; - this.init?.include(context, includeChildrenRecursively, { asSingleStatement: true }); + this.init?.include(context, includeChildrenRecursively, { + asSingleStatement: true + }); this.test?.include(context, includeChildrenRecursively); this.update?.include(context, includeChildrenRecursively); includeLoopBody(context, this.body, includeChildrenRecursively); @@ -50,3 +54,6 @@ export default class ForStatement extends StatementBase { this.body.render(code, options); } } + +ForStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ForStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/Identifier.ts b/src/ast/nodes/Identifier.ts index c513e800b..b74e063ea 100644 --- a/src/ast/nodes/Identifier.ts +++ b/src/ast/nodes/Identifier.ts @@ -1,23 +1,39 @@ import isReference, { type NodeWithFieldDefinition } from 'is-reference'; import type MagicString from 'magic-string'; +import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { createHasEffectsContext } from '../ExecutionContext'; +import { INTERACTION_ACCESSED, NODE_INTERACTION_UNKNOWN_ACCESS } from '../NodeInteractions'; import type FunctionScope from '../scopes/FunctionScope'; +import type { ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH, SHARED_RECURSION_TRACKER, UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import * as NodeType from './NodeType'; +import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; import { type ExpressionEntity } from './shared/Expression'; import IdentifierBase from './shared/IdentifierBase'; -import type { PatternNode } from './shared/Pattern'; +import { ObjectMember } from './shared/ObjectMember'; +import type { DeclarationPatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; export type IdentifierWithVariable = Identifier & { variable: Variable }; -export default class Identifier extends IdentifierBase implements PatternNode { +export default class Identifier extends IdentifierBase implements DeclarationPatternNode { name!: string; type!: NodeType.tIdentifier; variable: Variable | null = null; + private get isDestructuringDeoptimized(): boolean { + return isFlagSet(this.flags, Flag.destructuringDeoptimized); + } + + private set isDestructuringDeoptimized(value: boolean) { + this.flags = setFlag(this.flags, Flag.destructuringDeoptimized, value); + } + addExportedVariables( variables: Variable[], exportNamesByVariable: ReadonlyMap @@ -35,44 +51,90 @@ export default class Identifier extends IdentifierBase implements PatternNode { } } - declare(kind: VariableKind, init: ExpressionEntity): LocalVariable[] { + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[] { let variable: LocalVariable; const { treeshake } = this.scope.context.options; - switch (kind) { - case 'var': { - variable = this.scope.addDeclaration(this, this.scope.context, init, kind); - if (treeshake && treeshake.correctVarValueBeforeDeclaration) { - // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. - variable.markInitializersForDeoptimization(); - } - break; - } - case 'function': { - // in strict mode, functions are only hoisted within a scope but not across block scopes - variable = this.scope.addDeclaration(this, this.scope.context, init, kind); - break; - } - case 'let': - case 'const': - case 'using': - case 'await using': - case 'class': { - variable = this.scope.addDeclaration(this, this.scope.context, init, kind); - break; - } - case 'parameter': { - variable = (this.scope as FunctionScope).addParameterDeclaration(this); - break; - } - /* istanbul ignore next */ - default: { - /* istanbul ignore next */ - throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`); + if (kind === 'parameter') { + variable = (this.scope as FunctionScope).addParameterDeclaration(this, destructuredInitPath); + } else { + variable = this.scope.addDeclaration( + this, + this.scope.context, + init, + destructuredInitPath, + kind + ); + if (kind === 'var' && treeshake && treeshake.correctVarValueBeforeDeclaration) { + // Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here. + variable.markInitializersForDeoptimization(); } } return [(this.variable = variable)]; } + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity) { + this.deoptimizePath(EMPTY_PATH); + init.deoptimizePath([...destructuredInitPath, UnknownKey]); + } + + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + return ( + destructuredInitPath.length > 0 && + init.hasEffectsOnInteractionAtPath( + destructuredInitPath, + NODE_INTERACTION_UNKNOWN_ACCESS, + context + ) + ); + } + + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + if (destructuredInitPath.length > 0 && !this.isDestructuringDeoptimized) { + this.isDestructuringDeoptimized = true; + init.deoptimizeArgumentsOnInteractionAtPath( + { + args: [new ObjectMember(init, destructuredInitPath.slice(0, -1))], + type: INTERACTION_ACCESSED + }, + destructuredInitPath, + SHARED_RECURSION_TRACKER + ); + } + const { propertyReadSideEffects } = this.scope.context.options + .treeshake as NormalizedTreeshakingOptions; + if ( + (this.included ||= + destructuredInitPath.length > 0 && + !context.brokenFlow && + propertyReadSideEffects && + (propertyReadSideEffects === 'always' || + init.hasEffectsOnInteractionAtPath( + destructuredInitPath, + NODE_INTERACTION_UNKNOWN_ACCESS, + createHasEffectsContext() + ))) + ) { + if (this.variable && !this.variable.included) { + this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context); + } + init.includePath(destructuredInitPath, context); + return true; + } + return false; + } + markDeclarationReached(): void { this.variable!.initReached = true; } diff --git a/src/ast/nodes/IfStatement.ts b/src/ast/nodes/IfStatement.ts index f6497fe87..931d0d372 100644 --- a/src/ast/nodes/IfStatement.ts +++ b/src/ast/nodes/IfStatement.ts @@ -10,9 +10,11 @@ import type Identifier from './Identifier'; import * as NodeType from './NodeType'; import { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression'; import { + doNotDeoptimize, type ExpressionNode, type GenericEsTreeNode, type IncludeChildren, + onlyIncludeSelfNoDeoptimize, StatementBase, type StatementNode } from './shared/Node'; @@ -121,8 +123,6 @@ export default class IfStatement extends StatementBase implements DeoptimizableE this.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess); } - protected applyDeoptimizations() {} - private getTestValue(): LiteralValueOrUnknown { if (this.testValue === unset) { return (this.testValue = tryCastLiteralValueToBoolean( @@ -207,3 +207,6 @@ export default class IfStatement extends StatementBase implements DeoptimizableE return false; } } + +IfStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +IfStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ImportDeclaration.ts b/src/ast/nodes/ImportDeclaration.ts index 945737ee8..d279d26b2 100644 --- a/src/ast/nodes/ImportDeclaration.ts +++ b/src/ast/nodes/ImportDeclaration.ts @@ -6,7 +6,7 @@ import type ImportNamespaceSpecifier from './ImportNamespaceSpecifier'; import type ImportSpecifier from './ImportSpecifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ImportDeclaration extends NodeBase { declare attributes: ImportAttribute[]; @@ -30,8 +30,8 @@ export default class ImportDeclaration extends NodeBase { render(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void { code.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!); } - - protected applyDeoptimizations() {} } ImportDeclaration.prototype.needsBoundaries = true; +ImportDeclaration.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ImportDeclaration.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ImportDefaultSpecifier.ts b/src/ast/nodes/ImportDefaultSpecifier.ts index 910792842..e355254a5 100644 --- a/src/ast/nodes/ImportDefaultSpecifier.ts +++ b/src/ast/nodes/ImportDefaultSpecifier.ts @@ -1,10 +1,11 @@ import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ImportDefaultSpecifier extends NodeBase { declare local: Identifier; declare type: NodeType.tImportDefaultSpecifier; - - protected applyDeoptimizations() {} } + +ImportDefaultSpecifier.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ImportDefaultSpecifier.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ImportExpression.ts b/src/ast/nodes/ImportExpression.ts index c16ad8303..a50cc680d 100644 --- a/src/ast/nodes/ImportExpression.ts +++ b/src/ast/nodes/ImportExpression.ts @@ -2,16 +2,18 @@ import type MagicString from 'magic-string'; import ExternalModule from '../../ExternalModule'; import type Module from '../../Module'; import type { AstNode, GetInterop, NormalizedOutputOptions } from '../../rollup/types'; -import type { PluginDriver } from '../../utils/PluginDriver'; import { EMPTY_ARRAY } from '../../utils/blank'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; import { INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE, namespaceInteropHelpersByInteropType } from '../../utils/interopHelpers'; +import type { PluginDriver } from '../../utils/PluginDriver'; import { findFirstOccurrenceOutsideComment, type RenderOptions } from '../../utils/renderHelpers'; import type { InclusionContext } from '../ExecutionContext'; import type ChildScope from '../scopes/ChildScope'; +import type { ObjectPath } from '../utils/PathTracker'; +import { UnknownKey } from '../utils/PathTracker'; import type NamespaceVariable from '../variables/NamespaceVariable'; import ArrowFunctionExpression from './ArrowFunctionExpression'; import AwaitExpression from './AwaitExpression'; @@ -22,13 +24,14 @@ import Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import ObjectPattern from './ObjectPattern'; -import VariableDeclarator from './VariableDeclarator'; import { + doNotDeoptimize, type ExpressionNode, type GenericEsTreeNode, type IncludeChildren, NodeBase } from './shared/Node'; +import VariableDeclarator from './VariableDeclarator'; interface DynamicImportMechanism { left: string; @@ -42,6 +45,8 @@ export default class ImportExpression extends NodeBase { declare type: NodeType.tImportExpression; declare sourceAstNode: AstNode; + private hasUnknownAccessedKey = false; + private accessedPropKey = new Set(); private attributes: string | null | true = null; private mechanism: DynamicImportMechanism | null = null; private namespaceExportName: string | false | undefined = undefined; @@ -79,12 +84,15 @@ export default class ImportExpression extends NodeBase { return EMPTY_ARRAY; } - // Case 1: const { foo } = await import('bar') + // Case 1: const { foo } / module = await import('bar') if (parent2 instanceof VariableDeclarator) { const declaration = parent2.id; - return declaration instanceof ObjectPattern - ? getDeterministicObjectDestructure(declaration) - : undefined; + if (declaration instanceof Identifier) { + return this.hasUnknownAccessedKey ? undefined : [...this.accessedPropKey]; + } + if (declaration instanceof ObjectPattern) { + return getDeterministicObjectDestructure(declaration); + } } // Case 2: (await import('bar')).foo @@ -152,14 +160,29 @@ export default class ImportExpression extends NodeBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - if (!this.included) { - this.included = true; - this.scope.context.includeDynamicImport(this); - this.scope.addAccessedDynamicImport(this); - } + if (!this.included) this.includeNode(); this.source.include(context, includeChildrenRecursively); } + includeNode() { + this.included = true; + this.scope.context.includeDynamicImport(this); + this.scope.addAccessedDynamicImport(this); + } + + includePath(path: ObjectPath): void { + if (!this.included) this.includeNode(); + // Technically, this is not correct as dynamic imports return a Promise. + if (this.hasUnknownAccessedKey) return; + if (path[0] === UnknownKey) { + this.hasUnknownAccessedKey = true; + } else if (typeof path[0] === 'string') { + this.accessedPropKey.add(path[0]); + } + // Update included paths + this.scope.context.includeDynamicImport(this); + } + initialise(): void { super.initialise(); this.scope.context.addDynamicImport(this); @@ -262,8 +285,6 @@ export default class ImportExpression extends NodeBase { this.inlineNamespace = inlineNamespace; } - protected applyDeoptimizations() {} - private getDynamicImportMechanismAndHelper( resolution: Module | ExternalModule | string | null, exportMode: 'none' | 'named' | 'default' | 'external', @@ -369,6 +390,8 @@ export default class ImportExpression extends NodeBase { } } +ImportExpression.prototype.applyDeoptimizations = doNotDeoptimize; + function getInteropHelper( resolution: Module | ExternalModule | string | null, exportMode: 'none' | 'named' | 'default' | 'external', diff --git a/src/ast/nodes/ImportNamespaceSpecifier.ts b/src/ast/nodes/ImportNamespaceSpecifier.ts index f4d4d1dd0..7fa92cf96 100644 --- a/src/ast/nodes/ImportNamespaceSpecifier.ts +++ b/src/ast/nodes/ImportNamespaceSpecifier.ts @@ -1,10 +1,11 @@ import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ImportNamespaceSpecifier extends NodeBase { declare local: Identifier; declare type: NodeType.tImportNamespaceSpecifier; - - protected applyDeoptimizations() {} } + +ImportNamespaceSpecifier.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ImportNamespaceSpecifier.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ImportSpecifier.ts b/src/ast/nodes/ImportSpecifier.ts index d8b589dfc..1cde4f4ac 100644 --- a/src/ast/nodes/ImportSpecifier.ts +++ b/src/ast/nodes/ImportSpecifier.ts @@ -1,12 +1,13 @@ import type Identifier from './Identifier'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; export default class ImportSpecifier extends NodeBase { declare imported: Identifier | Literal; declare local: Identifier; declare type: NodeType.tImportSpecifier; - - protected applyDeoptimizations() {} } + +ImportSpecifier.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ImportSpecifier.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/JSXAttribute.ts b/src/ast/nodes/JSXAttribute.ts index b16287d9d..b43818c6e 100644 --- a/src/ast/nodes/JSXAttribute.ts +++ b/src/ast/nodes/JSXAttribute.ts @@ -9,7 +9,7 @@ import JSXIdentifier from './JSXIdentifier'; import type JSXNamespacedName from './JSXNamespacedName'; import type Literal from './Literal'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class JSXAttribute extends NodeBase { type!: NodeType.tJSXAttribute; @@ -36,3 +36,5 @@ export default class JSXAttribute extends NodeBase { } } } + +JSXAttribute.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/JSXElement.ts b/src/ast/nodes/JSXElement.ts index cd5ab4f44..7fd37b5f3 100644 --- a/src/ast/nodes/JSXElement.ts +++ b/src/ast/nodes/JSXElement.ts @@ -1,6 +1,7 @@ import type MagicString from 'magic-string'; import type { NormalizedJsxOptions } from '../../rollup/types'; import type { RenderOptions } from '../../utils/renderHelpers'; +import type { InclusionContext } from '../ExecutionContext'; import JSXAttribute from './JSXAttribute'; import type JSXClosingElement from './JSXClosingElement'; import type JSXOpeningElement from './JSXOpeningElement'; @@ -8,6 +9,7 @@ import JSXSpreadAttribute from './JSXSpreadAttribute'; import type * as NodeType from './NodeType'; import JSXElementBase from './shared/JSXElementBase'; import type { JSXChild, JsxMode } from './shared/jsxHelpers'; +import type { IncludeChildren } from './shared/Node'; export default class JSXElement extends JSXElementBase { type!: NodeType.tJSXElement; @@ -15,6 +17,12 @@ export default class JSXElement extends JSXElementBase { closingElement!: JSXClosingElement | null; children!: JSXChild[]; + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { + super.include(context, includeChildrenRecursively); + this.openingElement.include(context, includeChildrenRecursively); + this.closingElement?.include(context, includeChildrenRecursively); + } + render(code: MagicString, options: RenderOptions): void { switch (this.jsxMode.mode) { case 'classic': { diff --git a/src/ast/nodes/JSXEmptyExpression.ts b/src/ast/nodes/JSXEmptyExpression.ts index 87d3b29a1..8ae56517c 100644 --- a/src/ast/nodes/JSXEmptyExpression.ts +++ b/src/ast/nodes/JSXEmptyExpression.ts @@ -1,6 +1,8 @@ import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class JSXEmptyExpression extends NodeBase { type!: NodeType.tJSXEmptyExpression; } + +JSXEmptyExpression.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/JSXExpressionContainer.ts b/src/ast/nodes/JSXExpressionContainer.ts index d4b001629..4d71c3891 100644 --- a/src/ast/nodes/JSXExpressionContainer.ts +++ b/src/ast/nodes/JSXExpressionContainer.ts @@ -1,6 +1,8 @@ import type MagicString from 'magic-string'; import type { NormalizedJsxOptions } from '../../rollup/types'; import type { RenderOptions } from '../../utils/renderHelpers'; +import type { InclusionContext } from '../ExecutionContext'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type JSXEmptyExpression from './JSXEmptyExpression'; import type * as NodeType from './NodeType'; import type { ExpressionNode } from './shared/Node'; @@ -10,6 +12,12 @@ export default class JSXExpressionContainer extends NodeBase { type!: NodeType.tJSXExpressionContainer; expression!: ExpressionNode | JSXEmptyExpression; + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.expression.includePath(UNKNOWN_PATH, context); + } + render(code: MagicString, options: RenderOptions): void { const { mode } = this.scope.context.options.jsx as NormalizedJsxOptions; if (mode !== 'preserve') { diff --git a/src/ast/nodes/JSXFragment.ts b/src/ast/nodes/JSXFragment.ts index a239459c8..1f04e9f75 100644 --- a/src/ast/nodes/JSXFragment.ts +++ b/src/ast/nodes/JSXFragment.ts @@ -1,10 +1,12 @@ import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; +import type { InclusionContext } from '../ExecutionContext'; import type JSXClosingFragment from './JSXClosingFragment'; import type JSXOpeningFragment from './JSXOpeningFragment'; import type * as NodeType from './NodeType'; import JSXElementBase from './shared/JSXElementBase'; import type { JSXChild } from './shared/jsxHelpers'; +import type { IncludeChildren } from './shared/Node'; export default class JSXFragment extends JSXElementBase { type!: NodeType.tJSXElement; @@ -12,6 +14,12 @@ export default class JSXFragment extends JSXElementBase { children!: JSXChild[]; closingFragment!: JSXClosingFragment; + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { + super.include(context, includeChildrenRecursively); + this.openingFragment.include(context, includeChildrenRecursively); + this.closingFragment.include(context, includeChildrenRecursively); + } + render(code: MagicString, options: RenderOptions): void { switch (this.jsxMode.mode) { case 'classic': { diff --git a/src/ast/nodes/JSXIdentifier.ts b/src/ast/nodes/JSXIdentifier.ts index f75763283..89847c433 100644 --- a/src/ast/nodes/JSXIdentifier.ts +++ b/src/ast/nodes/JSXIdentifier.ts @@ -1,6 +1,9 @@ import type MagicString from 'magic-string'; import type { NormalizedJsxOptions } from '../../rollup/types'; import type { RenderOptions } from '../../utils/renderHelpers'; +import type { InclusionContext } from '../ExecutionContext'; +import type { ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH } from '../utils/PathTracker'; import type JSXMemberExpression from './JSXMemberExpression'; import type * as NodeType from './NodeType'; import IdentifierBase from './shared/IdentifierBase'; @@ -27,6 +30,29 @@ export default class JSXIdentifier extends IdentifierBase { } } + include(context: InclusionContext): void { + if (!this.included) this.includeNode(context); + } + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + if (this.variable !== null) { + this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context); + } + } + + includePath(path: ObjectPath, context: InclusionContext): void { + if (!this.included) { + this.included = true; + if (this.variable !== null) { + this.scope.context.includeVariableInModule(this.variable, path, context); + } + } else if (path.length > 0) { + this.variable?.includePath(path, context); + } + } + render( code: MagicString, { snippets: { getPropertyAccess }, useOriginalName }: RenderOptions diff --git a/src/ast/nodes/JSXMemberExpression.ts b/src/ast/nodes/JSXMemberExpression.ts index 1212066f3..f20963163 100644 --- a/src/ast/nodes/JSXMemberExpression.ts +++ b/src/ast/nodes/JSXMemberExpression.ts @@ -1,3 +1,5 @@ +import type { InclusionContext } from '../ExecutionContext'; +import type { ObjectPath } from '../utils/PathTracker'; import type JSXIdentifier from './JSXIdentifier'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; @@ -6,4 +8,15 @@ export default class JSXMemberExpression extends NodeBase { type!: NodeType.tJSXMemberExpression; object!: JSXMemberExpression | JSXIdentifier; property!: JSXIdentifier; + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.object.includePath([this.property.name], context); + } + + includePath(path: ObjectPath, context: InclusionContext) { + if (!this.included) this.includeNode(context); + this.object.includePath([this.property.name, ...path], context); + } } diff --git a/src/ast/nodes/JSXNamespacedName.ts b/src/ast/nodes/JSXNamespacedName.ts index 5172b2a47..086568a3d 100644 --- a/src/ast/nodes/JSXNamespacedName.ts +++ b/src/ast/nodes/JSXNamespacedName.ts @@ -1,9 +1,11 @@ import type JSXIdentifier from './JSXIdentifier'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class JSXNamespacedName extends NodeBase { type!: NodeType.tJSXNamespacedName; name!: JSXIdentifier; namespace!: JSXIdentifier; } + +JSXNamespacedName.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/JSXOpeningElement.ts b/src/ast/nodes/JSXOpeningElement.ts index a7a57f06a..30261a955 100644 --- a/src/ast/nodes/JSXOpeningElement.ts +++ b/src/ast/nodes/JSXOpeningElement.ts @@ -7,7 +7,7 @@ import type JSXMemberExpression from './JSXMemberExpression'; import type JSXNamespacedName from './JSXNamespacedName'; import type JSXSpreadAttribute from './JSXSpreadAttribute'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class JSXOpeningElement extends NodeBase { type!: NodeType.tJSXOpeningElement; @@ -28,3 +28,5 @@ export default class JSXOpeningElement extends NodeBase { } } } + +JSXOpeningElement.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/JSXOpeningFragment.ts b/src/ast/nodes/JSXOpeningFragment.ts index 6d50740c1..15d67eac1 100644 --- a/src/ast/nodes/JSXOpeningFragment.ts +++ b/src/ast/nodes/JSXOpeningFragment.ts @@ -5,7 +5,7 @@ import type { InclusionContext } from '../ExecutionContext'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { getAndIncludeFactoryVariable } from './shared/jsxHelpers'; -import { type IncludeChildren, NodeBase } from './shared/Node'; +import { NodeBase } from './shared/Node'; export default class JSXOpeningFragment extends NodeBase { type!: NodeType.tJSXOpeningElement; @@ -15,31 +15,32 @@ export default class JSXOpeningFragment extends NodeBase { private fragment: string | null = null; private fragmentVariable: Variable | null = null; - include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { - if (!this.included) { - const jsx = this.scope.context.options.jsx as NormalizedJsxOptions; - if (jsx.mode === 'automatic') { - this.fragment = 'Fragment'; + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + const jsx = this.scope.context.options.jsx as NormalizedJsxOptions; + if (jsx.mode === 'automatic') { + this.fragment = 'Fragment'; + this.fragmentVariable = getAndIncludeFactoryVariable( + 'Fragment', + false, + jsx.jsxImportSource, + this, + context + ); + } else { + const { fragment, importSource, mode } = jsx; + if (fragment != null) { + this.fragment = fragment; this.fragmentVariable = getAndIncludeFactoryVariable( - 'Fragment', - false, - jsx.jsxImportSource, - this + fragment, + mode === 'preserve', + importSource, + this, + context ); - } else { - const { fragment, importSource, mode } = jsx; - if (fragment != null) { - this.fragment = fragment; - this.fragmentVariable = getAndIncludeFactoryVariable( - fragment, - mode === 'preserve', - importSource, - this - ); - } } } - super.include(context, includeChildrenRecursively); } render(code: MagicString, options: RenderOptions): void { diff --git a/src/ast/nodes/JSXText.ts b/src/ast/nodes/JSXText.ts index 59e905cda..e06d0383d 100644 --- a/src/ast/nodes/JSXText.ts +++ b/src/ast/nodes/JSXText.ts @@ -1,7 +1,7 @@ import type MagicString from 'magic-string'; import type { NormalizedJsxOptions } from '../../rollup/types'; import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class JSXText extends NodeBase { type!: NodeType.tJSXText; @@ -17,3 +17,5 @@ export default class JSXText extends NodeBase { } } } + +JSXText.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/LabeledStatement.ts b/src/ast/nodes/LabeledStatement.ts index 57162a566..aea5d2787 100644 --- a/src/ast/nodes/LabeledStatement.ts +++ b/src/ast/nodes/LabeledStatement.ts @@ -4,10 +4,16 @@ import { findNonWhiteSpace, type RenderOptions } from '../../utils/renderHelpers'; -import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type Identifier from './Identifier'; import type * as NodeType from './NodeType'; -import { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; +import { + doNotDeoptimize, + type IncludeChildren, + StatementBase, + type StatementNode +} from './shared/Node'; export default class LabeledStatement extends StatementBase { declare body: StatementNode; @@ -33,18 +39,23 @@ export default class LabeledStatement extends StatementBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - this.included = true; + if (!this.included) this.includeNode(context); const { brokenFlow, includedLabels } = context; context.includedLabels = new Set(); this.body.include(context, includeChildrenRecursively); if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) { - this.label.include(); + this.label.include(context); context.includedLabels.delete(this.label.name); context.brokenFlow = brokenFlow; } context.includedLabels = new Set([...includedLabels, ...context.includedLabels]); } + includeNode(context: InclusionContext) { + this.included = true; + this.body.includePath(UNKNOWN_PATH, context); + } + render(code: MagicString, options: RenderOptions): void { if (this.label.included) { this.label.render(code, options); @@ -60,3 +71,5 @@ export default class LabeledStatement extends StatementBase { this.body.render(code, options); } } + +LabeledStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/Literal.ts b/src/ast/nodes/Literal.ts index f5c12569a..9ac887b53 100644 --- a/src/ast/nodes/Literal.ts +++ b/src/ast/nodes/Literal.ts @@ -20,7 +20,7 @@ import { UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; -import { type GenericEsTreeNode, NodeBase } from './shared/Node'; +import { type GenericEsTreeNode, NodeBase, onlyIncludeSelf } from './shared/Node'; export type LiteralValue = string | boolean | null | number | RegExp | undefined; export type LiteralValueOrBigInt = LiteralValue | bigint; @@ -107,3 +107,5 @@ export default class Literal< } } } + +Literal.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/LogicalExpression.ts b/src/ast/nodes/LogicalExpression.ts index 999146cd4..d2eee96f2 100644 --- a/src/ast/nodes/LogicalExpression.ts +++ b/src/ast/nodes/LogicalExpression.ts @@ -10,11 +10,12 @@ import { } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { createInclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, SHARED_RECURSION_TRACKER, UNKNOWN_PATH } from '../utils/PathTracker'; @@ -29,7 +30,13 @@ import { UnknownValue } from './shared/Expression'; import { MultiExpression } from './shared/MultiExpression'; -import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; +import { + doNotDeoptimize, + type ExpressionNode, + type IncludeChildren, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './shared/Node'; export type LogicalOperator = '||' | '&&' | '??'; @@ -61,7 +68,7 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.left.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); this.right.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); @@ -74,6 +81,10 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable const unusedBranch = this.usedBranch === this.left ? this.right : this.left; this.usedBranch = null; unusedBranch.deoptimizePath(UNKNOWN_PATH); + if (this.included) { + // As we are not tracking inclusions, we just include everything + unusedBranch.includePath(UNKNOWN_PATH, createInclusionContext()); + } } const { scope: { context }, @@ -100,7 +111,7 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (origin === this) return UnknownValue; @@ -128,35 +139,36 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const usedBranch = this.getUsedBranch(); - if (!usedBranch) - return [ - new MultiExpression([ - this.left.getReturnExpressionWhenCalledAtPath( - path, - interaction, - recursionTracker, - origin - )[0], - this.right.getReturnExpressionWhenCalledAtPath( - path, - interaction, - recursionTracker, - origin - )[0] - ]), - false - ]; - this.expressionsToBeDeoptimized.push(origin); - return usedBranch.getReturnExpressionWhenCalledAtPath( - path, - interaction, - recursionTracker, - origin - ); + if (usedBranch) { + this.expressionsToBeDeoptimized.push(origin); + return usedBranch.getReturnExpressionWhenCalledAtPath( + path, + interaction, + recursionTracker, + origin + ); + } + return [ + new MultiExpression([ + this.left.getReturnExpressionWhenCalledAtPath( + path, + interaction, + recursionTracker, + origin + )[0], + this.right.getReturnExpressionWhenCalledAtPath( + path, + interaction, + recursionTracker, + origin + )[0] + ]), + false + ]; } hasEffects(context: HasEffectsContext): boolean { @@ -175,13 +187,13 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable context: HasEffectsContext ): boolean { const usedBranch = this.getUsedBranch(); - if (!usedBranch) { - return ( - this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || - this.right.hasEffectsOnInteractionAtPath(path, interaction, context) - ); + if (usedBranch) { + return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); } - return usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context); + return ( + this.left.hasEffectsOnInteractionAtPath(path, interaction, context) || + this.right.hasEffectsOnInteractionAtPath(path, interaction, context) + ); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { @@ -189,8 +201,8 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable const usedBranch = this.getUsedBranch(); if ( includeChildrenRecursively || - (usedBranch === this.right && this.left.shouldBeIncluded(context)) || - !usedBranch + !usedBranch || + (usedBranch === this.right && this.left.shouldBeIncluded(context)) ) { this.left.include(context, includeChildrenRecursively); this.right.include(context, includeChildrenRecursively); @@ -199,6 +211,17 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable } } + includePath(path: ObjectPath, context: InclusionContext): void { + this.included = true; + const usedBranch = this.getUsedBranch(); + if (!usedBranch || (usedBranch === this.right && this.left.shouldBeIncluded(context))) { + this.left.includePath(path, context); + this.right.includePath(path, context); + } else { + usedBranch.includePath(path, context); + } + } + removeAnnotations(code: MagicString) { this.left.removeAnnotations(code); } @@ -263,3 +286,6 @@ export default class LogicalExpression extends NodeBase implements Deoptimizable return this.usedBranch; } } + +LogicalExpression.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +LogicalExpression.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/MemberExpression.ts b/src/ast/nodes/MemberExpression.ts index 025201ce0..454e0b0e0 100644 --- a/src/ast/nodes/MemberExpression.ts +++ b/src/ast/nodes/MemberExpression.ts @@ -7,18 +7,24 @@ import { logIllegalImportReassignment, logMissingExport } from '../../utils/logs import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { createHasEffectsContext, createInclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionAccessed, NodeInteractionAssigned, NodeInteractionCalled } from '../NodeInteractions'; -import { INTERACTION_ACCESSED, INTERACTION_ASSIGNED } from '../NodeInteractions'; +import { + INTERACTION_ACCESSED, + INTERACTION_ASSIGNED, + NODE_INTERACTION_UNKNOWN_ACCESS +} from '../NodeInteractions'; +import { MAX_PATH_DEPTH } from '../utils/limitPathLength'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, type ObjectPathKey, - type PathTracker, SHARED_RECURSION_TRACKER, SymbolToStringTag, UNKNOWN_PATH, @@ -33,9 +39,8 @@ import Identifier from './Identifier'; import Literal from './Literal'; import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; -import type SpreadElement from './SpreadElement'; -import type Super from './Super'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; +import { getChainElementLiteralValueAtPath } from './shared/chainElements'; import { deoptimizeInteraction, type ExpressionEntity, @@ -45,10 +50,8 @@ import { } from './shared/Expression'; import type { ChainElement, ExpressionNode, IncludeChildren, SkippedChain } from './shared/Node'; import { IS_SKIPPED_CHAIN, NodeBase } from './shared/Node'; -import { getChainElementLiteralValueAtPath } from './shared/chainElements'; - -// To avoid infinite recursions -const MAX_PATH_DEPTH = 7; +import type { PatternNode } from './shared/Pattern'; +import type Super from './Super'; function getResolvablePropertyKey(memberExpression: MemberExpression): string | null { return memberExpression.computed @@ -95,16 +98,17 @@ function getStringFromPath(path: PathWithPositions): string { export default class MemberExpression extends NodeBase - implements DeoptimizableEntity, ChainElement + implements DeoptimizableEntity, ChainElement, PatternNode { declare object: ExpressionNode | Super; declare property: ExpressionNode | PrivateIdentifier; - declare propertyKey: ObjectPathKey | null; + declare propertyKey: ObjectPathKey; declare type: NodeType.tMemberExpression; variable: Variable | null = null; declare protected assignmentInteraction: NodeInteractionAssigned; declare private accessInteraction: NodeInteractionAccessed; private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; + declare private dynamicPropertyKey: ObjectPathKey | null; get computed(): boolean { return isFlagSet(this.flags, Flag.computed); @@ -167,7 +171,7 @@ export default class MemberExpression deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { if (this.variable) { this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); @@ -175,7 +179,7 @@ export default class MemberExpression if (path.length < MAX_PATH_DEPTH) { this.object.deoptimizeArgumentsOnInteractionAtPath( interaction, - [this.getPropertyKey(), ...path], + this.propertyKey === UnknownKey ? UNKNOWN_PATH : [this.propertyKey, ...path], recursionTracker ); } else { @@ -184,11 +188,20 @@ export default class MemberExpression } } + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity) { + this.deoptimizePath(EMPTY_PATH); + init.deoptimizePath([...destructuredInitPath, UnknownKey]); + } + deoptimizeCache(): void { + if (this.propertyKey === this.dynamicPropertyKey) return; const { expressionsToBeDeoptimized, object } = this; this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; - this.propertyKey = UnknownKey; + this.dynamicPropertyKey = this.propertyKey; object.deoptimizePath(UNKNOWN_PATH); + if (this.included) { + object.includePath(UNKNOWN_PATH, createInclusionContext()); + } for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } @@ -198,18 +211,20 @@ export default class MemberExpression if (path.length === 0) this.disallowNamespaceReassignment(); if (this.variable) { this.variable.deoptimizePath(path); - } else if (!this.isUndefined && path.length < MAX_PATH_DEPTH) { - const propertyKey = this.getPropertyKey(); + } else if (!this.isUndefined) { + const { propertyKey } = this; this.object.deoptimizePath([ propertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey, - ...path + ...(path.length < MAX_PATH_DEPTH + ? path + : [...path.slice(0, MAX_PATH_DEPTH), UnknownKey as ObjectPathKey]) ]); } } getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (this.variable) { @@ -218,20 +233,17 @@ export default class MemberExpression if (this.isUndefined) { return undefined; } - if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { - this.expressionsToBeDeoptimized.push(origin); - return this.object.getLiteralValueAtPath( - [this.getPropertyKey(), ...path], - recursionTracker, - origin - ); + const propertyKey = this.getDynamicPropertyKey(); + if (propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + if (propertyKey !== this.propertyKey) this.expressionsToBeDeoptimized.push(origin); + return this.object.getLiteralValueAtPath([propertyKey, ...path], recursionTracker, origin); } return UnknownValue; } getLiteralValueAtPathAsChainElement( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown | SkippedChain { if (this.variable) { @@ -246,7 +258,7 @@ export default class MemberExpression getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { if (this.variable) { @@ -260,10 +272,11 @@ export default class MemberExpression if (this.isUndefined) { return [UNDEFINED_EXPRESSION, false]; } - if (this.propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { - this.expressionsToBeDeoptimized.push(origin); + const propertyKey = this.getDynamicPropertyKey(); + if (propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) { + if (propertyKey !== this.propertyKey) this.expressionsToBeDeoptimized.push(origin); return this.object.getReturnExpressionWhenCalledAtPath( - [this.getPropertyKey(), ...path], + [propertyKey, ...path], interaction, recursionTracker, origin @@ -323,7 +336,7 @@ export default class MemberExpression } if (path.length < MAX_PATH_DEPTH) { return this.object.hasEffectsOnInteractionAtPath( - [this.getPropertyKey(), ...path], + [this.getDynamicPropertyKey(), ...path], interaction, context ); @@ -331,9 +344,52 @@ export default class MemberExpression return true; } + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + return ( + destructuredInitPath.length > 0 && + init.hasEffectsOnInteractionAtPath( + destructuredInitPath, + NODE_INTERACTION_UNKNOWN_ACCESS, + context + ) + ); + } + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { + if (!this.included) this.includeNode(context); + this.object.include(context, includeChildrenRecursively); + this.property.include(context, includeChildrenRecursively); + } + + includeNode(context: InclusionContext) { + this.included = true; if (!this.deoptimized) this.applyDeoptimizations(); - this.includeProperties(context, includeChildrenRecursively); + if (this.variable) { + this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context); + } else if (!this.isUndefined) { + this.object.includePath([this.propertyKey], context); + } + } + + includePath(path: ObjectPath, context: InclusionContext): void { + if (!this.included) this.includeNode(context); + if (this.variable) { + this.variable?.includePath(path, context); + } else if (!this.isUndefined) { + this.object.includePath( + [ + this.propertyKey, + ...(path.length < MAX_PATH_DEPTH + ? path + : [...path.slice(0, MAX_PATH_DEPTH), UnknownKey as ObjectPathKey]) + ], + context + ); + } } includeAsAssignmentTarget( @@ -345,24 +401,45 @@ export default class MemberExpression if (deoptimizeAccess) { this.include(context, includeChildrenRecursively); } else { - this.includeProperties(context, includeChildrenRecursively); + if (!this.included) this.includeNode(context); + this.object.include(context, includeChildrenRecursively); + this.property.include(context, includeChildrenRecursively); } } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { if (this.variable) { - this.variable.includeCallArguments(context, parameters); + this.variable.includeCallArguments(context, interaction); } else { - super.includeCallArguments(context, parameters); + super.includeCallArguments(context, interaction); + } + } + + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + if ( + (this.included ||= + destructuredInitPath.length > 0 && + !context.brokenFlow && + init.hasEffectsOnInteractionAtPath( + destructuredInitPath, + NODE_INTERACTION_UNKNOWN_ACCESS, + createHasEffectsContext() + )) + ) { + init.include(context, false); + return true; } + return false; } initialise(): void { super.initialise(); - this.propertyKey = getResolvablePropertyKey(this); + this.dynamicPropertyKey = getResolvablePropertyKey(this); + this.propertyKey = this.dynamicPropertyKey === null ? UnknownKey : this.dynamicPropertyKey; this.accessInteraction = { args: [this.object], type: INTERACTION_ACCESSED }; } @@ -401,7 +478,7 @@ export default class MemberExpression }; } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; const { propertyReadSideEffects } = this.scope.context.options .treeshake as NormalizedTreeshakingOptions; @@ -411,10 +488,9 @@ export default class MemberExpression propertyReadSideEffects && !(this.variable || this.isUndefined) ) { - const propertyKey = this.getPropertyKey(); this.object.deoptimizeArgumentsOnInteractionAtPath( this.accessInteraction, - [propertyKey], + [this.propertyKey], SHARED_RECURSION_TRACKER ); this.scope.context.requestTreeshakingPass(); @@ -437,7 +513,7 @@ export default class MemberExpression ) { this.object.deoptimizeArgumentsOnInteractionAtPath( this.assignmentInteraction, - [this.getPropertyKey()], + [this.propertyKey], SHARED_RECURSION_TRACKER ); this.scope.context.requestTreeshakingPass(); @@ -449,7 +525,11 @@ export default class MemberExpression const variable = this.scope.findVariable(this.object.name); if (variable.isNamespace) { if (this.variable) { - this.scope.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule( + this.variable, + UNKNOWN_PATH, + createInclusionContext() + ); } this.scope.context.log( LOGLEVEL_WARN, @@ -460,18 +540,18 @@ export default class MemberExpression } } - private getPropertyKey(): ObjectPathKey { - if (this.propertyKey === null) { - this.propertyKey = UnknownKey; + private getDynamicPropertyKey(): ObjectPathKey { + if (this.dynamicPropertyKey === null) { + this.dynamicPropertyKey = this.propertyKey; const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); - return (this.propertyKey = + return (this.dynamicPropertyKey = value === SymbolToStringTag ? value : typeof value === 'symbol' ? UnknownKey : String(value)); } - return this.propertyKey; + return this.dynamicPropertyKey; } private hasAccessEffect(context: HasEffectsContext) { @@ -482,26 +562,12 @@ export default class MemberExpression propertyReadSideEffects && (propertyReadSideEffects === 'always' || this.object.hasEffectsOnInteractionAtPath( - [this.getPropertyKey()], + [this.getDynamicPropertyKey()], this.accessInteraction, context )) ); } - - private includeProperties( - context: InclusionContext, - includeChildrenRecursively: IncludeChildren - ) { - if (!this.included) { - this.included = true; - if (this.variable) { - this.scope.context.includeVariableInModule(this.variable); - } - } - this.object.include(context, includeChildrenRecursively); - this.property.include(context, includeChildrenRecursively); - } } function resolveNamespaceVariables( diff --git a/src/ast/nodes/MetaProperty.ts b/src/ast/nodes/MetaProperty.ts index a16a85c07..5993f031f 100644 --- a/src/ast/nodes/MetaProperty.ts +++ b/src/ast/nodes/MetaProperty.ts @@ -47,18 +47,20 @@ export default class MetaProperty extends NodeBase { } include(): void { - if (!this.included) { - this.included = true; - if (this.meta.name === IMPORT) { - this.scope.context.addImportMeta(this); - const parent = this.parent; - const metaProperty = (this.metaProperty = - parent instanceof MemberExpression && typeof parent.propertyKey === 'string' - ? parent.propertyKey - : null); - if (metaProperty?.startsWith(FILE_PREFIX)) { - this.referenceId = metaProperty.slice(FILE_PREFIX.length); - } + if (!this.included) this.includeNode(); + } + + includeNode() { + this.included = true; + if (this.meta.name === IMPORT) { + this.scope.context.addImportMeta(this); + const parent = this.parent; + const metaProperty = (this.metaProperty = + parent instanceof MemberExpression && typeof parent.propertyKey === 'string' + ? parent.propertyKey + : null); + if (metaProperty?.startsWith(FILE_PREFIX)) { + this.referenceId = metaProperty.slice(FILE_PREFIX.length); } } } diff --git a/src/ast/nodes/MethodDefinition.ts b/src/ast/nodes/MethodDefinition.ts index d4d66b48c..41dc6762e 100644 --- a/src/ast/nodes/MethodDefinition.ts +++ b/src/ast/nodes/MethodDefinition.ts @@ -14,8 +14,8 @@ export default class MethodDefinition extends MethodBase { declare type: NodeType.tMethodDefinition; declare value: FunctionExpression; declare decorators: Decorator[]; + hasEffects(context: HasEffectsContext): boolean { return super.hasEffects(context) || checkEffectForNodes(this.decorators, context); } - protected applyDeoptimizations() {} } diff --git a/src/ast/nodes/NewExpression.ts b/src/ast/nodes/NewExpression.ts index a70c3142e..431a72f9f 100644 --- a/src/ast/nodes/NewExpression.ts +++ b/src/ast/nodes/NewExpression.ts @@ -5,7 +5,12 @@ import type { RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED } from '../NodeInteractions'; -import { EMPTY_PATH, type ObjectPath, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; +import { + EMPTY_PATH, + type ObjectPath, + SHARED_RECURSION_TRACKER, + UNKNOWN_PATH +} from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; import { NodeBase } from './shared/Node'; @@ -37,14 +42,19 @@ export default class NewExpression extends NodeBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - if (!this.deoptimized) this.applyDeoptimizations(); if (includeChildrenRecursively) { super.include(context, includeChildrenRecursively); } else { - this.included = true; + if (!this.included) this.includeNode(context); this.callee.include(context, false); } - this.callee.includeCallArguments(context, this.arguments); + this.callee.includeCallArguments(context, this.interaction); + } + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.callee.includePath(UNKNOWN_PATH, context); } initialise(): void { @@ -67,7 +77,7 @@ export default class NewExpression extends NodeBase { renderCallArguments(code, options, this); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.callee.deoptimizeArgumentsOnInteractionAtPath( this.interaction, diff --git a/src/ast/nodes/ObjectExpression.ts b/src/ast/nodes/ObjectExpression.ts index f9c0bb4d4..942a9743b 100644 --- a/src/ast/nodes/ObjectExpression.ts +++ b/src/ast/nodes/ObjectExpression.ts @@ -1,35 +1,40 @@ import type MagicString from 'magic-string'; import { BLANK } from '../../utils/blank'; import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers'; +import { getCommaSeparatedNodesWithBoundaries } from '../../utils/renderHelpers'; +import { treeshakeNode } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, SHARED_RECURSION_TRACKER, + UNKNOWN_PATH, UnknownKey } from '../utils/PathTracker'; import Identifier from './Identifier'; import Literal from './Literal'; import * as NodeType from './NodeType'; import type Property from './Property'; -import SpreadElement from './SpreadElement'; -import { type ExpressionEntity, type LiteralValueOrUnknown } from './shared/Expression'; -import { NodeBase } from './shared/Node'; +import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; +import type { IncludeChildren } from './shared/Node'; +import { doNotDeoptimize, NodeBase } from './shared/Node'; import { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity'; import { OBJECT_PROTOTYPE } from './shared/ObjectPrototype'; +import SpreadElement from './SpreadElement'; export default class ObjectExpression extends NodeBase implements DeoptimizableEntity { declare properties: readonly (Property | SpreadElement)[]; declare type: NodeType.tObjectExpression; private objectEntity: ObjectEntity | null = null; + private protoProp: Property | null = null; deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, @@ -48,7 +53,7 @@ export default class ObjectExpression extends NodeBase implements DeoptimizableE getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); @@ -57,7 +62,7 @@ export default class ObjectExpression extends NodeBase implements DeoptimizableE getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( @@ -76,12 +81,27 @@ export default class ObjectExpression extends NodeBase implements DeoptimizableE return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { + if (!this.included) this.includeNode(context); + this.getObjectEntity().include(context, includeChildrenRecursively); + this.protoProp?.include(context, includeChildrenRecursively); + } + + includeNode(context: InclusionContext) { + this.included = true; + this.protoProp?.includePath(UNKNOWN_PATH, context); + } + + includePath(path: ObjectPath, context: InclusionContext) { + if (!this.included) this.includeNode(context); + this.getObjectEntity().includePath(path, context); + } + render( code: MagicString, options: RenderOptions, { renderedSurroundingElement }: NodeRenderOptions = BLANK ): void { - super.render(code, options); if ( renderedSurroundingElement === NodeType.ExpressionStatement || renderedSurroundingElement === NodeType.ArrowFunctionExpression @@ -89,10 +109,28 @@ export default class ObjectExpression extends NodeBase implements DeoptimizableE code.appendRight(this.start, '('); code.prependLeft(this.end, ')'); } + if (this.properties.length > 0) { + const separatedNodes = getCommaSeparatedNodesWithBoundaries( + this.properties, + code, + this.start + 1, + this.end - 1 + ); + let lastSeparatorPos: number | null = null; + for (const { node, separator, start, end } of separatedNodes) { + if (!node.included) { + treeshakeNode(node, code, start, end); + continue; + } + lastSeparatorPos = separator; + node.render(code, options); + } + if (lastSeparatorPos) { + code.remove(lastSeparatorPos, this.end - 1); + } + } } - protected applyDeoptimizations() {} - private getObjectEntity(): ObjectEntity { if (this.objectEntity !== null) { return this.objectEntity; @@ -123,6 +161,7 @@ export default class ObjectExpression extends NodeBase implements DeoptimizableE ? property.key.name : String((property.key as Literal).value); if (key === '__proto__' && property.kind === 'init') { + this.protoProp = property; prototype = property.value instanceof Literal && property.value.value === null ? null @@ -135,3 +174,5 @@ export default class ObjectExpression extends NodeBase implements DeoptimizableE return (this.objectEntity = new ObjectEntity(properties, prototype)); } } + +ObjectExpression.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/ObjectPattern.ts b/src/ast/nodes/ObjectPattern.ts index df8b9ef37..6a1beedcd 100644 --- a/src/ast/nodes/ObjectPattern.ts +++ b/src/ast/nodes/ObjectPattern.ts @@ -1,4 +1,8 @@ -import type { HasEffectsContext } from '../ExecutionContext'; +import type MagicString from 'magic-string'; +import type { RenderOptions } from '../../utils/renderHelpers'; +import { getCommaSeparatedNodesWithBoundaries } from '../../utils/renderHelpers'; +import { treeshakeNode } from '../../utils/treeshakeNode'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; @@ -7,11 +11,11 @@ import * as NodeType from './NodeType'; import type Property from './Property'; import type RestElement from './RestElement'; import type { ExpressionEntity } from './shared/Expression'; -import { NodeBase } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import { doNotDeoptimize, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node'; +import type { DeclarationPatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; -export default class ObjectPattern extends NodeBase implements PatternNode { +export default class ObjectPattern extends NodeBase implements DeclarationPatternNode { declare properties: readonly (Property | RestElement)[]; declare type: NodeType.tObjectPattern; @@ -21,24 +25,31 @@ export default class ObjectPattern extends NodeBase implements PatternNode { ): void { for (const property of this.properties) { if (property.type === NodeType.Property) { - (property.value as unknown as PatternNode).addExportedVariables( - variables, - exportNamesByVariable - ); + property.value.addExportedVariables(variables, exportNamesByVariable); } else { property.argument.addExportedVariables(variables, exportNamesByVariable); } } } - declare(kind: VariableKind, init: ExpressionEntity): LocalVariable[] { + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[] { const variables: LocalVariable[] = []; for (const property of this.properties) { - variables.push(...property.declare(kind, init)); + variables.push(...property.declare(kind, destructuredInitPath, init)); } return variables; } + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity): void { + for (const property of this.properties) { + property.deoptimizeAssignment(destructuredInitPath, init); + } + } + deoptimizePath(path: ObjectPath): void { if (path.length === 0) { for (const property of this.properties) { @@ -60,9 +71,59 @@ export default class ObjectPattern extends NodeBase implements PatternNode { return false; } + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + for (const property of this.properties) { + if (property.hasEffectsWhenDestructuring(context, destructuredInitPath, init)) return true; + } + return false; + } + + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + let included = false; + for (const property of this.properties) { + included = + property.includeDestructuredIfNecessary(context, destructuredInitPath, init) || included; + } + return (this.included ||= included); + } + markDeclarationReached(): void { for (const property of this.properties) { property.markDeclarationReached(); } } + + render(code: MagicString, options: RenderOptions): void { + if (this.properties.length > 0) { + const separatedNodes = getCommaSeparatedNodesWithBoundaries( + this.properties, + code, + this.start + 1, + this.end - 1 + ); + let lastSeparatorPos: number | null = null; + for (const { node, separator, start, end } of separatedNodes) { + if (!node.included) { + treeshakeNode(node, code, start, end); + continue; + } + lastSeparatorPos = separator; + node.render(code, options); + } + if (lastSeparatorPos) { + code.remove(lastSeparatorPos, this.end - 1); + } + } + } } + +ObjectPattern.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +ObjectPattern.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/PrivateIdentifier.ts b/src/ast/nodes/PrivateIdentifier.ts index 094a62664..47a51070b 100644 --- a/src/ast/nodes/PrivateIdentifier.ts +++ b/src/ast/nodes/PrivateIdentifier.ts @@ -1,7 +1,9 @@ import type * as NodeType from './NodeType'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class PrivateIdentifier extends NodeBase { declare name: string; declare type: NodeType.tPrivateIdentifier; } + +PrivateIdentifier.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/Program.ts b/src/ast/nodes/Program.ts index 0441eb8b9..6e9a4b520 100644 --- a/src/ast/nodes/Program.ts +++ b/src/ast/nodes/Program.ts @@ -11,7 +11,13 @@ import { import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { createHasEffectsContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; -import { type IncludeChildren, NodeBase, type StatementNode } from './shared/Node'; +import { + doNotDeoptimize, + type IncludeChildren, + NodeBase, + onlyIncludeSelfNoDeoptimize, + type StatementNode +} from './shared/Node'; export default class Program extends NodeBase { declare body: readonly StatementNode[]; @@ -99,6 +105,7 @@ export default class Program extends NodeBase { super.render(code, options); } } - - protected applyDeoptimizations() {} } + +Program.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +Program.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/Property.ts b/src/ast/nodes/Property.ts index 10b5a32c0..e4195cdea 100644 --- a/src/ast/nodes/Property.ts +++ b/src/ast/nodes/Property.ts @@ -1,22 +1,25 @@ import type MagicString from 'magic-string'; -import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import type { RenderOptions } from '../../utils/renderHelpers'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { createHasEffectsContext } from '../ExecutionContext'; +import type { ObjectPath } from '../utils/PathTracker'; import { UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; +import Identifier from './Identifier'; +import type Literal from './Literal'; import type * as NodeType from './NodeType'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; -import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression'; +import { type ExpressionEntity } from './shared/Expression'; import MethodBase from './shared/MethodBase'; -import type { ExpressionNode } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import type { ExpressionNode, IncludeChildren } from './shared/Node'; +import { doNotDeoptimize, onlyIncludeSelfNoDeoptimize } from './shared/Node'; +import type { DeclarationPatternNode, PatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; -export default class Property extends MethodBase implements PatternNode { +export default class Property extends MethodBase implements DeclarationPatternNode { declare key: ExpressionNode; declare kind: 'init' | 'get' | 'set'; declare type: NodeType.tProperty; - private declarationInit: ExpressionEntity | null = null; //declare method: boolean; get method(): boolean { @@ -34,25 +37,75 @@ export default class Property extends MethodBase implements PatternNode { this.flags = setFlag(this.flags, Flag.shorthand, value); } - declare(kind: VariableKind, init: ExpressionEntity): LocalVariable[] { - this.declarationInit = init; - return (this.value as PatternNode).declare(kind, UNKNOWN_EXPRESSION); + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[] { + return (this.value as DeclarationPatternNode).declare( + kind, + this.getPathInProperty(destructuredInitPath), + init + ); + } + + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity): void { + (this.value as PatternNode).deoptimizeAssignment?.( + this.getPathInProperty(destructuredInitPath), + init + ); } hasEffects(context: HasEffectsContext): boolean { - if (!this.deoptimized) this.applyDeoptimizations(); - const propertyReadSideEffects = ( - this.scope.context.options.treeshake as NormalizedTreeshakingOptions - ).propertyReadSideEffects; - return ( - (this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') || - this.key.hasEffects(context) || - this.value.hasEffects(context) + return this.key.hasEffects(context) || this.value.hasEffects(context); + } + + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + return (this.value as PatternNode).hasEffectsWhenDestructuring?.( + context, + this.getPathInProperty(destructuredInitPath), + init ); } + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + const path = this.getPathInProperty(destructuredInitPath); + let included = + (this.value as PatternNode).includeDestructuredIfNecessary(context, path, init) || + this.included; + if ((included ||= this.key.hasEffects(createHasEffectsContext()))) { + this.key.include(context, false); + if (!this.value.included) { + this.value.included = true; + // Unfortunately, we need to include the value again now, so that any + // declared variables are properly included. + (this.value as PatternNode).includeDestructuredIfNecessary(context, path, init); + } + } + return (this.included = included); + } + + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { + this.included = true; + this.key.include(context, includeChildrenRecursively); + this.value.include(context, includeChildrenRecursively); + } + + includePath(path: ObjectPath, context: InclusionContext) { + this.included = true; + this.value.includePath(path, context); + } + markDeclarationReached(): void { - (this.value as PatternNode).markDeclarationReached(); + (this.value as DeclarationPatternNode).markDeclarationReached(); } render(code: MagicString, options: RenderOptions): void { @@ -62,11 +115,18 @@ export default class Property extends MethodBase implements PatternNode { this.value.render(code, options, { isShorthandProperty: this.shorthand }); } - protected applyDeoptimizations(): void { - this.deoptimized = true; - if (this.declarationInit !== null) { - this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); - this.scope.context.requestTreeshakingPass(); - } + private getPathInProperty(destructuredInitPath: ObjectPath): ObjectPath { + return destructuredInitPath.at(-1) === UnknownKey + ? destructuredInitPath + : // For now, we only consider static paths as we do not know how to + // deoptimize the path in the dynamic case. + this.computed + ? [...destructuredInitPath, UnknownKey] + : this.key instanceof Identifier + ? [...destructuredInitPath, this.key.name] + : [...destructuredInitPath, String((this.key as Literal).value)]; } } + +Property.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +Property.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/PropertyDefinition.ts b/src/ast/nodes/PropertyDefinition.ts index bb1e9903d..1e8d9edca 100644 --- a/src/ast/nodes/PropertyDefinition.ts +++ b/src/ast/nodes/PropertyDefinition.ts @@ -1,8 +1,9 @@ import type { DeoptimizableEntity } from '../DeoptimizableEntity'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; import { checkEffectForNodes } from '../utils/checkEffectForNodes'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type Decorator from './Decorator'; import type * as NodeType from './NodeType'; import type PrivateIdentifier from './PrivateIdentifier'; @@ -13,7 +14,7 @@ import { UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; -import { type ExpressionNode, NodeBase } from './shared/Node'; +import { doNotDeoptimize, type ExpressionNode, NodeBase } from './shared/Node'; export default class PropertyDefinition extends NodeBase { declare key: ExpressionNode | PrivateIdentifier; @@ -32,7 +33,7 @@ export default class PropertyDefinition extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.value?.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } @@ -43,7 +44,7 @@ export default class PropertyDefinition extends NodeBase { getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.value @@ -54,7 +55,7 @@ export default class PropertyDefinition extends NodeBase { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.value @@ -78,5 +79,13 @@ export default class PropertyDefinition extends NodeBase { return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context); } - protected applyDeoptimizations() {} + includeNode(context: InclusionContext) { + this.included = true; + this.value?.includePath(UNKNOWN_PATH, context); + for (const decorator of this.decorators) { + decorator.includePath(UNKNOWN_PATH, context); + } + } } + +PropertyDefinition.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/RestElement.ts b/src/ast/nodes/RestElement.ts index 85cbb2e9f..1e742343f 100644 --- a/src/ast/nodes/RestElement.ts +++ b/src/ast/nodes/RestElement.ts @@ -1,15 +1,16 @@ -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteractionAssigned } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UnknownKey } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; -import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression'; -import { NodeBase } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import { type ExpressionEntity } from './shared/Expression'; +import type { IncludeChildren } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; +import type { DeclarationPatternNode, PatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; -export default class RestElement extends NodeBase implements PatternNode { +export default class RestElement extends NodeBase implements DeclarationPatternNode { declare argument: PatternNode; declare type: NodeType.tRestElement; private declarationInit: ExpressionEntity | null = null; @@ -21,9 +22,21 @@ export default class RestElement extends NodeBase implements PatternNode { this.argument.addExportedVariables(variables, exportNamesByVariable); } - declare(kind: VariableKind, init: ExpressionEntity): LocalVariable[] { + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[] { this.declarationInit = init; - return this.argument.declare(kind, UNKNOWN_EXPRESSION); + return (this.argument as DeclarationPatternNode).declare( + kind, + getIncludedPatternPath(destructuredInitPath), + init + ); + } + + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity): void { + this.argument.deoptimizeAssignment(getIncludedPatternPath(destructuredInitPath), init); } deoptimizePath(path: ObjectPath): void { @@ -43,11 +56,43 @@ export default class RestElement extends NodeBase implements PatternNode { ); } + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + return this.argument.hasEffectsWhenDestructuring( + context, + getIncludedPatternPath(destructuredInitPath), + init + ); + } + + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean { + return (this.included = + this.argument.includeDestructuredIfNecessary( + context, + getIncludedPatternPath(destructuredInitPath), + init + ) || this.included); + } + + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { + if (!this.included) this.includeNode(context); + // This should just include the identifier, its properties should be + // included where the variable is used. + this.argument.include(context, includeChildrenRecursively); + } + markDeclarationReached(): void { - this.argument.markDeclarationReached(); + (this.argument as DeclarationPatternNode).markDeclarationReached(); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; if (this.declarationInit !== null) { this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]); @@ -55,3 +100,10 @@ export default class RestElement extends NodeBase implements PatternNode { } } } + +RestElement.prototype.includeNode = onlyIncludeSelf; + +const getIncludedPatternPath = (destructuredInitPath: ObjectPath): ObjectPath => + destructuredInitPath.at(-1) === UnknownKey + ? destructuredInitPath + : [...destructuredInitPath, UnknownKey]; diff --git a/src/ast/nodes/ReturnStatement.ts b/src/ast/nodes/ReturnStatement.ts index 624a52165..695019cd3 100644 --- a/src/ast/nodes/ReturnStatement.ts +++ b/src/ast/nodes/ReturnStatement.ts @@ -1,9 +1,15 @@ import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { type HasEffectsContext, type InclusionContext } from '../ExecutionContext'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; -import { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node'; +import { + doNotDeoptimize, + type ExpressionNode, + type IncludeChildren, + StatementBase +} from './shared/Node'; export default class ReturnStatement extends StatementBase { declare argument: ExpressionNode | null; @@ -16,11 +22,16 @@ export default class ReturnStatement extends StatementBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - this.included = true; + if (!this.included) this.includeNode(context); this.argument?.include(context, includeChildrenRecursively); context.brokenFlow = true; } + includeNode(context: InclusionContext) { + this.included = true; + this.argument?.includePath(UNKNOWN_PATH, context); + } + initialise(): void { super.initialise(); this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION); @@ -35,3 +46,5 @@ export default class ReturnStatement extends StatementBase { } } } + +ReturnStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/SequenceExpression.ts b/src/ast/nodes/SequenceExpression.ts index 8ca3f731d..0d3fc7e17 100644 --- a/src/ast/nodes/SequenceExpression.ts +++ b/src/ast/nodes/SequenceExpression.ts @@ -10,11 +10,17 @@ import { treeshakeNode } from '../../utils/treeshakeNode'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import { type EntityPathTracker, type ObjectPath } from '../utils/PathTracker'; import ExpressionStatement from './ExpressionStatement'; import type * as NodeType from './NodeType'; import type { LiteralValueOrUnknown } from './shared/Expression'; -import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; +import { + doNotDeoptimize, + type ExpressionNode, + type IncludeChildren, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './shared/Node'; export default class SequenceExpression extends NodeBase { declare expressions: ExpressionNode[]; @@ -23,7 +29,7 @@ export default class SequenceExpression extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.expressions[this.expressions.length - 1].deoptimizeArgumentsOnInteractionAtPath( interaction, @@ -38,7 +44,7 @@ export default class SequenceExpression extends NodeBase { getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.expressions[this.expressions.length - 1].getLiteralValueAtPath( @@ -75,11 +81,17 @@ export default class SequenceExpression extends NodeBase { includeChildrenRecursively || (expression === lastExpression && !(this.parent instanceof ExpressionStatement)) || expression.shouldBeIncluded(context) - ) + ) { expression.include(context, includeChildrenRecursively); + } } } + includePath(path: ObjectPath, context: InclusionContext): void { + this.included = true; + this.expressions[this.expressions.length - 1].includePath(path, context); + } + removeAnnotations(code: MagicString) { this.expressions[0].removeAnnotations(code); } @@ -123,3 +135,6 @@ export default class SequenceExpression extends NodeBase { } } } + +SequenceExpression.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +SequenceExpression.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/SpreadElement.ts b/src/ast/nodes/SpreadElement.ts index e7605a0ce..a6f0a99c5 100644 --- a/src/ast/nodes/SpreadElement.ts +++ b/src/ast/nodes/SpreadElement.ts @@ -1,8 +1,13 @@ import type { NormalizedTreeshakingOptions } from '../../rollup/types'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { NODE_INTERACTION_UNKNOWN_ACCESS } from '../NodeInteractions'; -import { type ObjectPath, type PathTracker, UNKNOWN_PATH, UnknownKey } from '../utils/PathTracker'; +import { + type EntityPathTracker, + type ObjectPath, + UNKNOWN_PATH, + UnknownKey +} from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import { type ExpressionNode, NodeBase } from './shared/Node'; @@ -13,7 +18,7 @@ export default class SpreadElement extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { if (path.length > 0) { this.argument.deoptimizeArgumentsOnInteractionAtPath( @@ -40,7 +45,13 @@ export default class SpreadElement extends NodeBase { ); } - protected applyDeoptimizations(): void { + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.argument.includePath(UNKNOWN_PATH, context); + } + + applyDeoptimizations() { this.deoptimized = true; // Only properties of properties of the argument could become subject to reassignment // This will also reassign the return values of iterators diff --git a/src/ast/nodes/StaticBlock.ts b/src/ast/nodes/StaticBlock.ts index d97dad164..385737cf2 100644 --- a/src/ast/nodes/StaticBlock.ts +++ b/src/ast/nodes/StaticBlock.ts @@ -8,7 +8,13 @@ import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; import * as NodeType from './NodeType'; -import { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node'; +import { + doNotDeoptimize, + type IncludeChildren, + onlyIncludeSelfNoDeoptimize, + StatementBase, + type StatementNode +} from './shared/Node'; export default class StaticBlock extends StatementBase { declare body: readonly StatementNode[]; @@ -44,6 +50,9 @@ export default class StaticBlock extends StatementBase { } } +StaticBlock.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +StaticBlock.prototype.applyDeoptimizations = doNotDeoptimize; + export function isStaticBlock(statement: StatementNode): statement is StaticBlock { return statement.type === NodeType.StaticBlock; } diff --git a/src/ast/nodes/Super.ts b/src/ast/nodes/Super.ts index 5db71aed4..f91ed0e70 100644 --- a/src/ast/nodes/Super.ts +++ b/src/ast/nodes/Super.ts @@ -1,5 +1,7 @@ +import type { InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; @@ -15,7 +17,7 @@ export default class Super extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ) { this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } @@ -24,10 +26,13 @@ export default class Super extends NodeBase { this.variable.deoptimizePath(path); } - include(): void { - if (!this.included) { - this.included = true; - this.scope.context.includeVariableInModule(this.variable); - } + include(context: InclusionContext): void { + if (!this.included) this.includeNode(context); + } + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context); } } diff --git a/src/ast/nodes/SwitchCase.ts b/src/ast/nodes/SwitchCase.ts index 7f3f50dad..4f4413002 100644 --- a/src/ast/nodes/SwitchCase.ts +++ b/src/ast/nodes/SwitchCase.ts @@ -8,9 +8,11 @@ import { import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; import { + doNotDeoptimize, type ExpressionNode, type IncludeChildren, NodeBase, + onlyIncludeSelfNoDeoptimize, type StatementNode } from './shared/Node'; @@ -56,3 +58,5 @@ export default class SwitchCase extends NodeBase { } SwitchCase.prototype.needsBoundaries = true; +SwitchCase.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +SwitchCase.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/SwitchStatement.ts b/src/ast/nodes/SwitchStatement.ts index 34ced8099..97e83e771 100644 --- a/src/ast/nodes/SwitchStatement.ts +++ b/src/ast/nodes/SwitchStatement.ts @@ -8,9 +8,9 @@ import { import BlockScope from '../scopes/BlockScope'; import type ChildScope from '../scopes/ChildScope'; import type * as NodeType from './NodeType'; -import type SwitchCase from './SwitchCase'; import type { ExpressionNode, GenericEsTreeNode, IncludeChildren } from './shared/Node'; -import { StatementBase } from './shared/Node'; +import { doNotDeoptimize, onlyIncludeSelfNoDeoptimize, StatementBase } from './shared/Node'; +import type SwitchCase from './SwitchCase'; export default class SwitchStatement extends StatementBase { declare cases: readonly SwitchCase[]; @@ -106,3 +106,6 @@ export default class SwitchStatement extends StatementBase { } } } + +SwitchStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +SwitchStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/TaggedTemplateExpression.ts b/src/ast/nodes/TaggedTemplateExpression.ts index 0aae62095..7228d260e 100644 --- a/src/ast/nodes/TaggedTemplateExpression.ts +++ b/src/ast/nodes/TaggedTemplateExpression.ts @@ -4,16 +4,17 @@ import { logCannotCallNamespace } from '../../utils/logs'; import { type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import { INTERACTION_CALLED } from '../NodeInteractions'; -import type { PathTracker } from '../utils/PathTracker'; +import type { EntityPathTracker } from '../utils/PathTracker'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import type Identifier from './Identifier'; import MemberExpression from './MemberExpression'; import * as NodeType from './NodeType'; -import type TemplateLiteral from './TemplateLiteral'; import CallExpressionBase from './shared/CallExpressionBase'; import type { ExpressionEntity } from './shared/Expression'; import { UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './shared/Expression'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; +import { onlyIncludeSelf } from './shared/Node'; +import type TemplateLiteral from './TemplateLiteral'; export default class TaggedTemplateExpression extends CallExpressionBase { declare quasi: TemplateLiteral; @@ -45,7 +46,7 @@ export default class TaggedTemplateExpression extends CallExpressionBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - if (!this.deoptimized) this.applyDeoptimizations(); + if (!this.included) this.includeNode(context); if (includeChildrenRecursively) { super.include(context, includeChildrenRecursively); } else { @@ -53,7 +54,7 @@ export default class TaggedTemplateExpression extends CallExpressionBase { this.tag.include(context, includeChildrenRecursively); this.quasi.include(context, includeChildrenRecursively); } - this.tag.includeCallArguments(context, this.args); + this.tag.includeCallArguments(context, this.interaction); const [returnExpression] = this.getReturnExpression(); if (!returnExpression.included) { returnExpression.include(context, false); @@ -78,7 +79,7 @@ export default class TaggedTemplateExpression extends CallExpressionBase { this.quasi.render(code, options); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.tag.deoptimizeArgumentsOnInteractionAtPath( this.interaction, @@ -89,7 +90,7 @@ export default class TaggedTemplateExpression extends CallExpressionBase { } protected getReturnExpression( - recursionTracker: PathTracker = SHARED_RECURSION_TRACKER + recursionTracker: EntityPathTracker = SHARED_RECURSION_TRACKER ): [expression: ExpressionEntity, isPure: boolean] { if (this.returnExpression === null) { this.returnExpression = UNKNOWN_RETURN_EXPRESSION; @@ -103,3 +104,5 @@ export default class TaggedTemplateExpression extends CallExpressionBase { return this.returnExpression; } } + +TaggedTemplateExpression.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/TemplateElement.ts b/src/ast/nodes/TemplateElement.ts index 69f54ff33..c63183830 100644 --- a/src/ast/nodes/TemplateElement.ts +++ b/src/ast/nodes/TemplateElement.ts @@ -1,6 +1,6 @@ import type * as NodeType from './NodeType'; import { Flag, isFlagSet, setFlag } from './shared/BitFlags'; -import { type GenericEsTreeNode, NodeBase } from './shared/Node'; +import { type GenericEsTreeNode, NodeBase, onlyIncludeSelf } from './shared/Node'; export default class TemplateElement extends NodeBase { declare type: NodeType.tTemplateElement; @@ -23,10 +23,6 @@ export default class TemplateElement extends NodeBase { return false; } - include(): void { - this.included = true; - } - parseNode(esTreeNode: GenericEsTreeNode): this { this.value = esTreeNode.value; return super.parseNode(esTreeNode); @@ -34,3 +30,5 @@ export default class TemplateElement extends NodeBase { render(): void {} } + +TemplateElement.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/TemplateLiteral.ts b/src/ast/nodes/TemplateLiteral.ts index 0134909a8..ee0279a55 100644 --- a/src/ast/nodes/TemplateLiteral.ts +++ b/src/ast/nodes/TemplateLiteral.ts @@ -1,19 +1,20 @@ import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED, INTERACTION_CALLED } from '../NodeInteractions'; import type { ObjectPath } from '../utils/PathTracker'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import { getMemberReturnExpressionWhenCalled, hasMemberEffectWhenCalled, literalStringMembers } from '../values'; import type * as NodeType from './NodeType'; -import type TemplateElement from './TemplateElement'; import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; import { UNKNOWN_RETURN_EXPRESSION, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; +import type TemplateElement from './TemplateElement'; export default class TemplateLiteral extends NodeBase { declare expressions: ExpressionNode[]; @@ -52,6 +53,14 @@ export default class TemplateLiteral extends NodeBase { return true; } + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + for (const node of this.expressions) { + node.includePath(UNKNOWN_PATH, context); + } + } + render(code: MagicString, options: RenderOptions): void { (code.indentExclusionRanges as [number, number][]).push([this.start, this.end]); super.render(code, options); diff --git a/src/ast/nodes/ThisExpression.ts b/src/ast/nodes/ThisExpression.ts index 71e1c4a89..643a12f87 100644 --- a/src/ast/nodes/ThisExpression.ts +++ b/src/ast/nodes/ThisExpression.ts @@ -1,11 +1,12 @@ import type MagicString from 'magic-string'; import { LOGLEVEL_WARN } from '../../utils/logging'; import { logThisIsUndefined } from '../../utils/logs'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import ModuleScope from '../scopes/ModuleScope'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; @@ -22,7 +23,7 @@ export default class ThisExpression extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.variable.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } @@ -42,10 +43,22 @@ export default class ThisExpression extends NodeBase { return this.variable.hasEffectsOnInteractionAtPath(path, interaction, context); } - include(): void { + include(context: InclusionContext): void { + if (!this.included) this.includeNode(context); + } + + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context); + } + + includePath(path: ObjectPath, context: InclusionContext): void { if (!this.included) { this.included = true; - this.scope.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable, path, context); + } else if (path.length > 0) { + this.variable.includePath(path, context); } } diff --git a/src/ast/nodes/ThrowStatement.ts b/src/ast/nodes/ThrowStatement.ts index 2d9956e82..6b42c7ac4 100644 --- a/src/ast/nodes/ThrowStatement.ts +++ b/src/ast/nodes/ThrowStatement.ts @@ -2,7 +2,12 @@ import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { type InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; -import { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node'; +import { + type ExpressionNode, + type IncludeChildren, + onlyIncludeSelf, + StatementBase +} from './shared/Node'; export default class ThrowStatement extends StatementBase { declare argument: ExpressionNode; @@ -13,7 +18,7 @@ export default class ThrowStatement extends StatementBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - this.included = true; + if (!this.included) this.includeNode(context); this.argument.include(context, includeChildrenRecursively); context.brokenFlow = true; } @@ -25,3 +30,5 @@ export default class ThrowStatement extends StatementBase { } } } + +ThrowStatement.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/TryStatement.ts b/src/ast/nodes/TryStatement.ts index 851d2cdd0..5ec6fff81 100644 --- a/src/ast/nodes/TryStatement.ts +++ b/src/ast/nodes/TryStatement.ts @@ -3,7 +3,13 @@ import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type BlockStatement from './BlockStatement'; import type CatchClause from './CatchClause'; import type * as NodeType from './NodeType'; -import { INCLUDE_PARAMETERS, type IncludeChildren, StatementBase } from './shared/Node'; +import { + doNotDeoptimize, + INCLUDE_PARAMETERS, + type IncludeChildren, + onlyIncludeSelfNoDeoptimize, + StatementBase +} from './shared/Node'; export default class TryStatement extends StatementBase { declare block: BlockStatement; @@ -50,3 +56,6 @@ export default class TryStatement extends StatementBase { this.finalizer?.include(context, includeChildrenRecursively); } } + +TryStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +TryStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/UnaryExpression.ts b/src/ast/nodes/UnaryExpression.ts index f770380fb..12203f97d 100644 --- a/src/ast/nodes/UnaryExpression.ts +++ b/src/ast/nodes/UnaryExpression.ts @@ -6,8 +6,8 @@ import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED, NODE_INTERACTION_UNKNOWN_ASSIGNMENT } from '../NodeInteractions'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, SHARED_RECURSION_TRACKER } from '../utils/PathTracker'; import Identifier from './Identifier'; @@ -22,7 +22,7 @@ import { UnknownValue } from './shared/Expression'; import type { IncludeChildren } from './shared/Node'; -import { type ExpressionNode, NodeBase } from './shared/Node'; +import { type ExpressionNode, NodeBase, onlyIncludeSelf } from './shared/Node'; const unaryOperators: Record LiteralValueOrUnknown> = { '!': value => !value, @@ -55,7 +55,7 @@ export default class UnaryExpression extends NodeBase { getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { if (path.length > 0) return UnknownValue; @@ -90,7 +90,7 @@ export default class UnaryExpression extends NodeBase { return type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; if (this.operator === 'delete') { this.argument.deoptimizePath(EMPTY_PATH); @@ -162,3 +162,5 @@ function getSimplifiedNumber(value: number) { const stringifiedValue = String(value).replace('+', ''); return finalizedExp.length < stringifiedValue.length ? finalizedExp : stringifiedValue; } + +UnaryExpression.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/UpdateExpression.ts b/src/ast/nodes/UpdateExpression.ts index 746721795..eaa3a7db8 100644 --- a/src/ast/nodes/UpdateExpression.ts +++ b/src/ast/nodes/UpdateExpression.ts @@ -13,7 +13,7 @@ import Identifier from './Identifier'; import * as NodeType from './NodeType'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; import type { ExpressionNode, IncludeChildren } from './shared/Node'; -import { NodeBase } from './shared/Node'; +import { NodeBase, onlyIncludeSelf } from './shared/Node'; export default class UpdateExpression extends NodeBase { declare argument: ExpressionNode; @@ -32,8 +32,7 @@ export default class UpdateExpression extends NodeBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { - if (!this.deoptimized) this.applyDeoptimizations(); - this.included = true; + if (!this.included) this.includeNode(context); this.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true); } @@ -82,7 +81,7 @@ export default class UpdateExpression extends NodeBase { } } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; this.argument.deoptimizePath(EMPTY_PATH); if (this.argument instanceof Identifier) { @@ -92,3 +91,5 @@ export default class UpdateExpression extends NodeBase { this.scope.context.requestTreeshakingPass(); } } + +UpdateExpression.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/VariableDeclaration.ts b/src/ast/nodes/VariableDeclaration.ts index dd787ab79..6b9b9f8f7 100644 --- a/src/ast/nodes/VariableDeclaration.ts +++ b/src/ast/nodes/VariableDeclaration.ts @@ -12,6 +12,7 @@ import { getSystemExportStatement, renderSystemExportExpression } from '../../utils/systemJsRendering'; +import { treeshakeNode } from '../../utils/treeshakeNode'; import type { InclusionContext } from '../ExecutionContext'; import { EMPTY_PATH } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; @@ -19,10 +20,15 @@ import ArrayPattern from './ArrayPattern'; import Identifier, { type IdentifierWithVariable } from './Identifier'; import * as NodeType from './NodeType'; import ObjectPattern from './ObjectPattern'; -import type VariableDeclarator from './VariableDeclarator'; import type { InclusionOptions } from './shared/Expression'; -import { type IncludeChildren, NodeBase } from './shared/Node'; +import { + doNotDeoptimize, + type IncludeChildren, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './shared/Node'; import type { VariableDeclarationKind } from './shared/VariableKinds'; +import type VariableDeclarator from './VariableDeclarator'; function areAllDeclarationsIncludedAndNotExported( declarations: readonly VariableDeclarator[], @@ -64,8 +70,9 @@ export default class VariableDeclaration extends NodeBase { ): void { this.included = true; for (const declarator of this.declarations) { - if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) + if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) { declarator.include(context, includeChildrenRecursively); + } const { id, init } = declarator; if (asSingleStatement) { id.include(context, includeChildrenRecursively); @@ -116,8 +123,6 @@ export default class VariableDeclaration extends NodeBase { } } - protected applyDeoptimizations() {} - private renderDeclarationEnd( code: MagicString, separatorString: string, @@ -183,8 +188,7 @@ export default class VariableDeclaration extends NodeBase { ); for (const { node, start, separator, contentEnd, end } of separatedNodes) { if (!node.included) { - code.remove(start, end); - node.removeAnnotations(code); + treeshakeNode(node, code, start, end); continue; } node.render(code, options); @@ -277,3 +281,6 @@ function gatherSystemExportsAndGetSingleExport( } return singleSystemExport; } + +VariableDeclaration.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +VariableDeclaration.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/VariableDeclarator.ts b/src/ast/nodes/VariableDeclarator.ts index 2a96aba44..3169457f7 100644 --- a/src/ast/nodes/VariableDeclarator.ts +++ b/src/ast/nodes/VariableDeclarator.ts @@ -1,4 +1,5 @@ import type MagicString from 'magic-string'; +import type { NormalizedTreeshakingOptions } from '../../rollup/types'; import { BLANK } from '../../utils/blank'; import { isReassignedExportsMember } from '../../utils/reassignedExportsMember'; import { @@ -7,24 +8,29 @@ import { type RenderOptions } from '../../utils/renderHelpers'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; -import type { ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION } from '../values'; import ClassExpression from './ClassExpression'; import Identifier from './Identifier'; import * as NodeType from './NodeType'; -import { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node'; -import type { PatternNode } from './shared/Pattern'; +import { + doNotDeoptimize, + type ExpressionNode, + type IncludeChildren, + NodeBase +} from './shared/Node'; +import type { DeclarationPatternNode } from './shared/Pattern'; import type { VariableKind } from './shared/VariableKinds'; export default class VariableDeclarator extends NodeBase { - declare id: PatternNode; + declare id: DeclarationPatternNode; declare init: ExpressionNode | null; declare type: NodeType.tVariableDeclarator; declare isUsingDeclaration: boolean; declareDeclarator(kind: VariableKind, isUsingDeclaration: boolean): void { this.isUsingDeclaration = isUsingDeclaration; - this.id.declare(kind, this.init || UNDEFINED_EXPRESSION); + this.id.declare(kind, EMPTY_PATH, this.init || UNDEFINED_EXPRESSION); } deoptimizePath(path: ObjectPath): void { @@ -32,20 +38,27 @@ export default class VariableDeclarator extends NodeBase { } hasEffects(context: HasEffectsContext): boolean { - if (!this.deoptimized) this.applyDeoptimizations(); const initEffect = this.init?.hasEffects(context); this.id.markDeclarationReached(); - return initEffect || this.id.hasEffects(context) || this.isUsingDeclaration; + return ( + initEffect || + this.isUsingDeclaration || + this.id.hasEffects(context) || + ((this.scope.context.options.treeshake as NormalizedTreeshakingOptions) + .propertyReadSideEffects && + this.id.hasEffectsWhenDestructuring(context, EMPTY_PATH, this.init || UNDEFINED_EXPRESSION)) + ); } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - const { deoptimized, id, init } = this; - if (!deoptimized) this.applyDeoptimizations(); - this.included = true; + const { id, init } = this; + if (!this.included) this.includeNode(); init?.include(context, includeChildrenRecursively); id.markDeclarationReached(); - if (includeChildrenRecursively || id.shouldBeIncluded(context)) { + if (includeChildrenRecursively) { id.include(context, includeChildrenRecursively); + } else { + id.includeDestructuredIfNecessary(context, EMPTY_PATH, init || UNDEFINED_EXPRESSION); } } @@ -86,8 +99,8 @@ export default class VariableDeclarator extends NodeBase { } } - protected applyDeoptimizations() { - this.deoptimized = true; + includeNode() { + this.included = true; const { id, init } = this; if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) { const { name, variable } = id; @@ -99,3 +112,5 @@ export default class VariableDeclarator extends NodeBase { } } } + +VariableDeclarator.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/WhileStatement.ts b/src/ast/nodes/WhileStatement.ts index a710564cd..88eab4086 100644 --- a/src/ast/nodes/WhileStatement.ts +++ b/src/ast/nodes/WhileStatement.ts @@ -1,12 +1,14 @@ import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type * as NodeType from './NodeType'; +import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; import { + doNotDeoptimize, type ExpressionNode, type IncludeChildren, + onlyIncludeSelfNoDeoptimize, StatementBase, type StatementNode } from './shared/Node'; -import { hasLoopBodyEffects, includeLoopBody } from './shared/loops'; export default class WhileStatement extends StatementBase { declare body: StatementNode; @@ -24,3 +26,6 @@ export default class WhileStatement extends StatementBase { includeLoopBody(context, this.body, includeChildrenRecursively); } } + +WhileStatement.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +WhileStatement.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/YieldExpression.ts b/src/ast/nodes/YieldExpression.ts index cc44e8ea1..e342f6a64 100644 --- a/src/ast/nodes/YieldExpression.ts +++ b/src/ast/nodes/YieldExpression.ts @@ -1,6 +1,7 @@ import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; import { type ExpressionNode, NodeBase } from './shared/Node'; @@ -9,11 +10,22 @@ export default class YieldExpression extends NodeBase { declare delegate: boolean; declare type: NodeType.tYieldExpression; + applyDeoptimizations() { + this.deoptimized = true; + this.argument?.deoptimizePath(UNKNOWN_PATH); + } + hasEffects(context: HasEffectsContext): boolean { if (!this.deoptimized) this.applyDeoptimizations(); return !(context.ignore.returnYield && !this.argument?.hasEffects(context)); } + includeNode(context: InclusionContext) { + this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); + this.argument?.includePath(UNKNOWN_PATH, context); + } + render(code: MagicString, options: RenderOptions): void { if (this.argument) { this.argument.render(code, options, { preventASI: true }); diff --git a/src/ast/nodes/shared/BitFlags.ts b/src/ast/nodes/shared/BitFlags.ts index eeb657d66..536ce091b 100644 --- a/src/ast/nodes/shared/BitFlags.ts +++ b/src/ast/nodes/shared/BitFlags.ts @@ -23,7 +23,9 @@ export const enum Flag { prefix = 1 << 21, generator = 1 << 22, expression = 1 << 23, - hasDeoptimizedCache = 1 << 24 + destructuringDeoptimized = 1 << 24, + hasDeoptimizedCache = 1 << 25, + hasEffects = 1 << 26 } export function isFlagSet(flags: number, flag: Flag): boolean { diff --git a/src/ast/nodes/shared/CallExpressionBase.ts b/src/ast/nodes/shared/CallExpressionBase.ts index d86a9b11b..c63a0d314 100644 --- a/src/ast/nodes/shared/CallExpressionBase.ts +++ b/src/ast/nodes/shared/CallExpressionBase.ts @@ -3,7 +3,7 @@ import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../../NodeInteractions'; -import { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker'; +import { type EntityPathTracker, type ObjectPath, UNKNOWN_PATH } from '../../utils/PathTracker'; import { type ExpressionEntity, type LiteralValueOrUnknown, @@ -22,7 +22,7 @@ export default abstract class CallExpressionBase extends NodeBase implements Deo deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { const { args } = interaction; const [returnExpression, isPure] = this.getReturnExpression(recursionTracker); @@ -84,7 +84,7 @@ export default abstract class CallExpressionBase extends NodeBase implements Deo getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { const [returnExpression] = this.getReturnExpression(recursionTracker); @@ -105,7 +105,7 @@ export default abstract class CallExpressionBase extends NodeBase implements Deo getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const returnExpression = this.getReturnExpression(recursionTracker); @@ -162,6 +162,6 @@ export default abstract class CallExpressionBase extends NodeBase implements Deo } protected abstract getReturnExpression( - recursionTracker?: PathTracker + recursionTracker?: EntityPathTracker ): [expression: ExpressionEntity, isPure: boolean]; } diff --git a/src/ast/nodes/shared/ClassNode.ts b/src/ast/nodes/shared/ClassNode.ts index a5622b9b6..cf94e4090 100644 --- a/src/ast/nodes/shared/ClassNode.ts +++ b/src/ast/nodes/shared/ClassNode.ts @@ -1,17 +1,17 @@ import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; -import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext'; +import { type HasEffectsContext, type InclusionContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import ChildScope from '../../scopes/ChildScope'; +import { checkEffectForNodes } from '../../utils/checkEffectForNodes'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, SHARED_RECURSION_TRACKER, UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; -import { checkEffectForNodes } from '../../utils/checkEffectForNodes'; import type ClassBody from '../ClassBody'; import type Decorator from '../Decorator'; import Identifier from '../Identifier'; @@ -19,7 +19,7 @@ import type Literal from '../Literal'; import MethodDefinition from '../MethodDefinition'; import { isStaticBlock } from '../StaticBlock'; import { type ExpressionEntity, type LiteralValueOrUnknown } from './Expression'; -import { type ExpressionNode, type IncludeChildren, NodeBase } from './Node'; +import { type ExpressionNode, type IncludeChildren, NodeBase, onlyIncludeSelf } from './Node'; import { ObjectEntity, type ObjectProperty } from './ObjectEntity'; import { ObjectMember } from './ObjectMember'; import { OBJECT_PROTOTYPE } from './ObjectPrototype'; @@ -39,7 +39,7 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, @@ -58,7 +58,7 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); @@ -67,7 +67,7 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getObjectEntity().getReturnExpressionWhenCalledAtPath( @@ -100,20 +100,19 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - if (!this.deoptimized) this.applyDeoptimizations(); - this.included = true; + if (!this.included) this.includeNode(context); this.superClass?.include(context, includeChildrenRecursively); this.body.include(context, includeChildrenRecursively); for (const decorator of this.decorators) decorator.include(context, includeChildrenRecursively); if (this.id) { this.id.markDeclarationReached(); - this.id.include(); + this.id.include(context); } } initialise(): void { super.initialise(); - this.id?.declare('class', this); + this.id?.declare('class', EMPTY_PATH, this); for (const method of this.body.body) { if (method instanceof MethodDefinition && method.kind === 'constructor') { this.classConstructor = method; @@ -123,7 +122,7 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { this.classConstructor = null; } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; for (const definition of this.body.body) { if ( @@ -179,7 +178,7 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { kind: 'init', property: new ObjectEntity( dynamicMethods, - this.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE + this.superClass ? new ObjectMember(this.superClass, ['prototype']) : OBJECT_PROTOTYPE ) }); return (this.objectEntity = new ObjectEntity( @@ -188,3 +187,5 @@ export default class ClassNode extends NodeBase implements DeoptimizableEntity { )); } } + +ClassNode.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/shared/Expression.ts b/src/ast/nodes/shared/Expression.ts index 0a19137be..7cd16f32f 100644 --- a/src/ast/nodes/shared/Expression.ts +++ b/src/ast/nodes/shared/Expression.ts @@ -2,10 +2,9 @@ import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { WritableEntity } from '../../Entity'; import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; -import type { ObjectPath, PathTracker, SymbolToStringTag } from '../../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath, SymbolToStringTag } from '../../utils/PathTracker'; import { UNKNOWN_PATH } from '../../utils/PathTracker'; import type { LiteralValue } from '../Literal'; -import type SpreadElement from '../SpreadElement'; import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { IncludeChildren } from './Node'; @@ -41,7 +40,7 @@ export class ExpressionEntity implements WritableEntity { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, _path: ObjectPath, - _recursionTracker: PathTracker + _recursionTracker: EntityPathTracker ): void { deoptimizeInteraction(interaction); } @@ -55,7 +54,7 @@ export class ExpressionEntity implements WritableEntity { */ getLiteralValueAtPath( _path: ObjectPath, - _recursionTracker: PathTracker, + _recursionTracker: EntityPathTracker, _origin: DeoptimizableEntity ): LiteralValueOrUnknown { return UnknownValue; @@ -64,7 +63,7 @@ export class ExpressionEntity implements WritableEntity { getReturnExpressionWhenCalledAtPath( _path: ObjectPath, _interaction: NodeInteractionCalled, - _recursionTracker: PathTracker, + _recursionTracker: EntityPathTracker, _origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return UNKNOWN_RETURN_EXPRESSION; @@ -79,19 +78,29 @@ export class ExpressionEntity implements WritableEntity { } include( - _context: InclusionContext, + context: InclusionContext, _includeChildrenRecursively: IncludeChildren, _options?: InclusionOptions ): void { + if (!this.included) this.includeNode(context); + } + + includeNode(_context: InclusionContext): void { this.included = true; } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { - for (const argument of parameters) { - argument.include(context, false); + includePath(_path: ObjectPath, context: InclusionContext): void { + if (!this.included) this.includeNode(context); + } + /* We are both including and including an unknown path here as the former + * ensures that nested nodes are included while the latter ensures that all + * paths of the expression are included. + * */ + + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { + for (const argument of interaction.args) { + argument?.includePath(UNKNOWN_PATH, context); + argument?.include(context, false); } } diff --git a/src/ast/nodes/shared/FunctionBase.ts b/src/ast/nodes/shared/FunctionBase.ts index e57af88d0..a3da5e27a 100644 --- a/src/ast/nodes/shared/FunctionBase.ts +++ b/src/ast/nodes/shared/FunctionBase.ts @@ -8,35 +8,33 @@ import { NODE_INTERACTION_UNKNOWN_CALL } from '../../NodeInteractions'; import type ReturnValueScope from '../../scopes/ReturnValueScope'; -import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; -import { UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../../utils/PathTracker'; +import { EMPTY_PATH, UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; import { UNDEFINED_EXPRESSION } from '../../values'; import type ParameterVariable from '../../variables/ParameterVariable'; import type Variable from '../../variables/Variable'; import BlockStatement from '../BlockStatement'; import type ExportDefaultDeclaration from '../ExportDefaultDeclaration'; -import Identifier from '../Identifier'; import * as NodeType from '../NodeType'; import RestElement from '../RestElement'; -import SpreadElement from '../SpreadElement'; import type VariableDeclarator from '../VariableDeclarator'; import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { ExpressionEntity, LiteralValueOrUnknown } from './Expression'; import { UNKNOWN_EXPRESSION, UNKNOWN_RETURN_EXPRESSION } from './Expression'; import { + doNotDeoptimize, type ExpressionNode, type GenericEsTreeNode, type IncludeChildren, - NodeBase + NodeBase, + onlyIncludeSelfNoDeoptimize } from './Node'; import type { ObjectEntity } from './ObjectEntity'; -import type { PatternNode } from './Pattern'; - -type InteractionCalledArguments = NodeInteractionCalled['args']; +import type { DeclarationPatternNode } from './Pattern'; export default abstract class FunctionBase extends NodeBase { declare body: BlockStatement | ExpressionNode; - declare params: PatternNode[]; + declare params: DeclarationPatternNode[]; declare preventChildBlockScope: true; declare scope: ReturnValueScope; @@ -64,58 +62,20 @@ export default abstract class FunctionBase extends NodeBase { this.flags = setFlag(this.flags, Flag.generator, value); } - private updateParameterVariableValues(_arguments: InteractionCalledArguments): void { - for (let position = 0; position < this.params.length; position++) { - const parameter = this.params[position]; - if (!(parameter instanceof Identifier)) { - continue; - } - const parameterVariable = parameter.variable as ParameterVariable; - const argument = _arguments[position + 1] ?? UNDEFINED_EXPRESSION; - parameterVariable.updateKnownValue(argument); - } + protected get hasCachedEffects(): boolean { + return isFlagSet(this.flags, Flag.hasEffects); } - - private deoptimizeParameterVariableValues() { - for (const parameter of this.params) { - if (parameter instanceof Identifier) { - const parameterVariable = parameter.variable as ParameterVariable; - parameterVariable.markReassigned(); - } - } + protected set hasCachedEffects(value: boolean) { + this.flags = setFlag(this.flags, Flag.hasEffects, value); } - protected objectEntity: ObjectEntity | null = null; - deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { - if (interaction.type === INTERACTION_CALLED) { - const { parameters } = this.scope; - const { args } = interaction; - let hasRest = false; - for (let position = 0; position < args.length - 1; position++) { - const parameter = this.params[position]; - // Only the "this" argument arg[0] can be null - const argument = args[position + 1]!; - if (argument instanceof SpreadElement) { - this.deoptimizeParameterVariableValues(); - } - if (hasRest || parameter instanceof RestElement) { - hasRest = true; - argument.deoptimizePath(UNKNOWN_PATH); - } else if (parameter instanceof Identifier) { - parameters[position][0].addEntityToBeDeoptimized(argument); - this.addArgumentToBeDeoptimized(argument); - } else if (parameter) { - argument.deoptimizePath(UNKNOWN_PATH); - } else { - this.addArgumentToBeDeoptimized(argument); - } - } - this.updateParameterVariableValues(args); + if (interaction.type === INTERACTION_CALLED && path.length === 0) { + this.scope.deoptimizeArgumentsOnCall(interaction); } else { this.getObjectEntity().deoptimizeArgumentsOnInteractionAtPath( interaction, @@ -131,18 +91,13 @@ export default abstract class FunctionBase extends NodeBase { // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track // which means the return expression and parameters need to be reassigned this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH); - for (const parameterList of this.scope.parameters) { - for (const parameter of parameterList) { - parameter.deoptimizePath(UNKNOWN_PATH); - parameter.markReassigned(); - } - } + this.scope.deoptimizeAllParameters(); } } getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin); @@ -151,7 +106,7 @@ export default abstract class FunctionBase extends NodeBase { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { if (path.length > 0) { @@ -181,9 +136,8 @@ export default abstract class FunctionBase extends NodeBase { if (path.length > 0 || interaction.type !== INTERACTION_CALLED) { return this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context); } - - if (this.annotationNoSideEffects) { - return false; + if (this.hasCachedEffects) { + return true; } if (this.async) { @@ -204,11 +158,26 @@ export default abstract class FunctionBase extends NodeBase { context ))) ) { + this.hasCachedEffects = true; return true; } } - for (const parameter of this.params) { - if (parameter.hasEffects(context)) return true; + const { propertyReadSideEffects } = this.scope.context.options + .treeshake as NormalizedTreeshakingOptions; + for (let index = 0; index < this.params.length; index++) { + const parameter = this.params[index]; + if ( + parameter.hasEffects(context) || + (propertyReadSideEffects && + parameter.hasEffectsWhenDestructuring( + context, + EMPTY_PATH, + interaction.args[index + 1] || UNDEFINED_EXPRESSION + )) + ) { + this.hasCachedEffects = true; + return true; + } } return false; } @@ -228,25 +197,20 @@ export default abstract class FunctionBase extends NodeBase { } private parameterVariableValuesDeoptimized = false; + include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { - if (!this.parameterVariableValuesDeoptimized && !this.onlyFunctionCallUsed()) { + if (!this.included) this.includeNode(context); + if (!(this.parameterVariableValuesDeoptimized || this.onlyFunctionCallUsed())) { this.parameterVariableValuesDeoptimized = true; - this.deoptimizeParameterVariableValues(); + this.scope.reassignAllParameters(); } - if (!this.deoptimized) this.applyDeoptimizations(); - this.included = true; const { brokenFlow } = context; context.brokenFlow = false; this.body.include(context, includeChildrenRecursively); context.brokenFlow = brokenFlow; } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { - this.scope.includeCallArguments(context, parameters); - } + includeCallArguments = this.scope.includeCallArguments.bind(this.scope); initialise(): void { super.initialise(); @@ -276,11 +240,12 @@ export default abstract class FunctionBase extends NodeBase { (parameter: GenericEsTreeNode) => new (context.getNodeConstructor(parameter.type))(this, scope).parseNode( parameter - ) as unknown as PatternNode + ) as unknown as DeclarationPatternNode )); scope.addParameterVariables( parameters.map( - parameter => parameter.declare('parameter', UNKNOWN_EXPRESSION) as ParameterVariable[] + parameter => + parameter.declare('parameter', EMPTY_PATH, UNKNOWN_EXPRESSION) as ParameterVariable[] ), parameters[parameters.length - 1] instanceof RestElement ); @@ -288,11 +253,9 @@ export default abstract class FunctionBase extends NodeBase { return super.parseNode(esTreeNode); } - protected addArgumentToBeDeoptimized(_argument: ExpressionEntity) {} - - protected applyDeoptimizations() {} - protected abstract getObjectEntity(): ObjectEntity; } FunctionBase.prototype.preventChildBlockScope = true; +FunctionBase.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +FunctionBase.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/shared/FunctionNode.ts b/src/ast/nodes/shared/FunctionNode.ts index 17f1788e4..8a64ba5b6 100644 --- a/src/ast/nodes/shared/FunctionNode.ts +++ b/src/ast/nodes/shared/FunctionNode.ts @@ -3,21 +3,25 @@ import type { NodeInteraction } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import type ChildScope from '../../scopes/ChildScope'; import FunctionScope from '../../scopes/FunctionScope'; -import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; +import { + EMPTY_PATH, + type EntityPathTracker, + type ObjectPath, + UNKNOWN_PATH +} from '../../utils/PathTracker'; import type BlockStatement from '../BlockStatement'; import Identifier, { type IdentifierWithVariable } from '../Identifier'; -import type { ExpressionEntity } from './Expression'; import { UNKNOWN_EXPRESSION } from './Expression'; import FunctionBase from './FunctionBase'; import { type IncludeChildren } from './Node'; import { ObjectEntity } from './ObjectEntity'; import { OBJECT_PROTOTYPE } from './ObjectPrototype'; -import type { PatternNode } from './Pattern'; +import type { DeclarationPatternNode } from './Pattern'; export default class FunctionNode extends FunctionBase { declare body: BlockStatement; declare id: IdentifierWithVariable | null; - declare params: PatternNode[]; + declare params: DeclarationPatternNode[]; declare preventChildBlockScope: true; declare scope: FunctionScope; protected objectEntity: ObjectEntity | null = null; @@ -28,24 +32,22 @@ export default class FunctionNode extends FunctionBase { this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); // This makes sure that all deoptimizations of "this" are applied to the // constructed entity. - this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity); + this.scope.thisVariable.addArgumentValue(this.constructedEntity); } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { super.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); if (interaction.type === INTERACTION_CALLED && path.length === 0 && interaction.args[0]) { // args[0] is the "this" argument - this.scope.thisVariable.addEntityToBeDeoptimized(interaction.args[0]); + this.scope.thisVariable.addArgumentValue(interaction.args[0]); } } hasEffects(context: HasEffectsContext): boolean { - if (!this.deoptimized) this.applyDeoptimizations(); - if (this.annotationNoSideEffects) { return false; } @@ -58,13 +60,18 @@ export default class FunctionNode extends FunctionBase { interaction: NodeInteraction, context: HasEffectsContext ): boolean { - if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) return true; - - if (this.annotationNoSideEffects) { + if ( + this.annotationNoSideEffects && + path.length === 0 && + interaction.type === INTERACTION_CALLED + ) { return false; } + if (super.hasEffectsOnInteractionAtPath(path, interaction, context)) { + return true; + } - if (interaction.type === INTERACTION_CALLED) { + if (path.length === 0 && interaction.type === INTERACTION_CALLED) { const thisInit = context.replacedVariableInits.get(this.scope.thisVariable); context.replacedVariableInits.set( this.scope.thisVariable, @@ -78,7 +85,10 @@ export default class FunctionNode extends FunctionBase { returnYield: true, this: interaction.withNew }; - if (this.body.hasEffects(context)) return true; + if (this.body.hasEffects(context)) { + this.hasCachedEffects = true; + return true; + } context.brokenFlow = brokenFlow; if (thisInit) { replacedVariableInits.set(this.scope.thisVariable, thisInit); @@ -92,7 +102,7 @@ export default class FunctionNode extends FunctionBase { include(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void { super.include(context, includeChildrenRecursively); - this.id?.include(); + this.id?.include(context); const hasArguments = this.scope.argumentsVariable.included; for (const parameter of this.params) { if (!(parameter instanceof Identifier) || hasArguments) { @@ -101,13 +111,19 @@ export default class FunctionNode extends FunctionBase { } } - initialise(): void { - super.initialise(); - this.id?.declare('function', this); + includeNode(context: InclusionContext) { + this.included = true; + const hasArguments = this.scope.argumentsVariable.included; + for (const parameter of this.params) { + if (!(parameter instanceof Identifier) || hasArguments) { + parameter.includePath(UNKNOWN_PATH, context); + } + } } - protected addArgumentToBeDeoptimized(argument: ExpressionEntity) { - this.scope.argumentsVariable.addArgumentToBeDeoptimized(argument); + initialise(): void { + super.initialise(); + this.id?.declare('function', EMPTY_PATH, this); } protected getObjectEntity(): ObjectEntity { diff --git a/src/ast/nodes/shared/IdentifierBase.ts b/src/ast/nodes/shared/IdentifierBase.ts index 684d7f2de..9e151755d 100644 --- a/src/ast/nodes/shared/IdentifierBase.ts +++ b/src/ast/nodes/shared/IdentifierBase.ts @@ -11,12 +11,11 @@ import { INTERACTION_CALLED, NODE_INTERACTION_UNKNOWN_ACCESS } from '../../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../../utils/PathTracker'; import { EMPTY_PATH } from '../../utils/PathTracker'; import GlobalVariable from '../../variables/GlobalVariable'; import LocalVariable from '../../variables/LocalVariable'; import type Variable from '../../variables/Variable'; -import type SpreadElement from '../SpreadElement'; import { Flag, isFlagSet, setFlag } from './BitFlags'; import type { ExpressionEntity, LiteralValueOrUnknown } from './Expression'; import { UNKNOWN_EXPRESSION } from './Expression'; @@ -45,7 +44,7 @@ export default class IdentifierBase extends NodeBase { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.variable!.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker); } @@ -61,7 +60,7 @@ export default class IdentifierBase extends NodeBase { getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getVariableRespectingTDZ()!.getLiteralValueAtPath(path, recursionTracker, origin); @@ -70,7 +69,7 @@ export default class IdentifierBase extends NodeBase { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { const [expression, isPure] = @@ -128,21 +127,31 @@ export default class IdentifierBase extends NodeBase { } } - include(): void { + include(context: InclusionContext): void { + if (!this.included) this.includeNode(context); + } + + includeNode(context: InclusionContext) { + this.included = true; if (!this.deoptimized) this.applyDeoptimizations(); + if (this.variable !== null) { + this.scope.context.includeVariableInModule(this.variable, EMPTY_PATH, context); + } + } + + includePath(path: ObjectPath, context: InclusionContext): void { if (!this.included) { this.included = true; if (this.variable !== null) { - this.scope.context.includeVariableInModule(this.variable); + this.scope.context.includeVariableInModule(this.variable, path, context); } + } else if (path.length > 0) { + this.variable?.includePath(path, context); } } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { - this.variable!.includeCallArguments(context, parameters); + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { + this.variable!.includeCallArguments(context, interaction); } isPossibleTDZ(): boolean { @@ -186,7 +195,7 @@ export default class IdentifierBase extends NodeBase { return (this.isTDZAccess = false); } - protected applyDeoptimizations(): void { + applyDeoptimizations() { this.deoptimized = true; if (this.variable instanceof LocalVariable) { // When accessing a variable from a module without side effects, this diff --git a/src/ast/nodes/shared/JSXClosingBase.ts b/src/ast/nodes/shared/JSXClosingBase.ts index 9cb69e19b..19d672888 100644 --- a/src/ast/nodes/shared/JSXClosingBase.ts +++ b/src/ast/nodes/shared/JSXClosingBase.ts @@ -1,7 +1,7 @@ import type MagicString from 'magic-string'; import type { NormalizedJsxOptions } from '../../../rollup/types'; import type { RenderOptions } from '../../../utils/renderHelpers'; -import { NodeBase } from './Node'; +import { NodeBase, onlyIncludeSelf } from './Node'; export default class JSXClosingBase extends NodeBase { render(code: MagicString, options: RenderOptions): void { @@ -13,3 +13,5 @@ export default class JSXClosingBase extends NodeBase { } } } + +JSXClosingBase.prototype.includeNode = onlyIncludeSelf; diff --git a/src/ast/nodes/shared/JSXElementBase.ts b/src/ast/nodes/shared/JSXElementBase.ts index b5f4ef2c1..e5bba910d 100644 --- a/src/ast/nodes/shared/JSXElementBase.ts +++ b/src/ast/nodes/shared/JSXElementBase.ts @@ -9,7 +9,7 @@ import JSXExpressionContainer from '../JSXExpressionContainer'; import type { JSXChild, JsxMode } from './jsxHelpers'; import { getAndIncludeFactoryVariable } from './jsxHelpers'; import type { IncludeChildren } from './Node'; -import { NodeBase } from './Node'; +import { doNotDeoptimize, NodeBase } from './Node'; export default class JSXElementBase extends NodeBase { children!: JSXChild[]; @@ -27,22 +27,26 @@ export default class JSXElementBase extends NodeBase { } include(context: InclusionContext, includeChildrenRecursively: IncludeChildren) { - if (!this.included) { - const { factory, importSource, mode } = this.jsxMode; - if (factory) { - this.factory = factory; - this.factoryVariable = getAndIncludeFactoryVariable( - factory, - mode === 'preserve', - importSource, - this - ); - } + if (!this.included) this.includeNode(context); + for (const child of this.children) { + child.include(context, includeChildrenRecursively); } - super.include(context, includeChildrenRecursively); } - protected applyDeoptimizations() {} + includeNode(context: InclusionContext) { + this.included = true; + const { factory, importSource, mode } = this.jsxMode; + if (factory) { + this.factory = factory; + this.factoryVariable = getAndIncludeFactoryVariable( + factory, + mode === 'preserve', + importSource, + this, + context + ); + } + } protected getRenderingMode(): JsxMode { const jsx = this.scope.context.options.jsx as NormalizedJsxOptions; @@ -82,3 +86,5 @@ export default class JSXElementBase extends NodeBase { return { childrenEnd, firstChild, hasMultipleChildren }; } } + +JSXElementBase.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/shared/MethodBase.ts b/src/ast/nodes/shared/MethodBase.ts index b893dbc61..6bd71da55 100644 --- a/src/ast/nodes/shared/MethodBase.ts +++ b/src/ast/nodes/shared/MethodBase.ts @@ -9,8 +9,8 @@ import { } from '../../NodeInteractions'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, SHARED_RECURSION_TRACKER } from '../../utils/PathTracker'; import type PrivateIdentifier from '../PrivateIdentifier'; @@ -20,13 +20,18 @@ import { type LiteralValueOrUnknown, UNKNOWN_RETURN_EXPRESSION } from './Expression'; -import { type ExpressionNode, NodeBase } from './Node'; -import type { PatternNode } from './Pattern'; +import { + doNotDeoptimize, + type ExpressionNode, + NodeBase, + onlyIncludeSelfNoDeoptimize +} from './Node'; +import type { DeclarationPatternNode } from './Pattern'; export default class MethodBase extends NodeBase implements DeoptimizableEntity { declare key: ExpressionNode | PrivateIdentifier; declare kind: 'constructor' | 'method' | 'init' | 'get' | 'set'; - declare value: ExpressionNode | (ExpressionNode & PatternNode); + declare value: ExpressionNode | (ExpressionNode & DeclarationPatternNode); get computed(): boolean { return isFlagSet(this.flags, Flag.computed); @@ -40,7 +45,7 @@ export default class MethodBase extends NodeBase implements DeoptimizableEntity deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { if (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) { return this.value.deoptimizeArgumentsOnInteractionAtPath( @@ -81,7 +86,7 @@ export default class MethodBase extends NodeBase implements DeoptimizableEntity getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { return this.getAccessedValue()[0].getLiteralValueAtPath(path, recursionTracker, origin); @@ -90,7 +95,7 @@ export default class MethodBase extends NodeBase implements DeoptimizableEntity getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.getAccessedValue()[0].getReturnExpressionWhenCalledAtPath( @@ -136,8 +141,6 @@ export default class MethodBase extends NodeBase implements DeoptimizableEntity return this.getAccessedValue()[0].hasEffectsOnInteractionAtPath(path, interaction, context); } - protected applyDeoptimizations() {} - protected getAccessedValue(): [expression: ExpressionEntity, isPure: boolean] { if (this.accessedValue === null) { if (this.kind === 'get') { @@ -155,3 +158,6 @@ export default class MethodBase extends NodeBase implements DeoptimizableEntity return this.accessedValue; } } + +MethodBase.prototype.includeNode = onlyIncludeSelfNoDeoptimize; +MethodBase.prototype.applyDeoptimizations = doNotDeoptimize; diff --git a/src/ast/nodes/shared/MultiExpression.ts b/src/ast/nodes/shared/MultiExpression.ts index 5981af20b..5b1279355 100644 --- a/src/ast/nodes/shared/MultiExpression.ts +++ b/src/ast/nodes/shared/MultiExpression.ts @@ -1,7 +1,7 @@ import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../../utils/PathTracker'; import { ExpressionEntity } from './Expression'; export class MultiExpression extends ExpressionEntity { @@ -18,7 +18,7 @@ export class MultiExpression extends ExpressionEntity { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return [ diff --git a/src/ast/nodes/shared/Node.ts b/src/ast/nodes/shared/Node.ts index 8c75fb4e1..a56512f0b 100644 --- a/src/ast/nodes/shared/Node.ts +++ b/src/ast/nodes/shared/Node.ts @@ -18,8 +18,8 @@ import { INTERACTION_ASSIGNED } from '../../NodeInteractions'; import type ChildScope from '../../scopes/ChildScope'; import { EMPTY_PATH, + type EntityPathTracker, type ObjectPath, - type PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker'; import type Variable from '../../variables/Variable'; @@ -81,6 +81,7 @@ export interface Node extends Entity { * Includes the node in the bundle. If the flag is not set, children are * usually included if they are necessary for this node (e.g. a function body) * or if they have effects. Necessary variables need to be included as well. + * This is called repeatedly for each tree-shaking pass. */ include( context: InclusionContext, @@ -88,6 +89,18 @@ export interface Node extends Entity { options?: InclusionOptions ): void; + /** + * Includes this node for the first time in the bundle and ensures that all + * paths that this node relies on are included as well. Does not include + * child nodes by default, though. + */ + includeNode(context: InclusionContext): void; + + /** + * Explicitly include a path of this Node. + */ + includePath(path: ObjectPath, context: InclusionContext): void; + /** * Special version of include for assignment left-hand sides which ensures * that accessors are handled correctly. This is necessary to do from the @@ -131,7 +144,7 @@ export interface ExpressionNode extends ExpressionEntity, Node, Partial= 0; index--) { const { key, kind, property } = properties[index]; allProperties.push(property); diff --git a/src/ast/nodes/shared/ObjectMember.ts b/src/ast/nodes/shared/ObjectMember.ts index 676b7548c..8bda71fbc 100644 --- a/src/ast/nodes/shared/ObjectMember.ts +++ b/src/ast/nodes/shared/ObjectMember.ts @@ -1,13 +1,13 @@ import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; import type { HasEffectsContext } from '../../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions'; -import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../../utils/PathTracker'; import { ExpressionEntity, type LiteralValueOrUnknown } from './Expression'; export class ObjectMember extends ExpressionEntity { constructor( private readonly object: ExpressionEntity, - private readonly key: string + private readonly path: ObjectPath ) { super(); } @@ -15,35 +15,35 @@ export class ObjectMember extends ExpressionEntity { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { this.object.deoptimizeArgumentsOnInteractionAtPath( interaction, - [this.key, ...path], + [...this.path, ...path], recursionTracker ); } deoptimizePath(path: ObjectPath): void { - this.object.deoptimizePath([this.key, ...path]); + this.object.deoptimizePath([...this.path, ...path]); } getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { - return this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin); + return this.object.getLiteralValueAtPath([...this.path, ...path], recursionTracker, origin); } getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { return this.object.getReturnExpressionWhenCalledAtPath( - [this.key, ...path], + [...this.path, ...path], interaction, recursionTracker, origin @@ -55,6 +55,6 @@ export class ObjectMember extends ExpressionEntity { interaction: NodeInteraction, context: HasEffectsContext ): boolean { - return this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context); + return this.object.hasEffectsOnInteractionAtPath([...this.path, ...path], interaction, context); } } diff --git a/src/ast/nodes/shared/Pattern.ts b/src/ast/nodes/shared/Pattern.ts index e53385d28..040f5403f 100644 --- a/src/ast/nodes/shared/Pattern.ts +++ b/src/ast/nodes/shared/Pattern.ts @@ -1,10 +1,36 @@ import type { WritableEntity } from '../../Entity'; +import type { HasEffectsContext, InclusionContext } from '../../ExecutionContext'; +import type { ObjectPath } from '../../utils/PathTracker'; import type LocalVariable from '../../variables/LocalVariable'; import type { ExpressionEntity } from './Expression'; import type { Node } from './Node'; import type { VariableKind } from './VariableKinds'; export interface PatternNode extends WritableEntity, Node { - declare(kind: VariableKind, init: ExpressionEntity): LocalVariable[]; + // This should deoptimize both the left-hand and right-hand side + deoptimizeAssignment(destructuredInitPath: ObjectPath, init: ExpressionEntity): void; + + hasEffectsWhenDestructuring( + context: HasEffectsContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean; + + includeDestructuredIfNecessary( + context: InclusionContext, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): boolean; + + includePath(path: ObjectPath, context: InclusionContext): void; +} + +export interface DeclarationPatternNode extends PatternNode { + declare( + kind: VariableKind, + destructuredInitPath: ObjectPath, + init: ExpressionEntity + ): LocalVariable[]; + markDeclarationReached(): void; } diff --git a/src/ast/nodes/shared/chainElements.ts b/src/ast/nodes/shared/chainElements.ts index d7baa0a25..390e4029a 100644 --- a/src/ast/nodes/shared/chainElements.ts +++ b/src/ast/nodes/shared/chainElements.ts @@ -1,5 +1,5 @@ import type { DeoptimizableEntity } from '../../DeoptimizableEntity'; -import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../../utils/PathTracker'; import { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../../utils/PathTracker'; import type CallExpression from '../CallExpression'; import type MemberExpression from '../MemberExpression'; @@ -11,7 +11,7 @@ export function getChainElementLiteralValueAtPath( element: CallExpression | MemberExpression, object: ExpressionNode, path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown | SkippedChain { if ('getLiteralValueAtPathAsChainElement' in object) { diff --git a/src/ast/nodes/shared/jsxHelpers.ts b/src/ast/nodes/shared/jsxHelpers.ts index bdbdfe8ef..5a840d22d 100644 --- a/src/ast/nodes/shared/jsxHelpers.ts +++ b/src/ast/nodes/shared/jsxHelpers.ts @@ -1,3 +1,5 @@ +import type { InclusionContext } from '../../ExecutionContext'; +import { UNKNOWN_PATH } from '../../utils/PathTracker'; import LocalVariable from '../../variables/LocalVariable'; import type Variable from '../../variables/Variable'; import type JSXElement from '../JSXElement'; @@ -22,7 +24,8 @@ export function getAndIncludeFactoryVariable( factory: string, preserve: boolean, importSource: string | null, - node: JSXElementBase | JSXOpeningElement | JSXOpeningFragment + node: JSXElementBase | JSXOpeningElement | JSXOpeningFragment, + context: InclusionContext ): Variable { const [baseName, nestedName] = factory.split('.'); let factoryVariable: Variable; @@ -35,14 +38,14 @@ export function getAndIncludeFactoryVariable( if (preserve) { // This pretends we are accessing an included global variable of the same name const globalVariable = node.scope.findGlobal(baseName); - globalVariable.include(); + globalVariable.includePath(UNKNOWN_PATH, context); // This excludes this variable from renaming factoryVariable.globalName = baseName; } } else { factoryVariable = node.scope.findGlobal(baseName); } - node.scope.context.includeVariableInModule(factoryVariable); + node.scope.context.includeVariableInModule(factoryVariable, UNKNOWN_PATH, context); if (factoryVariable instanceof LocalVariable) { factoryVariable.consolidateInitializers(); factoryVariable.addUsedPlace(node); diff --git a/src/ast/scopes/BlockScope.ts b/src/ast/scopes/BlockScope.ts index 77e9f5307..278e4096c 100644 --- a/src/ast/scopes/BlockScope.ts +++ b/src/ast/scopes/BlockScope.ts @@ -3,6 +3,7 @@ import { logRedeclarationError } from '../../utils/logs'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type { VariableKind } from '../nodes/shared/VariableKinds'; +import type { ObjectPath } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import ChildScope from './ChildScope'; @@ -15,6 +16,7 @@ export default class BlockScope extends ChildScope { identifier: Identifier, context: AstContext, init: ExpressionEntity, + destructuredInitPath: ObjectPath, kind: VariableKind ): LocalVariable { if (kind === 'var') { @@ -31,7 +33,13 @@ export default class BlockScope extends ChildScope { } return context.error(logRedeclarationError(name), identifier.start); } - const declaredVariable = this.parent.addDeclaration(identifier, context, init, kind); + const declaredVariable = this.parent.addDeclaration( + identifier, + context, + init, + destructuredInitPath, + kind + ); // Necessary to make sure the init is deoptimized for conditional declarations. // We cannot call deoptimizePath here. declaredVariable.markInitializersForDeoptimization(); @@ -39,6 +47,6 @@ export default class BlockScope extends ChildScope { this.addHoistedVariable(name, declaredVariable); return declaredVariable; } - return super.addDeclaration(identifier, context, init, kind); + return super.addDeclaration(identifier, context, init, destructuredInitPath, kind); } } diff --git a/src/ast/scopes/CatchBodyScope.ts b/src/ast/scopes/CatchBodyScope.ts index 40dad8cae..46cc32b68 100644 --- a/src/ast/scopes/CatchBodyScope.ts +++ b/src/ast/scopes/CatchBodyScope.ts @@ -4,6 +4,7 @@ import type Identifier from '../nodes/Identifier'; import * as NodeType from '../nodes/NodeType'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type { VariableKind } from '../nodes/shared/VariableKinds'; +import type { ObjectPath } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION } from '../values'; import type LocalVariable from '../variables/LocalVariable'; import ChildScope from './ChildScope'; @@ -18,6 +19,7 @@ export default class CatchBodyScope extends ChildScope { identifier: Identifier, context: AstContext, init: ExpressionEntity, + destructuredInitPath: ObjectPath, kind: VariableKind ): LocalVariable { if (kind === 'var') { @@ -39,6 +41,7 @@ export default class CatchBodyScope extends ChildScope { identifier, context, UNDEFINED_EXPRESSION, + destructuredInitPath, kind ); // To avoid the need to rewrite the declaration, we link the variable @@ -59,7 +62,13 @@ export default class CatchBodyScope extends ChildScope { return context.error(logRedeclarationError(name), identifier.start); } // We only add parameters to parameter scopes - const declaredVariable = this.parent.parent.addDeclaration(identifier, context, init, kind); + const declaredVariable = this.parent.parent.addDeclaration( + identifier, + context, + init, + destructuredInitPath, + kind + ); // Necessary to make sure the init is deoptimized for conditional declarations. // We cannot call deoptimizePath here. declaredVariable.markInitializersForDeoptimization(); @@ -67,6 +76,6 @@ export default class CatchBodyScope extends ChildScope { this.addHoistedVariable(name, declaredVariable); return declaredVariable; } - return super.addDeclaration(identifier, context, init, kind); + return super.addDeclaration(identifier, context, init, destructuredInitPath, kind); } } diff --git a/src/ast/scopes/ClassBodyScope.ts b/src/ast/scopes/ClassBodyScope.ts index c8f7f1f62..a9c086444 100644 --- a/src/ast/scopes/ClassBodyScope.ts +++ b/src/ast/scopes/ClassBodyScope.ts @@ -1,4 +1,5 @@ import type ClassNode from '../nodes/shared/ClassNode'; +import { EMPTY_PATH } from '../utils/PathTracker'; import LocalVariable from '../variables/LocalVariable'; import ThisVariable from '../variables/ThisVariable'; import ChildScope from './ChildScope'; @@ -12,7 +13,7 @@ export default class ClassBodyScope extends ChildScope { super(parent, context); this.variables.set( 'this', - (this.thisVariable = new LocalVariable('this', null, classNode, context, 'other')) + (this.thisVariable = new LocalVariable('this', null, classNode, EMPTY_PATH, context, 'other')) ); this.instanceScope = new ChildScope(this, context); this.instanceScope.variables.set('this', new ThisVariable(context)); diff --git a/src/ast/scopes/FunctionBodyScope.ts b/src/ast/scopes/FunctionBodyScope.ts index 7343ac033..6edab0c0b 100644 --- a/src/ast/scopes/FunctionBodyScope.ts +++ b/src/ast/scopes/FunctionBodyScope.ts @@ -3,6 +3,7 @@ import { logRedeclarationError } from '../../utils/logs'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type { VariableKind } from '../nodes/shared/VariableKinds'; +import type { ObjectPath } from '../utils/PathTracker'; import LocalVariable from '../variables/LocalVariable'; import ChildScope from './ChildScope'; import type ParameterScope from './ParameterScope'; @@ -18,6 +19,7 @@ export default class FunctionBodyScope extends ChildScope { identifier: Identifier, context: AstContext, init: ExpressionEntity, + destructuredInitPath: ObjectPath, kind: VariableKind ): LocalVariable { const name = identifier.name; @@ -34,7 +36,14 @@ export default class FunctionBodyScope extends ChildScope { } context.error(logRedeclarationError(name), identifier.start); } - const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + const newVariable = new LocalVariable( + identifier.name, + identifier, + init, + destructuredInitPath, + context, + kind + ); this.variables.set(name, newVariable); return newVariable; } diff --git a/src/ast/scopes/FunctionScope.ts b/src/ast/scopes/FunctionScope.ts index ed1d91863..2898841f4 100644 --- a/src/ast/scopes/FunctionScope.ts +++ b/src/ast/scopes/FunctionScope.ts @@ -1,6 +1,7 @@ import type { InclusionContext } from '../ExecutionContext'; -import type SpreadElement from '../nodes/SpreadElement'; +import type { NodeInteractionCalled } from '../NodeInteractions'; import type { ExpressionEntity } from '../nodes/shared/Expression'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import ArgumentsVariable from '../variables/ArgumentsVariable'; import ThisVariable from '../variables/ThisVariable'; import type ChildScope from './ChildScope'; @@ -11,8 +12,8 @@ export default class FunctionScope extends ReturnValueScope { readonly thisVariable: ThisVariable; constructor(parent: ChildScope) { - const { context } = parent; super(parent, false); + const { context } = parent; this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); this.variables.set('this', (this.thisVariable = new ThisVariable(context))); } @@ -21,17 +22,21 @@ export default class FunctionScope extends ReturnValueScope { return this; } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { - super.includeCallArguments(context, parameters); + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { + super.includeCallArguments(context, interaction); if (this.argumentsVariable.included) { - for (const argument of parameters) { - if (!argument.included) { + const { args } = interaction; + for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) { + const argument = args[argumentIndex]; + if (argument) { + argument.includePath(UNKNOWN_PATH, context); argument.include(context, false); } } } } + + protected addArgumentToBeDeoptimized(argument: ExpressionEntity) { + this.argumentsVariable.addArgumentToBeDeoptimized(argument); + } } diff --git a/src/ast/scopes/ModuleScope.ts b/src/ast/scopes/ModuleScope.ts index 2902fe666..af7ba7235 100644 --- a/src/ast/scopes/ModuleScope.ts +++ b/src/ast/scopes/ModuleScope.ts @@ -5,6 +5,8 @@ import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type { VariableKind } from '../nodes/shared/VariableKinds'; +import type { ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH } from '../utils/PathTracker'; import { UNDEFINED_EXPRESSION } from '../values'; import ExportDefaultVariable from '../variables/ExportDefaultVariable'; import GlobalVariable from '../variables/GlobalVariable'; @@ -20,7 +22,7 @@ export default class ModuleScope extends ChildScope { super(parent, context); this.variables.set( 'this', - new LocalVariable('this', null, UNDEFINED_EXPRESSION, context, 'other') + new LocalVariable('this', null, UNDEFINED_EXPRESSION, EMPTY_PATH, context, 'other') ); } @@ -28,12 +30,13 @@ export default class ModuleScope extends ChildScope { identifier: Identifier, context: AstContext, init: ExpressionEntity, + destructuredInitPath: ObjectPath, kind: VariableKind ): LocalVariable { if (this.context.module.importDescriptions.has(identifier.name)) { context.error(logRedeclarationError(identifier.name), identifier.start); } - return super.addDeclaration(identifier, context, init, kind); + return super.addDeclaration(identifier, context, init, destructuredInitPath, kind); } addExportDefaultDeclaration( diff --git a/src/ast/scopes/ParameterScope.ts b/src/ast/scopes/ParameterScope.ts index 8cc03c02c..25914d86c 100644 --- a/src/ast/scopes/ParameterScope.ts +++ b/src/ast/scopes/ParameterScope.ts @@ -1,8 +1,10 @@ import { logDuplicateArgumentNameError } from '../../utils/logs'; import type { InclusionContext } from '../ExecutionContext'; +import type { NodeInteractionCalled } from '../NodeInteractions'; import type Identifier from '../nodes/Identifier'; import SpreadElement from '../nodes/SpreadElement'; -import type { ExpressionEntity } from '../nodes/shared/Expression'; +import type { ObjectPath } from '../utils/PathTracker'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import ParameterVariable from '../variables/ParameterVariable'; import CatchBodyScope from './CatchBodyScope'; import ChildScope from './ChildScope'; @@ -10,9 +12,9 @@ import FunctionBodyScope from './FunctionBodyScope'; export default class ParameterScope extends ChildScope { readonly bodyScope: ChildScope; - parameters: readonly ParameterVariable[][] = []; - private hasRest = false; + protected hasRest = false; + protected parameters: readonly ParameterVariable[][] = []; constructor(parent: ChildScope, isCatchScope: boolean) { super(parent, parent.context); @@ -23,13 +25,13 @@ export default class ParameterScope extends ChildScope { * Adds a parameter to this scope. Parameters must be added in the correct * order, i.e. from left to right. */ - addParameterDeclaration(identifier: Identifier): ParameterVariable { + addParameterDeclaration(identifier: Identifier, argumentPath: ObjectPath): ParameterVariable { const { name, start } = identifier; const existingParameter = this.variables.get(name); if (existingParameter) { return this.context.error(logDuplicateArgumentNameError(name), start); } - const variable = new ParameterVariable(name, identifier, this.context); + const variable = new ParameterVariable(name, identifier, argumentPath, this.context); this.variables.set(name, variable); // We also add it to the body scope to detect name conflicts with local // variables. We still need the intermediate scope, though, as parameter @@ -49,44 +51,54 @@ export default class ParameterScope extends ChildScope { this.hasRest = hasRest; } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { let calledFromTryStatement = false; let argumentIncluded = false; const restParameter = this.hasRest && this.parameters[this.parameters.length - 1]; - for (const checkedArgument of parameters) { - if (checkedArgument instanceof SpreadElement) { - for (const argument of parameters) { - argument.include(context, false); - } - break; + const { args } = interaction; + let lastExplicitlyIncludedIndex = args.length - 1; + // If there is a SpreadElement, we need to include all arguments after it + // because we no longer know which argument corresponds to which parameter. + for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) { + const argument = args[argumentIndex]; + if (argument instanceof SpreadElement && !argumentIncluded) { + argumentIncluded = true; + lastExplicitlyIncludedIndex = argumentIndex - 1; + } + if (argumentIncluded) { + argument!.includePath(UNKNOWN_PATH, context); + argument!.include(context, false); } } - for (let index = parameters.length - 1; index >= 0; index--) { - const parameterVariables = this.parameters[index] || restParameter; - const argument = parameters[index]; + // Now we go backwards either starting from the last argument or before the + // first SpreadElement to ensure all arguments before are included as needed + for (let index = lastExplicitlyIncludedIndex; index >= 1; index--) { + const parameterVariables = this.parameters[index - 1] || restParameter; + const argument = args[index]!; if (parameterVariables) { calledFromTryStatement = false; if (parameterVariables.length === 0) { - // handle empty destructuring + // handle empty destructuring to avoid destructuring undefined argumentIncluded = true; } else { - for (const variable of parameterVariables) { - if (variable.included) { - argumentIncluded = true; - } - if (variable.calledFromTryStatement) { + for (const parameterVariable of parameterVariables) { + if (parameterVariable.calledFromTryStatement) { calledFromTryStatement = true; } + if (parameterVariable.included) { + argumentIncluded = true; + if (calledFromTryStatement) { + argument.include(context, true); + } else { + parameterVariable.includeArgumentPaths(argument, context); + argument.include(context, false); + } + } } } } - if (!argumentIncluded && argument.shouldBeIncluded(context)) { + if (!argument.included && (argumentIncluded || argument.shouldBeIncluded(context))) { argumentIncluded = true; - } - if (argumentIncluded) { argument.include(context, calledFromTryStatement); } } diff --git a/src/ast/scopes/ReturnValueScope.ts b/src/ast/scopes/ReturnValueScope.ts index be4a522f3..dfa4a4663 100644 --- a/src/ast/scopes/ReturnValueScope.ts +++ b/src/ast/scopes/ReturnValueScope.ts @@ -1,5 +1,8 @@ +import type { NodeInteractionCalled } from '../NodeInteractions'; import { type ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression'; +import SpreadElement from '../nodes/SpreadElement'; import { UNKNOWN_PATH } from '../utils/PathTracker'; +import { UNDEFINED_EXPRESSION } from '../values'; import ParameterScope from './ParameterScope'; export default class ReturnValueScope extends ParameterScope { @@ -10,11 +13,65 @@ export default class ReturnValueScope extends ParameterScope { this.returnExpressions.push(expression); } + deoptimizeArgumentsOnCall(interaction: NodeInteractionCalled): void { + const { parameters } = this; + const { args } = interaction; + let position = 0; + for (; position < args.length - 1; position++) { + // Only the "this" argument arg[0] can be null + const argument = args[position + 1]!; + if (argument instanceof SpreadElement) { + // This deoptimizes the current and remaining parameters and arguments + for (; position < parameters.length; position++) { + args[position + 1]?.deoptimizePath(UNKNOWN_PATH); + parameters[position].forEach(variable => variable.markReassigned()); + } + break; + } + if (this.hasRest && position >= parameters.length - 1) { + argument.deoptimizePath(UNKNOWN_PATH); + } else { + const variables = parameters[position]; + if (variables) { + for (const variable of variables) { + variable.addArgumentValue(argument); + } + } + this.addArgumentToBeDeoptimized(argument); + } + } + const nonRestParameterLength = this.hasRest ? parameters.length - 1 : parameters.length; + for (; position < nonRestParameterLength; position++) { + for (const variable of parameters[position]) { + variable.addArgumentValue(UNDEFINED_EXPRESSION); + } + } + } + getReturnExpression(): ExpressionEntity { if (this.returnExpression === null) this.updateReturnExpression(); return this.returnExpression!; } + deoptimizeAllParameters() { + for (const parameter of this.parameters) { + for (const variable of parameter) { + variable.deoptimizePath(UNKNOWN_PATH); + variable.markReassigned(); + } + } + } + + reassignAllParameters() { + for (const parameter of this.parameters) { + for (const variable of parameter) { + variable.markReassigned(); + } + } + } + + protected addArgumentToBeDeoptimized(_argument: ExpressionEntity) {} + private updateReturnExpression() { if (this.returnExpressions.length === 1) { this.returnExpression = this.returnExpressions[0]; diff --git a/src/ast/scopes/Scope.ts b/src/ast/scopes/Scope.ts index eaeea352d..3be6b6429 100644 --- a/src/ast/scopes/Scope.ts +++ b/src/ast/scopes/Scope.ts @@ -3,6 +3,7 @@ import { logRedeclarationError } from '../../utils/logs'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type { VariableKind } from '../nodes/shared/VariableKinds'; +import type { ObjectPath } from '../utils/PathTracker'; import LocalVariable from '../variables/LocalVariable'; import type Variable from '../variables/Variable'; import type ChildScope from './ChildScope'; @@ -28,20 +29,27 @@ export default class Scope { identifier: Identifier, context: AstContext, init: ExpressionEntity, + destructuredInitPath: ObjectPath, kind: VariableKind ): LocalVariable { const name = identifier.name; const existingVariable = this.hoistedVariables?.get(name) || (this.variables.get(name) as LocalVariable); if (existingVariable) { - const existingKind = existingVariable.kind; - if (kind === 'var' && existingKind === 'var') { + if (kind === 'var' && existingVariable.kind === 'var') { existingVariable.addDeclaration(identifier, init); return existingVariable; } context.error(logRedeclarationError(name), identifier.start); } - const newVariable = new LocalVariable(identifier.name, identifier, init, context, kind); + const newVariable = new LocalVariable( + identifier.name, + identifier, + init, + destructuredInitPath, + context, + kind + ); this.variables.set(name, newVariable); return newVariable; } diff --git a/src/ast/scopes/TrackingScope.ts b/src/ast/scopes/TrackingScope.ts index 7449c5e0f..616fcafaf 100644 --- a/src/ast/scopes/TrackingScope.ts +++ b/src/ast/scopes/TrackingScope.ts @@ -2,6 +2,7 @@ import type { AstContext } from '../../Module'; import type Identifier from '../nodes/Identifier'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import type { VariableKind } from '../nodes/shared/VariableKinds'; +import type { ObjectPath } from '../utils/PathTracker'; import type LocalVariable from '../variables/LocalVariable'; import BlockScope from './BlockScope'; @@ -12,9 +13,10 @@ export default class TrackingScope extends BlockScope { identifier: Identifier, context: AstContext, init: ExpressionEntity, + destructuredInitPath: ObjectPath, kind: VariableKind ): LocalVariable { this.hoistedDeclarations.push(identifier); - return super.addDeclaration(identifier, context, init, kind); + return super.addDeclaration(identifier, context, init, destructuredInitPath, kind); } } diff --git a/src/ast/utils/PathTracker.ts b/src/ast/utils/PathTracker.ts index 406ffd661..5592eeb9c 100644 --- a/src/ast/utils/PathTracker.ts +++ b/src/ast/utils/PathTracker.ts @@ -1,5 +1,8 @@ +import { EMPTY_OBJECT } from '../../utils/blank'; import { getNewSet, getOrCreate } from '../../utils/getOrCreate'; import type { Entity } from '../Entity'; +import type { InclusionContext } from '../ExecutionContext'; +import type { ExpressionEntity } from '../nodes/shared/Expression'; export const UnknownKey = Symbol('Unknown Key'); export const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key'); @@ -34,7 +37,7 @@ interface EntityPaths { [UnknownNonAccessorKey]?: EntityPaths; } -export class PathTracker { +export class EntityPathTracker { private entityPaths: EntityPaths = Object.create(null, { [EntitiesKey]: { value: new Set() } }); @@ -63,15 +66,15 @@ export class PathTracker { private getEntities(path: ObjectPath): Set { let currentPaths = this.entityPaths; for (const pathSegment of path) { - currentPaths = currentPaths[pathSegment] = - currentPaths[pathSegment] || - Object.create(null, { [EntitiesKey]: { value: new Set() } }); + currentPaths = currentPaths[pathSegment] ||= Object.create(null, { + [EntitiesKey]: { value: new Set() } + }); } return currentPaths[EntitiesKey]; } } -export const SHARED_RECURSION_TRACKER = new PathTracker(); +export const SHARED_RECURSION_TRACKER = new EntityPathTracker(); interface DiscriminatedEntityPaths { [pathSegment: string]: DiscriminatedEntityPaths; @@ -94,9 +97,9 @@ export class DiscriminatedPathTracker { ): boolean { let currentPaths = this.entityPaths; for (const pathSegment of path) { - currentPaths = currentPaths[pathSegment] = - currentPaths[pathSegment] || - Object.create(null, { [EntitiesKey]: { value: new Map>() } }); + currentPaths = currentPaths[pathSegment] ||= Object.create(null, { + [EntitiesKey]: { value: new Map>() } + }); } const trackedEntities = getOrCreate( currentPaths[EntitiesKey], @@ -108,3 +111,108 @@ export class DiscriminatedPathTracker { return false; } } + +export interface IncludedPathTracker { + includePathAndGetIfIncluded(path: ObjectPath): boolean; +} + +interface IncludedPaths { + [pathSegment: string]: IncludedPaths; + [UnknownKey]?: IncludedPaths; +} + +const UNKNOWN_INCLUDED_PATH: IncludedPaths = Object.freeze({ [UnknownKey]: EMPTY_OBJECT }); + +export class IncludedFullPathTracker implements IncludedPathTracker { + private includedPaths: IncludedPaths | null = null; + + includePathAndGetIfIncluded(path: ObjectPath): boolean { + let included = true; + let parent = this as unknown as IncludedPaths; + let parentSegment = 'includedPaths'; + let currentPaths: IncludedPaths = (this.includedPaths ||= + ((included = false), Object.create(null))); + for (const pathSegment of path) { + // This means from here, all paths are included + if (currentPaths[UnknownKey]) { + return true; + } + // Including UnknownKey automatically includes all nested paths. + // From above, we know that UnknownKey is not included yet. + if (typeof pathSegment === 'symbol') { + // Hopefully, this saves some memory over just setting + // currentPaths[UnknownKey] = EMPTY_OBJECT + parent[parentSegment] = UNKNOWN_INCLUDED_PATH; + return false; + } + parent = currentPaths; + parentSegment = pathSegment; + currentPaths = currentPaths[pathSegment] ||= ((included = false), Object.create(null)); + } + return included; + } +} + +// "true" means not sub-paths are included, "UnknownKey" means at least some sub-paths are included +interface IncludedTopLevelPaths { + [pathSegment: string]: true | typeof UnknownKey; + [UnknownKey]?: true; +} + +const UNKNOWN_INCLUDED_TOP_LEVEL_PATH: IncludedTopLevelPaths = Object.freeze({ + [UnknownKey]: true as const +}); + +export class IncludedTopLevelPathTracker implements IncludedPathTracker { + private includedPaths: IncludedTopLevelPaths | null = null; + + includePathAndGetIfIncluded(path: ObjectPath): boolean { + let included = true; + const includedPaths: IncludedTopLevelPaths = (this.includedPaths ||= + ((included = false), Object.create(null))); + if (includedPaths[UnknownKey]) { + return true; + } + const [firstPathSegment, secondPathSegment] = path; + if (!firstPathSegment) { + return included; + } + if (typeof firstPathSegment === 'symbol') { + this.includedPaths = UNKNOWN_INCLUDED_TOP_LEVEL_PATH; + return false; + } + if (secondPathSegment) { + if (includedPaths[firstPathSegment] === UnknownKey) { + return true; + } + includedPaths[firstPathSegment] = UnknownKey; + return false; + } + if (includedPaths[firstPathSegment]) { + return true; + } + includedPaths[firstPathSegment] = true; + return false; + } + + includeAllPaths(entity: ExpressionEntity, context: InclusionContext, basePath: ObjectPath) { + const { includedPaths } = this; + if (includedPaths) { + if (includedPaths[UnknownKey]) { + entity.includePath([...basePath, UnknownKey], context); + } else { + const inclusionEntries = Object.entries(includedPaths); + if (inclusionEntries.length === 0) { + entity.includePath(basePath, context); + } else { + for (const [key, value] of inclusionEntries) { + entity.includePath( + value === UnknownKey ? [...basePath, key, UnknownKey] : [...basePath, key], + context + ); + } + } + } + } + } +} diff --git a/src/ast/values.ts b/src/ast/values.ts index 66147b82c..9c85be797 100644 --- a/src/ast/values.ts +++ b/src/ast/values.ts @@ -6,10 +6,12 @@ import { NODE_INTERACTION_UNKNOWN_CALL } from './NodeInteractions'; import type { LiteralValueOrBigInt } from './nodes/Literal'; +import type { LiteralValueOrUnknown } from './nodes/shared/Expression'; import { ExpressionEntity, UNKNOWN_EXPRESSION, - UNKNOWN_RETURN_EXPRESSION + UNKNOWN_RETURN_EXPRESSION, + UnknownValue } from './nodes/shared/Expression'; import { EMPTY_PATH, @@ -40,8 +42,8 @@ function assembleMemberDescriptions( export const UNDEFINED_EXPRESSION: ExpressionEntity = new (class UndefinedExpression extends ExpressionEntity { - getLiteralValueAtPath() { - return undefined; + getLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown { + return path.length > 0 ? UnknownValue : undefined; } })(); diff --git a/src/ast/variables/ArgumentsVariable.ts b/src/ast/variables/ArgumentsVariable.ts index a623b235b..7201572c6 100644 --- a/src/ast/variables/ArgumentsVariable.ts +++ b/src/ast/variables/ArgumentsVariable.ts @@ -1,36 +1,46 @@ import type { AstContext } from '../../Module'; +import type { InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type { ExpressionEntity } from '../nodes/shared/Expression'; import { UNKNOWN_EXPRESSION } from '../nodes/shared/Expression'; import type { ObjectPath } from '../utils/PathTracker'; -import { UNKNOWN_PATH } from '../utils/PathTracker'; +import { EMPTY_PATH, UNKNOWN_PATH } from '../utils/PathTracker'; import LocalVariable from './LocalVariable'; export default class ArgumentsVariable extends LocalVariable { - private deoptimizedArguments: ExpressionEntity[] = []; + deoptimizedArguments?: ExpressionEntity[]; constructor(context: AstContext) { - super('arguments', null, UNKNOWN_EXPRESSION, context, 'other'); + super('arguments', null, UNKNOWN_EXPRESSION, EMPTY_PATH, context, 'other'); } - addArgumentToBeDeoptimized(argument: ExpressionEntity): void { - if (this.included) { - argument.deoptimizePath(UNKNOWN_PATH); - } else { - this.deoptimizedArguments.push(argument); - } + addArgumentToBeDeoptimized(_argument: ExpressionEntity) {} + + // Only If there is at least one reference, then we need to track all + // arguments in order to be able to deoptimize them. + addReference() { + this.deoptimizedArguments = []; + this.addArgumentToBeDeoptimized = addArgumentToBeDeoptimized; } hasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean { return type !== INTERACTION_ACCESSED || path.length > 1; } - include() { - super.include(); - for (const argument of this.deoptimizedArguments) { + includePath(path: ObjectPath, context: InclusionContext) { + super.includePath(path, context); + for (const argument of this.deoptimizedArguments!) { argument.deoptimizePath(UNKNOWN_PATH); } - this.deoptimizedArguments.length = 0; + this.deoptimizedArguments!.length = 0; + } +} + +function addArgumentToBeDeoptimized(this: ArgumentsVariable, argument: ExpressionEntity) { + if (this.included) { + argument.deoptimizePath(UNKNOWN_PATH); + } else { + this.deoptimizedArguments?.push(argument); } } diff --git a/src/ast/variables/ExportDefaultVariable.ts b/src/ast/variables/ExportDefaultVariable.ts index baed0873c..f619de19b 100644 --- a/src/ast/variables/ExportDefaultVariable.ts +++ b/src/ast/variables/ExportDefaultVariable.ts @@ -5,6 +5,7 @@ import FunctionDeclaration from '../nodes/FunctionDeclaration'; import Identifier, { type IdentifierWithVariable } from '../nodes/Identifier'; import type IdentifierBase from '../nodes/shared/IdentifierBase'; import type { NodeBase } from '../nodes/shared/Node'; +import { EMPTY_PATH } from '../utils/PathTracker'; import LocalVariable from './LocalVariable'; import UndefinedVariable from './UndefinedVariable'; import type Variable from './Variable'; @@ -12,7 +13,7 @@ import type Variable from './Variable'; export default class ExportDefaultVariable extends LocalVariable { hasId = false; - private originalId: IdentifierWithVariable | null = null; + private readonly originalId: IdentifierWithVariable | null = null; private originalVariable: Variable | null = null; constructor( @@ -20,7 +21,14 @@ export default class ExportDefaultVariable extends LocalVariable { exportDefaultDeclaration: ExportDefaultDeclaration, context: AstContext ) { - super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context, 'other'); + super( + name, + exportDefaultDeclaration, + exportDefaultDeclaration.declaration, + EMPTY_PATH, + context, + 'other' + ); const declaration = exportDefaultDeclaration.declaration; if ( (declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) && diff --git a/src/ast/variables/ExportShimVariable.ts b/src/ast/variables/ExportShimVariable.ts index f473c49c8..f936e32c3 100644 --- a/src/ast/variables/ExportShimVariable.ts +++ b/src/ast/variables/ExportShimVariable.ts @@ -1,5 +1,7 @@ import type Module from '../../Module'; import { MISSING_EXPORT_SHIM_VARIABLE } from '../../utils/variableNames'; +import type { InclusionContext } from '../ExecutionContext'; +import type { ObjectPath } from '../utils/PathTracker'; import Variable from './Variable'; export default class ExportShimVariable extends Variable { @@ -10,8 +12,8 @@ export default class ExportShimVariable extends Variable { this.module = module; } - include(): void { - super.include(); + includePath(path: ObjectPath, context: InclusionContext): void { + super.includePath(path, context); this.module.needsExportShim = true; } } diff --git a/src/ast/variables/ExternalVariable.ts b/src/ast/variables/ExternalVariable.ts index 0775fc036..ceda7380b 100644 --- a/src/ast/variables/ExternalVariable.ts +++ b/src/ast/variables/ExternalVariable.ts @@ -1,8 +1,9 @@ import type ExternalModule from '../../ExternalModule'; +import type { InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type IdentifierBase from '../nodes/shared/IdentifierBase'; -import type { ObjectPath } from '../utils/PathTracker'; +import { type ObjectPath } from '../utils/PathTracker'; import Variable from './Variable'; export default class ExternalVariable extends Variable { @@ -27,8 +28,8 @@ export default class ExternalVariable extends Variable { return type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0); } - include(): void { - super.include(); + includePath(path: ObjectPath, context: InclusionContext): void { + super.includePath(path, context); this.module.used = true; } } diff --git a/src/ast/variables/GlobalVariable.ts b/src/ast/variables/GlobalVariable.ts index 4f168ac8f..d6be0ebab 100644 --- a/src/ast/variables/GlobalVariable.ts +++ b/src/ast/variables/GlobalVariable.ts @@ -9,7 +9,7 @@ import { import type { LiteralValueOrUnknown } from '../nodes/shared/Expression'; import { UnknownValue } from '../nodes/shared/Expression'; import { getGlobalAtPath } from '../nodes/shared/knownGlobals'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import { type EntityPathTracker, type ObjectPath } from '../utils/PathTracker'; import Variable from './Variable'; export default class GlobalVariable extends Variable { @@ -23,7 +23,7 @@ export default class GlobalVariable extends Variable { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ) { switch (interaction.type) { // While there is no point in testing these cases as at the moment, they @@ -49,7 +49,7 @@ export default class GlobalVariable extends Variable { getLiteralValueAtPath( path: ObjectPath, - _recursionTracker: PathTracker, + _recursionTracker: EntityPathTracker, _origin: DeoptimizableEntity ): LiteralValueOrUnknown { const globalAtPath = getGlobalAtPath([this.name, ...path]); diff --git a/src/ast/variables/LocalVariable.ts b/src/ast/variables/LocalVariable.ts index 83b32a81e..755a6eeed 100644 --- a/src/ast/variables/LocalVariable.ts +++ b/src/ast/variables/LocalVariable.ts @@ -2,7 +2,6 @@ import type { AstContext, default as Module } from '../../Module'; import { EMPTY_ARRAY } from '../../utils/blank'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; -import { createInclusionContext } from '../ExecutionContext'; import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions'; import { INTERACTION_ACCESSED, @@ -12,7 +11,6 @@ import { import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; import type Identifier from '../nodes/Identifier'; import * as NodeType from '../nodes/NodeType'; -import type SpreadElement from '../nodes/SpreadElement'; import { deoptimizeInteraction, type ExpressionEntity, @@ -23,33 +21,43 @@ import { } from '../nodes/shared/Expression'; import type { Node } from '../nodes/shared/Node'; import type { VariableKind } from '../nodes/shared/VariableKinds'; -import { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../utils/PathTracker'; +import { limitConcatenatedPathDepth, MAX_PATH_DEPTH } from '../utils/limitPathLength'; +import type { IncludedPathTracker } from '../utils/PathTracker'; +import { + type EntityPathTracker, + IncludedFullPathTracker, + type ObjectPath, + UNKNOWN_PATH, + UnknownKey +} from '../utils/PathTracker'; import Variable from './Variable'; export default class LocalVariable extends Variable { calledFromTryStatement = false; + readonly declarations: (Identifier | ExportDefaultDeclaration)[]; readonly module: Module; - readonly kind: VariableKind; protected additionalInitializers: ExpressionEntity[] | null = null; // Caching and deoptimization: // We track deoptimization when we do not return something unknown - protected deoptimizationTracker: PathTracker; + protected deoptimizationTracker: EntityPathTracker; + protected includedPathTracker: IncludedPathTracker = new IncludedFullPathTracker(); private expressionsToBeDeoptimized: DeoptimizableEntity[] = []; constructor( name: string, declarator: Identifier | ExportDefaultDeclaration | null, private init: ExpressionEntity, + /** if this is non-empty, the actual init is this path of this.init */ + protected initPath: ObjectPath, context: AstContext, - kind: VariableKind + readonly kind: VariableKind ) { super(name); this.declarations = declarator ? [declarator] : []; this.deoptimizationTracker = context.deoptimizationTracker; this.module = context.module; - this.kind = kind; } addDeclaration(identifier: Identifier, init: ExpressionEntity): void { @@ -62,23 +70,28 @@ export default class LocalVariable extends Variable { for (const initializer of this.additionalInitializers) { initializer.deoptimizePath(UNKNOWN_PATH); } - this.additionalInitializers = null; } } deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ): void { - if (this.isReassigned) { + if (this.isReassigned || path.length + this.initPath.length > MAX_PATH_DEPTH) { deoptimizeInteraction(interaction); return; } recursionTracker.withTrackedEntityAtPath( path, this.init, - () => this.init.deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker), + () => { + this.init.deoptimizeArgumentsOnInteractionAtPath( + interaction, + [...this.initPath, ...path], + recursionTracker + ); + }, undefined ); } @@ -97,18 +110,18 @@ export default class LocalVariable extends Variable { for (const expression of expressionsToBeDeoptimized) { expression.deoptimizeCache(); } - this.init.deoptimizePath(UNKNOWN_PATH); + this.init.deoptimizePath([...this.initPath, UnknownKey]); } else { - this.init.deoptimizePath(path); + this.init.deoptimizePath(limitConcatenatedPathDepth(this.initPath, path)); } } getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { - if (this.isReassigned) { + if (this.isReassigned || path.length + this.initPath.length > MAX_PATH_DEPTH) { return UnknownValue; } return recursionTracker.withTrackedEntityAtPath( @@ -116,7 +129,11 @@ export default class LocalVariable extends Variable { this.init, () => { this.expressionsToBeDeoptimized.push(origin); - return this.init.getLiteralValueAtPath(path, recursionTracker, origin); + return this.init.getLiteralValueAtPath( + [...this.initPath, ...path], + recursionTracker, + origin + ); }, UnknownValue ); @@ -125,10 +142,10 @@ export default class LocalVariable extends Variable { getReturnExpressionWhenCalledAtPath( path: ObjectPath, interaction: NodeInteractionCalled, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): [expression: ExpressionEntity, isPure: boolean] { - if (this.isReassigned) { + if (this.isReassigned || path.length + this.initPath.length > MAX_PATH_DEPTH) { return UNKNOWN_RETURN_EXPRESSION; } return recursionTracker.withTrackedEntityAtPath( @@ -137,7 +154,7 @@ export default class LocalVariable extends Variable { () => { this.expressionsToBeDeoptimized.push(origin); return this.init.getReturnExpressionWhenCalledAtPath( - path, + [...this.initPath, ...path], interaction, recursionTracker, origin @@ -152,12 +169,15 @@ export default class LocalVariable extends Variable { interaction: NodeInteraction, context: HasEffectsContext ): boolean { + if (path.length + this.initPath.length > MAX_PATH_DEPTH) { + return true; + } switch (interaction.type) { case INTERACTION_ACCESSED: { if (this.isReassigned) return true; return ( !context.accessed.trackEntityAtPathAndGetIfTracked(path, this) && - this.init.hasEffectsOnInteractionAtPath(path, interaction, context) + this.init.hasEffectsOnInteractionAtPath([...this.initPath, ...path], interaction, context) ); } case INTERACTION_ASSIGNED: { @@ -166,7 +186,7 @@ export default class LocalVariable extends Variable { if (this.isReassigned) return true; return ( !context.assigned.trackEntityAtPathAndGetIfTracked(path, this) && - this.init.hasEffectsOnInteractionAtPath(path, interaction, context) + this.init.hasEffectsOnInteractionAtPath([...this.initPath, ...path], interaction, context) ); } case INTERACTION_CALLED: { @@ -175,41 +195,61 @@ export default class LocalVariable extends Variable { !( interaction.withNew ? context.instantiated : context.called ).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) && - this.init.hasEffectsOnInteractionAtPath(path, interaction, context) + this.init.hasEffectsOnInteractionAtPath([...this.initPath, ...path], interaction, context) ); } } } - include(): void { - if (!this.included) { - super.include(); + includePath(path: ObjectPath, context: InclusionContext): void { + if (!this.includedPathTracker.includePathAndGetIfIncluded(path)) { + this.module.scope.context.requestTreeshakingPass(); + if (!this.included) { + // This will reduce the number of tree-shaking passes by eagerly + // including inits. By pushing this here instead of directly including + // we avoid deep call stacks. + this.module.scope.context.newlyIncludedVariableInits.add(this.init); + } + super.includePath(path, context); for (const declaration of this.declarations) { // If node is a default export, it can save a tree-shaking run to include the full declaration now - if (!declaration.included) declaration.include(createInclusionContext(), false); + if (!declaration.included) declaration.include(context, false); let node = declaration.parent as Node; while (!node.included) { // We do not want to properly include parents in case they are part of a dead branch // in which case .include() might pull in more dead code - node.included = true; + node.includeNode(context); if (node.type === NodeType.Program) break; node = node.parent as Node; } } + // We need to make sure we include the correct path of the init + if (path.length > 0) { + this.init.includePath(limitConcatenatedPathDepth(this.initPath, path), context); + this.additionalInitializers?.forEach(initializer => + initializer.includePath(UNKNOWN_PATH, context) + ); + } } } - includeCallArguments( - context: InclusionContext, - parameters: readonly (ExpressionEntity | SpreadElement)[] - ): void { - if (this.isReassigned || context.includedCallArguments.has(this.init)) { - for (const argument of parameters) { - argument.include(context, false); + includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { + if ( + this.isReassigned || + context.includedCallArguments.has(this.init) || + // This can be removed again once we can include arguments when called at + // a specific path + this.initPath.length > 0 + ) { + for (const argument of interaction.args) { + if (argument) { + argument.includePath(UNKNOWN_PATH, context); + argument.include(context, false); + } } } else { context.includedCallArguments.add(this.init); - this.init.includeCallArguments(context, parameters); + this.init.includeCallArguments(context, interaction); context.includedCallArguments.delete(this.init); } } diff --git a/src/ast/variables/NamespaceVariable.ts b/src/ast/variables/NamespaceVariable.ts index 6085c435b..91006e536 100644 --- a/src/ast/variables/NamespaceVariable.ts +++ b/src/ast/variables/NamespaceVariable.ts @@ -3,14 +3,14 @@ import { stringifyObjectKeyIfNeeded } from '../../utils/identifierHelpers'; import { getToStringTagValue, MERGE_NAMESPACES_VARIABLE } from '../../utils/interopHelpers'; import type { RenderOptions } from '../../utils/renderHelpers'; import { getSystemExportStatement } from '../../utils/systemJsRendering'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../NodeInteractions'; import type { LiteralValueOrUnknown } from '../nodes/shared/Expression'; import { deoptimizeInteraction, UnknownValue } from '../nodes/shared/Expression'; import type IdentifierBase from '../nodes/shared/IdentifierBase'; import type ChildScope from '../scopes/ChildScope'; -import type { ObjectPath, PathTracker } from '../utils/PathTracker'; +import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; import { SymbolToStringTag } from '../utils/PathTracker'; import Variable from './Variable'; @@ -38,7 +38,7 @@ export default class NamespaceVariable extends Variable { deoptimizeArgumentsOnInteractionAtPath( interaction: NodeInteraction, path: ObjectPath, - recursionTracker: PathTracker + recursionTracker: EntityPathTracker ) { if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) { const key = path[0]; @@ -113,8 +113,8 @@ export default class NamespaceVariable extends Variable { ); } - include(): void { - super.include(); + includePath(path: ObjectPath, context: InclusionContext): void { + super.includePath(path, context); this.context.includeAllExports(); } diff --git a/src/ast/variables/ParameterVariable.ts b/src/ast/variables/ParameterVariable.ts index a17bf3b11..3174389b7 100644 --- a/src/ast/variables/ParameterVariable.ts +++ b/src/ast/variables/ParameterVariable.ts @@ -1,7 +1,8 @@ import type { AstContext } from '../../Module'; import { EMPTY_ARRAY } from '../../utils/blank'; import type { DeoptimizableEntity } from '../DeoptimizableEntity'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { InclusionContext } from '../ExecutionContext'; +import { type HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ASSIGNED, INTERACTION_CALLED } from '../NodeInteractions'; import type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration'; @@ -13,10 +14,11 @@ import { UNKNOWN_RETURN_EXPRESSION, UnknownValue } from '../nodes/shared/Expression'; +import { MAX_PATH_DEPTH } from '../utils/limitPathLength'; import type { ObjectPath, ObjectPathKey } from '../utils/PathTracker'; import { - EMPTY_PATH, - PathTracker, + EntityPathTracker, + IncludedTopLevelPathTracker, SHARED_RECURSION_TRACKER, UNKNOWN_PATH, UnknownKey @@ -31,31 +33,36 @@ interface DeoptimizationInteraction { const MAX_TRACKED_INTERACTIONS = 20; const NO_INTERACTIONS = EMPTY_ARRAY as unknown as DeoptimizationInteraction[]; const UNKNOWN_DEOPTIMIZED_FIELD = new Set([UnknownKey]); -const EMPTY_PATH_TRACKER = new PathTracker(); +const EMPTY_PATH_TRACKER = new EntityPathTracker(); const UNKNOWN_DEOPTIMIZED_ENTITY = new Set([UNKNOWN_EXPRESSION]); export default class ParameterVariable extends LocalVariable { + protected includedPathTracker = new IncludedTopLevelPathTracker(); + private argumentsToBeDeoptimized = new Set(); private deoptimizationInteractions: DeoptimizationInteraction[] = []; - private deoptimizations = new PathTracker(); + private deoptimizations = new EntityPathTracker(); private deoptimizedFields = new Set(); - private entitiesToBeDeoptimized = new Set(); - private expressionsUseTheKnownValue: DeoptimizableEntity[] = []; + private expressionsDependingOnKnownValue: DeoptimizableEntity[] = []; + private knownValue: ExpressionEntity | null = null; + private knownValueLiteral: LiteralValueOrUnknown = UnknownValue; constructor( name: string, declarator: Identifier | ExportDefaultDeclaration | null, + argumentPath: ObjectPath, context: AstContext ) { - super(name, declarator, UNKNOWN_EXPRESSION, context, 'parameter'); + super(name, declarator, UNKNOWN_EXPRESSION, argumentPath, context, 'parameter'); } - addEntityToBeDeoptimized(entity: ExpressionEntity): void { + addArgumentValue(entity: ExpressionEntity): void { + this.updateKnownValue(entity); if (entity === UNKNOWN_EXPRESSION) { // As unknown expressions fully deoptimize all interactions, we can clear // the interaction cache at this point provided we keep this optimization // in mind when adding new interactions - if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { - this.entitiesToBeDeoptimized.add(UNKNOWN_EXPRESSION); + if (!this.argumentsToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + this.argumentsToBeDeoptimized.add(UNKNOWN_EXPRESSION); for (const { interaction } of this.deoptimizationInteractions) { deoptimizeInteraction(interaction); } @@ -64,42 +71,47 @@ export default class ParameterVariable extends LocalVariable { } else if (this.deoptimizedFields.has(UnknownKey)) { // This means that we already deoptimized all interactions and no longer // track them - entity.deoptimizePath(UNKNOWN_PATH); - } else if (!this.entitiesToBeDeoptimized.has(entity)) { - this.entitiesToBeDeoptimized.add(entity); + entity.deoptimizePath([...this.initPath, UnknownKey]); + } else if (!this.argumentsToBeDeoptimized.has(entity)) { + this.argumentsToBeDeoptimized.add(entity); for (const field of this.deoptimizedFields) { - entity.deoptimizePath([field]); + entity.deoptimizePath([...this.initPath, field]); } for (const { interaction, path } of this.deoptimizationInteractions) { - entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + entity.deoptimizeArgumentsOnInteractionAtPath( + interaction, + [...this.initPath, ...path], + SHARED_RECURSION_TRACKER + ); } } } + /** This says we should not make assumptions about the value of the parameter. + * This is different from deoptimization that will also cause argument values + * to be deoptimized. */ markReassigned(): void { if (this.isReassigned) { return; } super.markReassigned(); - for (const expression of this.expressionsUseTheKnownValue) { + for (const expression of this.expressionsDependingOnKnownValue) { expression.deoptimizeCache(); } - this.expressionsUseTheKnownValue = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; + this.expressionsDependingOnKnownValue = EMPTY_ARRAY as unknown as DeoptimizableEntity[]; } deoptimizeCache(): void { this.markReassigned(); } - private knownValue: ExpressionEntity | null = null; - private knownValueLiteral: LiteralValueOrUnknown = UnknownValue; /** * Update the known value of the parameter variable. * Must be called for every function call, so it can track all the arguments, * and deoptimizeCache itself to mark reassigned if the argument is changed. * @param argument The argument of the function call */ - updateKnownValue(argument: ExpressionEntity) { + private updateKnownValue(argument: ExpressionEntity) { if (this.isReassigned) { return; } @@ -107,7 +119,7 @@ export default class ParameterVariable extends LocalVariable { if (this.knownValue === null) { this.knownValue = argument; this.knownValueLiteral = argument.getLiteralValueAtPath( - EMPTY_PATH, + this.initPath, SHARED_RECURSION_TRACKER, this ); @@ -124,19 +136,16 @@ export default class ParameterVariable extends LocalVariable { return; } - const oldValue = this.knownValueLiteral; - if (typeof oldValue === 'symbol') { - this.markReassigned(); - return; - } - // add tracking for the new argument - const newValue = argument.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this); - if (newValue !== oldValue) { + const { knownValueLiteral } = this; + if ( + typeof knownValueLiteral === 'symbol' || + argument.getLiteralValueAtPath(this.initPath, SHARED_RECURSION_TRACKER, this) !== + knownValueLiteral + ) { this.markReassigned(); } } - private frozenValue: ExpressionEntity | null = null; /** * This function freezes the known value of the parameter variable, * so the optimization starts with a certain ExpressionEntity. @@ -144,26 +153,23 @@ export default class ParameterVariable extends LocalVariable { * @returns the frozen value */ private getKnownValue(): ExpressionEntity { - if (this.frozenValue === null) { - this.frozenValue = this.knownValue || UNKNOWN_EXPRESSION; - } - return this.frozenValue; + return this.knownValue || UNKNOWN_EXPRESSION; } getLiteralValueAtPath( path: ObjectPath, - recursionTracker: PathTracker, + recursionTracker: EntityPathTracker, origin: DeoptimizableEntity ): LiteralValueOrUnknown { - if (this.isReassigned) { + if (this.isReassigned || path.length + this.initPath.length > MAX_PATH_DEPTH) { return UnknownValue; } const knownValue = this.getKnownValue(); - this.expressionsUseTheKnownValue.push(origin); + this.expressionsDependingOnKnownValue.push(origin); return recursionTracker.withTrackedEntityAtPath( path, knownValue, - () => knownValue.getLiteralValueAtPath(path, recursionTracker, origin), + () => knownValue.getLiteralValueAtPath([...this.initPath, ...path], recursionTracker, origin), UnknownValue ); } @@ -173,31 +179,52 @@ export default class ParameterVariable extends LocalVariable { interaction: NodeInteraction, context: HasEffectsContext ): boolean { - if (this.isReassigned || interaction.type === INTERACTION_ASSIGNED) { + const { type } = interaction; + if ( + this.isReassigned || + type === INTERACTION_ASSIGNED || + path.length + this.initPath.length > MAX_PATH_DEPTH + ) { return super.hasEffectsOnInteractionAtPath(path, interaction, context); } - const knownValue = this.getKnownValue(); - return knownValue.hasEffectsOnInteractionAtPath(path, interaction, context); + return ( + !(type === INTERACTION_CALLED + ? (interaction.withNew + ? context.instantiated + : context.called + ).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) + : context.accessed.trackEntityAtPathAndGetIfTracked(path, this)) && + this.getKnownValue().hasEffectsOnInteractionAtPath( + [...this.initPath, ...path], + interaction, + context + ) + ); } deoptimizeArgumentsOnInteractionAtPath(interaction: NodeInteraction, path: ObjectPath): void { // For performance reasons, we fully deoptimize all deeper interactions if ( path.length >= 2 || - this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION) || + this.argumentsToBeDeoptimized.has(UNKNOWN_EXPRESSION) || this.deoptimizationInteractions.length >= MAX_TRACKED_INTERACTIONS || (path.length === 1 && (this.deoptimizedFields.has(UnknownKey) || - (interaction.type === INTERACTION_CALLED && this.deoptimizedFields.has(path[0])))) + (interaction.type === INTERACTION_CALLED && this.deoptimizedFields.has(path[0])))) || + this.initPath.length + path.length > MAX_PATH_DEPTH ) { deoptimizeInteraction(interaction); return; } if (!this.deoptimizations.trackEntityAtPathAndGetIfTracked(path, interaction.args)) { - for (const entity of this.entitiesToBeDeoptimized) { - entity.deoptimizeArgumentsOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER); + for (const entity of this.argumentsToBeDeoptimized) { + entity.deoptimizeArgumentsOnInteractionAtPath( + interaction, + [...this.initPath, ...path], + SHARED_RECURSION_TRACKER + ); } - if (!this.entitiesToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { + if (!this.argumentsToBeDeoptimized.has(UNKNOWN_EXPRESSION)) { this.deoptimizationInteractions.push({ interaction, path @@ -219,17 +246,17 @@ export default class ParameterVariable extends LocalVariable { return; } this.deoptimizedFields.add(key); - for (const entity of this.entitiesToBeDeoptimized) { + for (const entity of this.argumentsToBeDeoptimized) { // We do not need a recursion tracker here as we already track whether // this field is deoptimized - entity.deoptimizePath([key]); + entity.deoptimizePath([...this.initPath, key]); } if (key === UnknownKey) { // save some memory this.deoptimizationInteractions = NO_INTERACTIONS; this.deoptimizations = EMPTY_PATH_TRACKER; this.deoptimizedFields = UNKNOWN_DEOPTIMIZED_FIELD; - this.entitiesToBeDeoptimized = UNKNOWN_DEOPTIMIZED_ENTITY; + this.argumentsToBeDeoptimized = UNKNOWN_DEOPTIMIZED_ENTITY; } } @@ -246,4 +273,8 @@ export default class ParameterVariable extends LocalVariable { } return UNKNOWN_RETURN_EXPRESSION; } + + includeArgumentPaths(entity: ExpressionEntity, context: InclusionContext) { + this.includedPathTracker.includeAllPaths(entity, context, this.initPath); + } } diff --git a/src/ast/variables/SyntheticNamedExportVariable.ts b/src/ast/variables/SyntheticNamedExportVariable.ts index ce10f442e..299d3a096 100644 --- a/src/ast/variables/SyntheticNamedExportVariable.ts +++ b/src/ast/variables/SyntheticNamedExportVariable.ts @@ -1,5 +1,7 @@ import type Module from '../../Module'; import type { AstContext } from '../../Module'; +import type { InclusionContext } from '../ExecutionContext'; +import { type ObjectPath } from '../utils/PathTracker'; import ExportDefaultVariable from './ExportDefaultVariable'; import Variable from './Variable'; @@ -44,9 +46,9 @@ export default class SyntheticNamedExportVariable extends Variable { return `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`; } - include(): void { - super.include(); - this.context.includeVariableInModule(this.syntheticNamespace); + includePath(path: ObjectPath, context: InclusionContext): void { + super.includePath(path, context); + this.context.includeVariableInModule(this.syntheticNamespace, path, context); } setRenderNames(baseName: string | null, name: string | null): void { diff --git a/src/ast/variables/ThisVariable.ts b/src/ast/variables/ThisVariable.ts index 1d8ea9bcd..b55b2c1f4 100644 --- a/src/ast/variables/ThisVariable.ts +++ b/src/ast/variables/ThisVariable.ts @@ -2,12 +2,12 @@ import type { AstContext } from '../../Module'; import type { HasEffectsContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { UNKNOWN_EXPRESSION } from '../nodes/shared/Expression'; -import { type ObjectPath } from '../utils/PathTracker'; +import { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker'; import ParameterVariable from './ParameterVariable'; export default class ThisVariable extends ParameterVariable { constructor(context: AstContext) { - super('this', null, context); + super('this', null, EMPTY_PATH, context); } hasEffectsOnInteractionAtPath( diff --git a/src/ast/variables/Variable.ts b/src/ast/variables/Variable.ts index 2b8a1924f..319608171 100644 --- a/src/ast/variables/Variable.ts +++ b/src/ast/variables/Variable.ts @@ -1,7 +1,7 @@ import type ExternalModule from '../../ExternalModule'; import type Module from '../../Module'; import type { RenderOptions } from '../../utils/renderHelpers'; -import type { HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; import type CallExpression from '../nodes/CallExpression'; @@ -112,9 +112,9 @@ export default class Variable extends ExpressionEntity { * has not been included previously. Once a variable is included, it should * take care all its declarations are included. */ - include(): void { + includePath(path: ObjectPath, context: InclusionContext): void { this.included = true; - this.renderedLikeHoisted?.include(); + this.renderedLikeHoisted?.includePath(path, context); } /** diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_config.js b/test/chunking-form/samples/dynamic-import-with-namespace/_config.js new file mode 100644 index 000000000..e2744888c --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_config.js @@ -0,0 +1,22 @@ +const fs = require('node:fs'); +const path = require('node:path'); + +const moduleContent = fs.readFileSync(path.resolve(__dirname, './module.js'), 'utf8'); +let count = 1; +module.exports = defineTest({ + description: 'The all cases of tree-shaking for dynamic import with namespace', + options: { + plugins: [ + { + resolveId(id) { + if (id.startsWith('./module')) return id + count++; + return this.resolve(id); + }, + load(id) { + if (id.endsWith('main.js')) return null; + return moduleContent; + } + } + ] + } +}); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module1.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module1.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module1.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module10.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module10.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module10.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module2.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module2.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module2.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module3.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module3.js new file mode 100644 index 000000000..3123adef9 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module3.js @@ -0,0 +1,7 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + + exports.foo = foo; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module4.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module4.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module4.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module5.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module5.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module5.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module6.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module6.js new file mode 100644 index 000000000..3123adef9 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module6.js @@ -0,0 +1,7 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + + exports.foo = foo; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module7.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module7.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module7.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module8.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module8.js new file mode 100644 index 000000000..0317e08ce --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module8.js @@ -0,0 +1,13 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + const bar = () => {}; + const baz = () => {}; + const qux = () => {}; + + exports.bar = bar; + exports.baz = baz; + exports.foo = foo; + exports.qux = qux; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module9.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module9.js new file mode 100644 index 000000000..3123adef9 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/generated-module9.js @@ -0,0 +1,7 @@ +define(['exports'], (function (exports) { 'use strict'; + + const foo = () => {}; + + exports.foo = foo; + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/main.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/main.js new file mode 100644 index 000000000..012563bd0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/amd/main.js @@ -0,0 +1,87 @@ +define(['require'], (function (require) { 'use strict'; + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module1'], resolve, reject); }); + module.foo(); + // disabled + module[global.unknown](); + module.baz(); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module2'], resolve, reject); }); + const module1 = module; + module1.foo(); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module3'], resolve, reject); }); + const { foo } = module; + foo(); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module4'], resolve, reject); }); + // disabled + const { foo, ...rest } = module; + foo(); + rest.bar(); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module5'], resolve, reject); }); + readFoo({ foo: () => {} }); + readFoo(module); + function readFoo(module1) { + module1.foo(); + } + function readBar(module2) { + module2.bar(); + } + readBar(module); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module6'], resolve, reject); }); + function b({ foo }) { + foo(); + } + b(module); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module7'], resolve, reject); }); + // disabled + function b({ foo, ...rest }) { + foo(); + assert.ok(rest); + } + b(module); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module8'], resolve, reject); }); + // disabled + function b(o1, ...rest) { + assert.ok(rest); + } + b(o1, o2, module); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module9'], resolve, reject); }); + // disabled + function b({ foo = 1 }) { + assert.ok(foo); + } + b(module); + })(); + + (async () => { + const module = await new Promise(function (resolve, reject) { require(['./generated-module10'], resolve, reject); }); + (module).bar(); + (global.unknown && module).foo(); + (global.unknown ? module : 'foo').baz(); + })(); + +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module1.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module1.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module1.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module10.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module10.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module10.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module2.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module2.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module2.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module3.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module3.js new file mode 100644 index 000000000..02ce8a98f --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module3.js @@ -0,0 +1,5 @@ +'use strict'; + +const foo = () => {}; + +exports.foo = foo; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module4.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module4.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module4.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module5.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module5.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module5.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module6.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module6.js new file mode 100644 index 000000000..02ce8a98f --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module6.js @@ -0,0 +1,5 @@ +'use strict'; + +const foo = () => {}; + +exports.foo = foo; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module7.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module7.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module7.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module8.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module8.js new file mode 100644 index 000000000..32b8c4cc0 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module8.js @@ -0,0 +1,11 @@ +'use strict'; + +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +exports.bar = bar; +exports.baz = baz; +exports.foo = foo; +exports.qux = qux; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module9.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module9.js new file mode 100644 index 000000000..02ce8a98f --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/generated-module9.js @@ -0,0 +1,5 @@ +'use strict'; + +const foo = () => {}; + +exports.foo = foo; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/main.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/main.js new file mode 100644 index 000000000..9afab5592 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/cjs/main.js @@ -0,0 +1,85 @@ +'use strict'; + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module1.js'); }); + module.foo(); + // disabled + module[global.unknown](); + module.baz(); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module2.js'); }); + const module1 = module; + module1.foo(); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module3.js'); }); + const { foo } = module; + foo(); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module4.js'); }); + // disabled + const { foo, ...rest } = module; + foo(); + rest.bar(); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module5.js'); }); + readFoo({ foo: () => {} }); + readFoo(module); + function readFoo(module1) { + module1.foo(); + } + function readBar(module2) { + module2.bar(); + } + readBar(module); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module6.js'); }); + function b({ foo }) { + foo(); + } + b(module); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module7.js'); }); + // disabled + function b({ foo, ...rest }) { + foo(); + assert.ok(rest); + } + b(module); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module8.js'); }); + // disabled + function b(o1, ...rest) { + assert.ok(rest); + } + b(o1, o2, module); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module9.js'); }); + // disabled + function b({ foo = 1 }) { + assert.ok(foo); + } + b(module); +})(); + +(async () => { + const module = await Promise.resolve().then(function () { return require('./generated-module10.js'); }); + (module).bar(); + (global.unknown && module).foo(); + (global.unknown ? module : 'foo').baz(); +})(); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module1.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module1.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module1.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module10.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module10.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module10.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module2.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module2.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module2.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module3.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module3.js new file mode 100644 index 000000000..4ac31b619 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module3.js @@ -0,0 +1,3 @@ +const foo = () => {}; + +export { foo }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module4.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module4.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module4.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module5.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module5.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module5.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module6.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module6.js new file mode 100644 index 000000000..4ac31b619 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module6.js @@ -0,0 +1,3 @@ +const foo = () => {}; + +export { foo }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module7.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module7.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module7.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module8.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module8.js new file mode 100644 index 000000000..79e040814 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module8.js @@ -0,0 +1,6 @@ +const foo = () => {}; +const bar = () => {}; +const baz = () => {}; +const qux = () => {}; + +export { bar, baz, foo, qux }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module9.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module9.js new file mode 100644 index 000000000..4ac31b619 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/generated-module9.js @@ -0,0 +1,3 @@ +const foo = () => {}; + +export { foo }; diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/main.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/main.js new file mode 100644 index 000000000..9d78ab9ac --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/es/main.js @@ -0,0 +1,83 @@ +(async () => { + const module = await import('./generated-module1.js'); + module.foo(); + // disabled + module[global.unknown](); + module.baz(); +})(); + +(async () => { + const module = await import('./generated-module2.js'); + const module1 = module; + module1.foo(); +})(); + +(async () => { + const module = await import('./generated-module3.js'); + const { foo } = module; + foo(); +})(); + +(async () => { + const module = await import('./generated-module4.js'); + // disabled + const { foo, ...rest } = module; + foo(); + rest.bar(); +})(); + +(async () => { + const module = await import('./generated-module5.js'); + readFoo({ foo: () => {} }); + readFoo(module); + function readFoo(module1) { + module1.foo(); + } + function readBar(module2) { + module2.bar(); + } + readBar(module); +})(); + +(async () => { + const module = await import('./generated-module6.js'); + function b({ foo }) { + foo(); + } + b(module); +})(); + +(async () => { + const module = await import('./generated-module7.js'); + // disabled + function b({ foo, ...rest }) { + foo(); + assert.ok(rest); + } + b(module); +})(); + +(async () => { + const module = await import('./generated-module8.js'); + // disabled + function b(o1, ...rest) { + assert.ok(rest); + } + b(o1, o2, module); +})(); + +(async () => { + const module = await import('./generated-module9.js'); + // disabled + function b({ foo = 1 }) { + assert.ok(foo); + } + b(module); +})(); + +(async () => { + const module = await import('./generated-module10.js'); + (module).bar(); + (global.unknown && module).foo(); + (global.unknown ? module : 'foo').baz(); +})(); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module1.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module1.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module1.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module10.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module10.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module10.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module2.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module2.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module2.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module3.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module3.js new file mode 100644 index 000000000..72f26099c --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module3.js @@ -0,0 +1,10 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module4.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module4.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module4.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module5.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module5.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module5.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module6.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module6.js new file mode 100644 index 000000000..72f26099c --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module6.js @@ -0,0 +1,10 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module7.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module7.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module7.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module8.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module8.js new file mode 100644 index 000000000..e683d313e --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module8.js @@ -0,0 +1,13 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + const bar = exports("bar", () => {}); + const baz = exports("baz", () => {}); + const qux = exports("qux", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module9.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module9.js new file mode 100644 index 000000000..72f26099c --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/generated-module9.js @@ -0,0 +1,10 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + const foo = exports("foo", () => {}); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/main.js b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/main.js new file mode 100644 index 000000000..e5eda4d49 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/_expected/system/main.js @@ -0,0 +1,92 @@ +System.register([], (function (exports, module) { + 'use strict'; + return { + execute: (function () { + + (async () => { + const module$1 = await module.import('./generated-module1.js'); + module$1.foo(); + // disabled + module$1[global.unknown](); + module$1.baz(); + })(); + + (async () => { + const module$1 = await module.import('./generated-module2.js'); + const module1 = module$1; + module1.foo(); + })(); + + (async () => { + const module$1 = await module.import('./generated-module3.js'); + const { foo } = module$1; + foo(); + })(); + + (async () => { + const module$1 = await module.import('./generated-module4.js'); + // disabled + const { foo, ...rest } = module$1; + foo(); + rest.bar(); + })(); + + (async () => { + const module$1 = await module.import('./generated-module5.js'); + readFoo({ foo: () => {} }); + readFoo(module$1); + function readFoo(module1) { + module1.foo(); + } + function readBar(module2) { + module2.bar(); + } + readBar(module$1); + })(); + + (async () => { + const module$1 = await module.import('./generated-module6.js'); + function b({ foo }) { + foo(); + } + b(module$1); + })(); + + (async () => { + const module$1 = await module.import('./generated-module7.js'); + // disabled + function b({ foo, ...rest }) { + foo(); + assert.ok(rest); + } + b(module$1); + })(); + + (async () => { + const module$1 = await module.import('./generated-module8.js'); + // disabled + function b(o1, ...rest) { + assert.ok(rest); + } + b(o1, o2, module$1); + })(); + + (async () => { + const module$1 = await module.import('./generated-module9.js'); + // disabled + function b({ foo = 1 }) { + assert.ok(foo); + } + b(module$1); + })(); + + (async () => { + const module$1 = await module.import('./generated-module10.js'); + (module$1).bar(); + (global.unknown && module$1).foo(); + (global.unknown ? module$1 : 'foo').baz(); + })(); + + }) + }; +})); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/main.js b/test/chunking-form/samples/dynamic-import-with-namespace/main.js new file mode 100644 index 000000000..d7ad776d7 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/main.js @@ -0,0 +1,83 @@ +(async () => { + const module = await import('./module'); + module.foo(); + // disabled + module[global.unknown](); + module.baz(); +})(); + +(async () => { + const module = await import('./module'); + const module1 = module; + module1.foo(); +})(); + +(async () => { + const module = await import('./module'); + const { foo } = module; + foo(); +})(); + +(async () => { + const module = await import('./module'); + // disabled + const { foo, ...rest } = module; + foo(); + rest.bar(); +})(); + +(async () => { + const module = await import('./module'); + readFoo({ foo: () => {} }); + readFoo(module); + function readFoo(module1) { + module1.foo(); + } + function readBar(module2) { + module2.bar(); + } + readBar(module); +})(); + +(async () => { + const module = await import('./module'); + function b({ foo }) { + foo(); + } + b(module); +})(); + +(async () => { + const module = await import('./module'); + // disabled + function b({ foo, ...rest }) { + foo(); + assert.ok(rest); + } + b(module); +})(); + +(async () => { + const module = await import('./module'); + // disabled + function b(o1, ...rest) { + assert.ok(rest); + } + b(o1, o2, module); +})(); + +(async () => { + const module = await import('./module'); + // disabled + function b({ foo = 1 }) { + assert.ok(foo); + } + b(module); +})(); + +(async () => { + const module = await import('./module'); + ('foo', module).bar(); + (global.unknown && module).foo(); + (global.unknown ? module : 'foo').baz(); +})(); diff --git a/test/chunking-form/samples/dynamic-import-with-namespace/module.js b/test/chunking-form/samples/dynamic-import-with-namespace/module.js new file mode 100644 index 000000000..711d56916 --- /dev/null +++ b/test/chunking-form/samples/dynamic-import-with-namespace/module.js @@ -0,0 +1,4 @@ +export const foo = () => {}; +export const bar = () => {}; +export const baz = () => {}; +export const qux = () => {}; diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/generated-main2.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/generated-main2.js new file mode 100644 index 000000000..9643e93c5 --- /dev/null +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/generated-main2.js @@ -0,0 +1,14 @@ +define(['exports'], (function (exports) { 'use strict'; + + var dep = { x: 42 }; + + function log (x) { + if (dep) { + console.log(x); + } + } + + exports.dep = dep; + exports.log = log; + +})); diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main1alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main1alias.js index a058768ae..f2c65e8e5 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main1alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main1alias.js @@ -1,7 +1,5 @@ -define(['./main2alias'], (function (main2alias) { 'use strict'; +define(['./generated-main2'], (function (main2alias) { 'use strict'; - var dep = { x: 42 }; - - main2alias(dep); + main2alias.log(main2alias.dep); })); diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main2alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main2alias.js index 2c8a94842..b582fed37 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main2alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main2alias.js @@ -1,11 +1,7 @@ -define((function () { 'use strict'; +define(['./generated-main2'], (function (main2alias) { 'use strict'; - function log (x) { - { - console.log(x); - } - } - return log; + + return main2alias.log; })); diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/generated-main2.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/generated-main2.js new file mode 100644 index 000000000..6c9f57c45 --- /dev/null +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/generated-main2.js @@ -0,0 +1,12 @@ +'use strict'; + +var dep = { x: 42 }; + +function log (x) { + if (dep) { + console.log(x); + } +} + +exports.dep = dep; +exports.log = log; diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main1alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main1alias.js index 5548faffe..528760fed 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main1alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main1alias.js @@ -1,7 +1,5 @@ 'use strict'; -var main2alias = require('./main2alias.js'); +var main2alias = require('./generated-main2.js'); -var dep = { x: 42 }; - -main2alias(dep); +main2alias.log(main2alias.dep); diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main2alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main2alias.js index f8394b950..69b1826b7 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main2alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main2alias.js @@ -1,9 +1,7 @@ 'use strict'; -function log (x) { - { - console.log(x); - } -} +var main2alias = require('./generated-main2.js'); -module.exports = log; + + +module.exports = main2alias.log; diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/es/generated-main2.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/es/generated-main2.js new file mode 100644 index 000000000..ff43f7f71 --- /dev/null +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/es/generated-main2.js @@ -0,0 +1,9 @@ +var dep = { x: 42 }; + +function log (x) { + if (dep) { + console.log(x); + } +} + +export { dep as d, log as l }; diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main1alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main1alias.js index c6e94de57..7ad3b06e9 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main1alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main1alias.js @@ -1,5 +1,3 @@ -import log from './main2alias.js'; - -var dep = { x: 42 }; +import { l as log, d as dep } from './generated-main2.js'; log(dep); diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main2alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main2alias.js index c9c4c326b..d74b87aba 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main2alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main2alias.js @@ -1,7 +1 @@ -function log (x) { - { - console.log(x); - } -} - -export { log as default }; +export { l as default } from './generated-main2.js'; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-um8DK13a-system.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/system/generated-main2.js similarity index 68% rename from test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-um8DK13a-system.js rename to test/chunking-form/samples/entrypoint-aliasing/_expected/system/generated-main2.js index c474d122f..b6cc008bb 100644 --- a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-um8DK13a-system.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/system/generated-main2.js @@ -3,10 +3,12 @@ System.register([], (function (exports) { return { execute: (function () { - exports("default", log); + exports("l", log); + + var dep = exports("d", { x: 42 }); function log (x) { - { + if (dep) { console.log(x); } } diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main1alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main1alias.js index 0c66b58b8..413fc99fd 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main1alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main1alias.js @@ -1,14 +1,13 @@ -System.register(['./main2alias.js'], (function () { +System.register(['./generated-main2.js'], (function () { 'use strict'; - var log; + var log, dep; return { setters: [function (module) { - log = module.default; + log = module.l; + dep = module.d; }], execute: (function () { - var dep = { x: 42 }; - log(dep); }) diff --git a/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main2alias.js b/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main2alias.js index c474d122f..1750d72b4 100644 --- a/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main2alias.js +++ b/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main2alias.js @@ -1,16 +1,13 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { +System.register(['./generated-main2.js'], (function (exports) { + 'use strict'; + return { + setters: [function (module) { + exports("default", module.l); + }], + execute: (function () { - exports("default", log); - function log (x) { - { - console.log(x); - } - } - }) - }; + }) + }; })); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/amd/generated-main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/amd/generated-main2.js new file mode 100644 index 000000000..9643e93c5 --- /dev/null +++ b/test/chunking-form/samples/entrypoint-facade/_expected/amd/generated-main2.js @@ -0,0 +1,14 @@ +define(['exports'], (function (exports) { 'use strict'; + + var dep = { x: 42 }; + + function log (x) { + if (dep) { + console.log(x); + } + } + + exports.dep = dep; + exports.log = log; + +})); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/amd/main1.js b/test/chunking-form/samples/entrypoint-facade/_expected/amd/main1.js index f06a66684..d23070f5b 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/amd/main1.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/amd/main1.js @@ -1,7 +1,5 @@ -define(['./main2'], (function (main2) { 'use strict'; +define(['./generated-main2'], (function (main2) { 'use strict'; - var dep = { x: 42 }; - - main2(dep); + main2.log(main2.dep); })); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/amd/main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/amd/main2.js index 2c8a94842..9356f1aca 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/amd/main2.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/amd/main2.js @@ -1,11 +1,7 @@ -define((function () { 'use strict'; +define(['./generated-main2'], (function (main2) { 'use strict'; - function log (x) { - { - console.log(x); - } - } - return log; + + return main2.log; })); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/cjs/generated-main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/cjs/generated-main2.js new file mode 100644 index 000000000..6c9f57c45 --- /dev/null +++ b/test/chunking-form/samples/entrypoint-facade/_expected/cjs/generated-main2.js @@ -0,0 +1,12 @@ +'use strict'; + +var dep = { x: 42 }; + +function log (x) { + if (dep) { + console.log(x); + } +} + +exports.dep = dep; +exports.log = log; diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main1.js b/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main1.js index 12f252d0c..6c0864d07 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main1.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main1.js @@ -1,7 +1,5 @@ 'use strict'; -var main2 = require('./main2.js'); +var main2 = require('./generated-main2.js'); -var dep = { x: 42 }; - -main2(dep); +main2.log(main2.dep); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main2.js index f8394b950..1cca608ac 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main2.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main2.js @@ -1,9 +1,7 @@ 'use strict'; -function log (x) { - { - console.log(x); - } -} +var main2 = require('./generated-main2.js'); -module.exports = log; + + +module.exports = main2.log; diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/es/generated-main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/es/generated-main2.js new file mode 100644 index 000000000..ff43f7f71 --- /dev/null +++ b/test/chunking-form/samples/entrypoint-facade/_expected/es/generated-main2.js @@ -0,0 +1,9 @@ +var dep = { x: 42 }; + +function log (x) { + if (dep) { + console.log(x); + } +} + +export { dep as d, log as l }; diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/es/main1.js b/test/chunking-form/samples/entrypoint-facade/_expected/es/main1.js index d1543164b..7ad3b06e9 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/es/main1.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/es/main1.js @@ -1,5 +1,3 @@ -import log from './main2.js'; - -var dep = { x: 42 }; +import { l as log, d as dep } from './generated-main2.js'; log(dep); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/es/main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/es/main2.js index c9c4c326b..d74b87aba 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/es/main2.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/es/main2.js @@ -1,7 +1 @@ -function log (x) { - { - console.log(x); - } -} - -export { log as default }; +export { l as default } from './generated-main2.js'; diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/system/generated-main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/system/generated-main2.js new file mode 100644 index 000000000..b6cc008bb --- /dev/null +++ b/test/chunking-form/samples/entrypoint-facade/_expected/system/generated-main2.js @@ -0,0 +1,18 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + exports("l", log); + + var dep = exports("d", { x: 42 }); + + function log (x) { + if (dep) { + console.log(x); + } + } + + }) + }; +})); diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/system/main1.js b/test/chunking-form/samples/entrypoint-facade/_expected/system/main1.js index abd063145..413fc99fd 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/system/main1.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/system/main1.js @@ -1,14 +1,13 @@ -System.register(['./main2.js'], (function () { +System.register(['./generated-main2.js'], (function () { 'use strict'; - var log; + var log, dep; return { setters: [function (module) { - log = module.default; + log = module.l; + dep = module.d; }], execute: (function () { - var dep = { x: 42 }; - log(dep); }) diff --git a/test/chunking-form/samples/entrypoint-facade/_expected/system/main2.js b/test/chunking-form/samples/entrypoint-facade/_expected/system/main2.js index c474d122f..1750d72b4 100644 --- a/test/chunking-form/samples/entrypoint-facade/_expected/system/main2.js +++ b/test/chunking-form/samples/entrypoint-facade/_expected/system/main2.js @@ -1,16 +1,13 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { +System.register(['./generated-main2.js'], (function (exports) { + 'use strict'; + return { + setters: [function (module) { + exports("default", module.l); + }], + execute: (function () { - exports("default", log); - function log (x) { - { - console.log(x); - } - } - }) - }; + }) + }; })); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-BeN-_z3e-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-BeN-_z3e-amd.js new file mode 100644 index 000000000..9643e93c5 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/amd/chunk-main2-BeN-_z3e-amd.js @@ -0,0 +1,14 @@ +define(['exports'], (function (exports) { 'use strict'; + + var dep = { x: 42 }; + + function log (x) { + if (dep) { + console.log(x); + } + } + + exports.dep = dep; + exports.log = log; + +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DBBrcOFA-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DBBrcOFA-amd.js deleted file mode 100644 index e74998bb3..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DBBrcOFA-amd.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./entry-main2-DHcdu15H-amd'], (function (main2) { 'use strict'; - - var dep = { x: 42 }; - - main2(dep); - -})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DMJ9vLw5-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DMJ9vLw5-amd.js new file mode 100644 index 000000000..bf19b5fca --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main1-DMJ9vLw5-amd.js @@ -0,0 +1,5 @@ +define(['./chunk-main2-BeN-_z3e-amd'], (function (main2) { 'use strict'; + + main2.log(main2.dep); + +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-DHcdu15H-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-DHcdu15H-amd.js deleted file mode 100644 index 2c8a94842..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-DHcdu15H-amd.js +++ /dev/null @@ -1,11 +0,0 @@ -define((function () { 'use strict'; - - function log (x) { - { - console.log(x); - } - } - - return log; - -})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-SEc5gjvu-amd.js b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-SEc5gjvu-amd.js new file mode 100644 index 000000000..e814188de --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/amd/entry-main2-SEc5gjvu-amd.js @@ -0,0 +1,7 @@ +define(['./chunk-main2-BeN-_z3e-amd'], (function (main2) { 'use strict'; + + + + return main2.log; + +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-DB987Lh4-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-DB987Lh4-cjs.js new file mode 100644 index 000000000..6c9f57c45 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/cjs/chunk-main2-DB987Lh4-cjs.js @@ -0,0 +1,12 @@ +'use strict'; + +var dep = { x: 42 }; + +function log (x) { + if (dep) { + console.log(x); + } +} + +exports.dep = dep; +exports.log = log; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-DBCWfg7v-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-DBCWfg7v-cjs.js deleted file mode 100644 index 9a9af09ba..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-DBCWfg7v-cjs.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var main2 = require('./entry-main2-BVjYoW06-cjs.js'); - -var dep = { x: 42 }; - -main2(dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-m802XraR-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-m802XraR-cjs.js new file mode 100644 index 000000000..ff2abb6f2 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main1-m802XraR-cjs.js @@ -0,0 +1,5 @@ +'use strict'; + +var main2 = require('./chunk-main2-DB987Lh4-cjs.js'); + +main2.log(main2.dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-BVjYoW06-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-BVjYoW06-cjs.js deleted file mode 100644 index f8394b950..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-BVjYoW06-cjs.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -function log (x) { - { - console.log(x); - } -} - -module.exports = log; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-CDyYOEPK-cjs.js b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-CDyYOEPK-cjs.js new file mode 100644 index 000000000..a8c1d498e --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/cjs/entry-main2-CDyYOEPK-cjs.js @@ -0,0 +1,7 @@ +'use strict'; + +var main2 = require('./chunk-main2-DB987Lh4-cjs.js'); + + + +module.exports = main2.log; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-CPMnlUsH-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-CPMnlUsH-es.js new file mode 100644 index 000000000..ff43f7f71 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-CPMnlUsH-es.js @@ -0,0 +1,9 @@ +var dep = { x: 42 }; + +function log (x) { + if (dep) { + console.log(x); + } +} + +export { dep as d, log as l }; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-DCmtsuTI-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-DCmtsuTI-es.js new file mode 100644 index 000000000..2e9c7317e --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-DCmtsuTI-es.js @@ -0,0 +1,3 @@ +import { l as log, d as dep } from './chunk-main2-CPMnlUsH-es.js'; + +log(dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-WTHxIjMp-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-WTHxIjMp-es.js deleted file mode 100644 index 7f8a79168..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-WTHxIjMp-es.js +++ /dev/null @@ -1,5 +0,0 @@ -import log from './entry-main2-BNtK1lo1-es.js'; - -var dep = { x: 42 }; - -log(dep); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-BNtK1lo1-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-BNtK1lo1-es.js deleted file mode 100644 index c9c4c326b..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-BNtK1lo1-es.js +++ /dev/null @@ -1,7 +0,0 @@ -function log (x) { - { - console.log(x); - } -} - -export { log as default }; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-CO3mT8jT-es.js b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-CO3mT8jT-es.js new file mode 100644 index 000000000..83eddb16c --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-CO3mT8jT-es.js @@ -0,0 +1 @@ +export { l as default } from './chunk-main2-CPMnlUsH-es.js'; diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-BRXsWtDg-system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-BRXsWtDg-system.js new file mode 100644 index 000000000..b6cc008bb --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/system/chunk-main2-BRXsWtDg-system.js @@ -0,0 +1,18 @@ +System.register([], (function (exports) { + 'use strict'; + return { + execute: (function () { + + exports("l", log); + + var dep = exports("d", { x: 42 }); + + function log (x) { + if (dep) { + console.log(x); + } + } + + }) + }; +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-Biq2O0X--system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-Biq2O0X--system.js new file mode 100644 index 000000000..173ac94dd --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-Biq2O0X--system.js @@ -0,0 +1,15 @@ +System.register(['./chunk-main2-BRXsWtDg-system.js'], (function () { + 'use strict'; + var log, dep; + return { + setters: [function (module) { + log = module.l; + dep = module.d; + }], + execute: (function () { + + log(dep); + + }) + }; +})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-bvYFOXPm-system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-bvYFOXPm-system.js deleted file mode 100644 index a7b2fa721..000000000 --- a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main1-bvYFOXPm-system.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register(['./entry-main2-um8DK13a-system.js'], (function () { - 'use strict'; - var log; - return { - setters: [function (module) { - log = module.default; - }], - execute: (function () { - - var dep = { x: 42 }; - - log(dep); - - }) - }; -})); diff --git a/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-D_RLirM0-system.js b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-D_RLirM0-system.js new file mode 100644 index 000000000..417076cf1 --- /dev/null +++ b/test/chunking-form/samples/filenames-patterns/_expected/system/entry-main2-D_RLirM0-system.js @@ -0,0 +1,13 @@ +System.register(['./chunk-main2-BRXsWtDg-system.js'], (function (exports) { + 'use strict'; + return { + setters: [function (module) { + exports("default", module.l); + }], + execute: (function () { + + + + }) + }; +})); diff --git a/test/form/samples/argument-deoptimization/no-default-deoptimization/_expected.js b/test/form/samples/argument-deoptimization/no-default-deoptimization/_expected.js index d8c0c92e3..4825187a8 100644 --- a/test/form/samples/argument-deoptimization/no-default-deoptimization/_expected.js +++ b/test/form/samples/argument-deoptimization/no-default-deoptimization/_expected.js @@ -1,4 +1,4 @@ -const obj = { mutated: false, noEffect() {} }; +const obj = { mutated: false}; function updateObj(target) { target.mutated = true; diff --git a/test/form/samples/computed-properties/_expected/es.js b/test/form/samples/computed-properties/_expected.js similarity index 100% rename from test/form/samples/computed-properties/_expected/es.js rename to test/form/samples/computed-properties/_expected.js diff --git a/test/form/samples/computed-properties/_expected/amd.js b/test/form/samples/computed-properties/_expected/amd.js deleted file mode 100644 index 2d2e59712..000000000 --- a/test/form/samples/computed-properties/_expected/amd.js +++ /dev/null @@ -1,19 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var foo = 'foo'; - var bar = 'bar'; - var baz = 'baz'; - var bam = 'bam'; - - var x = { [foo]: 'bar' }; - - class X { - [bar] () {} - get [baz] () {} - set [bam] ( value ) {} - } - - exports.X = X; - exports.x = x; - -})); diff --git a/test/form/samples/computed-properties/_expected/cjs.js b/test/form/samples/computed-properties/_expected/cjs.js deleted file mode 100644 index 605d4a3e5..000000000 --- a/test/form/samples/computed-properties/_expected/cjs.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var foo = 'foo'; -var bar = 'bar'; -var baz = 'baz'; -var bam = 'bam'; - -var x = { [foo]: 'bar' }; - -class X { - [bar] () {} - get [baz] () {} - set [bam] ( value ) {} -} - -exports.X = X; -exports.x = x; diff --git a/test/form/samples/computed-properties/_expected/iife.js b/test/form/samples/computed-properties/_expected/iife.js deleted file mode 100644 index 07c70d5cc..000000000 --- a/test/form/samples/computed-properties/_expected/iife.js +++ /dev/null @@ -1,22 +0,0 @@ -var computedProperties = (function (exports) { - 'use strict'; - - var foo = 'foo'; - var bar = 'bar'; - var baz = 'baz'; - var bam = 'bam'; - - var x = { [foo]: 'bar' }; - - class X { - [bar] () {} - get [baz] () {} - set [bam] ( value ) {} - } - - exports.X = X; - exports.x = x; - - return exports; - -})({}); diff --git a/test/form/samples/computed-properties/_expected/system.js b/test/form/samples/computed-properties/_expected/system.js deleted file mode 100644 index ec34fc724..000000000 --- a/test/form/samples/computed-properties/_expected/system.js +++ /dev/null @@ -1,21 +0,0 @@ -System.register('computedProperties', [], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var foo = 'foo'; - var bar = 'bar'; - var baz = 'baz'; - var bam = 'bam'; - - var x = exports("x", { [foo]: 'bar' }); - - class X { - [bar] () {} - get [baz] () {} - set [bam] ( value ) {} - } exports("X", X); - - }) - }; -})); diff --git a/test/form/samples/computed-properties/_expected/umd.js b/test/form/samples/computed-properties/_expected/umd.js deleted file mode 100644 index 44eec078c..000000000 --- a/test/form/samples/computed-properties/_expected/umd.js +++ /dev/null @@ -1,23 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.computedProperties = {})); -})(this, (function (exports) { 'use strict'; - - var foo = 'foo'; - var bar = 'bar'; - var baz = 'baz'; - var bam = 'bam'; - - var x = { [foo]: 'bar' }; - - class X { - [bar] () {} - get [baz] () {} - set [bam] ( value ) {} - } - - exports.X = X; - exports.x = x; - -})); diff --git a/test/form/samples/destructured-known-arguments/_config.js b/test/form/samples/destructured-known-arguments/_config.js new file mode 100644 index 000000000..62a46d2e9 --- /dev/null +++ b/test/form/samples/destructured-known-arguments/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'tracks known argument values through destructuring' +}); diff --git a/test/form/samples/destructured-known-arguments/_expected.js b/test/form/samples/destructured-known-arguments/_expected.js new file mode 100644 index 000000000..cfd0627c1 --- /dev/null +++ b/test/form/samples/destructured-known-arguments/_expected.js @@ -0,0 +1,28 @@ +function test1({ a, noEffect, effect }) { + console.log('OK'); + effect(); +} + +test1({ + a: true, + noEffect() {}, + effect() { + console.log('effect'); + } +}); + +function test2({ a, noEffect, effect }) { + console.log('OK'); + effect(); +} + +const obj2 = { + a: true, + noEffect() {}, + effect() { + console.log('effect'); + } +}; + +test2(obj2); +test2(obj2); diff --git a/test/form/samples/destructured-known-arguments/main.js b/test/form/samples/destructured-known-arguments/main.js new file mode 100644 index 000000000..c4a22063c --- /dev/null +++ b/test/form/samples/destructured-known-arguments/main.js @@ -0,0 +1,32 @@ +function test1({ a, noEffect, effect }) { + if (a) console.log('OK'); + else console.log('REMOVED'); + noEffect(); + effect(); +} + +test1({ + a: true, + noEffect() {}, + effect() { + console.log('effect'); + } +}); + +function test2({ a, noEffect, effect }) { + if (a) console.log('OK'); + else console.log('REMOVED'); + noEffect(); + effect(); +} + +const obj2 = { + a: true, + noEffect() {}, + effect() { + console.log('effect'); + } +}; + +test2(obj2); +test2(obj2); diff --git a/test/form/samples/early-bind-member-expressions/_expected.js b/test/form/samples/early-bind-member-expressions/_expected.js index 9fefa5dfc..b3755754a 100644 --- a/test/form/samples/early-bind-member-expressions/_expected.js +++ b/test/form/samples/early-bind-member-expressions/_expected.js @@ -1,3 +1,3 @@ import * as stuff from 'external'; -stuff.y(); +const {x} = stuff.y(); diff --git a/test/form/samples/logical-expression/mutate-logical-expression/_expected/amd.js b/test/form/samples/logical-expression/mutate-logical-expression/_expected/amd.js index 01da54eab..5b474e013 100644 --- a/test/form/samples/logical-expression/mutate-logical-expression/_expected/amd.js +++ b/test/form/samples/logical-expression/mutate-logical-expression/_expected/amd.js @@ -1,7 +1,7 @@ define(['exports'], (function (exports) { 'use strict'; var aExp = {}; - var logicalAExp = aExp; + var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; diff --git a/test/form/samples/logical-expression/mutate-logical-expression/_expected/cjs.js b/test/form/samples/logical-expression/mutate-logical-expression/_expected/cjs.js index 27218c17c..2a72123b9 100644 --- a/test/form/samples/logical-expression/mutate-logical-expression/_expected/cjs.js +++ b/test/form/samples/logical-expression/mutate-logical-expression/_expected/cjs.js @@ -1,7 +1,7 @@ 'use strict'; var aExp = {}; -var logicalAExp = aExp; +var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; diff --git a/test/form/samples/logical-expression/mutate-logical-expression/_expected/es.js b/test/form/samples/logical-expression/mutate-logical-expression/_expected/es.js index 45592bb00..78297b3e7 100644 --- a/test/form/samples/logical-expression/mutate-logical-expression/_expected/es.js +++ b/test/form/samples/logical-expression/mutate-logical-expression/_expected/es.js @@ -1,5 +1,5 @@ var aExp = {}; -var logicalAExp = aExp; +var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; diff --git a/test/form/samples/logical-expression/mutate-logical-expression/_expected/iife.js b/test/form/samples/logical-expression/mutate-logical-expression/_expected/iife.js index 3c5e327f1..7dcdf795c 100644 --- a/test/form/samples/logical-expression/mutate-logical-expression/_expected/iife.js +++ b/test/form/samples/logical-expression/mutate-logical-expression/_expected/iife.js @@ -2,7 +2,7 @@ var bundle = (function (exports) { 'use strict'; var aExp = {}; - var logicalAExp = aExp; + var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; diff --git a/test/form/samples/logical-expression/mutate-logical-expression/_expected/system.js b/test/form/samples/logical-expression/mutate-logical-expression/_expected/system.js index 76655df49..640086779 100644 --- a/test/form/samples/logical-expression/mutate-logical-expression/_expected/system.js +++ b/test/form/samples/logical-expression/mutate-logical-expression/_expected/system.js @@ -4,7 +4,7 @@ System.register('bundle', [], (function (exports) { execute: (function () { var aExp = exports("aExp", {}); - var logicalAExp = aExp; + var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = exports("bExp", {}); diff --git a/test/form/samples/logical-expression/mutate-logical-expression/_expected/umd.js b/test/form/samples/logical-expression/mutate-logical-expression/_expected/umd.js index cd0819947..f14730028 100644 --- a/test/form/samples/logical-expression/mutate-logical-expression/_expected/umd.js +++ b/test/form/samples/logical-expression/mutate-logical-expression/_expected/umd.js @@ -5,7 +5,7 @@ })(this, (function (exports) { 'use strict'; var aExp = {}; - var logicalAExp = aExp; + var logicalAExp = aExp || {}; logicalAExp.bar = 1; var bExp = {}; diff --git a/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_config.js b/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_config.js new file mode 100644 index 000000000..2871b74fd --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: 'ignores property read side effects via option', + options: { treeshake: { propertyReadSideEffects: false } } +}); diff --git a/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_expected.js b/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_expected.js new file mode 100644 index 000000000..59b5fe8e2 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/_expected.js @@ -0,0 +1,4 @@ +const { a} = { + a: true}; + +console.log(a.b); diff --git a/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/main.js b/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/main.js new file mode 100644 index 000000000..2a5bf6c92 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/ignore-property-read-side-effects/main.js @@ -0,0 +1,8 @@ +const { a, b } = { + a: true, + get b() { + console.log('effect'); + } +}; + +console.log(a.b); diff --git a/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_config.js b/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_config.js new file mode 100644 index 000000000..a9129d7fb --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'only includes destructured parameter props' +}); diff --git a/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_expected.js b/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_expected.js new file mode 100644 index 000000000..b822667d2 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/_expected.js @@ -0,0 +1,7 @@ +function test({ a, d: { e } }) { + console.log(a, e); +} + +test({ + a: { b: 1, c: 2 }, + d: { e: 4}}); diff --git a/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/main.js b/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/main.js new file mode 100644 index 000000000..d7e782dbd --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/only-include-destructured-parameter-props/main.js @@ -0,0 +1,9 @@ +function test({ a, d: { e } }) { + console.log(a, e); +} + +test({ + a: { b: 1, c: 2 }, + d: { e: 4, f: 5 }, + g: 6 +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_config.js b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_config.js new file mode 100644 index 000000000..c25c9638e --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'removes unused nested properties through destructuring declarations' +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_expected.js b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_expected.js new file mode 100644 index 000000000..48ef3c76d --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/_expected.js @@ -0,0 +1,9 @@ +const { + a: { b } +} = { a: { b: { c: 1}}}; +console.log(b.c); + +const { + a: { ...rest } +} = { a: { b: { c: 1, d: 1 }, e: 1 }}; +console.log(rest); diff --git a/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js new file mode 100644 index 000000000..be4bfe8b7 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js @@ -0,0 +1,9 @@ +const { + a: { b } +} = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; +console.log(b.c); + +const { + a: { ...rest } +} = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; +console.log(rest); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_config.js b/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_config.js new file mode 100644 index 000000000..b0f0e703a --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'removes unused nested properties' +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_expected.js b/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_expected.js new file mode 100644 index 000000000..a87f92cf0 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/_expected.js @@ -0,0 +1,2 @@ +const obj = { y: { a: 1} }; +console.log(obj.y.a); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/main.js b/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/main.js new file mode 100644 index 000000000..1a46a5cf6 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-nested-props/main.js @@ -0,0 +1,2 @@ +const obj = { x: 1, y: { a: 1, b: 2 } }; +console.log(obj.y.a); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_config.js b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_config.js new file mode 100644 index 000000000..780dd0a50 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: + 'removes props that are not used in a function when part of the parameter is passed to an external function' +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_expected.js b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_expected.js new file mode 100644 index 000000000..7e3e405c4 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/_expected.js @@ -0,0 +1,6 @@ +function test(obj) { + externalFunc(obj.a); +} + +test({ + a: { b: 1, c: 2 }}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/main.js b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/main.js new file mode 100644 index 000000000..4f29aed21 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props-external-call/main.js @@ -0,0 +1,8 @@ +function test(obj) { + externalFunc(obj.a); +} + +test({ + a: { b: 1, c: 2 }, + d: { e: 4, f: 5 } +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_config.js b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_config.js new file mode 100644 index 000000000..8a1447349 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'removes props that are not used in a function' +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_expected.js b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_expected.js new file mode 100644 index 000000000..00e03a61d --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/_expected.js @@ -0,0 +1,18 @@ +function test1(obj) { + return [obj.a, obj.d.e]; +} + +console.log( + test1({ + a: { b: 1, c: 2 }, + d: { e: 4, f: 5 }}) +); + +function test2(obj) { + console.log(obj.a); + console.log(obj.d.e); +} + +test2({ + a: { b: 1, c: 2 }, + d: { e: 4, f: 5 }}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/main.js b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/main.js new file mode 100644 index 000000000..3c381fe96 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-parameter-props/main.js @@ -0,0 +1,22 @@ +function test1(obj) { + return [obj.a, obj.d.e]; +} + +console.log( + test1({ + a: { b: 1, c: 2 }, + d: { e: 4, f: 5 }, + g: 6 + }) +); + +function test2(obj) { + console.log(obj.a); + console.log(obj.d.e); +} + +test2({ + a: { b: 1, c: 2 }, + d: { e: 4, f: 5 }, + g: 6 +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-props/_config.js b/test/form/samples/object-expression-treeshaking/remove-unused-props/_config.js new file mode 100644 index 000000000..efeec207d --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-props/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'removes unused object properties' +}); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-props/_expected.js b/test/form/samples/object-expression-treeshaking/remove-unused-props/_expected.js new file mode 100644 index 000000000..f73015887 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-props/_expected.js @@ -0,0 +1,5 @@ +const obj1 = { x: 1}; +const obj2 = { y: { a: 1, b: 2 } }; +const obj3 = { y: { a: 1} }; +const obj4 = { }; +console.log(obj1.x, obj2.y, obj3.y.a, obj4.z); diff --git a/test/form/samples/object-expression-treeshaking/remove-unused-props/main.js b/test/form/samples/object-expression-treeshaking/remove-unused-props/main.js new file mode 100644 index 000000000..3b2940aaa --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/remove-unused-props/main.js @@ -0,0 +1,5 @@ +const obj1 = { x: 1, y: { a: 1, b: 2 } }; +const obj2 = { x: 1, y: { a: 1, b: 2 } }; +const obj3 = { x: 1, y: { a: 1, b: 2 } }; +const obj4 = { x: 1, y: { a: 1, b: 2 } }; +console.log(obj1.x, obj2.y, obj3.y.a, obj4.z); diff --git a/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_config.js b/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_config.js new file mode 100644 index 000000000..ac6cebc36 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'tracks property access through optional chains' +}); diff --git a/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_expected.js b/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_expected.js new file mode 100644 index 000000000..642bd2e3d --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/_expected.js @@ -0,0 +1,3 @@ +const a = { b: { c: 1}}; +const b = a?.b; +console.log(b?.c); diff --git a/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/main.js b/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/main.js new file mode 100644 index 000000000..bbbc0e5f0 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/track-through-chain-expressions/main.js @@ -0,0 +1,3 @@ +const a = { b: { c: 1, removed: true }, removed: true }; +const b = a?.b; +console.log(b?.c); diff --git a/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_config.js b/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_config.js new file mode 100644 index 000000000..2c211e43c --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: 'tree-shakes unused properties of JSX namespaces', + options: { jsx: 'preserve' } +}); diff --git a/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_expected.js b/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_expected.js new file mode 100644 index 000000000..00696f749 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/_expected.js @@ -0,0 +1,7 @@ +const ns = { + Bar: () => null +}; + +const a = ; + +export { a }; diff --git a/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/main.js b/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/main.js new file mode 100644 index 000000000..0fbcaca66 --- /dev/null +++ b/test/form/samples/object-expression-treeshaking/tree-shake-jsx-namespace/main.js @@ -0,0 +1,6 @@ +const ns = { + Foo: () => null, + Bar: () => null +} + +export const a = diff --git a/test/form/samples/object-literal-property-overwrites/_expected.js b/test/form/samples/object-literal-property-overwrites/_expected.js index ecd783e1d..0d2ad4b1d 100644 --- a/test/form/samples/object-literal-property-overwrites/_expected.js +++ b/test/form/samples/object-literal-property-overwrites/_expected.js @@ -18,20 +18,14 @@ const retained3 = { retained3.bar(); const retained4 = { - foo: {}, foo: globalThis.unknown }; retained4.foo.bar = 1; const retained5 = { - foo: {}, - ['f' + 'oo']: globalThis.unknown, - ['b' + 'ar']: {}, -}; + ['f' + 'oo']: globalThis.unknown}; retained5.foo.bar = 1; const retained6 = { - ['fo' + 'o']: {}, - ['f' + 'oo']: {} -}; + }; retained6.bar.baz = 1; diff --git a/test/form/samples/object-tree-shaking-issue-5734/_config.js b/test/form/samples/object-tree-shaking-issue-5734/_config.js new file mode 100644 index 000000000..c6e2b401e --- /dev/null +++ b/test/form/samples/object-tree-shaking-issue-5734/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'do not throw error Maximum call stack size exceeded' +}); diff --git a/test/form/samples/object-tree-shaking-issue-5734/_expected.js b/test/form/samples/object-tree-shaking-issue-5734/_expected.js new file mode 100644 index 000000000..46d40da7e --- /dev/null +++ b/test/form/samples/object-tree-shaking-issue-5734/_expected.js @@ -0,0 +1,45586 @@ +class MySqlParser extends SQLParserBase { + get grammarFileName() { return "MySqlParser.g4"; } + get literalNames() { return MySqlParser.literalNames; } + get symbolicNames() { return MySqlParser.symbolicNames; } + get ruleNames() { return MySqlParser.ruleNames; } + get serializedATN() { return MySqlParser._serializedATN; } + createFailedPredicateException(predicate, message) { + return new antlr.FailedPredicateException(this, predicate, message); + } + constructor(input) { + super(input); + this.interpreter = new antlr.ParserATNSimulator(this, MySqlParser._ATN, MySqlParser.decisionsToDFA, new antlr.PredictionContextCache()); + } + program() { + let localContext = new ProgramContext(this.context, this.state); + this.enterRule(localContext, 0, MySqlParser.RULE_program); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 837; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 169870592) !== 0) || ((((_la - 34)) & ~0x1F) === 0 && ((1 << (_la - 34)) & 268573697) !== 0) || ((((_la - 72)) & ~0x1F) === 0 && ((1 << (_la - 72)) & 2151694339) !== 0) || ((((_la - 104)) & ~0x1F) === 0 && ((1 << (_la - 104)) & 536936449) !== 0) || ((((_la - 140)) & ~0x1F) === 0 && ((1 << (_la - 140)) & 442923) !== 0) || ((((_la - 173)) & ~0x1F) === 0 && ((1 << (_la - 173)) & 2184193) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 16781443) !== 0) || _la === 362 || _la === 371 || ((((_la - 404)) & ~0x1F) === 0 && ((1 << (_la - 404)) & 270573569) !== 0) || _la === 540 || _la === 562 || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 16643) !== 0) || ((((_la - 640)) & ~0x1F) === 0 && ((1 << (_la - 640)) & 268435521) !== 0) || _la === 673 || _la === 694 || _la === 713 || _la === 717 || _la === 749 || _la === 866 || _la === 869) { + { + { + this.state = 834; + this.singleStatement(); + } + } + this.state = 839; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 840; + this.match(MySqlParser.EOF); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + singleStatement() { + let localContext = new SingleStatementContext(this.context, this.state); + this.enterRule(localContext, 2, MySqlParser.RULE_singleStatement); + try { + this.state = 847; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + this.enterOuterAlt(localContext, 1); + { + this.state = 842; + this.sqlStatement(); + this.state = 844; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1, this.context)) { + case 1: + { + this.state = 843; + this.match(MySqlParser.SEMI); + } + break; + } + } + break; + case MySqlParser.SEMI: + this.enterOuterAlt(localContext, 2); + { + this.state = 846; + this.emptyStatement_(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + sqlStatement() { + let localContext = new SqlStatementContext(this.context, this.state); + this.enterRule(localContext, 4, MySqlParser.RULE_sqlStatement); + try { + this.state = 856; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 849; + this.ddlStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 850; + this.dmlStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 851; + this.transactionStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 852; + this.replicationStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 853; + this.preparedStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 854; + this.administrationStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 855; + this.utilityStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + emptyStatement_() { + let localContext = new EmptyStatement_Context(this.context, this.state); + this.enterRule(localContext, 6, MySqlParser.RULE_emptyStatement_); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 858; + this.match(MySqlParser.SEMI); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ddlStatement() { + let localContext = new DdlStatementContext(this.context, this.state); + this.enterRule(localContext, 8, MySqlParser.RULE_ddlStatement); + try { + this.state = 899; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 4, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 860; + this.createDatabase(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 861; + this.createEvent(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 862; + this.createIndex(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 863; + this.createLogfileGroup(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 864; + this.createProcedure(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 865; + this.createFunction(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 866; + this.createServer(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 867; + this.createTable(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 868; + this.createTablespaceInnodb(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 869; + this.createTablespaceNdb(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 870; + this.createTrigger(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 871; + this.createView(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 872; + this.createRole(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 873; + this.alterDatabase(); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 874; + this.alterEvent(); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 875; + this.alterFunction(); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 876; + this.alterInstance(); + } + break; + case 18: + this.enterOuterAlt(localContext, 18); + { + this.state = 877; + this.alterLogfileGroup(); + } + break; + case 19: + this.enterOuterAlt(localContext, 19); + { + this.state = 878; + this.alterProcedure(); + } + break; + case 20: + this.enterOuterAlt(localContext, 20); + { + this.state = 879; + this.alterServer(); + } + break; + case 21: + this.enterOuterAlt(localContext, 21); + { + this.state = 880; + this.alterTable(); + } + break; + case 22: + this.enterOuterAlt(localContext, 22); + { + this.state = 881; + this.alterTablespace(); + } + break; + case 23: + this.enterOuterAlt(localContext, 23); + { + this.state = 882; + this.alterView(); + } + break; + case 24: + this.enterOuterAlt(localContext, 24); + { + this.state = 883; + this.dropDatabase(); + } + break; + case 25: + this.enterOuterAlt(localContext, 25); + { + this.state = 884; + this.dropEvent(); + } + break; + case 26: + this.enterOuterAlt(localContext, 26); + { + this.state = 885; + this.dropIndex(); + } + break; + case 27: + this.enterOuterAlt(localContext, 27); + { + this.state = 886; + this.dropLogfileGroup(); + } + break; + case 28: + this.enterOuterAlt(localContext, 28); + { + this.state = 887; + this.dropProcedure(); + } + break; + case 29: + this.enterOuterAlt(localContext, 29); + { + this.state = 888; + this.dropFunction(); + } + break; + case 30: + this.enterOuterAlt(localContext, 30); + { + this.state = 889; + this.dropServer(); + } + break; + case 31: + this.enterOuterAlt(localContext, 31); + { + this.state = 890; + this.dropSpatial(); + } + break; + case 32: + this.enterOuterAlt(localContext, 32); + { + this.state = 891; + this.dropTable(); + } + break; + case 33: + this.enterOuterAlt(localContext, 33); + { + this.state = 892; + this.dropTablespace(); + } + break; + case 34: + this.enterOuterAlt(localContext, 34); + { + this.state = 893; + this.dropTrigger(); + } + break; + case 35: + this.enterOuterAlt(localContext, 35); + { + this.state = 894; + this.dropView(); + } + break; + case 36: + this.enterOuterAlt(localContext, 36); + { + this.state = 895; + this.dropRole(); + } + break; + case 37: + this.enterOuterAlt(localContext, 37); + { + this.state = 896; + this.setRole(); + } + break; + case 38: + this.enterOuterAlt(localContext, 38); + { + this.state = 897; + this.renameTable(); + } + break; + case 39: + this.enterOuterAlt(localContext, 39); + { + this.state = 898; + this.truncateTable(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dmlStatement() { + let localContext = new DmlStatementContext(this.context, this.state); + this.enterRule(localContext, 10, MySqlParser.RULE_dmlStatement); + try { + this.state = 918; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 5, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 901; + this.selectStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 902; + this.setOperations(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 903; + this.insertStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 904; + this.updateStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 905; + this.deleteStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 906; + this.replaceStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 907; + this.callStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 908; + this.interSectStatement(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 909; + this.loadDataStatement(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 910; + this.loadXmlStatement(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 911; + this.parenthesizedQuery(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 912; + this.doStatement(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 913; + this.handlerStatement(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 914; + this.importTableStatement(); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 915; + this.valuesStatement(); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 916; + this.withStatement(); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 917; + this.tableStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionStatement() { + let localContext = new TransactionStatementContext(this.context, this.state); + this.enterRule(localContext, 12, MySqlParser.RULE_transactionStatement); + try { + this.state = 929; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 6, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 920; + this.startTransaction(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 921; + this.beginWork(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 922; + this.commitWork(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 923; + this.rollbackWork(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 924; + this.savepointStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 925; + this.rollbackStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 926; + this.releaseStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 927; + this.lockTables(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 928; + this.unlockTables(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replicationStatement() { + let localContext = new ReplicationStatementContext(this.context, this.state); + this.enterRule(localContext, 14, MySqlParser.RULE_replicationStatement); + try { + this.state = 945; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 7, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 931; + this.changeMaster(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 932; + this.changeReplicationFilter(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 933; + this.changeReplicationSource(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 934; + this.purgeBinaryLogs(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 935; + this.startSlaveOrReplica(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 936; + this.stopSlaveOrReplica(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 937; + this.startGroupReplication(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 938; + this.stopGroupReplication(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 939; + this.xaStartTransaction(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 940; + this.xaEndTransaction(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 941; + this.xaPrepareStatement(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 942; + this.xaCommitWork(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 943; + this.xaRollbackWork(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 944; + this.xaRecoverWork(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + preparedStatement() { + let localContext = new PreparedStatementContext(this.context, this.state); + this.enterRule(localContext, 16, MySqlParser.RULE_preparedStatement); + try { + this.state = 950; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PREPARE: + this.enterOuterAlt(localContext, 1); + { + this.state = 947; + this.prepareStatement(); + } + break; + case MySqlParser.KW_EXECUTE: + this.enterOuterAlt(localContext, 2); + { + this.state = 948; + this.executeStatement(); + } + break; + case MySqlParser.KW_DROP: + case MySqlParser.KW_DEALLOCATE: + this.enterOuterAlt(localContext, 3); + { + this.state = 949; + this.deallocatePrepare(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + compoundStatement() { + let localContext = new CompoundStatementContext(this.context, this.state); + this.enterRule(localContext, 18, MySqlParser.RULE_compoundStatement); + try { + this.state = 962; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 9, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 952; + this.blockStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 953; + this.caseStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 954; + this.ifStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 955; + this.leaveStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 956; + this.loopStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 957; + this.repeatStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 958; + this.whileStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 959; + this.iterateStatement(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 960; + this.returnStatement(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 961; + this.cursorStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + administrationStatement() { + let localContext = new AdministrationStatementContext(this.context, this.state); + this.enterRule(localContext, 20, MySqlParser.RULE_administrationStatement); + try { + this.state = 997; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 10, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 964; + this.alterUser(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 965; + this.createUser(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 966; + this.dropUser(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 967; + this.grantStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 968; + this.grantProxy(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 969; + this.renameUser(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 970; + this.revokeStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 971; + this.alterResourceGroup(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 972; + this.createResourceGroup(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 973; + this.dropResourceGroup(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 974; + this.setResourceGroup(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 975; + this.analyzeTable(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 976; + this.checkTable(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 977; + this.checksumTable(); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 978; + this.optimizeTable(); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 979; + this.repairTable(); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 980; + this.installComponent(); + } + break; + case 18: + this.enterOuterAlt(localContext, 18); + { + this.state = 981; + this.uninstallComponent(); + } + break; + case 19: + this.enterOuterAlt(localContext, 19); + { + this.state = 982; + this.installPlugin(); + } + break; + case 20: + this.enterOuterAlt(localContext, 20); + { + this.state = 983; + this.uninstallPlugin(); + } + break; + case 21: + this.enterOuterAlt(localContext, 21); + { + this.state = 984; + this.cloneStatement(); + } + break; + case 22: + this.enterOuterAlt(localContext, 22); + { + this.state = 985; + this.setStatement(); + } + break; + case 23: + this.enterOuterAlt(localContext, 23); + { + this.state = 986; + this.showStatement(); + } + break; + case 24: + this.enterOuterAlt(localContext, 24); + { + this.state = 987; + this.binlogStatement(); + } + break; + case 25: + this.enterOuterAlt(localContext, 25); + { + this.state = 988; + this.cacheIndexStatement(); + } + break; + case 26: + this.enterOuterAlt(localContext, 26); + { + this.state = 989; + this.flushStatement(); + } + break; + case 27: + this.enterOuterAlt(localContext, 27); + { + this.state = 990; + this.killStatement(); + } + break; + case 28: + this.enterOuterAlt(localContext, 28); + { + this.state = 991; + this.loadIndexIntoCache(); + } + break; + case 29: + this.enterOuterAlt(localContext, 29); + { + this.state = 992; + this.resetStatement(); + } + break; + case 30: + this.enterOuterAlt(localContext, 30); + { + this.state = 993; + this.resetPersist(); + } + break; + case 31: + this.enterOuterAlt(localContext, 31); + { + this.state = 994; + this.resetAllChannel(); + } + break; + case 32: + this.enterOuterAlt(localContext, 32); + { + this.state = 995; + this.reStartStatement(); + } + break; + case 33: + this.enterOuterAlt(localContext, 33); + { + this.state = 996; + this.shutdownStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + utilityStatement() { + let localContext = new UtilityStatementContext(this.context, this.state); + this.enterRule(localContext, 22, MySqlParser.RULE_utilityStatement); + try { + this.state = 1007; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 11, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 999; + this.fullDescribeStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1000; + this.simpleDescribeStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1001; + this.analyzeDescribeStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1002; + this.helpStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 1003; + this.useStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 1004; + this.signalStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 1005; + this.resignalStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 1006; + this.diagnosticsStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDatabase() { + let localContext = new CreateDatabaseContext(this.context, this.state); + this.enterRule(localContext, 24, MySqlParser.RULE_createDatabase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1009; + this.match(MySqlParser.KW_CREATE); + this.state = 1010; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1012; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 12, this.context)) { + case 1: + { + this.state = 1011; + this.ifNotExists(); + } + break; + } + this.state = 1014; + this.databaseNameCreate(); + this.state = 1018; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 135 || _la === 224 || _la === 376 || _la === 823) { + { + { + this.state = 1015; + this.createDatabaseOption(); + } + } + this.state = 1020; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createEvent() { + let localContext = new CreateEventContext(this.context, this.state); + this.enterRule(localContext, 26, MySqlParser.RULE_createEvent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1021; + this.match(MySqlParser.KW_CREATE); + this.state = 1023; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1022; + this.ownerStatement(); + } + } + this.state = 1025; + this.match(MySqlParser.KW_EVENT); + this.state = 1027; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 15, this.context)) { + case 1: + { + this.state = 1026; + this.ifNotExists(); + } + break; + } + this.state = 1029; + localContext._event_name = this.fullId(); + this.state = 1030; + this.match(MySqlParser.KW_ON); + this.state = 1031; + this.match(MySqlParser.KW_SCHEDULE); + this.state = 1032; + this.scheduleExpression(); + this.state = 1039; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 119) { + { + this.state = 1033; + this.match(MySqlParser.KW_ON); + this.state = 1034; + this.match(MySqlParser.KW_COMPLETION); + this.state = 1036; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 1035; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 1038; + this.match(MySqlParser.KW_PRESERVE); + } + } + this.state = 1042; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 1041; + this.enableType(); + } + } + this.state = 1046; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 1044; + this.match(MySqlParser.KW_COMMENT); + this.state = 1045; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1048; + this.match(MySqlParser.KW_DO); + this.state = 1049; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createIndex() { + let localContext = new CreateIndexContext(this.context, this.state); + this.enterRule(localContext, 28, MySqlParser.RULE_createIndex); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 1051; + this.match(MySqlParser.KW_CREATE); + this.state = 1053; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 508 || _la === 514) { + { + this.state = 1052; + localContext._intimeAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 508 || _la === 514)) { + localContext._intimeAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1056; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 69 || _la === 161 || _la === 182) { + { + this.state = 1055; + localContext._indexCategory = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 69 || _la === 161 || _la === 182)) { + localContext._indexCategory = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1058; + this.match(MySqlParser.KW_INDEX); + this.state = 1059; + this.indexNameCreate(); + this.state = 1061; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1060; + this.indexType(); + } + } + this.state = 1063; + this.match(MySqlParser.KW_ON); + this.state = 1064; + this.tableName(); + this.state = 1065; + this.indexColumnNames(); + this.state = 1069; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 23, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1066; + this.indexOption(); + } + } + } + this.state = 1071; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 23, this.context); + } + this.state = 1084; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 27, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + this.state = 1082; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALGORITHM: + { + this.state = 1072; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 1074; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1073; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1076; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 357 || _la === 430)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_LOCK: + { + this.state = 1077; + this.match(MySqlParser.KW_LOCK); + this.state = 1079; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1078; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1081; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 389 || _la === 505 || _la === 595)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 1086; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 27, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createLogfileGroup() { + let localContext = new CreateLogfileGroupContext(this.context, this.state); + this.enterRule(localContext, 30, MySqlParser.RULE_createLogfileGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1087; + this.match(MySqlParser.KW_CREATE); + this.state = 1088; + this.match(MySqlParser.KW_LOGFILE); + this.state = 1089; + this.match(MySqlParser.KW_GROUP); + this.state = 1090; + localContext._logfileGroupName = this.uid(); + this.state = 1091; + this.match(MySqlParser.KW_ADD); + this.state = 1092; + this.match(MySqlParser.KW_UNDOFILE); + this.state = 1093; + localContext._undoFile = this.match(MySqlParser.STRING_LITERAL); + this.state = 1099; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 1094; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 1096; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1095; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1098; + localContext._initSize = this.fileSizeLiteral(); + } + } + this.state = 1106; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 672) { + { + this.state = 1101; + this.match(MySqlParser.KW_UNDO_BUFFER_SIZE); + this.state = 1103; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1102; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1105; + localContext._undoSize = this.fileSizeLiteral(); + } + } + this.state = 1113; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 553) { + { + this.state = 1108; + this.match(MySqlParser.KW_REDO_BUFFER_SIZE); + this.state = 1110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1109; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1112; + localContext._redoSize = this.fileSizeLiteral(); + } + } + this.state = 1120; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 504) { + { + this.state = 1115; + this.match(MySqlParser.KW_NODEGROUP); + this.state = 1117; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1116; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1119; + localContext._nodegroup = this.uid(); + } + } + this.state = 1123; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 1122; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 1130; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 1125; + this.match(MySqlParser.KW_COMMENT); + this.state = 1127; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1126; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1129; + localContext._comment = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1132; + this.match(MySqlParser.KW_ENGINE); + this.state = 1134; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1133; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1136; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createProcedure() { + let localContext = new CreateProcedureContext(this.context, this.state); + this.enterRule(localContext, 32, MySqlParser.RULE_createProcedure); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 1138; + this.match(MySqlParser.KW_CREATE); + this.state = 1140; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1139; + this.ownerStatement(); + } + } + this.state = 1142; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 1144; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 41, this.context)) { + case 1: + { + this.state = 1143; + this.ifNotExists(); + } + break; + } + this.state = 1146; + localContext._sp_name = this.fullId(); + this.state = 1147; + this.match(MySqlParser.LR_BRACKET); + this.state = 1149; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18880593) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100680481) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1148; + this.procedureParameter(); + } + } + this.state = 1155; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1151; + this.match(MySqlParser.COMMA); + this.state = 1152; + this.procedureParameter(); + } + } + this.state = 1157; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1158; + this.match(MySqlParser.RR_BRACKET); + this.state = 1162; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 44, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1159; + this.routineOption(); + } + } + } + this.state = 1164; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 44, this.context); + } + this.state = 1165; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createRole() { + let localContext = new CreateRoleContext(this.context, this.state); + this.enterRule(localContext, 34, MySqlParser.RULE_createRole); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1167; + this.match(MySqlParser.KW_CREATE); + this.state = 1168; + this.match(MySqlParser.KW_ROLE); + this.state = 1170; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 45, this.context)) { + case 1: + { + this.state = 1169; + this.ifNotExists(); + } + break; + } + this.state = 1172; + this.userOrRoleNames(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createServer() { + let localContext = new CreateServerContext(this.context, this.state); + this.enterRule(localContext, 36, MySqlParser.RULE_createServer); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1174; + this.match(MySqlParser.KW_CREATE); + this.state = 1175; + this.match(MySqlParser.KW_SERVER); + this.state = 1176; + localContext._servername = this.uid(); + this.state = 1177; + this.match(MySqlParser.KW_FOREIGN); + this.state = 1178; + this.match(MySqlParser.KW_DATA); + this.state = 1179; + this.match(MySqlParser.KW_WRAPPER); + this.state = 1180; + localContext._wrapperName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 494 || _la === 882)) { + localContext._wrapperName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1181; + this.match(MySqlParser.KW_OPTIONS); + this.state = 1182; + this.match(MySqlParser.LR_BRACKET); + this.state = 1183; + this.serverOption(); + this.state = 1188; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1184; + this.match(MySqlParser.COMMA); + this.state = 1185; + this.serverOption(); + } + } + this.state = 1190; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1191; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTable() { + let localContext = new CreateTableContext(this.context, this.state); + this.enterRule(localContext, 38, MySqlParser.RULE_createTable); + let _la; + try { + let alternative; + this.state = 1271; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 65, this.context)) { + case 1: + localContext = new QueryCreateTableContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1193; + this.match(MySqlParser.KW_CREATE); + this.state = 1195; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 1194; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 1197; + this.match(MySqlParser.KW_TABLE); + this.state = 1199; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 48, this.context)) { + case 1: + { + this.state = 1198; + this.ifNotExists(); + } + break; + } + this.state = 1201; + localContext._tb = this.tableNameCreate(); + this.state = 1203; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 49, this.context)) { + case 1: + { + this.state = 1202; + localContext._col = this.createDefinitions(); + } + break; + } + this.state = 1215; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 82 || _la === 181 || _la === 224 || ((((_la - 314)) & ~0x1F) === 0 && ((1 << (_la - 314)) & 67141639) !== 0) || ((((_la - 346)) & ~0x1F) === 0 && ((1 << (_la - 346)) & 3221766153) !== 0) || _la === 380 || _la === 431 || _la === 443 || _la === 480 || _la === 490 || ((((_la - 520)) & ~0x1F) === 0 && ((1 << (_la - 520)) & 541) !== 0) || _la === 588 || ((((_la - 640)) & ~0x1F) === 0 && ((1 << (_la - 640)) & 34341021) !== 0) || ((((_la - 823)) & ~0x1F) === 0 && ((1 << (_la - 823)) & 1029) !== 0) || _la === 882) { + { + this.state = 1205; + this.tableOption(); + this.state = 1212; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 82 || _la === 181 || _la === 224 || ((((_la - 314)) & ~0x1F) === 0 && ((1 << (_la - 314)) & 67141639) !== 0) || ((((_la - 346)) & ~0x1F) === 0 && ((1 << (_la - 346)) & 3221766153) !== 0) || _la === 380 || _la === 431 || _la === 443 || _la === 480 || _la === 490 || ((((_la - 520)) & ~0x1F) === 0 && ((1 << (_la - 520)) & 541) !== 0) || _la === 588 || ((((_la - 640)) & ~0x1F) === 0 && ((1 << (_la - 640)) & 34341021) !== 0) || ((((_la - 823)) & ~0x1F) === 0 && ((1 << (_la - 823)) & 1029) !== 0) || _la === 868 || _la === 882) { + { + { + this.state = 1207; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 1206; + this.match(MySqlParser.COMMA); + } + } + this.state = 1209; + this.tableOption(); + } + } + this.state = 1214; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 1218; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 1217; + this.partitionDefinitions(); + } + } + this.state = 1221; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79 || _la === 143) { + { + this.state = 1220; + _la = this.tokenStream.LA(1); + if (!(_la === 79 || _la === 143)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1224; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 1223; + this.match(MySqlParser.KW_AS); + } + } + this.state = 1226; + this.selectStatement(); + } + break; + case 2: + localContext = new CopyCreateTableContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1228; + this.match(MySqlParser.KW_CREATE); + this.state = 1230; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 1229; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 1232; + this.match(MySqlParser.KW_TABLE); + this.state = 1234; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 57, this.context)) { + case 1: + { + this.state = 1233; + this.ifNotExists(); + } + break; + } + this.state = 1236; + this.tableNameCreate(); + this.state = 1244; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_LIKE: + { + this.state = 1237; + this.match(MySqlParser.KW_LIKE); + this.state = 1238; + this.tableName(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 1239; + this.match(MySqlParser.LR_BRACKET); + this.state = 1240; + this.match(MySqlParser.KW_LIKE); + this.state = 1241; + this.tableName(); + this.state = 1242; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 3: + localContext = new ColumnCreateTableContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1246; + this.match(MySqlParser.KW_CREATE); + this.state = 1248; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 1247; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 1250; + this.match(MySqlParser.KW_TABLE); + this.state = 1252; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 60, this.context)) { + case 1: + { + this.state = 1251; + this.ifNotExists(); + } + break; + } + this.state = 1254; + this.tableNameCreate(); + this.state = 1255; + this.createDefinitions(); + this.state = 1266; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 63, this.context)) { + case 1: + { + this.state = 1256; + this.tableOption(); + this.state = 1263; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 62, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1258; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 1257; + this.match(MySqlParser.COMMA); + } + } + this.state = 1260; + this.tableOption(); + } + } + } + this.state = 1265; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 62, this.context); + } + } + break; + } + this.state = 1269; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 1268; + this.partitionDefinitions(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTablespaceInnodb() { + let localContext = new CreateTablespaceInnodbContext(this.context, this.state); + this.enterRule(localContext, 40, MySqlParser.RULE_createTablespaceInnodb); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1273; + this.match(MySqlParser.KW_CREATE); + this.state = 1275; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 1274; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 1277; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 1278; + this.tablespaceNameCreate(); + this.state = 1282; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 6) { + { + this.state = 1279; + this.match(MySqlParser.KW_ADD); + this.state = 1280; + this.match(MySqlParser.KW_DATAFILE); + this.state = 1281; + localContext._datafile = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1289; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 314) { + { + this.state = 1284; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 1286; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1285; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1288; + localContext._autoextendSize = this.fileSizeLiteral(); + } + } + this.state = 1294; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 399) { + { + this.state = 1291; + this.match(MySqlParser.KW_FILE_BLOCK_SIZE); + this.state = 1292; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 1293; + localContext._fileBlockSize = this.fileSizeLiteral(); + } + } + this.state = 1301; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 380) { + { + this.state = 1296; + this.match(MySqlParser.KW_ENGINE); + this.state = 1298; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1297; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1300; + this.engineName(); + } + } + this.state = 1308; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 825) { + { + this.state = 1303; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 1305; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1304; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1307; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTablespaceNdb() { + let localContext = new CreateTablespaceNdbContext(this.context, this.state); + this.enterRule(localContext, 42, MySqlParser.RULE_createTablespaceNdb); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1310; + this.match(MySqlParser.KW_CREATE); + this.state = 1312; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 1311; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 1314; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 1315; + this.tablespaceNameCreate(); + this.state = 1316; + this.match(MySqlParser.KW_ADD); + this.state = 1317; + this.match(MySqlParser.KW_DATAFILE); + this.state = 1318; + localContext._datafile = this.match(MySqlParser.STRING_LITERAL); + this.state = 1319; + this.match(MySqlParser.KW_USE); + this.state = 1320; + this.match(MySqlParser.KW_LOGFILE); + this.state = 1321; + this.match(MySqlParser.KW_GROUP); + this.state = 1322; + localContext._logfileGroupName = this.uid(); + this.state = 1328; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 393) { + { + this.state = 1323; + this.match(MySqlParser.KW_EXTENT_SIZE); + this.state = 1325; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1324; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1327; + localContext._extentSize = this.fileSizeLiteral(); + } + } + this.state = 1335; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 1330; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 1332; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1331; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1334; + localContext._initialSize = this.fileSizeLiteral(); + } + } + this.state = 1342; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 314) { + { + this.state = 1337; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 1339; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1338; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1341; + localContext._autoextendSize = this.fileSizeLiteral(); + } + } + this.state = 1349; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 481) { + { + this.state = 1344; + this.match(MySqlParser.KW_MAX_SIZE); + this.state = 1346; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1345; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1348; + localContext._maxSize = this.fileSizeLiteral(); + } + } + this.state = 1356; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 504) { + { + this.state = 1351; + this.match(MySqlParser.KW_NODEGROUP); + this.state = 1353; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1352; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1355; + localContext._nodegroup = this.uid(); + } + } + this.state = 1359; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 1358; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 1366; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 1361; + this.match(MySqlParser.KW_COMMENT); + this.state = 1363; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1362; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1365; + localContext._comment = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1368; + this.match(MySqlParser.KW_ENGINE); + this.state = 1370; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1369; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1372; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTrigger() { + let localContext = new CreateTriggerContext(this.context, this.state); + this.enterRule(localContext, 44, MySqlParser.RULE_createTrigger); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1374; + this.match(MySqlParser.KW_CREATE); + this.state = 1376; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1375; + this.ownerStatement(); + } + } + this.state = 1378; + this.match(MySqlParser.KW_TRIGGER); + this.state = 1380; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 91, this.context)) { + case 1: + { + this.state = 1379; + this.ifNotExists(); + } + break; + } + this.state = 1382; + localContext._trigger_name = this.fullId(); + this.state = 1383; + localContext._triggerTime = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 16 || _la === 306)) { + localContext._triggerTime = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1384; + localContext._triggerEvent = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 44 || _la === 86 || _la === 185)) { + localContext._triggerEvent = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1385; + this.match(MySqlParser.KW_ON); + this.state = 1386; + this.tableName(); + this.state = 1387; + this.match(MySqlParser.KW_FOR); + this.state = 1388; + this.match(MySqlParser.KW_EACH); + this.state = 1389; + this.match(MySqlParser.KW_ROW); + this.state = 1392; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 92, this.context)) { + case 1: + { + this.state = 1390; + localContext._triggerPlace = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 406 || _la === 538)) { + localContext._triggerPlace = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1391; + localContext._other_trigger_name = this.fullId(); + } + break; + } + this.state = 1394; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + withClause() { + let localContext = new WithClauseContext(this.context, this.state); + this.enterRule(localContext, 46, MySqlParser.RULE_withClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1396; + this.match(MySqlParser.KW_WITH); + this.state = 1398; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 93, this.context)) { + case 1: + { + this.state = 1397; + this.match(MySqlParser.KW_RECURSIVE); + } + break; + } + this.state = 1400; + this.commonTableExpressions(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + commonTableExpressions() { + let localContext = new CommonTableExpressionsContext(this.context, this.state); + this.enterRule(localContext, 48, MySqlParser.RULE_commonTableExpressions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1402; + localContext._cteName = this.uid(); + this.state = 1414; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 1403; + this.match(MySqlParser.LR_BRACKET); + this.state = 1404; + localContext._cteColumnName = this.uid(); + this.state = 1409; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1405; + this.match(MySqlParser.COMMA); + this.state = 1406; + localContext._cteColumnName = this.uid(); + } + } + this.state = 1411; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1412; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 1416; + this.match(MySqlParser.KW_AS); + this.state = 1417; + this.match(MySqlParser.LR_BRACKET); + this.state = 1418; + this.dmlStatement(); + this.state = 1419; + this.match(MySqlParser.RR_BRACKET); + this.state = 1422; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 96, this.context)) { + case 1: + { + this.state = 1420; + this.match(MySqlParser.COMMA); + this.state = 1421; + this.commonTableExpressions(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createView() { + let localContext = new CreateViewContext(this.context, this.state); + this.enterRule(localContext, 50, MySqlParser.RULE_createView); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1424; + this.match(MySqlParser.KW_CREATE); + this.state = 1426; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 124) { + { + this.state = 1425; + this.orReplace(); + } + } + this.state = 1431; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 1428; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 1429; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 1430; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 486 || _la === 661 || _la === 670)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1434; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1433; + this.ownerStatement(); + } + } + this.state = 1439; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 162) { + { + this.state = 1436; + this.match(MySqlParser.KW_SQL); + this.state = 1437; + this.match(MySqlParser.KW_SECURITY); + this.state = 1438; + localContext._secContext = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 364 || _la === 436)) { + localContext._secContext = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1441; + this.match(MySqlParser.KW_VIEW); + this.state = 1442; + this.viewNameCreate(); + this.state = 1454; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 1443; + this.match(MySqlParser.LR_BRACKET); + this.state = 1444; + this.columnNameCreate(); + this.state = 1449; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1445; + this.match(MySqlParser.COMMA); + this.state = 1446; + this.columnNameCreate(); + } + } + this.state = 1451; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1452; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 1456; + this.match(MySqlParser.KW_AS); + this.state = 1476; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 107, this.context)) { + case 1: + { + this.state = 1457; + this.match(MySqlParser.LR_BRACKET); + this.state = 1459; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 1458; + this.withClause(); + } + } + this.state = 1461; + this.selectStatement(); + this.state = 1462; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 1465; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 1464; + this.withClause(); + } + } + this.state = 1467; + this.selectStatement(); + this.state = 1474; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 106, this.context)) { + case 1: + { + this.state = 1468; + this.match(MySqlParser.KW_WITH); + this.state = 1470; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 325 || _la === 450) { + { + this.state = 1469; + localContext._checkOption = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 325 || _la === 450)) { + localContext._checkOption = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1472; + this.match(MySqlParser.KW_CHECK); + this.state = 1473; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDatabaseOption() { + let localContext = new CreateDatabaseOptionContext(this.context, this.state); + this.enterRule(localContext, 52, MySqlParser.RULE_createDatabaseOption); + let _la; + try { + this.state = 1511; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 116, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1479; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1478; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1481; + this.charSet(); + this.state = 1483; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1482; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1487; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 1485; + this.charsetName(); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 1486; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1490; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1489; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1492; + this.match(MySqlParser.KW_COLLATE); + this.state = 1494; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1493; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1496; + this.collationName(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1498; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1497; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1500; + this.match(MySqlParser.KW_ENCRYPTION); + this.state = 1502; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1501; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1504; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1505; + this.match(MySqlParser.KW_READ); + this.state = 1506; + this.match(MySqlParser.KW_ONLY); + this.state = 1508; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1507; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1510; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + charSet() { + let localContext = new CharSetContext(this.context, this.state); + this.enterRule(localContext, 54, MySqlParser.RULE_charSet); + try { + this.state = 1518; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CHARACTER: + this.enterOuterAlt(localContext, 1); + { + this.state = 1513; + this.match(MySqlParser.KW_CHARACTER); + this.state = 1514; + this.match(MySqlParser.KW_SET); + } + break; + case MySqlParser.KW_CHARSET: + this.enterOuterAlt(localContext, 2); + { + this.state = 1515; + this.match(MySqlParser.KW_CHARSET); + } + break; + case MySqlParser.KW_CHAR: + this.enterOuterAlt(localContext, 3); + { + this.state = 1516; + this.match(MySqlParser.KW_CHAR); + this.state = 1517; + this.match(MySqlParser.KW_SET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + currentUserExpression() { + let localContext = new CurrentUserExpressionContext(this.context, this.state); + this.enterRule(localContext, 56, MySqlParser.RULE_currentUserExpression); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1520; + _la = this.tokenStream.LA(1); + if (!(_la === 37 || _la === 678)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1523; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 118, this.context)) { + case 1: + { + this.state = 1521; + this.match(MySqlParser.LR_BRACKET); + this.state = 1522; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ownerStatement() { + let localContext = new OwnerStatementContext(this.context, this.state); + this.enterRule(localContext, 58, MySqlParser.RULE_ownerStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1525; + this.match(MySqlParser.KW_DEFINER); + this.state = 1526; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 1529; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 119, this.context)) { + case 1: + { + this.state = 1527; + this.userName(); + } + break; + case 2: + { + this.state = 1528; + this.currentUserExpression(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + scheduleExpression() { + let localContext = new ScheduleExpressionContext(this.context, this.state); + this.enterRule(localContext, 60, MySqlParser.RULE_scheduleExpression); + let _la; + try { + this.state = 1565; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AT: + localContext = new PreciseScheduleContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1531; + this.match(MySqlParser.KW_AT); + this.state = 1532; + this.timestampValue(); + this.state = 1536; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 853) { + { + { + this.state = 1533; + this.intervalExpr(); + } + } + this.state = 1538; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case MySqlParser.KW_EVERY: + localContext = new IntervalScheduleContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1539; + this.match(MySqlParser.KW_EVERY); + this.state = 1542; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 121, this.context)) { + case 1: + { + this.state = 1540; + this.decimalLiteral(); + } + break; + case 2: + { + this.state = 1541; + this.expression(0); + } + break; + } + this.state = 1544; + this.intervalType(); + this.state = 1553; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 641) { + { + this.state = 1545; + this.match(MySqlParser.KW_STARTS); + this.state = 1546; + localContext._startTimestamp = this.timestampValue(); + this.state = 1550; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 853) { + { + { + this.state = 1547; + localContext._intervalExpr = this.intervalExpr(); + localContext._startIntervals.push(localContext._intervalExpr); + } + } + this.state = 1552; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 1563; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 379) { + { + this.state = 1555; + this.match(MySqlParser.KW_ENDS); + this.state = 1556; + localContext._endTimestamp = this.timestampValue(); + this.state = 1560; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 853) { + { + { + this.state = 1557; + localContext._intervalExpr = this.intervalExpr(); + localContext._endIntervals.push(localContext._intervalExpr); + } + } + this.state = 1562; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + timestampValue() { + let localContext = new TimestampValueContext(this.context, this.state); + this.enterRule(localContext, 62, MySqlParser.RULE_timestampValue); + try { + this.state = 1571; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 127, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1567; + this.match(MySqlParser.KW_CURRENT_TIMESTAMP); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1568; + this.stringLiteral(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1569; + this.decimalLiteral(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1570; + this.expression(0); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intervalExpr() { + let localContext = new IntervalExprContext(this.context, this.state); + this.enterRule(localContext, 64, MySqlParser.RULE_intervalExpr); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1573; + this.match(MySqlParser.PLUS); + this.state = 1574; + this.match(MySqlParser.KW_INTERVAL); + this.state = 1577; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 128, this.context)) { + case 1: + { + this.state = 1575; + this.decimalLiteral(); + } + break; + case 2: + { + this.state = 1576; + this.expression(0); + } + break; + } + this.state = 1579; + this.intervalType(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intervalType() { + let localContext = new IntervalTypeContext(this.context, this.state); + this.enterRule(localContext, 66, MySqlParser.RULE_intervalType); + try { + this.state = 1594; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + this.enterOuterAlt(localContext, 1); + { + this.state = 1581; + this.intervalTypeBase(); + } + break; + case MySqlParser.KW_YEAR: + this.enterOuterAlt(localContext, 2); + { + this.state = 1582; + this.match(MySqlParser.KW_YEAR); + } + break; + case MySqlParser.KW_YEAR_MONTH: + this.enterOuterAlt(localContext, 3); + { + this.state = 1583; + this.match(MySqlParser.KW_YEAR_MONTH); + } + break; + case MySqlParser.KW_DAY_HOUR: + this.enterOuterAlt(localContext, 4); + { + this.state = 1584; + this.match(MySqlParser.KW_DAY_HOUR); + } + break; + case MySqlParser.KW_DAY_MINUTE: + this.enterOuterAlt(localContext, 5); + { + this.state = 1585; + this.match(MySqlParser.KW_DAY_MINUTE); + } + break; + case MySqlParser.KW_DAY_SECOND: + this.enterOuterAlt(localContext, 6); + { + this.state = 1586; + this.match(MySqlParser.KW_DAY_SECOND); + } + break; + case MySqlParser.KW_HOUR_MINUTE: + this.enterOuterAlt(localContext, 7); + { + this.state = 1587; + this.match(MySqlParser.KW_HOUR_MINUTE); + } + break; + case MySqlParser.KW_HOUR_SECOND: + this.enterOuterAlt(localContext, 8); + { + this.state = 1588; + this.match(MySqlParser.KW_HOUR_SECOND); + } + break; + case MySqlParser.KW_MINUTE_SECOND: + this.enterOuterAlt(localContext, 9); + { + this.state = 1589; + this.match(MySqlParser.KW_MINUTE_SECOND); + } + break; + case MySqlParser.KW_SECOND_MICROSECOND: + this.enterOuterAlt(localContext, 10); + { + this.state = 1590; + this.match(MySqlParser.KW_SECOND_MICROSECOND); + } + break; + case MySqlParser.KW_MINUTE_MICROSECOND: + this.enterOuterAlt(localContext, 11); + { + this.state = 1591; + this.match(MySqlParser.KW_MINUTE_MICROSECOND); + } + break; + case MySqlParser.KW_HOUR_MICROSECOND: + this.enterOuterAlt(localContext, 12); + { + this.state = 1592; + this.match(MySqlParser.KW_HOUR_MICROSECOND); + } + break; + case MySqlParser.KW_DAY_MICROSECOND: + this.enterOuterAlt(localContext, 13); + { + this.state = 1593; + this.match(MySqlParser.KW_DAY_MICROSECOND); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + enableType() { + let localContext = new EnableTypeContext(this.context, this.state); + this.enterRule(localContext, 68, MySqlParser.RULE_enableType); + try { + this.state = 1601; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 130, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1596; + this.match(MySqlParser.KW_ENABLE); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1597; + this.match(MySqlParser.KW_DISABLE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1598; + this.match(MySqlParser.KW_DISABLE); + this.state = 1599; + this.match(MySqlParser.KW_ON); + this.state = 1600; + this.match(MySqlParser.KW_SLAVE); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexType() { + let localContext = new IndexTypeContext(this.context, this.state); + this.enterRule(localContext, 70, MySqlParser.RULE_indexType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1603; + this.match(MySqlParser.KW_USING); + this.state = 1604; + _la = this.tokenStream.LA(1); + if (!(_la === 323 || _la === 418)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexOption() { + let localContext = new IndexOptionContext(this.context, this.state); + this.enterRule(localContext, 72, MySqlParser.RULE_indexOption); + let _la; + try { + this.state = 1628; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_KEY_BLOCK_SIZE: + this.enterOuterAlt(localContext, 1); + { + this.state = 1606; + this.match(MySqlParser.KW_KEY_BLOCK_SIZE); + this.state = 1608; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1607; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1610; + this.fileSizeLiteral(); + } + break; + case MySqlParser.KW_USING: + this.enterOuterAlt(localContext, 2); + { + this.state = 1611; + this.indexType(); + } + break; + case MySqlParser.KW_WITH: + this.enterOuterAlt(localContext, 3); + { + this.state = 1612; + this.match(MySqlParser.KW_WITH); + this.state = 1613; + this.match(MySqlParser.KW_PARSER); + this.state = 1614; + localContext._parserName = this.uid(); + } + break; + case MySqlParser.KW_COMMENT: + this.enterOuterAlt(localContext, 4); + { + this.state = 1615; + this.match(MySqlParser.KW_COMMENT); + this.state = 1616; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_VISIBLE: + this.enterOuterAlt(localContext, 5); + { + this.state = 1617; + _la = this.tokenStream.LA(1); + if (!(_la === 435 || _la === 686)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ENGINE_ATTRIBUTE: + this.enterOuterAlt(localContext, 6); + { + this.state = 1618; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 1620; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1619; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1622; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + this.enterOuterAlt(localContext, 7); + { + this.state = 1623; + this.match(MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE); + this.state = 1625; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1624; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1627; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + procedureParameter() { + let localContext = new ProcedureParameterContext(this.context, this.state); + this.enterRule(localContext, 74, MySqlParser.RULE_procedureParameter); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1631; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 80 || _la === 85 || _la === 126) { + { + this.state = 1630; + localContext._direction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 80 || _la === 85 || _la === 126)) { + localContext._direction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1633; + localContext._paramName = this.uid(); + this.state = 1634; + this.dataType(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + routineOption() { + let localContext = new RoutineOptionContext(this.context, this.state); + this.enterRule(localContext, 76, MySqlParser.RULE_routineOption); + let _la; + try { + this.state = 1659; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_COMMENT: + localContext = new RoutineCommentContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1636; + this.match(MySqlParser.KW_COMMENT); + this.state = 1637; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_LANGUAGE: + localContext = new RoutineLanguageContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1638; + this.match(MySqlParser.KW_LANGUAGE); + this.state = 1639; + this.match(MySqlParser.KW_SQL); + } + break; + case MySqlParser.KW_DETERMINISTIC: + case MySqlParser.KW_NOT: + localContext = new RoutineBehaviorContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1641; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 1640; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 1643; + this.match(MySqlParser.KW_DETERMINISTIC); + } + break; + case MySqlParser.KW_MODIFIES: + case MySqlParser.KW_READS: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_NO: + localContext = new RoutineDataContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 1654; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CONTAINS: + { + this.state = 1644; + this.match(MySqlParser.KW_CONTAINS); + this.state = 1645; + this.match(MySqlParser.KW_SQL); + } + break; + case MySqlParser.KW_NO: + { + this.state = 1646; + this.match(MySqlParser.KW_NO); + this.state = 1647; + this.match(MySqlParser.KW_SQL); + } + break; + case MySqlParser.KW_READS: + { + this.state = 1648; + this.match(MySqlParser.KW_READS); + this.state = 1649; + this.match(MySqlParser.KW_SQL); + this.state = 1650; + this.match(MySqlParser.KW_DATA); + } + break; + case MySqlParser.KW_MODIFIES: + { + this.state = 1651; + this.match(MySqlParser.KW_MODIFIES); + this.state = 1652; + this.match(MySqlParser.KW_SQL); + this.state = 1653; + this.match(MySqlParser.KW_DATA); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_SQL: + localContext = new RoutineSecurityContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 1656; + this.match(MySqlParser.KW_SQL); + this.state = 1657; + this.match(MySqlParser.KW_SECURITY); + this.state = 1658; + localContext._context = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 364 || _la === 436)) { + localContext._context = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + serverOption() { + let localContext = new ServerOptionContext(this.context, this.state); + this.enterRule(localContext, 78, MySqlParser.RULE_serverOption); + try { + this.state = 1675; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_HOST: + this.enterOuterAlt(localContext, 1); + { + this.state = 1661; + this.match(MySqlParser.KW_HOST); + this.state = 1662; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_DATABASE: + this.enterOuterAlt(localContext, 2); + { + this.state = 1663; + this.match(MySqlParser.KW_DATABASE); + this.state = 1664; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_USER: + this.enterOuterAlt(localContext, 3); + { + this.state = 1665; + this.match(MySqlParser.KW_USER); + this.state = 1666; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PASSWORD: + this.enterOuterAlt(localContext, 4); + { + this.state = 1667; + this.match(MySqlParser.KW_PASSWORD); + this.state = 1668; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_SOCKET: + this.enterOuterAlt(localContext, 5); + { + this.state = 1669; + this.match(MySqlParser.KW_SOCKET); + this.state = 1670; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_OWNER: + this.enterOuterAlt(localContext, 6); + { + this.state = 1671; + this.match(MySqlParser.KW_OWNER); + this.state = 1672; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PORT: + this.enterOuterAlt(localContext, 7); + { + this.state = 1673; + this.match(MySqlParser.KW_PORT); + this.state = 1674; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDefinitions() { + let localContext = new CreateDefinitionsContext(this.context, this.state); + this.enterRule(localContext, 80, MySqlParser.RULE_createDefinitions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1677; + this.match(MySqlParser.LR_BRACKET); + this.state = 1678; + this.createDefinition(); + this.state = 1683; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1679; + this.match(MySqlParser.COMMA); + this.state = 1680; + this.createDefinition(); + } + } + this.state = 1685; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1686; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDefinition() { + let localContext = new CreateDefinitionContext(this.context, this.state); + this.enterRule(localContext, 82, MySqlParser.RULE_createDefinition); + let _la; + try { + this.state = 1771; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 157, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1688; + this.columnNameCreate(); + this.state = 1689; + this.columnDefinition(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1691; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1693; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1692; + this.indexName(); + } + } + this.state = 1696; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1695; + this.indexType(); + } + } + this.state = 1698; + this.indexColumnNames(); + this.state = 1702; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1699; + this.indexOption(); + } + } + this.state = 1704; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1705; + _la = this.tokenStream.LA(1); + if (!(_la === 69 || _la === 161)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1707; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 1706; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1710; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1709; + this.indexName(); + } + } + this.state = 1712; + this.indexColumnNames(); + this.state = 1716; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1713; + this.indexOption(); + } + } + this.state = 1718; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1720; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1719; + this.constraintSymbol(); + } + } + this.state = 1722; + this.match(MySqlParser.KW_PRIMARY); + this.state = 1723; + this.match(MySqlParser.KW_KEY); + this.state = 1725; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1724; + this.indexType(); + } + } + this.state = 1727; + this.indexColumnNames(); + this.state = 1731; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1728; + this.indexOption(); + } + } + this.state = 1733; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 1735; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1734; + this.constraintSymbol(); + } + } + this.state = 1737; + this.match(MySqlParser.KW_UNIQUE); + this.state = 1739; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 1738; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1742; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1741; + this.indexName(); + } + } + this.state = 1745; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1744; + this.indexType(); + } + } + this.state = 1747; + this.indexColumnNames(); + this.state = 1751; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1748; + this.indexOption(); + } + } + this.state = 1753; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 1755; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1754; + this.constraintSymbol(); + } + } + this.state = 1757; + this.match(MySqlParser.KW_FOREIGN); + this.state = 1758; + this.match(MySqlParser.KW_KEY); + this.state = 1760; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1759; + this.indexName(); + } + } + this.state = 1762; + this.indexColumnNames(); + this.state = 1763; + this.referenceDefinition(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 1765; + this.match(MySqlParser.KW_CHECK); + this.state = 1766; + this.match(MySqlParser.LR_BRACKET); + this.state = 1767; + this.expression(0); + this.state = 1768; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 1770; + this.checkConstraintDefinition(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checkConstraintDefinition() { + let localContext = new CheckConstraintDefinitionContext(this.context, this.state); + this.enterRule(localContext, 84, MySqlParser.RULE_checkConstraintDefinition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1774; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1773; + this.constraintSymbol(); + } + } + this.state = 1776; + this.match(MySqlParser.KW_CHECK); + this.state = 1777; + this.match(MySqlParser.LR_BRACKET); + this.state = 1778; + this.expression(0); + this.state = 1779; + this.match(MySqlParser.RR_BRACKET); + this.state = 1784; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 160, this.context)) { + case 1: + { + this.state = 1781; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 1780; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 1783; + this.match(MySqlParser.KW_ENFORCED); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + constraintSymbol() { + let localContext = new ConstraintSymbolContext(this.context, this.state); + this.enterRule(localContext, 86, MySqlParser.RULE_constraintSymbol); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1786; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 1788; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 161, this.context)) { + case 1: + { + this.state = 1787; + localContext._symbol_ = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnDefinition() { + let localContext = new ColumnDefinitionContext(this.context, this.state); + this.enterRule(localContext, 88, MySqlParser.RULE_columnDefinition); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 1790; + this.dataType(); + this.state = 1794; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 162, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1791; + this.columnConstraint(); + } + } + } + this.state = 1796; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 162, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnConstraint() { + let localContext = new ColumnConstraintContext(this.context, this.state); + this.enterRule(localContext, 90, MySqlParser.RULE_columnConstraint); + let _la; + try { + this.state = 1840; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NOT: + case MySqlParser.KW_NULL_LITERAL: + case MySqlParser.NULL_SPEC_LITERAL: + localContext = new NullColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1797; + this.nullNotnull(); + } + break; + case MySqlParser.KW_DEFAULT: + localContext = new DefaultColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1798; + this.match(MySqlParser.KW_DEFAULT); + this.state = 1799; + this.defaultValue(); + } + break; + case MySqlParser.KW_VISIBLE: + localContext = new VisibilityColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1800; + this.match(MySqlParser.KW_VISIBLE); + } + break; + case MySqlParser.KW_INVISIBLE: + localContext = new InvisibilityColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 1801; + this.match(MySqlParser.KW_INVISIBLE); + } + break; + case MySqlParser.KW_ON: + case MySqlParser.KW_AUTO_INCREMENT: + localContext = new AutoIncrementColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 1806; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AUTO_INCREMENT: + { + this.state = 1802; + this.match(MySqlParser.KW_AUTO_INCREMENT); + } + break; + case MySqlParser.KW_ON: + { + this.state = 1803; + this.match(MySqlParser.KW_ON); + this.state = 1804; + this.match(MySqlParser.KW_UPDATE); + this.state = 1805; + this.currentTimestamp(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_KEY: + case MySqlParser.KW_PRIMARY: + localContext = new PrimaryKeyColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 1809; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 131) { + { + this.state = 1808; + this.match(MySqlParser.KW_PRIMARY); + } + } + this.state = 1811; + this.match(MySqlParser.KW_KEY); + } + break; + case MySqlParser.KW_UNIQUE: + localContext = new UniqueKeyColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 1812; + this.match(MySqlParser.KW_UNIQUE); + this.state = 1814; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 165, this.context)) { + case 1: + { + this.state = 1813; + this.match(MySqlParser.KW_KEY); + } + break; + } + } + break; + case MySqlParser.KW_COMMENT: + localContext = new CommentColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 1816; + this.match(MySqlParser.KW_COMMENT); + this.state = 1817; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_COLUMN_FORMAT: + localContext = new FormatColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 1818; + this.match(MySqlParser.KW_COLUMN_FORMAT); + this.state = 1819; + localContext._colformat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 374 || _la === 403)) { + localContext._colformat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_STORAGE: + localContext = new StorageColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 1820; + this.match(MySqlParser.KW_STORAGE); + this.state = 1821; + localContext._storageval = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 370 || _la === 802)) { + localContext._storageval = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_REFERENCES: + localContext = new ReferenceColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 1822; + this.referenceDefinition(); + } + break; + case MySqlParser.KW_COLLATE: + localContext = new CollateColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 1823; + this.match(MySqlParser.KW_COLLATE); + this.state = 1824; + this.collationName(); + } + break; + case MySqlParser.KW_AS: + case MySqlParser.KW_GENERATED: + localContext = new GeneratedColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 1827; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 71) { + { + this.state = 1825; + this.match(MySqlParser.KW_GENERATED); + this.state = 1826; + this.match(MySqlParser.KW_ALWAYS); + } + } + this.state = 1829; + this.match(MySqlParser.KW_AS); + this.state = 1830; + this.match(MySqlParser.LR_BRACKET); + this.state = 1831; + this.expression(0); + this.state = 1832; + this.match(MySqlParser.RR_BRACKET); + this.state = 1834; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 648 || _la === 685) { + { + this.state = 1833; + _la = this.tokenStream.LA(1); + if (!(_la === 648 || _la === 685)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + break; + case MySqlParser.KW_SERIAL: + localContext = new SerialDefaultColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 1836; + this.match(MySqlParser.KW_SERIAL); + this.state = 1837; + this.match(MySqlParser.KW_DEFAULT); + this.state = 1838; + this.match(MySqlParser.KW_VALUE); + } + break; + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CONSTRAINT: + localContext = new CheckExprContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 1839; + this.checkConstraintDefinition(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + referenceDefinition() { + let localContext = new ReferenceDefinitionContext(this.context, this.state); + this.enterRule(localContext, 92, MySqlParser.RULE_referenceDefinition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1842; + this.match(MySqlParser.KW_REFERENCES); + this.state = 1843; + this.tableName(); + this.state = 1845; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 169, this.context)) { + case 1: + { + this.state = 1844; + this.indexColumnNames(); + } + break; + } + this.state = 1849; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 110) { + { + this.state = 1847; + this.match(MySqlParser.KW_MATCH); + this.state = 1848; + localContext._matchType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 408 || _la === 526 || _la === 597)) { + localContext._matchType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1852; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 171, this.context)) { + case 1: + { + this.state = 1851; + this.referenceAction(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + referenceAction() { + let localContext = new ReferenceActionContext(this.context, this.state); + this.enterRule(localContext, 94, MySqlParser.RULE_referenceAction); + try { + this.state = 1870; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 174, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1854; + this.match(MySqlParser.KW_ON); + this.state = 1855; + this.match(MySqlParser.KW_DELETE); + this.state = 1856; + localContext._onDelete = this.referenceControlType(); + this.state = 1860; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 172, this.context)) { + case 1: + { + this.state = 1857; + this.match(MySqlParser.KW_ON); + this.state = 1858; + this.match(MySqlParser.KW_UPDATE); + this.state = 1859; + localContext._onUpdate = this.referenceControlType(); + } + break; + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1862; + this.match(MySqlParser.KW_ON); + this.state = 1863; + this.match(MySqlParser.KW_UPDATE); + this.state = 1864; + localContext._onUpdate = this.referenceControlType(); + this.state = 1868; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 173, this.context)) { + case 1: + { + this.state = 1865; + this.match(MySqlParser.KW_ON); + this.state = 1866; + this.match(MySqlParser.KW_DELETE); + this.state = 1867; + localContext._onDelete = this.referenceControlType(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + referenceControlType() { + let localContext = new ReferenceControlTypeContext(this.context, this.state); + this.enterRule(localContext, 96, MySqlParser.RULE_referenceControlType); + try { + this.state = 1880; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 175, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1872; + this.match(MySqlParser.KW_RESTRICT); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1873; + this.match(MySqlParser.KW_CASCADE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1874; + this.match(MySqlParser.KW_SET); + this.state = 1875; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1876; + this.match(MySqlParser.KW_NO); + this.state = 1877; + this.match(MySqlParser.KW_ACTION); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 1878; + this.match(MySqlParser.KW_SET); + this.state = 1879; + this.match(MySqlParser.KW_DEFAULT); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableOption() { + let localContext = new TableOptionContext(this.context, this.state); + this.enterRule(localContext, 98, MySqlParser.RULE_tableOption); + let _la; + try { + this.state = 2067; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 213, this.context)) { + case 1: + localContext = new TableOptionEngineContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1882; + this.match(MySqlParser.KW_ENGINE); + this.state = 1884; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1883; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1887; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 177, this.context)) { + case 1: + { + this.state = 1886; + this.engineName(); + } + break; + } + } + break; + case 2: + localContext = new TableOptionEngineAttributeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1889; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 1891; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1890; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1893; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 3: + localContext = new TableOptionAutoextendSizeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1894; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 1896; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1895; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1898; + this.decimalLiteral(); + } + break; + case 4: + localContext = new TableOptionAutoIncrementContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 1899; + this.match(MySqlParser.KW_AUTO_INCREMENT); + this.state = 1901; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1900; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1903; + this.decimalLiteral(); + } + break; + case 5: + localContext = new TableOptionAverageContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 1904; + this.match(MySqlParser.KW_AVG_ROW_LENGTH); + this.state = 1906; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1905; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1908; + this.decimalLiteral(); + } + break; + case 6: + localContext = new TableOptionCharsetContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 1910; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1909; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1912; + this.charSet(); + this.state = 1914; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1913; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1918; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 1916; + this.charsetName(); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 1917; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 7: + localContext = new TableOptionChecksumContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 1920; + _la = this.tokenStream.LA(1); + if (!(_la === 329 || _la === 522)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1922; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1921; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1924; + localContext._boolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 8: + localContext = new TableOptionCollateContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 1926; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1925; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1928; + this.match(MySqlParser.KW_COLLATE); + this.state = 1930; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1929; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1932; + this.collationName(); + } + break; + case 9: + localContext = new TableOptionCommentContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 1933; + this.match(MySqlParser.KW_COMMENT); + this.state = 1935; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1934; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1937; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 10: + localContext = new TableOptionCompressionContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 1938; + this.match(MySqlParser.KW_COMPRESSION); + this.state = 1940; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1939; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1942; + _la = this.tokenStream.LA(1); + if (!(_la === 882 || _la === 889)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 11: + localContext = new TableOptionConnectionContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 1943; + this.match(MySqlParser.KW_CONNECTION); + this.state = 1945; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1944; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1947; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 12: + localContext = new TableOptionDataDirectoryContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 1948; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 360)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1949; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 1951; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1950; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1953; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 13: + localContext = new TableOptionDelayContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 1954; + this.match(MySqlParser.KW_DELAY_KEY_WRITE); + this.state = 1956; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1955; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1958; + localContext._boolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 14: + localContext = new TableOptionEncryptionContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 1959; + this.match(MySqlParser.KW_ENCRYPTION); + this.state = 1961; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1960; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1963; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 15: + localContext = new TableOptionPageCompressedContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 1964; + _la = this.tokenStream.LA(1); + if (!(_la === 523 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1966; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1965; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1968; + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 16: + localContext = new TableOptionPageCompressionLevelContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 1969; + _la = this.tokenStream.LA(1); + if (!(_la === 524 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1971; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1970; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1973; + this.decimalLiteral(); + } + break; + case 17: + localContext = new TableOptionEncryptionKeyIdContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 1974; + this.match(MySqlParser.KW_ENCRYPTION_KEY_ID); + this.state = 1976; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1975; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1978; + this.decimalLiteral(); + } + break; + case 18: + localContext = new TableOptionIndexDirectoryContext(localContext); + this.enterOuterAlt(localContext, 18); + { + this.state = 1979; + this.match(MySqlParser.KW_INDEX); + this.state = 1980; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 1982; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1981; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1984; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 19: + localContext = new TableOptionInsertMethodContext(localContext); + this.enterOuterAlt(localContext, 19); + { + this.state = 1985; + this.match(MySqlParser.KW_INSERT_METHOD); + this.state = 1987; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1986; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1989; + localContext._insertMethod = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 402 || _la === 445 || _la === 502)) { + localContext._insertMethod = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 20: + localContext = new TableOptionKeyBlockSizeContext(localContext); + this.enterOuterAlt(localContext, 20); + { + this.state = 1990; + this.match(MySqlParser.KW_KEY_BLOCK_SIZE); + this.state = 1992; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1991; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1994; + this.fileSizeLiteral(); + } + break; + case 21: + localContext = new TableOptionMaxRowsContext(localContext); + this.enterOuterAlt(localContext, 21); + { + this.state = 1995; + this.match(MySqlParser.KW_MAX_ROWS); + this.state = 1997; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1996; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1999; + this.decimalLiteral(); + } + break; + case 22: + localContext = new TableOptionMinRowsContext(localContext); + this.enterOuterAlt(localContext, 22); + { + this.state = 2000; + this.match(MySqlParser.KW_MIN_ROWS); + this.state = 2002; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2001; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2004; + this.decimalLiteral(); + } + break; + case 23: + localContext = new TableOptionPackKeysContext(localContext); + this.enterOuterAlt(localContext, 23); + { + this.state = 2005; + this.match(MySqlParser.KW_PACK_KEYS); + this.state = 2007; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2006; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2009; + localContext._extBoolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + localContext._extBoolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 24: + localContext = new TableOptionPasswordContext(localContext); + this.enterOuterAlt(localContext, 24); + { + this.state = 2010; + this.match(MySqlParser.KW_PASSWORD); + this.state = 2012; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2011; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2014; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 25: + localContext = new TableOptionRowFormatContext(localContext); + this.enterOuterAlt(localContext, 25); + { + this.state = 2015; + this.match(MySqlParser.KW_ROW_FORMAT); + this.state = 2017; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2016; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2019; + localContext._rowFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 342 || _la === 345 || _la === 374 || _la === 403 || _la === 554 || _la === 889)) { + localContext._rowFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 26: + localContext = new TableOptionStartTransactionContext(localContext); + this.enterOuterAlt(localContext, 26); + { + this.state = 2020; + this.match(MySqlParser.KW_START); + this.state = 2021; + this.match(MySqlParser.KW_TRANSACTION); + } + break; + case 27: + localContext = new TableOptionSecondaryEngineAttributeContext(localContext); + this.enterOuterAlt(localContext, 27); + { + this.state = 2022; + this.match(MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE); + this.state = 2024; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2023; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2026; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 28: + localContext = new TableOptionRecalculationContext(localContext); + this.enterOuterAlt(localContext, 28); + { + this.state = 2027; + this.match(MySqlParser.KW_STATS_AUTO_RECALC); + this.state = 2029; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2028; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2031; + localContext._extBoolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + localContext._extBoolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 29: + localContext = new TableOptionPersistentContext(localContext); + this.enterOuterAlt(localContext, 29); + { + this.state = 2032; + this.match(MySqlParser.KW_STATS_PERSISTENT); + this.state = 2034; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2033; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2036; + localContext._extBoolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + localContext._extBoolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 30: + localContext = new TableOptionSamplePageContext(localContext); + this.enterOuterAlt(localContext, 30); + { + this.state = 2037; + this.match(MySqlParser.KW_STATS_SAMPLE_PAGES); + this.state = 2039; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2038; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2043; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 2041; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 2042; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 31: + localContext = new TableOptionTablespaceContext(localContext); + this.enterOuterAlt(localContext, 31); + { + this.state = 2045; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 2046; + this.tablespaceName(); + this.state = 2048; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 210, this.context)) { + case 1: + { + this.state = 2047; + this.tablespaceStorage(); + } + break; + } + } + break; + case 32: + localContext = new TableOptionTableTypeContext(localContext); + this.enterOuterAlt(localContext, 32); + { + this.state = 2050; + this.match(MySqlParser.KW_TABLE_TYPE); + this.state = 2051; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2052; + this.tableType(); + } + break; + case 33: + localContext = new TableOptionTablespaceContext(localContext); + this.enterOuterAlt(localContext, 33); + { + this.state = 2053; + this.tablespaceStorage(); + } + break; + case 34: + localContext = new TableOptionTransactionalContext(localContext); + this.enterOuterAlt(localContext, 34); + { + this.state = 2054; + this.match(MySqlParser.KW_TRANSACTIONAL); + this.state = 2056; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2055; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2058; + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 35: + localContext = new TableOptionUnionContext(localContext); + this.enterOuterAlt(localContext, 35); + { + this.state = 2059; + this.match(MySqlParser.KW_UNION); + this.state = 2061; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2060; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2063; + this.match(MySqlParser.LR_BRACKET); + this.state = 2064; + this.tableNames(); + this.state = 2065; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableType() { + let localContext = new TableTypeContext(this.context, this.state); + this.enterRule(localContext, 100, MySqlParser.RULE_tableType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2069; + _la = this.tokenStream.LA(1); + if (!(_la === 494 || _la === 506)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablespaceStorage() { + let localContext = new TablespaceStorageContext(this.context, this.state); + this.enterRule(localContext, 102, MySqlParser.RULE_tablespaceStorage); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2071; + this.match(MySqlParser.KW_STORAGE); + this.state = 2072; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 370 || _la === 802)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinitions() { + let localContext = new PartitionDefinitionsContext(this.context, this.state); + this.enterRule(localContext, 104, MySqlParser.RULE_partitionDefinitions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2074; + this.match(MySqlParser.KW_PARTITION); + this.state = 2075; + this.match(MySqlParser.KW_BY); + this.state = 2076; + this.partitionFunctionDefinition(); + this.state = 2079; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 528) { + { + this.state = 2077; + this.match(MySqlParser.KW_PARTITIONS); + this.state = 2078; + localContext._count = this.decimalLiteral(); + } + } + this.state = 2088; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 652) { + { + this.state = 2081; + this.match(MySqlParser.KW_SUBPARTITION); + this.state = 2082; + this.match(MySqlParser.KW_BY); + this.state = 2083; + this.subpartitionFunctionDefinition(); + this.state = 2086; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 653) { + { + this.state = 2084; + this.match(MySqlParser.KW_SUBPARTITIONS); + this.state = 2085; + localContext._subCount = this.decimalLiteral(); + } + } + } + } + this.state = 2101; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 218, this.context)) { + case 1: + { + this.state = 2090; + this.match(MySqlParser.LR_BRACKET); + this.state = 2091; + this.partitionDefinition(); + this.state = 2096; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2092; + this.match(MySqlParser.COMMA); + this.state = 2093; + this.partitionDefinition(); + } + } + this.state = 2098; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2099; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionFunctionDefinition() { + let localContext = new PartitionFunctionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 106, MySqlParser.RULE_partitionFunctionDefinition); + let _la; + try { + this.state = 2149; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 225, this.context)) { + case 1: + localContext = new PartitionFunctionHashContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2104; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2103; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2106; + this.match(MySqlParser.KW_HASH); + this.state = 2107; + this.match(MySqlParser.LR_BRACKET); + this.state = 2108; + this.expression(0); + this.state = 2109; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + localContext = new PartitionFunctionKeyContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2112; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2111; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2114; + this.match(MySqlParser.KW_KEY); + this.state = 2118; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 2115; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2116; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2117; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 872 || _la === 873)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2120; + this.match(MySqlParser.LR_BRACKET); + this.state = 2122; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 222, this.context)) { + case 1: + { + this.state = 2121; + this.columnNames(); + } + break; + } + this.state = 2124; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 3: + localContext = new PartitionFunctionRangeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2125; + this.match(MySqlParser.KW_RANGE); + this.state = 2135; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LR_BRACKET: + { + this.state = 2126; + this.match(MySqlParser.LR_BRACKET); + this.state = 2127; + this.expression(0); + this.state = 2128; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_COLUMNS: + { + this.state = 2130; + this.match(MySqlParser.KW_COLUMNS); + this.state = 2131; + this.match(MySqlParser.LR_BRACKET); + this.state = 2132; + this.columnNames(); + this.state = 2133; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 4: + localContext = new PartitionFunctionListContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2137; + this.match(MySqlParser.KW_LIST); + this.state = 2147; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LR_BRACKET: + { + this.state = 2138; + this.match(MySqlParser.LR_BRACKET); + this.state = 2139; + this.expression(0); + this.state = 2140; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_COLUMNS: + { + this.state = 2142; + this.match(MySqlParser.KW_COLUMNS); + this.state = 2143; + this.match(MySqlParser.LR_BRACKET); + this.state = 2144; + this.columnNames(); + this.state = 2145; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + subpartitionFunctionDefinition() { + let localContext = new SubpartitionFunctionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 108, MySqlParser.RULE_subpartitionFunctionDefinition); + let _la; + try { + this.state = 2172; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 229, this.context)) { + case 1: + localContext = new SubPartitionFunctionHashContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2152; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2151; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2154; + this.match(MySqlParser.KW_HASH); + this.state = 2155; + this.match(MySqlParser.LR_BRACKET); + this.state = 2156; + this.expression(0); + this.state = 2157; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + localContext = new SubPartitionFunctionKeyContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2160; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2159; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2162; + this.match(MySqlParser.KW_KEY); + this.state = 2166; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 2163; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2164; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2165; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 872 || _la === 873)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2168; + this.match(MySqlParser.LR_BRACKET); + this.state = 2169; + this.columnNames(); + this.state = 2170; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinition() { + let localContext = new PartitionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 110, MySqlParser.RULE_partitionDefinition); + let _la; + try { + this.state = 2320; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 248, this.context)) { + case 1: + localContext = new PartitionComparisonContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2174; + this.match(MySqlParser.KW_PARTITION); + this.state = 2175; + this.partitionName(); + this.state = 2176; + this.match(MySqlParser.KW_VALUES); + this.state = 2177; + this.match(MySqlParser.KW_LESS); + this.state = 2178; + this.match(MySqlParser.KW_THAN); + this.state = 2179; + this.match(MySqlParser.LR_BRACKET); + this.state = 2180; + this.partitionDefinerAtom(); + this.state = 2185; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2181; + this.match(MySqlParser.COMMA); + this.state = 2182; + this.partitionDefinerAtom(); + } + } + this.state = 2187; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2188; + this.match(MySqlParser.RR_BRACKET); + this.state = 2192; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2189; + this.partitionOption(); + } + } + this.state = 2194; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2206; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2195; + this.match(MySqlParser.LR_BRACKET); + this.state = 2196; + this.subpartitionDefinition(); + this.state = 2201; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2197; + this.match(MySqlParser.COMMA); + this.state = 2198; + this.subpartitionDefinition(); + } + } + this.state = 2203; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2204; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 2: + localContext = new PartitionComparisonContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2208; + this.match(MySqlParser.KW_PARTITION); + this.state = 2209; + this.partitionName(); + this.state = 2210; + this.match(MySqlParser.KW_VALUES); + this.state = 2211; + this.match(MySqlParser.KW_LESS); + this.state = 2212; + this.match(MySqlParser.KW_THAN); + this.state = 2213; + this.partitionDefinerAtom(); + this.state = 2217; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2214; + this.partitionOption(); + } + } + this.state = 2219; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2231; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2220; + this.match(MySqlParser.LR_BRACKET); + this.state = 2221; + this.subpartitionDefinition(); + this.state = 2226; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2222; + this.match(MySqlParser.COMMA); + this.state = 2223; + this.subpartitionDefinition(); + } + } + this.state = 2228; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2229; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 3: + localContext = new PartitionListAtomContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2233; + this.match(MySqlParser.KW_PARTITION); + this.state = 2234; + this.partitionName(); + this.state = 2235; + this.match(MySqlParser.KW_VALUES); + this.state = 2236; + this.match(MySqlParser.KW_IN); + this.state = 2237; + this.match(MySqlParser.LR_BRACKET); + this.state = 2238; + this.partitionDefinerAtom(); + this.state = 2243; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2239; + this.match(MySqlParser.COMMA); + this.state = 2240; + this.partitionDefinerAtom(); + } + } + this.state = 2245; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2246; + this.match(MySqlParser.RR_BRACKET); + this.state = 2250; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2247; + this.partitionOption(); + } + } + this.state = 2252; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2264; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2253; + this.match(MySqlParser.LR_BRACKET); + this.state = 2254; + this.subpartitionDefinition(); + this.state = 2259; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2255; + this.match(MySqlParser.COMMA); + this.state = 2256; + this.subpartitionDefinition(); + } + } + this.state = 2261; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2262; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 4: + localContext = new PartitionListVectorContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2266; + this.match(MySqlParser.KW_PARTITION); + this.state = 2267; + this.partitionName(); + this.state = 2268; + this.match(MySqlParser.KW_VALUES); + this.state = 2269; + this.match(MySqlParser.KW_IN); + this.state = 2270; + this.match(MySqlParser.LR_BRACKET); + this.state = 2271; + this.partitionDefinerVector(); + this.state = 2276; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2272; + this.match(MySqlParser.COMMA); + this.state = 2273; + this.partitionDefinerVector(); + } + } + this.state = 2278; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2279; + this.match(MySqlParser.RR_BRACKET); + this.state = 2283; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2280; + this.partitionOption(); + } + } + this.state = 2285; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2286; + this.match(MySqlParser.LR_BRACKET); + this.state = 2287; + this.subpartitionDefinition(); + this.state = 2292; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2288; + this.match(MySqlParser.COMMA); + this.state = 2289; + this.subpartitionDefinition(); + } + } + this.state = 2294; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2295; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 5: + localContext = new PartitionSimpleContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2299; + this.match(MySqlParser.KW_PARTITION); + this.state = 2300; + this.partitionName(); + this.state = 2304; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2301; + this.partitionOption(); + } + } + this.state = 2306; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2318; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2307; + this.match(MySqlParser.LR_BRACKET); + this.state = 2308; + this.subpartitionDefinition(); + this.state = 2313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2309; + this.match(MySqlParser.COMMA); + this.state = 2310; + this.subpartitionDefinition(); + } + } + this.state = 2315; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2316; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinerAtom() { + let localContext = new PartitionDefinerAtomContext(this.context, this.state); + this.enterRule(localContext, 112, MySqlParser.RULE_partitionDefinerAtom); + try { + this.state = 2325; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 249, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 2322; + this.constant(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 2323; + this.expression(0); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 2324; + this.match(MySqlParser.KW_MAXVALUE); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinerVector() { + let localContext = new PartitionDefinerVectorContext(this.context, this.state); + this.enterRule(localContext, 114, MySqlParser.RULE_partitionDefinerVector); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2327; + this.match(MySqlParser.LR_BRACKET); + this.state = 2328; + this.partitionDefinerAtom(); + this.state = 2331; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 2329; + this.match(MySqlParser.COMMA); + this.state = 2330; + this.partitionDefinerAtom(); + } + } + this.state = 2333; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 868); + this.state = 2335; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + subpartitionDefinition() { + let localContext = new SubpartitionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 116, MySqlParser.RULE_subpartitionDefinition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2337; + this.match(MySqlParser.KW_SUBPARTITION); + this.state = 2338; + localContext._logicalName = this.uid(); + this.state = 2342; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2339; + this.partitionOption(); + } + } + this.state = 2344; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionOption() { + let localContext = new PartitionOptionContext(this.context, this.state); + this.enterRule(localContext, 118, MySqlParser.RULE_partitionOption); + let _la; + try { + this.state = 2393; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_STORAGE: + localContext = new PartitionOptionEngineContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2346; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 2345; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 2349; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 647) { + { + this.state = 2348; + this.match(MySqlParser.KW_STORAGE); + } + } + this.state = 2351; + this.match(MySqlParser.KW_ENGINE); + this.state = 2353; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2352; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2355; + this.engineName(); + } + break; + case MySqlParser.KW_COMMENT: + localContext = new PartitionOptionCommentContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2356; + this.match(MySqlParser.KW_COMMENT); + this.state = 2358; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2357; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2360; + localContext._comment = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_DATA: + localContext = new PartitionOptionDataDirectoryContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2361; + this.match(MySqlParser.KW_DATA); + this.state = 2362; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 2364; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2363; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2366; + localContext._dataDirectory = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_INDEX: + localContext = new PartitionOptionIndexDirectoryContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2367; + this.match(MySqlParser.KW_INDEX); + this.state = 2368; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 2370; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2369; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2372; + localContext._indexDirectory = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_MAX_ROWS: + localContext = new PartitionOptionMaxRowsContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2373; + this.match(MySqlParser.KW_MAX_ROWS); + this.state = 2375; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2374; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2377; + localContext._maxRows = this.decimalLiteral(); + } + break; + case MySqlParser.KW_MIN_ROWS: + localContext = new PartitionOptionMinRowsContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 2378; + this.match(MySqlParser.KW_MIN_ROWS); + this.state = 2380; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2379; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2382; + localContext._minRows = this.decimalLiteral(); + } + break; + case MySqlParser.KW_TABLESPACE: + localContext = new PartitionOptionTablespaceContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 2383; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 2385; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2384; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2387; + this.tablespaceName(); + } + break; + case MySqlParser.KW_NODEGROUP: + localContext = new PartitionOptionNodeGroupContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 2388; + this.match(MySqlParser.KW_NODEGROUP); + this.state = 2390; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2389; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2392; + localContext._nodegroup = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterDatabase() { + let localContext = new AlterDatabaseContext(this.context, this.state); + this.enterRule(localContext, 120, MySqlParser.RULE_alterDatabase); + let _la; + try { + this.state = 2413; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 265, this.context)) { + case 1: + localContext = new AlterSimpleDatabaseContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2395; + this.match(MySqlParser.KW_ALTER); + this.state = 2396; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2398; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 263, this.context)) { + case 1: + { + this.state = 2397; + this.databaseName(); + } + break; + } + this.state = 2401; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 2400; + this.createDatabaseOption(); + } + } + this.state = 2403; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 135 || _la === 224 || _la === 376 || _la === 823); + } + break; + case 2: + localContext = new AlterUpgradeNameContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2405; + this.match(MySqlParser.KW_ALTER); + this.state = 2406; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2407; + this.databaseName(); + this.state = 2408; + this.match(MySqlParser.KW_UPGRADE); + this.state = 2409; + this.match(MySqlParser.KW_DATA); + this.state = 2410; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 2411; + this.match(MySqlParser.KW_NAME); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterEvent() { + let localContext = new AlterEventContext(this.context, this.state); + this.enterRule(localContext, 122, MySqlParser.RULE_alterEvent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2415; + this.match(MySqlParser.KW_ALTER); + this.state = 2417; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 2416; + this.ownerStatement(); + } + } + this.state = 2419; + this.match(MySqlParser.KW_EVENT); + this.state = 2420; + localContext._event_name = this.fullId(); + this.state = 2424; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 267, this.context)) { + case 1: + { + this.state = 2421; + this.match(MySqlParser.KW_ON); + this.state = 2422; + this.match(MySqlParser.KW_SCHEDULE); + this.state = 2423; + this.scheduleExpression(); + } + break; + } + this.state = 2432; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 119) { + { + this.state = 2426; + this.match(MySqlParser.KW_ON); + this.state = 2427; + this.match(MySqlParser.KW_COMPLETION); + this.state = 2429; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 2428; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 2431; + this.match(MySqlParser.KW_PRESERVE); + } + } + this.state = 2437; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 270, this.context)) { + case 1: + { + this.state = 2434; + this.match(MySqlParser.KW_RENAME); + this.state = 2435; + this.match(MySqlParser.KW_TO); + this.state = 2436; + localContext._new_event_name = this.fullId(); + } + break; + } + this.state = 2440; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 2439; + this.enableType(); + } + } + this.state = 2444; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 2442; + this.match(MySqlParser.KW_COMMENT); + this.state = 2443; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 2448; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 273, this.context)) { + case 1: + { + this.state = 2446; + this.match(MySqlParser.KW_DO); + this.state = 2447; + this.routineBody(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterFunction() { + let localContext = new AlterFunctionContext(this.context, this.state); + this.enterRule(localContext, 124, MySqlParser.RULE_alterFunction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2450; + this.match(MySqlParser.KW_ALTER); + this.state = 2451; + this.match(MySqlParser.KW_FUNCTION); + this.state = 2452; + this.functionName(); + this.state = 2456; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 47 || ((((_la - 112)) & ~0x1F) === 0 && ((1 << (_la - 112)) & 16777221) !== 0) || _la === 162 || _la === 340 || _la === 354 || _la === 444 || _la === 502) { + { + { + this.state = 2453; + this.routineOption(); + } + } + this.state = 2458; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterInstance() { + let localContext = new AlterInstanceContext(this.context, this.state); + this.enterRule(localContext, 126, MySqlParser.RULE_alterInstance); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2459; + this.match(MySqlParser.KW_ALTER); + this.state = 2460; + this.match(MySqlParser.KW_INSTANCE); + this.state = 2461; + this.match(MySqlParser.KW_ROTATE); + this.state = 2462; + this.match(MySqlParser.KW_INNODB); + this.state = 2463; + this.match(MySqlParser.KW_MASTER); + this.state = 2464; + this.match(MySqlParser.KW_KEY); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterLogfileGroup() { + let localContext = new AlterLogfileGroupContext(this.context, this.state); + this.enterRule(localContext, 128, MySqlParser.RULE_alterLogfileGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2466; + this.match(MySqlParser.KW_ALTER); + this.state = 2467; + this.match(MySqlParser.KW_LOGFILE); + this.state = 2468; + this.match(MySqlParser.KW_GROUP); + this.state = 2469; + localContext._logfileGroupName = this.uid(); + this.state = 2470; + this.match(MySqlParser.KW_ADD); + this.state = 2471; + this.match(MySqlParser.KW_UNDOFILE); + this.state = 2472; + this.match(MySqlParser.STRING_LITERAL); + this.state = 2478; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 2473; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 2475; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2474; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2477; + this.fileSizeLiteral(); + } + } + this.state = 2481; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 2480; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 2483; + this.match(MySqlParser.KW_ENGINE); + this.state = 2485; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2484; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2487; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterProcedure() { + let localContext = new AlterProcedureContext(this.context, this.state); + this.enterRule(localContext, 130, MySqlParser.RULE_alterProcedure); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2489; + this.match(MySqlParser.KW_ALTER); + this.state = 2490; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 2491; + localContext._proc_name = this.fullId(); + this.state = 2495; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 47 || ((((_la - 112)) & ~0x1F) === 0 && ((1 << (_la - 112)) & 16777221) !== 0) || _la === 162 || _la === 340 || _la === 354 || _la === 444 || _la === 502) { + { + { + this.state = 2492; + this.routineOption(); + } + } + this.state = 2497; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterServer() { + let localContext = new AlterServerContext(this.context, this.state); + this.enterRule(localContext, 132, MySqlParser.RULE_alterServer); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2498; + this.match(MySqlParser.KW_ALTER); + this.state = 2499; + this.match(MySqlParser.KW_SERVER); + this.state = 2500; + localContext._serverName = this.uid(); + this.state = 2501; + this.match(MySqlParser.KW_OPTIONS); + this.state = 2502; + this.match(MySqlParser.LR_BRACKET); + this.state = 2503; + this.serverOption(); + this.state = 2508; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2504; + this.match(MySqlParser.COMMA); + this.state = 2505; + this.serverOption(); + } + } + this.state = 2510; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2511; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterTable() { + let localContext = new AlterTableContext(this.context, this.state); + this.enterRule(localContext, 134, MySqlParser.RULE_alterTable); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 2513; + this.match(MySqlParser.KW_ALTER); + this.state = 2514; + this.match(MySqlParser.KW_TABLE); + this.state = 2515; + this.tableName(); + this.state = 2524; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 282, this.context)) { + case 1: + { + this.state = 2516; + this.alterOption(); + this.state = 2521; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2517; + this.match(MySqlParser.COMMA); + this.state = 2518; + this.alterOption(); + } + } + this.state = 2523; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + this.state = 2533; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 284, this.context)) { + case 1: + { + this.state = 2526; + this.alterPartitionSpecification(); + this.state = 2530; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 283, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2527; + this.alterPartitionSpecification(); + } + } + } + this.state = 2532; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 283, this.context); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterTablespace() { + let localContext = new AlterTablespaceContext(this.context, this.state); + this.enterRule(localContext, 136, MySqlParser.RULE_alterTablespace); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2535; + this.match(MySqlParser.KW_ALTER); + this.state = 2537; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 2536; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 2539; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 2540; + this.tablespaceName(); + this.state = 2541; + _la = this.tokenStream.LA(1); + if (!(_la === 6 || _la === 51)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2542; + this.match(MySqlParser.KW_DATAFILE); + this.state = 2543; + this.match(MySqlParser.STRING_LITERAL); + this.state = 2549; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 2544; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 2546; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2545; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2548; + this.fileSizeLiteral(); + } + } + this.state = 2552; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 2551; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 2557; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 289, this.context)) { + case 1: + { + this.state = 2554; + this.match(MySqlParser.KW_RENAME); + this.state = 2555; + this.match(MySqlParser.KW_TO); + this.state = 2556; + this.tablespaceNameCreate(); + } + break; + } + this.state = 2564; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 314) { + { + this.state = 2559; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 2561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2560; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2563; + this.fileSizeLiteral(); + } + } + this.state = 2568; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 292, this.context)) { + case 1: + { + this.state = 2566; + this.match(MySqlParser.KW_SET); + this.state = 2567; + _la = this.tokenStream.LA(1); + if (!(_la === 5 || _la === 81)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 2575; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 376) { + { + this.state = 2570; + this.match(MySqlParser.KW_ENCRYPTION); + this.state = 2572; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2571; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2574; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 2582; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 380) { + { + this.state = 2577; + this.match(MySqlParser.KW_ENGINE); + this.state = 2579; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2578; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2581; + this.engineName(); + } + } + this.state = 2589; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 825) { + { + this.state = 2584; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 2586; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2585; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2588; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterView() { + let localContext = new AlterViewContext(this.context, this.state); + this.enterRule(localContext, 138, MySqlParser.RULE_alterView); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2591; + this.match(MySqlParser.KW_ALTER); + this.state = 2595; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 2592; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2593; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2594; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 486 || _la === 661 || _la === 670)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2598; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 2597; + this.ownerStatement(); + } + } + this.state = 2603; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 162) { + { + this.state = 2600; + this.match(MySqlParser.KW_SQL); + this.state = 2601; + this.match(MySqlParser.KW_SECURITY); + this.state = 2602; + localContext._secContext = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 364 || _la === 436)) { + localContext._secContext = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2605; + this.match(MySqlParser.KW_VIEW); + this.state = 2606; + this.viewName(); + this.state = 2611; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2607; + this.match(MySqlParser.LR_BRACKET); + this.state = 2608; + this.columnNames(); + this.state = 2609; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 2613; + this.match(MySqlParser.KW_AS); + this.state = 2614; + this.selectStatement(); + this.state = 2621; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 304, this.context)) { + case 1: + { + this.state = 2615; + this.match(MySqlParser.KW_WITH); + this.state = 2617; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 325 || _la === 450) { + { + this.state = 2616; + localContext._checkOpt = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 325 || _la === 450)) { + localContext._checkOpt = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2619; + this.match(MySqlParser.KW_CHECK); + this.state = 2620; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterOption() { + let localContext = new AlterOptionContext(this.context, this.state); + this.enterRule(localContext, 140, MySqlParser.RULE_alterOption); + let _la; + try { + let alternative; + this.state = 2887; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 348, this.context)) { + case 1: + localContext = new AlterByTableOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2623; + this.tableOption(); + this.state = 2630; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 306, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2625; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 2624; + this.match(MySqlParser.COMMA); + } + } + this.state = 2627; + this.tableOption(); + } + } + } + this.state = 2632; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 306, this.context); + } + } + break; + case 2: + localContext = new AlterByAddColumnContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2633; + this.match(MySqlParser.KW_ADD); + this.state = 2635; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 307, this.context)) { + case 1: + { + this.state = 2634; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2637; + this.columnName(); + this.state = 2638; + this.columnDefinition(); + this.state = 2642; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FIRST: + { + this.state = 2639; + this.match(MySqlParser.KW_FIRST); + } + break; + case MySqlParser.KW_AFTER: + { + this.state = 2640; + this.match(MySqlParser.KW_AFTER); + this.state = 2641; + this.columnName(); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ADD: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DO: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 3: + localContext = new AlterByAddColumnsContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2644; + this.match(MySqlParser.KW_ADD); + this.state = 2646; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 29) { + { + this.state = 2645; + this.match(MySqlParser.KW_COLUMN); + } + } + this.state = 2648; + this.match(MySqlParser.LR_BRACKET); + this.state = 2649; + this.columnName(); + this.state = 2650; + this.columnDefinition(); + this.state = 2657; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2651; + this.match(MySqlParser.COMMA); + this.state = 2652; + this.columnName(); + this.state = 2653; + this.columnDefinition(); + } + } + this.state = 2659; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2660; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 4: + localContext = new AlterByAddIndexContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2662; + this.match(MySqlParser.KW_ADD); + this.state = 2663; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2665; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2664; + this.indexName(); + } + } + this.state = 2668; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 2667; + this.indexType(); + } + } + this.state = 2670; + this.indexColumnNames(); + this.state = 2674; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 313, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2671; + this.indexOption(); + } + } + } + this.state = 2676; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 313, this.context); + } + } + break; + case 5: + localContext = new AlterByAddSpecialIndexContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2677; + this.match(MySqlParser.KW_ADD); + this.state = 2678; + _la = this.tokenStream.LA(1); + if (!(_la === 69 || _la === 161)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2680; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 2679; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2683; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2682; + this.indexName(); + } + } + this.state = 2685; + this.indexColumnNames(); + this.state = 2689; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 316, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2686; + this.indexOption(); + } + } + } + this.state = 2691; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 316, this.context); + } + } + break; + case 6: + localContext = new AlterByAddPrimaryKeyContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 2692; + this.match(MySqlParser.KW_ADD); + this.state = 2697; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 2693; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 2695; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 317, this.context)) { + case 1: + { + this.state = 2694; + localContext._symbol_ = this.uid(); + } + break; + } + } + } + this.state = 2699; + this.match(MySqlParser.KW_PRIMARY); + this.state = 2700; + this.match(MySqlParser.KW_KEY); + this.state = 2702; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 2701; + this.indexType(); + } + } + this.state = 2704; + this.indexColumnNames(); + this.state = 2708; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 320, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2705; + this.indexOption(); + } + } + } + this.state = 2710; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 320, this.context); + } + } + break; + case 7: + localContext = new AlterByAddUniqueKeyContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 2711; + this.match(MySqlParser.KW_ADD); + this.state = 2716; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 2712; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 2714; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2713; + localContext._symbol_ = this.uid(); + } + } + } + } + this.state = 2718; + this.match(MySqlParser.KW_UNIQUE); + this.state = 2720; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 2719; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2723; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2722; + this.indexName(); + } + } + this.state = 2726; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 2725; + this.indexType(); + } + } + this.state = 2728; + this.indexColumnNames(); + this.state = 2732; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 326, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2729; + this.indexOption(); + } + } + } + this.state = 2734; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 326, this.context); + } + } + break; + case 8: + localContext = new AlterByAddForeignKeyContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 2735; + this.match(MySqlParser.KW_ADD); + this.state = 2740; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 2736; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 2738; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2737; + localContext._symbol_ = this.uid(); + } + } + } + } + this.state = 2742; + this.match(MySqlParser.KW_FOREIGN); + this.state = 2743; + this.match(MySqlParser.KW_KEY); + this.state = 2745; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2744; + this.indexName(); + } + } + this.state = 2747; + this.indexColumnNames(); + this.state = 2748; + this.referenceDefinition(); + } + break; + case 9: + localContext = new AlterByAddCheckTableConstraintContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 2750; + this.match(MySqlParser.KW_ADD); + this.state = 2752; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 330, this.context)) { + case 1: + { + this.state = 2751; + this.checkConstraintDefinition(); + } + break; + } + } + break; + case 10: + localContext = new AlterByDropConstraintCheckContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 2754; + this.match(MySqlParser.KW_DROP); + this.state = 2755; + _la = this.tokenStream.LA(1); + if (!(_la === 27 || _la === 31)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2756; + localContext._symbol_ = this.uid(); + } + break; + case 11: + localContext = new AlterByAlterCheckTableConstraintContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 2757; + this.match(MySqlParser.KW_ALTER); + this.state = 2758; + _la = this.tokenStream.LA(1); + if (!(_la === 27 || _la === 31)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2759; + localContext._symbol_ = this.uid(); + this.state = 2761; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 2760; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 2764; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 57) { + { + this.state = 2763; + this.match(MySqlParser.KW_ENFORCED); + } + } + } + break; + case 12: + localContext = new AlterBySetAlgorithmContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 2766; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2768; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2767; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2770; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 357 || _la === 430 || _la === 434)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 13: + localContext = new AlterByAlterColumnDefaultContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 2771; + this.match(MySqlParser.KW_ALTER); + this.state = 2773; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 334, this.context)) { + case 1: + { + this.state = 2772; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2775; + this.columnName(); + this.state = 2783; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 335, this.context)) { + case 1: + { + this.state = 2776; + this.match(MySqlParser.KW_SET); + this.state = 2777; + this.match(MySqlParser.KW_DEFAULT); + this.state = 2778; + this.defaultValue(); + } + break; + case 2: + { + this.state = 2779; + this.match(MySqlParser.KW_SET); + this.state = 2780; + _la = this.tokenStream.LA(1); + if (!(_la === 435 || _la === 686)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 3: + { + this.state = 2781; + this.match(MySqlParser.KW_DROP); + this.state = 2782; + this.match(MySqlParser.KW_DEFAULT); + } + break; + } + } + break; + case 14: + localContext = new AlterByAlterIndexVisibilityContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 2785; + this.match(MySqlParser.KW_ALTER); + this.state = 2786; + this.match(MySqlParser.KW_INDEX); + this.state = 2787; + this.indexName(); + this.state = 2788; + _la = this.tokenStream.LA(1); + if (!(_la === 435 || _la === 686)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 15: + localContext = new AlterByChangeColumnContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 2790; + this.match(MySqlParser.KW_CHANGE); + this.state = 2792; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 336, this.context)) { + case 1: + { + this.state = 2791; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2794; + localContext._oldColumn = this.columnName(); + this.state = 2795; + localContext._newColumn = this.columnNameCreate(); + this.state = 2796; + this.columnDefinition(); + this.state = 2800; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FIRST: + { + this.state = 2797; + this.match(MySqlParser.KW_FIRST); + } + break; + case MySqlParser.KW_AFTER: + { + this.state = 2798; + this.match(MySqlParser.KW_AFTER); + this.state = 2799; + this.columnName(); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ADD: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DO: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 16: + localContext = new AlterByDefaultCharsetContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 2803; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 2802; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 2805; + this.match(MySqlParser.KW_CHARACTER); + this.state = 2806; + this.match(MySqlParser.KW_SET); + this.state = 2807; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2808; + this.charsetName(); + this.state = 2814; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 28) { + { + this.state = 2809; + this.match(MySqlParser.KW_COLLATE); + this.state = 2811; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2810; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2813; + this.collationName(); + } + } + } + break; + case 17: + localContext = new AlterByConvertCharsetContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 2816; + this.match(MySqlParser.KW_CONVERT); + this.state = 2817; + this.match(MySqlParser.KW_TO); + this.state = 2821; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CHARSET: + { + this.state = 2818; + this.match(MySqlParser.KW_CHARSET); + } + break; + case MySqlParser.KW_CHARACTER: + { + this.state = 2819; + this.match(MySqlParser.KW_CHARACTER); + this.state = 2820; + this.match(MySqlParser.KW_SET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 2823; + this.charsetName(); + this.state = 2826; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 28) { + { + this.state = 2824; + this.match(MySqlParser.KW_COLLATE); + this.state = 2825; + this.collationName(); + } + } + } + break; + case 18: + localContext = new AlterKeysContext(localContext); + this.enterOuterAlt(localContext, 18); + { + this.state = 2828; + _la = this.tokenStream.LA(1); + if (!(_la === 368 || _la === 375)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2829; + this.match(MySqlParser.KW_KEYS); + } + break; + case 19: + localContext = new AlterTablespaceOptionContext(localContext); + this.enterOuterAlt(localContext, 19); + { + this.state = 2830; + _la = this.tokenStream.LA(1); + if (!(_la === 369 || _la === 425)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2831; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case 20: + localContext = new AlterByDropColumnContext(localContext); + this.enterOuterAlt(localContext, 20); + { + this.state = 2832; + this.match(MySqlParser.KW_DROP); + this.state = 2834; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 343, this.context)) { + case 1: + { + this.state = 2833; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2836; + this.columnName(); + } + break; + case 21: + localContext = new AlterByDropIndexContext(localContext); + this.enterOuterAlt(localContext, 21); + { + this.state = 2837; + this.match(MySqlParser.KW_DROP); + this.state = 2838; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2839; + this.indexName(); + } + break; + case 22: + localContext = new AlterByDropPrimaryKeyContext(localContext); + this.enterOuterAlt(localContext, 22); + { + this.state = 2840; + this.match(MySqlParser.KW_DROP); + this.state = 2841; + this.match(MySqlParser.KW_PRIMARY); + this.state = 2842; + this.match(MySqlParser.KW_KEY); + } + break; + case 23: + localContext = new AlterByDropForeignKeyContext(localContext); + this.enterOuterAlt(localContext, 23); + { + this.state = 2843; + this.match(MySqlParser.KW_DROP); + this.state = 2844; + this.match(MySqlParser.KW_FOREIGN); + this.state = 2845; + this.match(MySqlParser.KW_KEY); + this.state = 2846; + localContext._fk_symbol = this.uid(); + } + break; + case 24: + localContext = new AlterByForceContext(localContext); + this.enterOuterAlt(localContext, 24); + { + this.state = 2847; + this.match(MySqlParser.KW_FORCE); + } + break; + case 25: + localContext = new AlterByLockContext(localContext); + this.enterOuterAlt(localContext, 25); + { + this.state = 2848; + this.match(MySqlParser.KW_LOCK); + this.state = 2850; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2849; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2852; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 389 || _la === 505 || _la === 595)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 26: + localContext = new AlterByModifyColumnContext(localContext); + this.enterOuterAlt(localContext, 26); + { + this.state = 2853; + this.match(MySqlParser.KW_MODIFY); + this.state = 2855; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 345, this.context)) { + case 1: + { + this.state = 2854; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2857; + this.columnName(); + this.state = 2858; + this.columnDefinition(); + this.state = 2862; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FIRST: + { + this.state = 2859; + this.match(MySqlParser.KW_FIRST); + } + break; + case MySqlParser.KW_AFTER: + { + this.state = 2860; + this.match(MySqlParser.KW_AFTER); + this.state = 2861; + this.columnName(); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ADD: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DO: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 27: + localContext = new AlterByOrderContext(localContext); + this.enterOuterAlt(localContext, 27); + { + this.state = 2864; + this.match(MySqlParser.KW_ORDER); + this.state = 2865; + this.match(MySqlParser.KW_BY); + this.state = 2866; + this.columnNames(); + } + break; + case 28: + localContext = new AlterByRenameColumnContext(localContext); + this.enterOuterAlt(localContext, 28); + { + this.state = 2867; + this.match(MySqlParser.KW_RENAME); + this.state = 2868; + this.match(MySqlParser.KW_COLUMN); + this.state = 2869; + localContext._olcdColumn = this.columnName(); + this.state = 2870; + this.match(MySqlParser.KW_TO); + this.state = 2871; + localContext._newColumn = this.columnNameCreate(); + } + break; + case 29: + localContext = new AlterByRenameIndexContext(localContext); + this.enterOuterAlt(localContext, 29); + { + this.state = 2873; + this.match(MySqlParser.KW_RENAME); + this.state = 2874; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2875; + this.indexName(); + this.state = 2876; + this.match(MySqlParser.KW_TO); + this.state = 2877; + this.indexNameCreate(); + } + break; + case 30: + localContext = new AlterByRenameContext(localContext); + this.enterOuterAlt(localContext, 30); + { + this.state = 2879; + this.match(MySqlParser.KW_RENAME); + this.state = 2881; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13 || _la === 176) { + { + this.state = 2880; + localContext._renameFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 13 || _la === 176)) { + localContext._renameFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2883; + this.tableNameCreate(); + } + break; + case 31: + localContext = new AlterByValidateContext(localContext); + this.enterOuterAlt(localContext, 31); + { + this.state = 2884; + _la = this.tokenStream.LA(1); + if (!(_la === 194 || _la === 690)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2885; + this.match(MySqlParser.KW_VALIDATION); + } + break; + case 32: + localContext = new AlterPartitionContext(localContext); + this.enterOuterAlt(localContext, 32); + { + this.state = 2886; + this.alterPartitionSpecification(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterPartitionSpecification() { + let localContext = new AlterPartitionSpecificationContext(this.context, this.state); + this.enterRule(localContext, 142, MySqlParser.RULE_alterPartitionSpecification); + let _la; + try { + this.state = 2987; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ADD: + localContext = new AlterByAddPartitionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2889; + this.match(MySqlParser.KW_ADD); + this.state = 2890; + this.match(MySqlParser.KW_PARTITION); + this.state = 2891; + this.match(MySqlParser.LR_BRACKET); + this.state = 2892; + this.partitionDefinition(); + this.state = 2897; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2893; + this.match(MySqlParser.COMMA); + this.state = 2894; + this.partitionDefinition(); + } + } + this.state = 2899; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2900; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_DROP: + localContext = new AlterByDropPartitionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2902; + this.match(MySqlParser.KW_DROP); + this.state = 2903; + this.match(MySqlParser.KW_PARTITION); + this.state = 2904; + this.partitionNames(); + } + break; + case MySqlParser.KW_DISCARD: + localContext = new AlterByDiscardPartitionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2905; + this.match(MySqlParser.KW_DISCARD); + this.state = 2906; + this.match(MySqlParser.KW_PARTITION); + this.state = 2909; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2907; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2908; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 2911; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case MySqlParser.KW_IMPORT: + localContext = new AlterByImportPartitionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2912; + this.match(MySqlParser.KW_IMPORT); + this.state = 2913; + this.match(MySqlParser.KW_PARTITION); + this.state = 2916; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2914; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2915; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 2918; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case MySqlParser.KW_TRUNCATE: + localContext = new AlterByTruncatePartitionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2919; + this.match(MySqlParser.KW_TRUNCATE); + this.state = 2920; + this.match(MySqlParser.KW_PARTITION); + this.state = 2923; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2921; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2922; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_COALESCE: + localContext = new AlterByCoalescePartitionContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 2925; + this.match(MySqlParser.KW_COALESCE); + this.state = 2926; + this.match(MySqlParser.KW_PARTITION); + this.state = 2927; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_REORGANIZE: + localContext = new AlterByReorganizePartitionContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 2928; + this.match(MySqlParser.KW_REORGANIZE); + this.state = 2929; + this.match(MySqlParser.KW_PARTITION); + this.state = 2930; + this.partitionNames(); + this.state = 2931; + this.match(MySqlParser.KW_INTO); + this.state = 2932; + this.match(MySqlParser.LR_BRACKET); + this.state = 2933; + this.partitionDefinition(); + this.state = 2938; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2934; + this.match(MySqlParser.COMMA); + this.state = 2935; + this.partitionDefinition(); + } + } + this.state = 2940; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2941; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_EXCHANGE: + localContext = new AlterByExchangePartitionContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 2943; + this.match(MySqlParser.KW_EXCHANGE); + this.state = 2944; + this.match(MySqlParser.KW_PARTITION); + this.state = 2945; + this.partitionName(); + this.state = 2946; + this.match(MySqlParser.KW_WITH); + this.state = 2947; + this.match(MySqlParser.KW_TABLE); + this.state = 2948; + this.tableName(); + this.state = 2951; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 354, this.context)) { + case 1: + { + this.state = 2949; + localContext._validationFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 194 || _la === 690)) { + localContext._validationFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2950; + this.match(MySqlParser.KW_VALIDATION); + } + break; + } + } + break; + case MySqlParser.KW_ANALYZE: + localContext = new AlterByAnalyzePartitionContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 2953; + this.match(MySqlParser.KW_ANALYZE); + this.state = 2954; + this.match(MySqlParser.KW_PARTITION); + this.state = 2957; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2955; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2956; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_CHECK: + localContext = new AlterByCheckPartitionContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 2959; + this.match(MySqlParser.KW_CHECK); + this.state = 2960; + this.match(MySqlParser.KW_PARTITION); + this.state = 2963; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2961; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2962; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_OPTIMIZE: + localContext = new AlterByOptimizePartitionContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 2965; + this.match(MySqlParser.KW_OPTIMIZE); + this.state = 2966; + this.match(MySqlParser.KW_PARTITION); + this.state = 2969; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2967; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2968; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_REBUILD: + localContext = new AlterByRebuildPartitionContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 2971; + this.match(MySqlParser.KW_REBUILD); + this.state = 2972; + this.match(MySqlParser.KW_PARTITION); + this.state = 2975; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2973; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2974; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_REPAIR: + localContext = new AlterByRepairPartitionContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 2977; + this.match(MySqlParser.KW_REPAIR); + this.state = 2978; + this.match(MySqlParser.KW_PARTITION); + this.state = 2981; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2979; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2980; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_REMOVE: + localContext = new AlterByRemovePartitioningContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 2983; + this.match(MySqlParser.KW_REMOVE); + this.state = 2984; + this.match(MySqlParser.KW_PARTITIONING); + } + break; + case MySqlParser.KW_UPGRADE: + localContext = new AlterByUpgradePartitioningContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 2985; + this.match(MySqlParser.KW_UPGRADE); + this.state = 2986; + this.match(MySqlParser.KW_PARTITIONING); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropDatabase() { + let localContext = new DropDatabaseContext(this.context, this.state); + this.enterRule(localContext, 144, MySqlParser.RULE_dropDatabase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2989; + this.match(MySqlParser.KW_DROP); + this.state = 2990; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2992; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 361, this.context)) { + case 1: + { + this.state = 2991; + this.ifExists(); + } + break; + } + this.state = 2994; + this.databaseName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropEvent() { + let localContext = new DropEventContext(this.context, this.state); + this.enterRule(localContext, 146, MySqlParser.RULE_dropEvent); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2996; + this.match(MySqlParser.KW_DROP); + this.state = 2997; + this.match(MySqlParser.KW_EVENT); + this.state = 2999; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 362, this.context)) { + case 1: + { + this.state = 2998; + this.ifExists(); + } + break; + } + this.state = 3001; + localContext._event_name = this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropIndex() { + let localContext = new DropIndexContext(this.context, this.state); + this.enterRule(localContext, 148, MySqlParser.RULE_dropIndex); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3003; + this.match(MySqlParser.KW_DROP); + this.state = 3004; + this.match(MySqlParser.KW_INDEX); + this.state = 3006; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 363, this.context)) { + case 1: + { + this.state = 3005; + localContext._intimeAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 508 || _la === 514)) { + localContext._intimeAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 3008; + this.indexName(); + this.state = 3009; + this.match(MySqlParser.KW_ON); + this.state = 3010; + this.tableName(); + this.state = 3023; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 367, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + this.state = 3021; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALGORITHM: + { + this.state = 3011; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 3013; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3012; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3015; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 357 || _la === 430)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_LOCK: + { + this.state = 3016; + this.match(MySqlParser.KW_LOCK); + this.state = 3018; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3017; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3020; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 389 || _la === 505 || _la === 595)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 3025; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 367, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropLogfileGroup() { + let localContext = new DropLogfileGroupContext(this.context, this.state); + this.enterRule(localContext, 150, MySqlParser.RULE_dropLogfileGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3026; + this.match(MySqlParser.KW_DROP); + this.state = 3027; + this.match(MySqlParser.KW_LOGFILE); + this.state = 3028; + this.match(MySqlParser.KW_GROUP); + this.state = 3029; + localContext._logfileGroupName = this.uid(); + this.state = 3030; + this.match(MySqlParser.KW_ENGINE); + this.state = 3032; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3031; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3034; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropProcedure() { + let localContext = new DropProcedureContext(this.context, this.state); + this.enterRule(localContext, 152, MySqlParser.RULE_dropProcedure); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3036; + this.match(MySqlParser.KW_DROP); + this.state = 3037; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 3039; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 369, this.context)) { + case 1: + { + this.state = 3038; + this.ifExists(); + } + break; + } + this.state = 3041; + localContext._sp_name = this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropFunction() { + let localContext = new DropFunctionContext(this.context, this.state); + this.enterRule(localContext, 154, MySqlParser.RULE_dropFunction); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3043; + this.match(MySqlParser.KW_DROP); + this.state = 3044; + this.match(MySqlParser.KW_FUNCTION); + this.state = 3046; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 370, this.context)) { + case 1: + { + this.state = 3045; + this.ifExists(); + } + break; + } + this.state = 3048; + this.functionName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropServer() { + let localContext = new DropServerContext(this.context, this.state); + this.enterRule(localContext, 156, MySqlParser.RULE_dropServer); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3050; + this.match(MySqlParser.KW_DROP); + this.state = 3051; + this.match(MySqlParser.KW_SERVER); + this.state = 3053; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 371, this.context)) { + case 1: + { + this.state = 3052; + this.ifExists(); + } + break; + } + this.state = 3055; + localContext._serverName = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropSpatial() { + let localContext = new DropSpatialContext(this.context, this.state); + this.enterRule(localContext, 158, MySqlParser.RULE_dropSpatial); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3057; + this.match(MySqlParser.KW_DROP); + this.state = 3058; + this.match(MySqlParser.KW_SPATIAL); + this.state = 3059; + this.match(MySqlParser.KW_REFERENCE); + this.state = 3060; + this.match(MySqlParser.KW_SYSTEM); + this.state = 3062; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 3061; + this.ifExists(); + } + } + this.state = 3064; + this.match(MySqlParser.DECIMAL_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropTable() { + let localContext = new DropTableContext(this.context, this.state); + this.enterRule(localContext, 160, MySqlParser.RULE_dropTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3066; + this.match(MySqlParser.KW_DROP); + this.state = 3068; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 3067; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 3070; + this.match(MySqlParser.KW_TABLE); + this.state = 3072; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 374, this.context)) { + case 1: + { + this.state = 3071; + this.ifExists(); + } + break; + } + this.state = 3074; + this.tableNames(); + this.state = 3076; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 22 || _la === 146) { + { + this.state = 3075; + localContext._dropType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 22 || _la === 146)) { + localContext._dropType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropTablespace() { + let localContext = new DropTablespaceContext(this.context, this.state); + this.enterRule(localContext, 162, MySqlParser.RULE_dropTablespace); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3078; + this.match(MySqlParser.KW_DROP); + this.state = 3080; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 3079; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 3082; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 3083; + this.tablespaceName(); + this.state = 3089; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 380) { + { + this.state = 3084; + this.match(MySqlParser.KW_ENGINE); + this.state = 3086; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3085; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3088; + this.engineName(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropTrigger() { + let localContext = new DropTriggerContext(this.context, this.state); + this.enterRule(localContext, 164, MySqlParser.RULE_dropTrigger); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3091; + this.match(MySqlParser.KW_DROP); + this.state = 3092; + this.match(MySqlParser.KW_TRIGGER); + this.state = 3094; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 379, this.context)) { + case 1: + { + this.state = 3093; + this.ifExists(); + } + break; + } + this.state = 3096; + localContext._trigger_name = this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropView() { + let localContext = new DropViewContext(this.context, this.state); + this.enterRule(localContext, 166, MySqlParser.RULE_dropView); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3098; + this.match(MySqlParser.KW_DROP); + this.state = 3099; + this.match(MySqlParser.KW_VIEW); + this.state = 3101; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 380, this.context)) { + case 1: + { + this.state = 3100; + this.ifExists(); + } + break; + } + this.state = 3103; + this.viewName(); + this.state = 3108; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3104; + this.match(MySqlParser.COMMA); + this.state = 3105; + this.viewName(); + } + } + this.state = 3110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3112; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 22 || _la === 146) { + { + this.state = 3111; + localContext._dropType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 22 || _la === 146)) { + localContext._dropType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropRole() { + let localContext = new DropRoleContext(this.context, this.state); + this.enterRule(localContext, 168, MySqlParser.RULE_dropRole); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3114; + this.match(MySqlParser.KW_DROP); + this.state = 3115; + this.match(MySqlParser.KW_ROLE); + this.state = 3117; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 383, this.context)) { + case 1: + { + this.state = 3116; + this.ifExists(); + } + break; + } + this.state = 3119; + this.userOrRoleNames(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setRole() { + let localContext = new SetRoleContext(this.context, this.state); + this.enterRule(localContext, 170, MySqlParser.RULE_setRole); + let _la; + try { + this.state = 3141; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 386, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3121; + this.match(MySqlParser.KW_SET); + this.state = 3122; + this.match(MySqlParser.KW_DEFAULT); + this.state = 3123; + this.match(MySqlParser.KW_ROLE); + this.state = 3127; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 384, this.context)) { + case 1: + { + this.state = 3124; + this.match(MySqlParser.KW_NONE); + } + break; + case 2: + { + this.state = 3125; + this.match(MySqlParser.KW_ALL); + } + break; + case 3: + { + this.state = 3126; + this.userOrRoleNames(); + } + break; + } + this.state = 3129; + this.match(MySqlParser.KW_TO); + { + this.state = 3130; + this.userOrRoleName(); + } + this.state = 3135; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3131; + this.match(MySqlParser.COMMA); + { + this.state = 3132; + this.userOrRoleName(); + } + } + } + this.state = 3137; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3138; + this.match(MySqlParser.KW_SET); + this.state = 3139; + this.match(MySqlParser.KW_ROLE); + this.state = 3140; + this.roleOption(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameTable() { + let localContext = new RenameTableContext(this.context, this.state); + this.enterRule(localContext, 172, MySqlParser.RULE_renameTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3143; + this.match(MySqlParser.KW_RENAME); + this.state = 3144; + this.match(MySqlParser.KW_TABLE); + this.state = 3145; + this.renameTableClause(); + this.state = 3150; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3146; + this.match(MySqlParser.COMMA); + this.state = 3147; + this.renameTableClause(); + } + } + this.state = 3152; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameTableClause() { + let localContext = new RenameTableClauseContext(this.context, this.state); + this.enterRule(localContext, 174, MySqlParser.RULE_renameTableClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3153; + this.tableName(); + this.state = 3154; + this.match(MySqlParser.KW_TO); + this.state = 3155; + this.tableNameCreate(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + truncateTable() { + let localContext = new TruncateTableContext(this.context, this.state); + this.enterRule(localContext, 176, MySqlParser.RULE_truncateTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3157; + this.match(MySqlParser.KW_TRUNCATE); + this.state = 3159; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 173) { + { + this.state = 3158; + this.match(MySqlParser.KW_TABLE); + } + } + this.state = 3161; + this.tableName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + callStatement() { + let localContext = new CallStatementContext(this.context, this.state); + this.enterRule(localContext, 178, MySqlParser.RULE_callStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3163; + this.match(MySqlParser.KW_CALL); + this.state = 3164; + localContext._sp_name = this.fullId(); + this.state = 3171; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 390, this.context)) { + case 1: + { + this.state = 3165; + this.match(MySqlParser.LR_BRACKET); + this.state = 3168; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 389, this.context)) { + case 1: + { + this.state = 3166; + this.constants(); + } + break; + case 2: + { + this.state = 3167; + this.expressions(); + } + break; + } + this.state = 3170; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + deleteStatement() { + let localContext = new DeleteStatementContext(this.context, this.state); + this.enterRule(localContext, 180, MySqlParser.RULE_deleteStatement); + try { + this.state = 3175; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 391, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3173; + this.singleDeleteStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3174; + this.multipleDeleteStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + doStatement() { + let localContext = new DoStatementContext(this.context, this.state); + this.enterRule(localContext, 182, MySqlParser.RULE_doStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3177; + this.match(MySqlParser.KW_DO); + this.state = 3178; + this.expressions(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerStatement() { + let localContext = new HandlerStatementContext(this.context, this.state); + this.enterRule(localContext, 184, MySqlParser.RULE_handlerStatement); + try { + this.state = 3184; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 392, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3180; + this.handlerOpenStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3181; + this.handlerReadIndexStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 3182; + this.handlerReadStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 3183; + this.handlerCloseStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + insertStatement() { + let localContext = new InsertStatementContext(this.context, this.state); + this.enterRule(localContext, 186, MySqlParser.RULE_insertStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3186; + this.match(MySqlParser.KW_INSERT); + this.state = 3188; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 43 || _la === 76 || _la === 107) { + { + this.state = 3187; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 43 || _la === 76 || _la === 107)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3191; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3190; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3194; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3193; + this.match(MySqlParser.KW_INTO); + } + } + this.state = 3196; + this.tableName(); + this.state = 3203; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3197; + this.match(MySqlParser.KW_PARTITION); + this.state = 3198; + this.match(MySqlParser.LR_BRACKET); + this.state = 3200; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 3199; + this.partitionNames(); + } + } + this.state = 3202; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3216; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 401, this.context)) { + case 1: + { + this.state = 3206; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 398, this.context)) { + case 1: + { + this.state = 3205; + this.fullColumnNames(); + } + break; + } + this.state = 3210; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 399, this.context)) { + case 1: + { + this.state = 3208; + this.valuesOrValueList(); + } + break; + case 2: + { + this.state = 3209; + this.selectOrTableOrValues(); + } + break; + } + this.state = 3213; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 400, this.context)) { + case 1: + { + this.state = 3212; + this.asRowAlias(); + } + break; + } + } + break; + case 2: + { + this.state = 3215; + this.setAssignmentList(); + } + break; + } + this.state = 3219; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3218; + this.asRowAlias(); + } + } + this.state = 3233; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 119) { + { + this.state = 3221; + this.match(MySqlParser.KW_ON); + this.state = 3222; + this.match(MySqlParser.KW_DUPLICATE); + this.state = 3223; + this.match(MySqlParser.KW_KEY); + this.state = 3224; + this.match(MySqlParser.KW_UPDATE); + this.state = 3225; + localContext._duplicatedFirst = this.updatedElement(); + this.state = 3230; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3226; + this.match(MySqlParser.COMMA); + this.state = 3227; + localContext._updatedElement = this.updatedElement(); + localContext._duplicatedElements.push(localContext._updatedElement); + } + } + this.state = 3232; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + asRowAlias() { + let localContext = new AsRowAliasContext(this.context, this.state); + this.enterRule(localContext, 188, MySqlParser.RULE_asRowAlias); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3235; + this.match(MySqlParser.KW_AS); + this.state = 3236; + localContext._rowAlias = this.uid(); + this.state = 3238; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 405, this.context)) { + case 1: + { + this.state = 3237; + this.fullColumnNames(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectOrTableOrValues() { + let localContext = new SelectOrTableOrValuesContext(this.context, this.state); + this.enterRule(localContext, 190, MySqlParser.RULE_selectOrTableOrValues); + try { + this.state = 3244; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.LR_BRACKET: + this.enterOuterAlt(localContext, 1); + { + this.state = 3240; + this.selectStatement(); + } + break; + case MySqlParser.KW_TABLE: + this.enterOuterAlt(localContext, 2); + { + this.state = 3241; + this.match(MySqlParser.KW_TABLE); + this.state = 3242; + this.tableName(); + } + break; + case MySqlParser.KW_VALUES: + this.enterOuterAlt(localContext, 3); + { + this.state = 3243; + this.rowValuesList(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + interSectStatement() { + let localContext = new InterSectStatementContext(this.context, this.state); + this.enterRule(localContext, 192, MySqlParser.RULE_interSectStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3246; + this.interSectQuery(); + this.state = 3252; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 3247; + this.match(MySqlParser.KW_INTERSECT); + this.state = 3249; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3248; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3251; + this.interSectQuery(); + } + } + this.state = 3254; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 828); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + interSectQuery() { + let localContext = new InterSectQueryContext(this.context, this.state); + this.enterRule(localContext, 194, MySqlParser.RULE_interSectQuery); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3257; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 3256; + this.match(MySqlParser.LR_BRACKET); + } + } + this.state = 3259; + this.querySpecification(); + this.state = 3261; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 410, this.context)) { + case 1: + { + this.state = 3260; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadDataStatement() { + let localContext = new LoadDataStatementContext(this.context, this.state); + this.enterRule(localContext, 196, MySqlParser.RULE_loadDataStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3263; + this.match(MySqlParser.KW_LOAD); + this.state = 3264; + this.match(MySqlParser.KW_DATA); + this.state = 3266; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107 || _la === 347) { + { + this.state = 3265; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 107 || _la === 347)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3269; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 450) { + { + this.state = 3268; + this.match(MySqlParser.KW_LOCAL); + } + } + this.state = 3271; + this.match(MySqlParser.KW_INFILE); + this.state = 3272; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + this.state = 3274; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79 || _la === 143) { + { + this.state = 3273; + localContext._violation = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 79 || _la === 143)) { + localContext._violation = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3276; + this.match(MySqlParser.KW_INTO); + this.state = 3277; + this.match(MySqlParser.KW_TABLE); + this.state = 3278; + this.tableName(); + this.state = 3284; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3279; + this.match(MySqlParser.KW_PARTITION); + this.state = 3280; + this.match(MySqlParser.LR_BRACKET); + this.state = 3281; + this.partitionNames(); + this.state = 3282; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3289; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26) { + { + this.state = 3286; + this.match(MySqlParser.KW_CHARACTER); + this.state = 3287; + this.match(MySqlParser.KW_SET); + this.state = 3288; + localContext._charset = this.charsetName(); + } + } + this.state = 3297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 337 || _la === 398) { + { + this.state = 3291; + localContext._fieldsFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 337 || _la === 398)) { + localContext._fieldsFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3293; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 3292; + this.selectFieldsInto(); + } + } + this.state = 3295; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 56 || _la === 58 || _la === 123 || _la === 174); + } + } + this.state = 3305; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 102) { + { + this.state = 3299; + this.match(MySqlParser.KW_LINES); + this.state = 3301; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 3300; + this.selectLinesInto(); + } + } + this.state = 3303; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 171 || _la === 174); + } + } + this.state = 3311; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3307; + this.match(MySqlParser.KW_IGNORE); + this.state = 3308; + this.decimalLiteral(); + this.state = 3309; + localContext._linesFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 102 || _la === 587)) { + localContext._linesFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3324; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 422, this.context)) { + case 1: + { + this.state = 3313; + this.match(MySqlParser.LR_BRACKET); + this.state = 3314; + this.assignmentField(); + this.state = 3319; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3315; + this.match(MySqlParser.COMMA); + this.state = 3316; + this.assignmentField(); + } + } + this.state = 3321; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3322; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3335; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 424, this.context)) { + case 1: + { + this.state = 3326; + this.match(MySqlParser.KW_SET); + this.state = 3327; + this.updatedElement(); + this.state = 3332; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3328; + this.match(MySqlParser.COMMA); + this.state = 3329; + this.updatedElement(); + } + } + this.state = 3334; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadXmlStatement() { + let localContext = new LoadXmlStatementContext(this.context, this.state); + this.enterRule(localContext, 198, MySqlParser.RULE_loadXmlStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3337; + this.match(MySqlParser.KW_LOAD); + this.state = 3338; + this.match(MySqlParser.KW_XML); + this.state = 3340; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107 || _la === 347) { + { + this.state = 3339; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 107 || _la === 347)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3343; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 450) { + { + this.state = 3342; + this.match(MySqlParser.KW_LOCAL); + } + } + this.state = 3345; + this.match(MySqlParser.KW_INFILE); + this.state = 3346; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + this.state = 3348; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79 || _la === 143) { + { + this.state = 3347; + localContext._violation = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 79 || _la === 143)) { + localContext._violation = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3350; + this.match(MySqlParser.KW_INTO); + this.state = 3351; + this.match(MySqlParser.KW_TABLE); + this.state = 3352; + this.tableName(); + this.state = 3356; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26) { + { + this.state = 3353; + this.match(MySqlParser.KW_CHARACTER); + this.state = 3354; + this.match(MySqlParser.KW_SET); + this.state = 3355; + localContext._charset = this.charsetName(); + } + } + this.state = 3368; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 587) { + { + this.state = 3358; + this.match(MySqlParser.KW_ROWS); + this.state = 3359; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 3360; + this.match(MySqlParser.KW_BY); + this.state = 3362; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 859) { + { + this.state = 3361; + this.match(MySqlParser.LESS_SYMBOL); + } + } + this.state = 3364; + localContext._tag = this.match(MySqlParser.STRING_LITERAL); + this.state = 3366; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 858) { + { + this.state = 3365; + this.match(MySqlParser.GREATER_SYMBOL); + } + } + } + } + this.state = 3374; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3370; + this.match(MySqlParser.KW_IGNORE); + this.state = 3371; + this.decimalLiteral(); + this.state = 3372; + localContext._linesFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 102 || _la === 587)) { + localContext._linesFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3387; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 434, this.context)) { + case 1: + { + this.state = 3376; + this.match(MySqlParser.LR_BRACKET); + this.state = 3377; + this.assignmentField(); + this.state = 3382; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3378; + this.match(MySqlParser.COMMA); + this.state = 3379; + this.assignmentField(); + } + } + this.state = 3384; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3385; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3398; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 436, this.context)) { + case 1: + { + this.state = 3389; + this.match(MySqlParser.KW_SET); + this.state = 3390; + this.updatedElement(); + this.state = 3395; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3391; + this.match(MySqlParser.COMMA); + this.state = 3392; + this.updatedElement(); + } + } + this.state = 3397; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + parenthesizedQuery() { + let localContext = new ParenthesizedQueryContext(this.context, this.state); + this.enterRule(localContext, 200, MySqlParser.RULE_parenthesizedQuery); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3400; + this.match(MySqlParser.LR_BRACKET); + this.state = 3401; + this.parenthesizedQueryExpression(); + this.state = 3403; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3402; + this.orderByClause(); + } + } + this.state = 3406; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3405; + this.limitClause(); + } + } + this.state = 3408; + this.match(MySqlParser.RR_BRACKET); + this.state = 3410; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3409; + this.orderByClause(); + } + } + this.state = 3413; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3412; + this.limitClause(); + } + } + this.state = 3416; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3415; + this.intoClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replaceStatement() { + let localContext = new ReplaceStatementContext(this.context, this.state); + this.enterRule(localContext, 202, MySqlParser.RULE_replaceStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3418; + this.match(MySqlParser.KW_REPLACE); + this.state = 3420; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 43 || _la === 107) { + { + this.state = 3419; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 43 || _la === 107)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3423; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3422; + this.match(MySqlParser.KW_INTO); + } + } + this.state = 3425; + this.tableName(); + this.state = 3431; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3426; + this.match(MySqlParser.KW_PARTITION); + this.state = 3427; + this.match(MySqlParser.LR_BRACKET); + this.state = 3428; + this.partitionNames(); + this.state = 3429; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3441; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_VALUE: + case MySqlParser.LR_BRACKET: + { + this.state = 3437; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 445, this.context)) { + case 1: + { + this.state = 3433; + this.match(MySqlParser.LR_BRACKET); + this.state = 3434; + this.columnNames(); + this.state = 3435; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3439; + this.replaceStatementValuesOrSelectOrTable(); + } + break; + case MySqlParser.KW_SET: + { + this.state = 3440; + this.setAssignmentList(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectStatement() { + let localContext = new SelectStatementContext(this.context, this.state); + this.enterRule(localContext, 204, MySqlParser.RULE_selectStatement); + let _la; + try { + let alternative; + this.state = 3502; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + localContext = new UnionAndLateralSelectContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3443; + this.querySpecification(); + this.state = 3447; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 447, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3444; + this.unionStatement(); + } + } + } + this.state = 3449; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 447, this.context); + } + this.state = 3458; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 450, this.context)) { + case 1: + { + this.state = 3450; + this.match(MySqlParser.KW_UNION); + this.state = 3452; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3451; + localContext._unionType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._unionType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3456; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + { + this.state = 3454; + this.querySpecification(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 3455; + this.queryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + } + this.state = 3464; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 451, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3460; + this.match(MySqlParser.COMMA); + this.state = 3461; + this.lateralStatement(); + } + } + } + this.state = 3466; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 451, this.context); + } + this.state = 3468; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 452, this.context)) { + case 1: + { + this.state = 3467; + this.orderByClause(); + } + break; + } + this.state = 3471; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 453, this.context)) { + case 1: + { + this.state = 3470; + this.limitClause(); + } + break; + } + this.state = 3474; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 454, this.context)) { + case 1: + { + this.state = 3473; + this.lockClause(); + } + break; + } + this.state = 3477; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 455, this.context)) { + case 1: + { + this.state = 3476; + this.intoClause(); + } + break; + } + } + break; + case MySqlParser.LR_BRACKET: + localContext = new SelectExpressionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3479; + this.queryExpression(); + this.state = 3483; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 456, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3480; + this.unionStatement(); + } + } + } + this.state = 3485; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 456, this.context); + } + this.state = 3491; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 458, this.context)) { + case 1: + { + this.state = 3486; + this.match(MySqlParser.KW_UNION); + this.state = 3488; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3487; + localContext._unionType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._unionType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3490; + this.queryExpression(); + } + break; + } + this.state = 3494; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 459, this.context)) { + case 1: + { + this.state = 3493; + this.orderByClause(); + } + break; + } + this.state = 3497; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 460, this.context)) { + case 1: + { + this.state = 3496; + this.limitClause(); + } + break; + } + this.state = 3500; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 461, this.context)) { + case 1: + { + this.state = 3499; + this.lockClause(); + } + break; + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setOperations() { + let localContext = new SetOperationsContext(this.context, this.state); + this.enterRule(localContext, 206, MySqlParser.RULE_setOperations); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3505; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 3504; + this.withClause(); + } + } + this.state = 3507; + this.queryExpressionBody(0); + this.state = 3509; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3508; + this.orderByClause(); + } + } + this.state = 3512; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3511; + this.limitClause(); + } + } + this.state = 3515; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3514; + this.intoClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + queryExpressionBody(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new QueryExpressionBodyContext(this.context, parentState); + let previousContext = localContext; + let _startState = 208; + this.enterRecursionRule(localContext, 208, MySqlParser.RULE_queryExpressionBody, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + { + this.state = 3518; + this.queryItem(0); + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 3534; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 470, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + this.state = 3532; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 469, this.context)) { + case 1: + { + localContext = new QueryExpressionBodyContext(parentContext, parentState); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_queryExpressionBody); + this.state = 3520; + if (!(this.precpred(this.context, 2))) { + throw this.createFailedPredicateException("this.precpred(this.context, 2)"); + } + this.state = 3521; + this.match(MySqlParser.KW_UNION); + this.state = 3523; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3522; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3525; + this.queryItem(0); + } + break; + case 2: + { + localContext = new QueryExpressionBodyContext(parentContext, parentState); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_queryExpressionBody); + this.state = 3526; + if (!(this.precpred(this.context, 1))) { + throw this.createFailedPredicateException("this.precpred(this.context, 1)"); + } + this.state = 3527; + this.match(MySqlParser.KW_EXCEPT); + this.state = 3529; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3528; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3531; + this.queryItem(0); + } + break; + } + } + } + this.state = 3536; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 470, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + queryItem(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new QueryItemContext(this.context, parentState); + let previousContext = localContext; + let _startState = 210; + this.enterRecursionRule(localContext, 210, MySqlParser.RULE_queryItem, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + { + this.state = 3538; + this.queryPrimary(); + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 3548; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 472, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + { + localContext = new QueryItemContext(parentContext, parentState); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_queryItem); + this.state = 3540; + if (!(this.precpred(this.context, 1))) { + throw this.createFailedPredicateException("this.precpred(this.context, 1)"); + } + this.state = 3541; + this.match(MySqlParser.KW_INTERSECT); + this.state = 3543; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3542; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3545; + this.queryPrimary(); + } + } + } + this.state = 3550; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 472, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + queryPrimary() { + let localContext = new QueryPrimaryContext(this.context, this.state); + this.enterRule(localContext, 212, MySqlParser.RULE_queryPrimary); + let _la; + try { + this.state = 3565; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 476, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3551; + this.queryBlock(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3552; + this.match(MySqlParser.LR_BRACKET); + this.state = 3553; + this.queryExpressionBody(0); + this.state = 3555; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3554; + this.orderByClause(); + } + } + this.state = 3558; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3557; + this.limitClause(); + } + } + this.state = 3561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3560; + this.intoClause(); + } + } + this.state = 3563; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + updateStatement() { + let localContext = new UpdateStatementContext(this.context, this.state); + this.enterRule(localContext, 214, MySqlParser.RULE_updateStatement); + try { + this.state = 3569; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 477, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3567; + this.singleUpdateStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3568; + this.multipleUpdateStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + valuesStatement() { + let localContext = new ValuesStatementContext(this.context, this.state); + this.enterRule(localContext, 216, MySqlParser.RULE_valuesStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3571; + this.rowValuesList(); + this.state = 3575; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 478, this.context)) { + case 1: + { + this.state = 3572; + this.match(MySqlParser.KW_ORDER); + this.state = 3573; + this.match(MySqlParser.KW_BY); + this.state = 3574; + this.indexColumnName(); + } + break; + } + this.state = 3579; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 479, this.context)) { + case 1: + { + this.state = 3577; + this.match(MySqlParser.KW_LIMIT); + this.state = 3578; + this.limitClauseAtom(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + parenthesizedQueryExpression() { + let localContext = new ParenthesizedQueryExpressionContext(this.context, this.state); + this.enterRule(localContext, 218, MySqlParser.RULE_parenthesizedQueryExpression); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3581; + this.queryBlock(); + this.state = 3586; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 59 || _la === 181 || _la === 828) { + { + { + this.state = 3582; + _la = this.tokenStream.LA(1); + if (!(_la === 59 || _la === 181 || _la === 828)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3583; + this.queryBlock(); + } + } + this.state = 3588; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3590; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 481, this.context)) { + case 1: + { + this.state = 3589; + this.orderByClause(); + } + break; + } + this.state = 3593; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 482, this.context)) { + case 1: + { + this.state = 3592; + this.limitClause(); + } + break; + } + this.state = 3596; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3595; + this.intoClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + queryBlock() { + let localContext = new QueryBlockContext(this.context, this.state); + this.enterRule(localContext, 220, MySqlParser.RULE_queryBlock); + try { + this.state = 3601; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.LR_BRACKET: + this.enterOuterAlt(localContext, 1); + { + this.state = 3598; + this.selectStatement(); + } + break; + case MySqlParser.KW_TABLE: + this.enterOuterAlt(localContext, 2); + { + this.state = 3599; + this.tableStatement(); + } + break; + case MySqlParser.KW_VALUES: + this.enterOuterAlt(localContext, 3); + { + this.state = 3600; + this.valuesStatement(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replaceStatementValuesOrSelectOrTable() { + let localContext = new ReplaceStatementValuesOrSelectOrTableContext(this.context, this.state); + this.enterRule(localContext, 222, MySqlParser.RULE_replaceStatementValuesOrSelectOrTable); + try { + this.state = 3608; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 485, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3603; + this.selectStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3604; + this.match(MySqlParser.KW_TABLE); + this.state = 3605; + this.tableName(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 3606; + this.valuesOrValueList(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 3607; + this.rowValuesList(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + rowValuesList() { + let localContext = new RowValuesListContext(this.context, this.state); + this.enterRule(localContext, 224, MySqlParser.RULE_rowValuesList); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3610; + this.match(MySqlParser.KW_VALUES); + this.state = 3611; + this.match(MySqlParser.KW_ROW); + this.state = 3612; + this.expressionsWithDefaults(); + this.state = 3618; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 486, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3613; + this.match(MySqlParser.COMMA); + this.state = 3614; + this.match(MySqlParser.KW_ROW); + this.state = 3615; + this.expressionsWithDefaults(); + } + } + } + this.state = 3620; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 486, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setAssignmentList() { + let localContext = new SetAssignmentListContext(this.context, this.state); + this.enterRule(localContext, 226, MySqlParser.RULE_setAssignmentList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3621; + this.match(MySqlParser.KW_SET); + this.state = 3622; + localContext._setFirst = this.updatedElement(); + this.state = 3627; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3623; + this.match(MySqlParser.COMMA); + this.state = 3624; + localContext._updatedElement = this.updatedElement(); + localContext._setElements.push(localContext._updatedElement); + } + } + this.state = 3629; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + updatedElement() { + let localContext = new UpdatedElementContext(this.context, this.state); + this.enterRule(localContext, 228, MySqlParser.RULE_updatedElement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3630; + this.columnName(); + this.state = 3631; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 3632; + this.expressionOrDefault(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + assignmentField() { + let localContext = new AssignmentFieldContext(this.context, this.state); + this.enterRule(localContext, 230, MySqlParser.RULE_assignmentField); + try { + this.state = 3636; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 1); + { + this.state = 3634; + localContext._var_name = this.uid(); + } + break; + case MySqlParser.LOCAL_ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 3635; + this.match(MySqlParser.LOCAL_ID); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockClause() { + let localContext = new LockClauseContext(this.context, this.state); + this.enterRule(localContext, 232, MySqlParser.RULE_lockClause); + let _la; + try { + let alternative; + this.state = 3659; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FOR: + this.enterOuterAlt(localContext, 1); + { + this.state = 3638; + this.match(MySqlParser.KW_FOR); + this.state = 3639; + _la = this.tokenStream.LA(1); + if (!(_la === 185 || _la === 594)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3649; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 490, this.context)) { + case 1: + { + this.state = 3640; + this.match(MySqlParser.KW_OF); + this.state = 3641; + this.tableName(); + this.state = 3646; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 489, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3642; + this.match(MySqlParser.COMMA); + this.state = 3643; + this.tableName(); + } + } + } + this.state = 3648; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 489, this.context); + } + } + break; + } + this.state = 3653; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 491, this.context)) { + case 1: + { + this.state = 3651; + _la = this.tokenStream.LA(1); + if (!(_la === 159 || _la === 503)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3652; + this.match(MySqlParser.KW_LOCKED); + } + break; + } + } + break; + case MySqlParser.KW_LOCK: + this.enterOuterAlt(localContext, 2); + { + this.state = 3655; + this.match(MySqlParser.KW_LOCK); + this.state = 3656; + this.match(MySqlParser.KW_IN); + this.state = 3657; + this.match(MySqlParser.KW_SHARE); + this.state = 3658; + this.match(MySqlParser.KW_MODE); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + singleDeleteStatement() { + let localContext = new SingleDeleteStatementContext(this.context, this.state); + this.enterRule(localContext, 234, MySqlParser.RULE_singleDeleteStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3661; + this.match(MySqlParser.KW_DELETE); + this.state = 3663; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3662; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3666; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 549) { + { + this.state = 3665; + this.match(MySqlParser.KW_QUICK); + } + } + this.state = 3669; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3668; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3671; + this.match(MySqlParser.KW_FROM); + this.state = 3672; + this.tableName(); + this.state = 3677; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 497, this.context)) { + case 1: + { + this.state = 3674; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3673; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3676; + localContext._table_alias = this.uid(); + } + break; + } + this.state = 3684; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3679; + this.match(MySqlParser.KW_PARTITION); + this.state = 3680; + this.match(MySqlParser.LR_BRACKET); + this.state = 3681; + this.partitionNames(); + this.state = 3682; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3688; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3686; + this.match(MySqlParser.KW_WHERE); + this.state = 3687; + this.expression(0); + } + } + this.state = 3691; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3690; + this.orderByClause(); + } + } + this.state = 3695; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3693; + this.match(MySqlParser.KW_LIMIT); + this.state = 3694; + this.limitClauseAtom(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + multipleDeleteStatement() { + let localContext = new MultipleDeleteStatementContext(this.context, this.state); + this.enterRule(localContext, 236, MySqlParser.RULE_multipleDeleteStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3697; + this.match(MySqlParser.KW_DELETE); + this.state = 3699; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3698; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3702; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 503, this.context)) { + case 1: + { + this.state = 3701; + this.match(MySqlParser.KW_QUICK); + } + break; + } + this.state = 3705; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3704; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3746; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 3707; + this.tableName(); + this.state = 3710; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3708; + this.match(MySqlParser.DOT); + this.state = 3709; + this.match(MySqlParser.STAR); + } + } + this.state = 3720; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3712; + this.match(MySqlParser.COMMA); + this.state = 3713; + this.tableName(); + this.state = 3716; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3714; + this.match(MySqlParser.DOT); + this.state = 3715; + this.match(MySqlParser.STAR); + } + } + } + } + this.state = 3722; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3723; + this.match(MySqlParser.KW_FROM); + this.state = 3724; + this.tableSources(); + } + break; + case MySqlParser.KW_FROM: + { + this.state = 3726; + this.match(MySqlParser.KW_FROM); + this.state = 3727; + this.tableName(); + this.state = 3730; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3728; + this.match(MySqlParser.DOT); + this.state = 3729; + this.match(MySqlParser.STAR); + } + } + this.state = 3740; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3732; + this.match(MySqlParser.COMMA); + this.state = 3733; + this.tableName(); + this.state = 3736; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3734; + this.match(MySqlParser.DOT); + this.state = 3735; + this.match(MySqlParser.STAR); + } + } + } + } + this.state = 3742; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3743; + this.match(MySqlParser.KW_USING); + this.state = 3744; + this.tableSources(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 3750; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3748; + this.match(MySqlParser.KW_WHERE); + this.state = 3749; + this.expression(0); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerOpenStatement() { + let localContext = new HandlerOpenStatementContext(this.context, this.state); + this.enterRule(localContext, 238, MySqlParser.RULE_handlerOpenStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3752; + this.match(MySqlParser.KW_HANDLER); + this.state = 3753; + this.tableName(); + this.state = 3754; + this.match(MySqlParser.KW_OPEN); + this.state = 3759; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 514, this.context)) { + case 1: + { + this.state = 3756; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3755; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3758; + localContext._table_alias = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerReadIndexStatement() { + let localContext = new HandlerReadIndexStatementContext(this.context, this.state); + this.enterRule(localContext, 240, MySqlParser.RULE_handlerReadIndexStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3761; + this.match(MySqlParser.KW_HANDLER); + this.state = 3762; + this.tableName(); + this.state = 3763; + this.match(MySqlParser.KW_READ); + this.state = 3764; + this.indexName(); + this.state = 3771; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.EQUAL_SYMBOL: + case MySqlParser.GREATER_SYMBOL: + case MySqlParser.LESS_SYMBOL: + { + this.state = 3765; + this.comparisonBase(); + this.state = 3766; + this.match(MySqlParser.LR_BRACKET); + this.state = 3767; + this.constants(); + this.state = 3768; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_FIRST: + case MySqlParser.KW_LAST: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_PREV: + { + this.state = 3770; + localContext._moveOrder = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 402 || _la === 445 || _la === 501 || _la === 542)) { + localContext._moveOrder = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 3775; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3773; + this.match(MySqlParser.KW_WHERE); + this.state = 3774; + this.expression(0); + } + } + this.state = 3779; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3777; + this.match(MySqlParser.KW_LIMIT); + this.state = 3778; + this.limitClauseAtom(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerReadStatement() { + let localContext = new HandlerReadStatementContext(this.context, this.state); + this.enterRule(localContext, 242, MySqlParser.RULE_handlerReadStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3781; + this.match(MySqlParser.KW_HANDLER); + this.state = 3782; + this.tableName(); + this.state = 3783; + this.match(MySqlParser.KW_READ); + this.state = 3784; + localContext._moveOrder = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 402 || _la === 501)) { + localContext._moveOrder = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3787; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3785; + this.match(MySqlParser.KW_WHERE); + this.state = 3786; + this.expression(0); + } + } + this.state = 3791; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3789; + this.match(MySqlParser.KW_LIMIT); + this.state = 3790; + this.limitClauseAtom(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerCloseStatement() { + let localContext = new HandlerCloseStatementContext(this.context, this.state); + this.enterRule(localContext, 244, MySqlParser.RULE_handlerCloseStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3793; + this.match(MySqlParser.KW_HANDLER); + this.state = 3794; + this.tableName(); + this.state = 3795; + this.match(MySqlParser.KW_CLOSE); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + importTableStatement() { + let localContext = new ImportTableStatementContext(this.context, this.state); + this.enterRule(localContext, 246, MySqlParser.RULE_importTableStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3797; + this.match(MySqlParser.KW_IMPORT); + this.state = 3798; + this.match(MySqlParser.KW_TABLE); + this.state = 3799; + this.match(MySqlParser.KW_FROM); + this.state = 3800; + this.stringLiteral(); + this.state = 3805; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3801; + this.match(MySqlParser.COMMA); + this.state = 3802; + this.stringLiteral(); + } + } + this.state = 3807; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + singleUpdateStatement() { + let localContext = new SingleUpdateStatementContext(this.context, this.state); + this.enterRule(localContext, 248, MySqlParser.RULE_singleUpdateStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3808; + this.match(MySqlParser.KW_UPDATE); + this.state = 3810; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3809; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3813; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3812; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3815; + this.tableName(); + this.state = 3820; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074311168) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 3817; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3816; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3819; + localContext._table_alias = this.uid(); + } + } + this.state = 3822; + this.match(MySqlParser.KW_SET); + this.state = 3823; + this.updatedElement(); + this.state = 3828; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3824; + this.match(MySqlParser.COMMA); + this.state = 3825; + this.updatedElement(); + } + } + this.state = 3830; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3833; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3831; + this.match(MySqlParser.KW_WHERE); + this.state = 3832; + this.expression(0); + } + } + this.state = 3836; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3835; + this.orderByClause(); + } + } + this.state = 3839; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3838; + this.limitClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + multipleUpdateStatement() { + let localContext = new MultipleUpdateStatementContext(this.context, this.state); + this.enterRule(localContext, 250, MySqlParser.RULE_multipleUpdateStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3841; + this.match(MySqlParser.KW_UPDATE); + this.state = 3843; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3842; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3846; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3845; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3848; + this.tableSources(); + this.state = 3849; + this.match(MySqlParser.KW_SET); + this.state = 3850; + this.updatedElement(); + this.state = 3855; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3851; + this.match(MySqlParser.COMMA); + this.state = 3852; + this.updatedElement(); + } + } + this.state = 3857; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3860; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3858; + this.match(MySqlParser.KW_WHERE); + this.state = 3859; + this.expression(0); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + orderByClause() { + let localContext = new OrderByClauseContext(this.context, this.state); + this.enterRule(localContext, 252, MySqlParser.RULE_orderByClause); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3862; + this.match(MySqlParser.KW_ORDER); + this.state = 3863; + this.match(MySqlParser.KW_BY); + this.state = 3864; + this.orderByExpression(); + this.state = 3869; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 533, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3865; + this.match(MySqlParser.COMMA); + this.state = 3866; + this.orderByExpression(); + } + } + } + this.state = 3871; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 533, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + orderByExpression() { + let localContext = new OrderByExpressionContext(this.context, this.state); + this.enterRule(localContext, 254, MySqlParser.RULE_orderByExpression); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3872; + this.expression(0); + this.state = 3874; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 534, this.context)) { + case 1: + { + this.state = 3873; + localContext._order = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45)) { + localContext._order = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableSources() { + let localContext = new TableSourcesContext(this.context, this.state); + this.enterRule(localContext, 256, MySqlParser.RULE_tableSources); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3876; + this.tableSource(); + this.state = 3881; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 535, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3877; + this.match(MySqlParser.COMMA); + this.state = 3878; + this.tableSource(); + } + } + } + this.state = 3883; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 535, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableSource() { + let localContext = new TableSourceContext(this.context, this.state); + this.enterRule(localContext, 258, MySqlParser.RULE_tableSource); + let _la; + try { + let alternative; + this.state = 3902; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 538, this.context)) { + case 1: + localContext = new TableSourceBaseContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3884; + this.tableSourceItem(); + this.state = 3888; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 536, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3885; + this.joinPart(); + } + } + } + this.state = 3890; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 536, this.context); + } + } + break; + case 2: + localContext = new TableSourceNestedContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3891; + this.match(MySqlParser.LR_BRACKET); + this.state = 3892; + this.tableSourceItem(); + this.state = 3896; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 35 || ((((_la - 84)) & ~0x1F) === 0 && ((1 << (_la - 84)) & 536887425) !== 0) || _la === 150 || _la === 172) { + { + { + this.state = 3893; + this.joinPart(); + } + } + this.state = 3898; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3899; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 3: + localContext = new TableJsonContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 3901; + this.jsonTable(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableSourceItem() { + let localContext = new TableSourceItemContext(this.context, this.state); + this.enterRule(localContext, 260, MySqlParser.RULE_tableSourceItem); + let _la; + try { + let alternative; + this.state = 3949; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 548, this.context)) { + case 1: + localContext = new AtomTableItemContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3904; + this.tableName(); + this.state = 3910; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 539, this.context)) { + case 1: + { + this.state = 3905; + this.match(MySqlParser.KW_PARTITION); + this.state = 3906; + this.match(MySqlParser.LR_BRACKET); + this.state = 3907; + this.partitionNames(); + this.state = 3908; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3916; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 541, this.context)) { + case 1: + { + this.state = 3913; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3912; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3915; + localContext._alias = this.uid(); + } + break; + } + this.state = 3926; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 543, this.context)) { + case 1: + { + this.state = 3918; + this.indexHint(); + this.state = 3923; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 542, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3919; + this.match(MySqlParser.COMMA); + this.state = 3920; + this.indexHint(); + } + } + } + this.state = 3925; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 542, this.context); + } + } + break; + } + } + break; + case 2: + localContext = new SubqueryTableItemContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3929; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 95) { + { + this.state = 3928; + this.match(MySqlParser.KW_LATERAL); + } + } + this.state = 3936; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 545, this.context)) { + case 1: + { + this.state = 3931; + this.selectStatement(); + } + break; + case 2: + { + this.state = 3932; + this.match(MySqlParser.LR_BRACKET); + this.state = 3933; + localContext._parenthesisSubquery = this.selectStatement(); + this.state = 3934; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3939; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3938; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3941; + localContext._alias = this.uid(); + this.state = 3943; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 547, this.context)) { + case 1: + { + this.state = 3942; + this.fullColumnNames(); + } + break; + } + } + break; + case 3: + localContext = new TableSourcesItemContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 3945; + this.match(MySqlParser.LR_BRACKET); + this.state = 3946; + this.tableSources(); + this.state = 3947; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fullColumnNames() { + let localContext = new FullColumnNamesContext(this.context, this.state); + this.enterRule(localContext, 262, MySqlParser.RULE_fullColumnNames); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3951; + this.match(MySqlParser.LR_BRACKET); + this.state = 3952; + this.columnNames(); + this.state = 3953; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexHint() { + let localContext = new IndexHintContext(this.context, this.state); + this.enterRule(localContext, 264, MySqlParser.RULE_indexHint); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3955; + localContext._indexHintAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 66 || _la === 79 || _la === 187)) { + localContext._indexHintAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3956; + localContext._keyFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._keyFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3959; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 3957; + this.match(MySqlParser.KW_FOR); + this.state = 3958; + this.indexHintType(); + } + } + this.state = 3961; + this.match(MySqlParser.LR_BRACKET); + this.state = 3963; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 3962; + this.indexNames(); + } + } + this.state = 3965; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexHintType() { + let localContext = new IndexHintTypeContext(this.context, this.state); + this.enterRule(localContext, 266, MySqlParser.RULE_indexHintType); + try { + this.state = 3972; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_JOIN: + this.enterOuterAlt(localContext, 1); + { + this.state = 3967; + this.match(MySqlParser.KW_JOIN); + } + break; + case MySqlParser.KW_ORDER: + this.enterOuterAlt(localContext, 2); + { + this.state = 3968; + this.match(MySqlParser.KW_ORDER); + this.state = 3969; + this.match(MySqlParser.KW_BY); + } + break; + case MySqlParser.KW_GROUP: + this.enterOuterAlt(localContext, 3); + { + this.state = 3970; + this.match(MySqlParser.KW_GROUP); + this.state = 3971; + this.match(MySqlParser.KW_BY); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + joinPart() { + let localContext = new JoinPartContext(this.context, this.state); + this.enterRule(localContext, 268, MySqlParser.RULE_joinPart); + let _la; + try { + let alternative; + this.state = 4023; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CROSS: + case MySqlParser.KW_INNER: + case MySqlParser.KW_JOIN: + localContext = new InnerJoinContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3975; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 35 || _la === 84) { + { + this.state = 3974; + _la = this.tokenStream.LA(1); + if (!(_la === 35 || _la === 84)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3977; + this.match(MySqlParser.KW_JOIN); + this.state = 3979; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 553, this.context)) { + case 1: + { + this.state = 3978; + this.match(MySqlParser.KW_LATERAL); + } + break; + } + this.state = 3981; + this.tableSourceItem(); + this.state = 3985; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 554, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3982; + this.joinSpec(); + } + } + } + this.state = 3987; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 554, this.context); + } + } + break; + case MySqlParser.KW_STRAIGHT_JOIN: + localContext = new StraightJoinContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3988; + this.match(MySqlParser.KW_STRAIGHT_JOIN); + this.state = 3989; + this.tableSourceItem(); + this.state = 3993; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 555, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3990; + this.joinSpec(); + } + } + } + this.state = 3995; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 555, this.context); + } + } + break; + case MySqlParser.KW_LEFT: + case MySqlParser.KW_RIGHT: + localContext = new OuterJoinContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 3996; + _la = this.tokenStream.LA(1); + if (!(_la === 98 || _la === 150)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3998; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 127) { + { + this.state = 3997; + this.match(MySqlParser.KW_OUTER); + } + } + this.state = 4000; + this.match(MySqlParser.KW_JOIN); + this.state = 4002; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 557, this.context)) { + case 1: + { + this.state = 4001; + this.match(MySqlParser.KW_LATERAL); + } + break; + } + this.state = 4004; + this.tableSourceItem(); + this.state = 4008; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 558, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4005; + this.joinSpec(); + } + } + } + this.state = 4010; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 558, this.context); + } + } + break; + case MySqlParser.KW_NATURAL: + localContext = new NaturalJoinContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4011; + this.match(MySqlParser.KW_NATURAL); + this.state = 4019; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 84 || _la === 98 || _la === 150) { + { + this.state = 4014; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_INNER: + { + this.state = 4012; + this.match(MySqlParser.KW_INNER); + } + break; + case MySqlParser.KW_LEFT: + case MySqlParser.KW_RIGHT: + { + this.state = 4013; + _la = this.tokenStream.LA(1); + if (!(_la === 98 || _la === 150)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4017; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 127) { + { + this.state = 4016; + this.match(MySqlParser.KW_OUTER); + } + } + } + } + this.state = 4021; + this.match(MySqlParser.KW_JOIN); + this.state = 4022; + this.tableSourceItem(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + joinSpec() { + let localContext = new JoinSpecContext(this.context, this.state); + this.enterRule(localContext, 270, MySqlParser.RULE_joinSpec); + try { + this.state = 4032; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ON: + this.enterOuterAlt(localContext, 1); + { + { + this.state = 4025; + this.match(MySqlParser.KW_ON); + this.state = 4026; + this.expression(0); + } + } + break; + case MySqlParser.KW_USING: + this.enterOuterAlt(localContext, 2); + { + this.state = 4027; + this.match(MySqlParser.KW_USING); + this.state = 4028; + this.match(MySqlParser.LR_BRACKET); + this.state = 4029; + this.columnNames(); + this.state = 4030; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + queryExpression() { + let localContext = new QueryExpressionContext(this.context, this.state); + this.enterRule(localContext, 272, MySqlParser.RULE_queryExpression); + try { + this.state = 4042; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 564, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4034; + this.match(MySqlParser.LR_BRACKET); + this.state = 4035; + this.querySpecification(); + this.state = 4036; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4038; + this.match(MySqlParser.LR_BRACKET); + this.state = 4039; + this.queryExpression(); + this.state = 4040; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + querySpecification() { + let localContext = new QuerySpecificationContext(this.context, this.state); + this.enterRule(localContext, 274, MySqlParser.RULE_querySpecification); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4044; + this.match(MySqlParser.KW_SELECT); + this.state = 4048; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 565, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4045; + this.selectSpec(); + } + } + } + this.state = 4050; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 565, this.context); + } + this.state = 4051; + this.selectElements(); + this.state = 4053; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 566, this.context)) { + case 1: + { + this.state = 4052; + this.intoClause(); + } + break; + } + this.state = 4055; + this.fromClause(); + this.state = 4057; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 567, this.context)) { + case 1: + { + this.state = 4056; + this.groupByClause(); + } + break; + } + this.state = 4060; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 568, this.context)) { + case 1: + { + this.state = 4059; + this.havingClause(); + } + break; + } + this.state = 4063; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 569, this.context)) { + case 1: + { + this.state = 4062; + this.windowClause(); + } + break; + } + this.state = 4066; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 570, this.context)) { + case 1: + { + this.state = 4065; + this.orderByClause(); + } + break; + } + this.state = 4069; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 571, this.context)) { + case 1: + { + this.state = 4068; + this.limitClause(); + } + break; + } + this.state = 4072; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 572, this.context)) { + case 1: + { + this.state = 4071; + this.intoClause(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + unionStatement() { + let localContext = new UnionStatementContext(this.context, this.state); + this.enterRule(localContext, 276, MySqlParser.RULE_unionStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4074; + this.match(MySqlParser.KW_UNION); + this.state = 4076; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 4075; + localContext._unionType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._unionType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 4080; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + { + this.state = 4078; + this.querySpecification(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 4079; + this.queryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lateralStatement() { + let localContext = new LateralStatementContext(this.context, this.state); + this.enterRule(localContext, 278, MySqlParser.RULE_lateralStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4082; + this.match(MySqlParser.KW_LATERAL); + this.state = 4097; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 578, this.context)) { + case 1: + { + this.state = 4083; + this.querySpecification(); + } + break; + case 2: + { + this.state = 4084; + this.queryExpression(); + } + break; + case 3: + { + { + this.state = 4085; + this.match(MySqlParser.LR_BRACKET); + this.state = 4088; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + { + this.state = 4086; + this.querySpecification(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 4087; + this.queryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4090; + this.match(MySqlParser.RR_BRACKET); + this.state = 4095; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 577, this.context)) { + case 1: + { + this.state = 4092; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4091; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4094; + localContext._alias = this.uid(); + } + break; + } + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonTable() { + let localContext = new JsonTableContext(this.context, this.state); + this.enterRule(localContext, 280, MySqlParser.RULE_jsonTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4099; + this.match(MySqlParser.KW_JSON_TABLE); + this.state = 4100; + this.match(MySqlParser.LR_BRACKET); + this.state = 4101; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4102; + this.match(MySqlParser.COMMA); + this.state = 4103; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4104; + this.match(MySqlParser.KW_COLUMNS); + this.state = 4105; + this.match(MySqlParser.LR_BRACKET); + this.state = 4106; + this.jsonColumnList(); + this.state = 4107; + this.match(MySqlParser.RR_BRACKET); + this.state = 4108; + this.match(MySqlParser.RR_BRACKET); + this.state = 4113; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 580, this.context)) { + case 1: + { + this.state = 4110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4109; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4112; + localContext._alias = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonColumnList() { + let localContext = new JsonColumnListContext(this.context, this.state); + this.enterRule(localContext, 282, MySqlParser.RULE_jsonColumnList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4115; + this.jsonColumn(); + this.state = 4120; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4116; + this.match(MySqlParser.COMMA); + this.state = 4117; + this.jsonColumn(); + } + } + this.state = 4122; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonColumn() { + let localContext = new JsonColumnContext(this.context, this.state); + this.enterRule(localContext, 284, MySqlParser.RULE_jsonColumn); + let _la; + try { + this.state = 4152; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 587, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4123; + this.columnName(); + this.state = 4140; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FOR: + { + this.state = 4124; + this.match(MySqlParser.KW_FOR); + this.state = 4125; + this.match(MySqlParser.KW_ORDINALITY); + } + break; + case MySqlParser.KW_CHARACTER: + case MySqlParser.KW_SET: + case MySqlParser.KW_TINYINT: + case MySqlParser.KW_SMALLINT: + case MySqlParser.KW_MEDIUMINT: + case MySqlParser.KW_MIDDLEINT: + case MySqlParser.KW_INT: + case MySqlParser.KW_INT1: + case MySqlParser.KW_INT2: + case MySqlParser.KW_INT3: + case MySqlParser.KW_INT4: + case MySqlParser.KW_INT8: + case MySqlParser.KW_INTEGER: + case MySqlParser.KW_BIGINT: + case MySqlParser.KW_REAL: + case MySqlParser.KW_DOUBLE: + case MySqlParser.KW_FLOAT: + case MySqlParser.KW_FLOAT4: + case MySqlParser.KW_FLOAT8: + case MySqlParser.KW_DECIMAL: + case MySqlParser.KW_DEC: + case MySqlParser.KW_NUMERIC: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_CHAR: + case MySqlParser.KW_VARCHAR: + case MySqlParser.KW_NVARCHAR: + case MySqlParser.KW_NATIONAL: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_VARBINARY: + case MySqlParser.KW_TINYBLOB: + case MySqlParser.KW_BLOB: + case MySqlParser.KW_MEDIUMBLOB: + case MySqlParser.KW_LONG: + case MySqlParser.KW_LONGBLOB: + case MySqlParser.KW_TINYTEXT: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_MEDIUMTEXT: + case MySqlParser.KW_LONGTEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_JSON: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_GEOMCOLLECTION: + case MySqlParser.KW_GEOMETRY: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + { + this.state = 4126; + this.dataType(); + this.state = 4138; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PATH: + { + this.state = 4127; + this.match(MySqlParser.KW_PATH); + this.state = 4128; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4130; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 582, this.context)) { + case 1: + { + this.state = 4129; + this.jsonOnEmpty(); + } + break; + } + this.state = 4133; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42 || _la === 116 || _la === 382) { + { + this.state = 4132; + this.jsonOnError(); + } + } + } + break; + case MySqlParser.KW_EXISTS: + { + this.state = 4135; + this.match(MySqlParser.KW_EXISTS); + this.state = 4136; + this.match(MySqlParser.KW_PATH); + this.state = 4137; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4142; + this.match(MySqlParser.KW_NESTED); + this.state = 4144; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 257) { + { + this.state = 4143; + this.match(MySqlParser.KW_PATH); + } + } + this.state = 4146; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4147; + this.match(MySqlParser.KW_COLUMNS); + this.state = 4148; + this.match(MySqlParser.LR_BRACKET); + this.state = 4149; + this.jsonColumnList(); + this.state = 4150; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonOnEmpty() { + let localContext = new JsonOnEmptyContext(this.context, this.state); + this.enterRule(localContext, 286, MySqlParser.RULE_jsonOnEmpty); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4158; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NULL_LITERAL: + { + this.state = 4154; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case MySqlParser.KW_ERROR: + { + this.state = 4155; + this.match(MySqlParser.KW_ERROR); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 4156; + this.match(MySqlParser.KW_DEFAULT); + this.state = 4157; + this.defaultValue(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4160; + this.match(MySqlParser.KW_ON); + this.state = 4161; + this.match(MySqlParser.KW_EMPTY); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonOnError() { + let localContext = new JsonOnErrorContext(this.context, this.state); + this.enterRule(localContext, 288, MySqlParser.RULE_jsonOnError); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4167; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NULL_LITERAL: + { + this.state = 4163; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case MySqlParser.KW_ERROR: + { + this.state = 4164; + this.match(MySqlParser.KW_ERROR); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 4165; + this.match(MySqlParser.KW_DEFAULT); + this.state = 4166; + this.defaultValue(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4169; + this.match(MySqlParser.KW_ON); + this.state = 4170; + this.match(MySqlParser.KW_ERROR); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectSpec() { + let localContext = new SelectSpecContext(this.context, this.state); + this.enterRule(localContext, 290, MySqlParser.RULE_selectSpec); + let _la; + try { + this.state = 4180; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALL: + case MySqlParser.KW_DISTINCT: + case MySqlParser.KW_DISTINCTROW: + this.enterOuterAlt(localContext, 1); + { + this.state = 4172; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49 || _la === 50)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_HIGH_PRIORITY: + this.enterOuterAlt(localContext, 2); + { + this.state = 4173; + this.match(MySqlParser.KW_HIGH_PRIORITY); + } + break; + case MySqlParser.KW_STRAIGHT_JOIN: + this.enterOuterAlt(localContext, 3); + { + this.state = 4174; + this.match(MySqlParser.KW_STRAIGHT_JOIN); + } + break; + case MySqlParser.KW_SQL_SMALL_RESULT: + this.enterOuterAlt(localContext, 4); + { + this.state = 4175; + this.match(MySqlParser.KW_SQL_SMALL_RESULT); + } + break; + case MySqlParser.KW_SQL_BIG_RESULT: + this.enterOuterAlt(localContext, 5); + { + this.state = 4176; + this.match(MySqlParser.KW_SQL_BIG_RESULT); + } + break; + case MySqlParser.KW_SQL_BUFFER_RESULT: + this.enterOuterAlt(localContext, 6); + { + this.state = 4177; + this.match(MySqlParser.KW_SQL_BUFFER_RESULT); + } + break; + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + this.enterOuterAlt(localContext, 7); + { + this.state = 4178; + _la = this.tokenStream.LA(1); + if (!(_la === 637 || _la === 638)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_SQL_CALC_FOUND_ROWS: + this.enterOuterAlt(localContext, 8); + { + this.state = 4179; + this.match(MySqlParser.KW_SQL_CALC_FOUND_ROWS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectElements() { + let localContext = new SelectElementsContext(this.context, this.state); + this.enterRule(localContext, 292, MySqlParser.RULE_selectElements); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4184; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 591, this.context)) { + case 1: + { + this.state = 4182; + localContext._star = this.match(MySqlParser.STAR); + } + break; + case 2: + { + this.state = 4183; + this.selectElement(); + } + break; + } + this.state = 4190; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 592, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4186; + this.match(MySqlParser.COMMA); + this.state = 4187; + this.selectElement(); + } + } + } + this.state = 4192; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 592, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectElement() { + let localContext = new SelectElementContext(this.context, this.state); + this.enterRule(localContext, 294, MySqlParser.RULE_selectElement); + let _la; + try { + this.state = 4222; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 600, this.context)) { + case 1: + localContext = new SelectExpressionElementContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4195; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 593, this.context)) { + case 1: + { + this.state = 4193; + this.match(MySqlParser.LOCAL_ID); + this.state = 4194; + this.match(MySqlParser.VAR_ASSIGN); + } + break; + } + this.state = 4197; + this.expression(0); + this.state = 4202; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 595, this.context)) { + case 1: + { + this.state = 4199; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4198; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4201; + localContext._alias = this.uid(); + } + break; + } + } + break; + case 2: + localContext = new SelectFunctionElementContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4204; + this.functionCall(); + this.state = 4209; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 597, this.context)) { + case 1: + { + this.state = 4206; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4205; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4208; + localContext._alias = this.uid(); + } + break; + } + } + break; + case 3: + localContext = new SelectStarElementContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4211; + localContext._select_element = this.fullId(); + this.state = 4212; + this.match(MySqlParser.DOT); + this.state = 4213; + this.match(MySqlParser.STAR); + } + break; + case 4: + localContext = new SelectColumnElementContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4215; + this.columnName(); + this.state = 4220; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 599, this.context)) { + case 1: + { + this.state = 4217; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4216; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4219; + localContext._alias = this.uid(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intoClause() { + let localContext = new IntoClauseContext(this.context, this.state); + this.enterRule(localContext, 296, MySqlParser.RULE_intoClause); + let _la; + try { + let alternative; + this.state = 4260; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 607, this.context)) { + case 1: + localContext = new SelectIntoVariablesContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4224; + this.match(MySqlParser.KW_INTO); + this.state = 4225; + this.assignmentField(); + this.state = 4230; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 601, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4226; + this.match(MySqlParser.COMMA); + this.state = 4227; + this.assignmentField(); + } + } + } + this.state = 4232; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 601, this.context); + } + } + break; + case 2: + localContext = new SelectIntoDumpFileContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4233; + this.match(MySqlParser.KW_INTO); + this.state = 4234; + this.match(MySqlParser.KW_DUMPFILE); + this.state = 4235; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 3: + localContext = new SelectIntoTextFileContext(localContext); + this.enterOuterAlt(localContext, 3); + { + { + this.state = 4236; + this.match(MySqlParser.KW_INTO); + this.state = 4237; + this.match(MySqlParser.KW_OUTFILE); + this.state = 4238; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + this.state = 4242; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 602, this.context)) { + case 1: + { + this.state = 4239; + this.match(MySqlParser.KW_CHARACTER); + this.state = 4240; + this.match(MySqlParser.KW_SET); + this.state = 4241; + localContext._charset = this.charsetName(); + } + break; + } + this.state = 4250; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 604, this.context)) { + case 1: + { + this.state = 4244; + localContext._fieldsFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 337 || _la === 398)) { + localContext._fieldsFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4246; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4245; + this.selectFieldsInto(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4248; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 603, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + } + this.state = 4258; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 606, this.context)) { + case 1: + { + this.state = 4252; + this.match(MySqlParser.KW_LINES); + this.state = 4254; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4253; + this.selectLinesInto(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4256; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 605, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectFieldsInto() { + let localContext = new SelectFieldsIntoContext(this.context, this.state); + this.enterRule(localContext, 298, MySqlParser.RULE_selectFieldsInto); + let _la; + try { + this.state = 4274; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TERMINATED: + this.enterOuterAlt(localContext, 1); + { + this.state = 4262; + this.match(MySqlParser.KW_TERMINATED); + this.state = 4263; + this.match(MySqlParser.KW_BY); + this.state = 4264; + localContext._terminationField = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ENCLOSED: + case MySqlParser.KW_OPTIONALLY: + this.enterOuterAlt(localContext, 2); + { + this.state = 4266; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 123) { + { + this.state = 4265; + this.match(MySqlParser.KW_OPTIONALLY); + } + } + this.state = 4268; + this.match(MySqlParser.KW_ENCLOSED); + this.state = 4269; + this.match(MySqlParser.KW_BY); + this.state = 4270; + localContext._enclosion = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ESCAPED: + this.enterOuterAlt(localContext, 3); + { + this.state = 4271; + this.match(MySqlParser.KW_ESCAPED); + this.state = 4272; + this.match(MySqlParser.KW_BY); + this.state = 4273; + localContext._escaping = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectLinesInto() { + let localContext = new SelectLinesIntoContext(this.context, this.state); + this.enterRule(localContext, 300, MySqlParser.RULE_selectLinesInto); + try { + this.state = 4282; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_STARTING: + this.enterOuterAlt(localContext, 1); + { + this.state = 4276; + this.match(MySqlParser.KW_STARTING); + this.state = 4277; + this.match(MySqlParser.KW_BY); + this.state = 4278; + localContext._starting = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_TERMINATED: + this.enterOuterAlt(localContext, 2); + { + this.state = 4279; + this.match(MySqlParser.KW_TERMINATED); + this.state = 4280; + this.match(MySqlParser.KW_BY); + this.state = 4281; + localContext._terminationLine = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fromClause() { + let localContext = new FromClauseContext(this.context, this.state); + this.enterRule(localContext, 302, MySqlParser.RULE_fromClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4286; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 611, this.context)) { + case 1: + { + this.state = 4284; + this.match(MySqlParser.KW_FROM); + this.state = 4285; + this.tableSources(); + } + break; + } + this.state = 4290; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 612, this.context)) { + case 1: + { + this.state = 4288; + this.match(MySqlParser.KW_WHERE); + this.state = 4289; + localContext._whereExpr = this.expression(0); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupByClause() { + let localContext = new GroupByClauseContext(this.context, this.state); + this.enterRule(localContext, 304, MySqlParser.RULE_groupByClause); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4292; + this.match(MySqlParser.KW_GROUP); + this.state = 4293; + this.match(MySqlParser.KW_BY); + this.state = 4294; + this.groupByItem(); + this.state = 4299; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 613, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4295; + this.match(MySqlParser.COMMA); + this.state = 4296; + this.groupByItem(); + } + } + } + this.state = 4301; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 613, this.context); + } + this.state = 4304; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 614, this.context)) { + case 1: + { + this.state = 4302; + this.match(MySqlParser.KW_WITH); + this.state = 4303; + this.match(MySqlParser.KW_ROLLUP); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + havingClause() { + let localContext = new HavingClauseContext(this.context, this.state); + this.enterRule(localContext, 306, MySqlParser.RULE_havingClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4306; + this.match(MySqlParser.KW_HAVING); + this.state = 4307; + localContext._havingExpr = this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + windowClause() { + let localContext = new WindowClauseContext(this.context, this.state); + this.enterRule(localContext, 308, MySqlParser.RULE_windowClause); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4309; + this.match(MySqlParser.KW_WINDOW); + this.state = 4310; + this.windowName(); + this.state = 4311; + this.match(MySqlParser.KW_AS); + this.state = 4312; + this.match(MySqlParser.LR_BRACKET); + this.state = 4313; + this.windowSpec(); + this.state = 4314; + this.match(MySqlParser.RR_BRACKET); + this.state = 4324; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 615, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4315; + this.match(MySqlParser.COMMA); + this.state = 4316; + this.windowName(); + this.state = 4317; + this.match(MySqlParser.KW_AS); + this.state = 4318; + this.match(MySqlParser.LR_BRACKET); + this.state = 4319; + this.windowSpec(); + this.state = 4320; + this.match(MySqlParser.RR_BRACKET); + } + } + } + this.state = 4326; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 615, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupByItem() { + let localContext = new GroupByItemContext(this.context, this.state); + this.enterRule(localContext, 310, MySqlParser.RULE_groupByItem); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4327; + this.expression(0); + this.state = 4329; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 616, this.context)) { + case 1: + { + this.state = 4328; + localContext._order = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45)) { + localContext._order = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + limitClause() { + let localContext = new LimitClauseContext(this.context, this.state); + this.enterRule(localContext, 312, MySqlParser.RULE_limitClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4331; + this.match(MySqlParser.KW_LIMIT); + this.state = 4342; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 618, this.context)) { + case 1: + { + this.state = 4335; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 617, this.context)) { + case 1: + { + this.state = 4332; + localContext._offset = this.limitClauseAtom(); + this.state = 4333; + this.match(MySqlParser.COMMA); + } + break; + } + this.state = 4337; + localContext._limit = this.limitClauseAtom(); + } + break; + case 2: + { + this.state = 4338; + localContext._limit = this.limitClauseAtom(); + this.state = 4339; + this.match(MySqlParser.KW_OFFSET); + this.state = 4340; + localContext._offset = this.limitClauseAtom(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + limitClauseAtom() { + let localContext = new LimitClauseAtomContext(this.context, this.state); + this.enterRule(localContext, 314, MySqlParser.RULE_limitClauseAtom); + try { + this.state = 4347; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 4344; + this.decimalLiteral(); + } + break; + case MySqlParser.LOCAL_ID: + case MySqlParser.GLOBAL_ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 4345; + this.mysqlVariable(); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 3); + { + this.state = 4346; + this.simpleId(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + startTransaction() { + let localContext = new StartTransactionContext(this.context, this.state); + this.enterRule(localContext, 316, MySqlParser.RULE_startTransaction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4349; + this.match(MySqlParser.KW_START); + this.state = 4350; + this.match(MySqlParser.KW_TRANSACTION); + this.state = 4359; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 621, this.context)) { + case 1: + { + this.state = 4351; + this.transactionMode(); + this.state = 4356; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4352; + this.match(MySqlParser.COMMA); + this.state = 4353; + this.transactionMode(); + } + } + this.state = 4358; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + beginWork() { + let localContext = new BeginWorkContext(this.context, this.state); + this.enterRule(localContext, 318, MySqlParser.RULE_beginWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4361; + this.match(MySqlParser.KW_BEGIN); + this.state = 4363; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4362; + this.match(MySqlParser.KW_WORK); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + commitWork() { + let localContext = new CommitWorkContext(this.context, this.state); + this.enterRule(localContext, 320, MySqlParser.RULE_commitWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4365; + this.match(MySqlParser.KW_COMMIT); + this.state = 4367; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4366; + this.match(MySqlParser.KW_WORK); + } + } + this.state = 4374; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 4369; + this.match(MySqlParser.KW_AND); + this.state = 4371; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4370; + localContext._nochain = this.match(MySqlParser.KW_NO); + } + } + this.state = 4373; + this.match(MySqlParser.KW_CHAIN); + } + } + this.state = 4380; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 627, this.context)) { + case 1: + { + this.state = 4377; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4376; + localContext._norelease = this.match(MySqlParser.KW_NO); + } + } + this.state = 4379; + this.match(MySqlParser.KW_RELEASE); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + rollbackWork() { + let localContext = new RollbackWorkContext(this.context, this.state); + this.enterRule(localContext, 322, MySqlParser.RULE_rollbackWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4382; + this.match(MySqlParser.KW_ROLLBACK); + this.state = 4384; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4383; + this.match(MySqlParser.KW_WORK); + } + } + this.state = 4391; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 4386; + this.match(MySqlParser.KW_AND); + this.state = 4388; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4387; + localContext._nochain = this.match(MySqlParser.KW_NO); + } + } + this.state = 4390; + this.match(MySqlParser.KW_CHAIN); + } + } + this.state = 4397; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 632, this.context)) { + case 1: + { + this.state = 4394; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4393; + localContext._norelease = this.match(MySqlParser.KW_NO); + } + } + this.state = 4396; + this.match(MySqlParser.KW_RELEASE); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + savepointStatement() { + let localContext = new SavepointStatementContext(this.context, this.state); + this.enterRule(localContext, 324, MySqlParser.RULE_savepointStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4399; + this.match(MySqlParser.KW_SAVEPOINT); + this.state = 4400; + localContext._identifier = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + rollbackStatement() { + let localContext = new RollbackStatementContext(this.context, this.state); + this.enterRule(localContext, 326, MySqlParser.RULE_rollbackStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4402; + this.match(MySqlParser.KW_ROLLBACK); + this.state = 4404; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4403; + this.match(MySqlParser.KW_WORK); + } + } + this.state = 4406; + this.match(MySqlParser.KW_TO); + this.state = 4408; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 634, this.context)) { + case 1: + { + this.state = 4407; + this.match(MySqlParser.KW_SAVEPOINT); + } + break; + } + this.state = 4410; + localContext._identifier = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + releaseStatement() { + let localContext = new ReleaseStatementContext(this.context, this.state); + this.enterRule(localContext, 328, MySqlParser.RULE_releaseStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4412; + this.match(MySqlParser.KW_RELEASE); + this.state = 4413; + this.match(MySqlParser.KW_SAVEPOINT); + this.state = 4414; + localContext._identifier = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockTables() { + let localContext = new LockTablesContext(this.context, this.state); + this.enterRule(localContext, 330, MySqlParser.RULE_lockTables); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4416; + this.match(MySqlParser.KW_LOCK); + this.state = 4417; + _la = this.tokenStream.LA(1); + if (!(_la === 173 || _la === 752)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4418; + this.lockTableElement(); + this.state = 4423; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4419; + this.match(MySqlParser.COMMA); + this.state = 4420; + this.lockTableElement(); + } + } + this.state = 4425; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + unlockTables() { + let localContext = new UnlockTablesContext(this.context, this.state); + this.enterRule(localContext, 332, MySqlParser.RULE_unlockTables); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4426; + this.match(MySqlParser.KW_UNLOCK); + this.state = 4427; + this.match(MySqlParser.KW_TABLES); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setAutocommitStatement() { + let localContext = new SetAutocommitStatementContext(this.context, this.state); + this.enterRule(localContext, 334, MySqlParser.RULE_setAutocommitStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4429; + this.match(MySqlParser.KW_SET); + this.state = 4430; + this.match(MySqlParser.KW_AUTOCOMMIT); + this.state = 4431; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4432; + localContext._autocommitValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._autocommitValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setTransactionStatement() { + let localContext = new SetTransactionStatementContext(this.context, this.state); + this.enterRule(localContext, 336, MySqlParser.RULE_setTransactionStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4434; + this.match(MySqlParser.KW_SET); + this.state = 4436; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 413 || _la === 593) { + { + this.state = 4435; + localContext._transactionContext = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 593)) { + localContext._transactionContext = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 4438; + this.match(MySqlParser.KW_TRANSACTION); + this.state = 4439; + this.transactionOption(); + this.state = 4444; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4440; + this.match(MySqlParser.COMMA); + this.state = 4441; + this.transactionOption(); + } + } + this.state = 4446; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionMode() { + let localContext = new TransactionModeContext(this.context, this.state); + this.enterRule(localContext, 338, MySqlParser.RULE_transactionMode); + try { + this.state = 4454; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 638, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4447; + this.match(MySqlParser.KW_WITH); + this.state = 4448; + this.match(MySqlParser.KW_CONSISTENT); + this.state = 4449; + this.match(MySqlParser.KW_SNAPSHOT); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4450; + this.match(MySqlParser.KW_READ); + this.state = 4451; + this.match(MySqlParser.KW_WRITE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 4452; + this.match(MySqlParser.KW_READ); + this.state = 4453; + this.match(MySqlParser.KW_ONLY); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockTableElement() { + let localContext = new LockTableElementContext(this.context, this.state); + this.enterRule(localContext, 340, MySqlParser.RULE_lockTableElement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4456; + this.tableName(); + this.state = 4461; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074311168) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4458; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4457; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4460; + localContext._alias = this.uid(); + } + } + this.state = 4463; + this.lockAction(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockAction() { + let localContext = new LockActionContext(this.context, this.state); + this.enterRule(localContext, 342, MySqlParser.RULE_lockAction); + let _la; + try { + this.state = 4473; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_READ: + this.enterOuterAlt(localContext, 1); + { + this.state = 4465; + this.match(MySqlParser.KW_READ); + this.state = 4467; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 450) { + { + this.state = 4466; + this.match(MySqlParser.KW_LOCAL); + } + } + } + break; + case MySqlParser.KW_LOW_PRIORITY: + case MySqlParser.KW_WRITE: + this.enterOuterAlt(localContext, 2); + { + this.state = 4470; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 4469; + this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 4472; + this.match(MySqlParser.KW_WRITE); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionOption() { + let localContext = new TransactionOptionContext(this.context, this.state); + this.enterRule(localContext, 344, MySqlParser.RULE_transactionOption); + try { + this.state = 4482; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 644, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4475; + this.match(MySqlParser.KW_ISOLATION); + this.state = 4476; + this.match(MySqlParser.KW_LEVEL); + this.state = 4477; + this.transactionLevel(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4478; + this.match(MySqlParser.KW_READ); + this.state = 4479; + this.match(MySqlParser.KW_WRITE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 4480; + this.match(MySqlParser.KW_READ); + this.state = 4481; + this.match(MySqlParser.KW_ONLY); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionLevel() { + let localContext = new TransactionLevelContext(this.context, this.state); + this.enterRule(localContext, 346, MySqlParser.RULE_transactionLevel); + try { + this.state = 4491; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 645, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4484; + this.match(MySqlParser.KW_REPEATABLE); + this.state = 4485; + this.match(MySqlParser.KW_READ); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4486; + this.match(MySqlParser.KW_READ); + this.state = 4487; + this.match(MySqlParser.KW_COMMITTED); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 4488; + this.match(MySqlParser.KW_READ); + this.state = 4489; + this.match(MySqlParser.KW_UNCOMMITTED); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 4490; + this.match(MySqlParser.KW_SERIALIZABLE); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + changeMaster() { + let localContext = new ChangeMasterContext(this.context, this.state); + this.enterRule(localContext, 348, MySqlParser.RULE_changeMaster); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4493; + this.match(MySqlParser.KW_CHANGE); + this.state = 4494; + this.match(MySqlParser.KW_MASTER); + this.state = 4495; + this.match(MySqlParser.KW_TO); + this.state = 4496; + this.masterOption(); + this.state = 4501; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4497; + this.match(MySqlParser.COMMA); + this.state = 4498; + this.masterOption(); + } + } + this.state = 4503; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4505; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4504; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + changeReplicationFilter() { + let localContext = new ChangeReplicationFilterContext(this.context, this.state); + this.enterRule(localContext, 350, MySqlParser.RULE_changeReplicationFilter); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4507; + this.match(MySqlParser.KW_CHANGE); + this.state = 4508; + this.match(MySqlParser.KW_REPLICATION); + this.state = 4509; + this.match(MySqlParser.KW_FILTER); + this.state = 4510; + this.replicationFilter(); + this.state = 4515; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4511; + this.match(MySqlParser.COMMA); + this.state = 4512; + this.replicationFilter(); + } + } + this.state = 4517; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4519; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4518; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + changeReplicationSource() { + let localContext = new ChangeReplicationSourceContext(this.context, this.state); + this.enterRule(localContext, 352, MySqlParser.RULE_changeReplicationSource); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4521; + this.match(MySqlParser.KW_CHANGE); + this.state = 4522; + this.match(MySqlParser.KW_REPLICATION); + this.state = 4523; + this.match(MySqlParser.KW_SOURCE); + this.state = 4524; + this.match(MySqlParser.KW_TO); + this.state = 4525; + this.replicationSourceOption(); + this.state = 4530; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4526; + this.match(MySqlParser.COMMA); + this.state = 4527; + this.replicationSourceOption(); + } + } + this.state = 4532; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4534; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4533; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + purgeBinaryLogs() { + let localContext = new PurgeBinaryLogsContext(this.context, this.state); + this.enterRule(localContext, 354, MySqlParser.RULE_purgeBinaryLogs); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4536; + this.match(MySqlParser.KW_PURGE); + this.state = 4537; + localContext._purgeFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 228 || _la === 453)) { + localContext._purgeFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4538; + this.match(MySqlParser.KW_LOGS); + this.state = 4543; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TO: + { + this.state = 4539; + this.match(MySqlParser.KW_TO); + this.state = 4540; + localContext._fileName = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_BEFORE: + { + this.state = 4541; + this.match(MySqlParser.KW_BEFORE); + this.state = 4542; + localContext._timeValue = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + startSlaveOrReplica() { + let localContext = new StartSlaveOrReplicaContext(this.context, this.state); + this.enterRule(localContext, 356, MySqlParser.RULE_startSlaveOrReplica); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4545; + this.match(MySqlParser.KW_START); + this.state = 4546; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4555; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 438 || _la === 639) { + { + this.state = 4547; + this.threadType(); + this.state = 4552; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4548; + this.match(MySqlParser.COMMA); + this.state = 4549; + this.threadType(); + } + } + this.state = 4554; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4559; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 676) { + { + this.state = 4557; + this.match(MySqlParser.KW_UNTIL); + this.state = 4558; + this.untilOption(); + } + } + this.state = 4564; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 363 || _la === 529 || _la === 535 || _la === 678) { + { + { + this.state = 4561; + this.connectionOptions(); + } + } + this.state = 4566; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4568; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4567; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stopSlaveOrReplica() { + let localContext = new StopSlaveOrReplicaContext(this.context, this.state); + this.enterRule(localContext, 358, MySqlParser.RULE_stopSlaveOrReplica); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4570; + this.match(MySqlParser.KW_STOP); + this.state = 4571; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4580; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 438 || _la === 639) { + { + this.state = 4572; + this.threadType(); + this.state = 4577; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4573; + this.match(MySqlParser.COMMA); + this.state = 4574; + this.threadType(); + } + } + this.state = 4579; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4583; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4582; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + startGroupReplication() { + let localContext = new StartGroupReplicationContext(this.context, this.state); + this.enterRule(localContext, 360, MySqlParser.RULE_startGroupReplication); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4585; + this.match(MySqlParser.KW_START); + this.state = 4586; + this.match(MySqlParser.KW_GROUP_REPLICATION); + this.state = 4590; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 678) { + { + this.state = 4587; + this.match(MySqlParser.KW_USER); + this.state = 4588; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4589; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 4596; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 662, this.context)) { + case 1: + { + this.state = 4592; + this.match(MySqlParser.COMMA); + this.state = 4593; + this.match(MySqlParser.KW_PASSWORD); + this.state = 4594; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4595; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + this.state = 4602; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 4598; + this.match(MySqlParser.COMMA); + this.state = 4599; + this.match(MySqlParser.KW_DEFAULT_AUTH); + this.state = 4600; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4601; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stopGroupReplication() { + let localContext = new StopGroupReplicationContext(this.context, this.state); + this.enterRule(localContext, 362, MySqlParser.RULE_stopGroupReplication); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4604; + this.match(MySqlParser.KW_STOP); + this.state = 4605; + this.match(MySqlParser.KW_GROUP_REPLICATION); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + masterOption() { + let localContext = new MasterOptionContext(this.context, this.state); + this.enterRule(localContext, 364, MySqlParser.RULE_masterOption); + let _la; + try { + this.state = 4634; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_MASTER_BIND: + case MySqlParser.KW_MASTER_COMPRESSION_ALGORITHMS: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PUBLIC_KEY_PATH: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_CIPHERSUITES: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_NETWORK_NAMESPACE: + case MySqlParser.KW_RELAY_LOG_FILE: + localContext = new MasterStringOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4607; + this.stringMasterOption(); + this.state = 4608; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4609; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_ZSTD_COMPRESSION_LEVEL: + case MySqlParser.KW_RELAY_LOG_POS: + localContext = new MasterDecimalOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4611; + this.decimalMasterOption(); + this.state = 4612; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4613; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MASTER_SSL_VERIFY_SERVER_CERT: + case MySqlParser.KW_GET_MASTER_PUBLIC_KEY: + case MySqlParser.KW_GTID_ONLY: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_REQUIRE_ROW_FORMAT: + case MySqlParser.KW_SOURCE_CONNECTION_AUTO_FAILOVER: + localContext = new MasterBoolOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4615; + this.boolMasterOption(); + this.state = 4616; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4617; + localContext._boolVal = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolVal = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + localContext = new V8AddMasterOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4619; + this.v8NewMasterOption(); + } + break; + case MySqlParser.KW_IGNORE_SERVER_IDS: + localContext = new MasterUidListOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4620; + this.match(MySqlParser.KW_IGNORE_SERVER_IDS); + this.state = 4621; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4622; + this.match(MySqlParser.LR_BRACKET); + this.state = 4631; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4623; + localContext._server_id = this.uid(); + this.state = 4628; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4624; + this.match(MySqlParser.COMMA); + this.state = 4625; + localContext._server_id = this.uid(); + } + } + this.state = 4630; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4633; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stringMasterOption() { + let localContext = new StringMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 366, MySqlParser.RULE_stringMasterOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4636; + _la = this.tokenStream.LA(1); + if (!(_la === 108 || ((((_la - 455)) & ~0x1F) === 0 && ((1 << (_la - 455)) & 4190897) !== 0) || _la === 499 || _la === 557)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + decimalMasterOption() { + let localContext = new DecimalMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 368, MySqlParser.RULE_decimalMasterOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4638; + _la = this.tokenStream.LA(1); + if (!(((((_la - 456)) & ~0x1F) === 0 && ((1 << (_la - 456)) & 2097831) !== 0) || _la === 558)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + boolMasterOption() { + let localContext = new BoolMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 370, MySqlParser.RULE_boolMasterOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4640; + _la = this.tokenStream.LA(1); + if (!(_la === 109 || _la === 411 || _la === 416 || _la === 454 || _la === 466 || _la === 573 || _la === 617)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + v8NewMasterOption() { + let localContext = new V8NewMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 372, MySqlParser.RULE_v8NewMasterOption); + let _la; + try { + this.state = 4655; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + this.enterOuterAlt(localContext, 1); + { + this.state = 4642; + this.match(MySqlParser.KW_PRIVILEGE_CHECKS_USER); + this.state = 4643; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4644; + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + this.enterOuterAlt(localContext, 2); + { + this.state = 4645; + this.match(MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK); + this.state = 4646; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4647; + _la = this.tokenStream.LA(1); + if (!(_la === 118 || _la === 119 || _la === 507)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + this.enterOuterAlt(localContext, 3); + { + this.state = 4648; + this.match(MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS); + this.state = 4649; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4653; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_OFF: + { + this.state = 4650; + this.match(MySqlParser.KW_OFF); + } + break; + case MySqlParser.KW_LOCAL: + { + this.state = 4651; + this.match(MySqlParser.KW_LOCAL); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.STRING_LITERAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 4652; + this.gtuidSet(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replicationSourceOption() { + let localContext = new ReplicationSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 374, MySqlParser.RULE_replicationSourceOption); + let _la; + try { + this.state = 4684; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NETWORK_NAMESPACE: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_SOURCE_BIND: + case MySqlParser.KW_SOURCE_HOST: + case MySqlParser.KW_SOURCE_USER: + case MySqlParser.KW_SOURCE_PASSWORD: + case MySqlParser.KW_SOURCE_LOG_FILE: + case MySqlParser.KW_SOURCE_COMPRESSION_ALGORITHMS: + case MySqlParser.KW_SOURCE_SSL_CA: + case MySqlParser.KW_SOURCE_SSL_CAPATH: + case MySqlParser.KW_SOURCE_SSL_CERT: + case MySqlParser.KW_SOURCE_SSL_CRL: + case MySqlParser.KW_SOURCE_SSL_CRLPATH: + case MySqlParser.KW_SOURCE_SSL_KEY: + case MySqlParser.KW_SOURCE_SSL_CIPHER: + case MySqlParser.KW_SOURCE_TLS_VERSION: + case MySqlParser.KW_SOURCE_TLS_CIPHERSUITES: + case MySqlParser.KW_SOURCE_PUBLIC_KEY_PATH: + localContext = new SourceStringOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4657; + this.stringSourceOption(); + this.state = 4658; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4659; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_SOURCE_PORT: + case MySqlParser.KW_SOURCE_LOG_POS: + case MySqlParser.KW_SOURCE_HEARTBEAT_PERIOD: + case MySqlParser.KW_SOURCE_CONNECT_RETRY: + case MySqlParser.KW_SOURCE_RETRY_COUNT: + case MySqlParser.KW_SOURCE_DELAY: + case MySqlParser.KW_SOURCE_ZSTD_COMPRESSION_LEVEL: + localContext = new SourceDecimalOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4661; + this.decimalSourceOption(); + this.state = 4662; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4663; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_GET_SOURCE_PUBLIC_KEY: + case MySqlParser.KW_GTID_ONLY: + case MySqlParser.KW_REQUIRE_ROW_FORMAT: + case MySqlParser.KW_SOURCE_AUTO_POSITION: + case MySqlParser.KW_SOURCE_CONNECTION_AUTO_FAILOVER: + case MySqlParser.KW_SOURCE_SSL: + case MySqlParser.KW_SOURCE_SSL_VERIFY_SERVER_CERT: + localContext = new SourceBoolOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4665; + this.boolSourceOption(); + this.state = 4666; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4667; + localContext._boolVal = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolVal = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + localContext = new SourceOtherOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4669; + this.otherSourceOption(); + } + break; + case MySqlParser.KW_IGNORE_SERVER_IDS: + localContext = new SourceUidListOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4670; + this.match(MySqlParser.KW_IGNORE_SERVER_IDS); + this.state = 4671; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4672; + this.match(MySqlParser.LR_BRACKET); + this.state = 4681; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4673; + localContext._server_id = this.uid(); + this.state = 4678; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4674; + this.match(MySqlParser.COMMA); + this.state = 4675; + localContext._server_id = this.uid(); + } + } + this.state = 4680; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4683; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stringSourceOption() { + let localContext = new StringSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 376, MySqlParser.RULE_stringSourceOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4686; + _la = this.tokenStream.LA(1); + if (!(_la === 499 || _la === 557 || ((((_la - 606)) & ~0x1F) === 0 && ((1 << (_la - 606)) & 125771823) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + decimalSourceOption() { + let localContext = new DecimalSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 378, MySqlParser.RULE_decimalSourceOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4688; + _la = this.tokenStream.LA(1); + if (!(_la === 558 || ((((_la - 610)) & ~0x1F) === 0 && ((1 << (_la - 610)) & 1397) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + boolSourceOption() { + let localContext = new BoolSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 380, MySqlParser.RULE_boolSourceOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4690; + _la = this.tokenStream.LA(1); + if (!(_la === 412 || _la === 416 || _la === 573 || ((((_la - 613)) & ~0x1F) === 0 && ((1 << (_la - 613)) & 65809) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + otherSourceOption() { + let localContext = new OtherSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 382, MySqlParser.RULE_otherSourceOption); + let _la; + try { + this.state = 4705; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + this.enterOuterAlt(localContext, 1); + { + this.state = 4692; + this.match(MySqlParser.KW_PRIVILEGE_CHECKS_USER); + this.state = 4693; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4694; + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + this.enterOuterAlt(localContext, 2); + { + this.state = 4695; + this.match(MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK); + this.state = 4696; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4697; + _la = this.tokenStream.LA(1); + if (!(_la === 70 || _la === 118 || _la === 119 || _la === 507)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + this.enterOuterAlt(localContext, 3); + { + this.state = 4698; + this.match(MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS); + this.state = 4699; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4703; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_OFF: + { + this.state = 4700; + this.match(MySqlParser.KW_OFF); + } + break; + case MySqlParser.KW_LOCAL: + { + this.state = 4701; + this.match(MySqlParser.KW_LOCAL); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.STRING_LITERAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 4702; + this.gtuidSet(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + channelOption() { + let localContext = new ChannelOptionContext(this.context, this.state); + this.enterRule(localContext, 384, MySqlParser.RULE_channelOption); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4707; + this.match(MySqlParser.KW_FOR); + this.state = 4708; + this.match(MySqlParser.KW_CHANNEL); + this.state = 4709; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replicationFilter() { + let localContext = new ReplicationFilterContext(this.context, this.state); + this.enterRule(localContext, 386, MySqlParser.RULE_replicationFilter); + let _la; + try { + this.state = 4774; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_REPLICATE_DO_DB: + localContext = new DoDbReplicationContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4711; + this.match(MySqlParser.KW_REPLICATE_DO_DB); + this.state = 4712; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4713; + this.match(MySqlParser.LR_BRACKET); + this.state = 4714; + this.databaseName(); + this.state = 4719; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4715; + this.match(MySqlParser.COMMA); + this.state = 4716; + this.databaseName(); + } + } + this.state = 4721; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4722; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_IGNORE_DB: + localContext = new IgnoreDbReplicationContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4724; + this.match(MySqlParser.KW_REPLICATE_IGNORE_DB); + this.state = 4725; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4726; + this.match(MySqlParser.LR_BRACKET); + this.state = 4727; + this.databaseName(); + this.state = 4732; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4728; + this.match(MySqlParser.COMMA); + this.state = 4729; + this.databaseName(); + } + } + this.state = 4734; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4735; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_DO_TABLE: + localContext = new DoTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4737; + this.match(MySqlParser.KW_REPLICATE_DO_TABLE); + this.state = 4738; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4739; + this.match(MySqlParser.LR_BRACKET); + this.state = 4740; + this.tableNames(); + this.state = 4741; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + localContext = new IgnoreTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4743; + this.match(MySqlParser.KW_REPLICATE_IGNORE_TABLE); + this.state = 4744; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4745; + this.match(MySqlParser.LR_BRACKET); + this.state = 4746; + this.tableNames(); + this.state = 4747; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + localContext = new WildDoTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4749; + this.match(MySqlParser.KW_REPLICATE_WILD_DO_TABLE); + this.state = 4750; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4751; + this.match(MySqlParser.LR_BRACKET); + this.state = 4752; + this.simpleStrings(); + this.state = 4753; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + localContext = new WildIgnoreTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 4755; + this.match(MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE); + this.state = 4756; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4757; + this.match(MySqlParser.LR_BRACKET); + this.state = 4758; + this.simpleStrings(); + this.state = 4759; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_REWRITE_DB: + localContext = new RewriteDbReplicationContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 4761; + this.match(MySqlParser.KW_REPLICATE_REWRITE_DB); + this.state = 4762; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4763; + this.match(MySqlParser.LR_BRACKET); + this.state = 4764; + this.tablePair(); + this.state = 4769; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4765; + this.match(MySqlParser.COMMA); + this.state = 4766; + this.tablePair(); + } + } + this.state = 4771; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4772; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablePair() { + let localContext = new TablePairContext(this.context, this.state); + this.enterRule(localContext, 388, MySqlParser.RULE_tablePair); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4776; + this.match(MySqlParser.LR_BRACKET); + this.state = 4777; + localContext._firstTable = this.tableName(); + this.state = 4778; + this.match(MySqlParser.COMMA); + this.state = 4779; + localContext._secondTable = this.tableName(); + this.state = 4780; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + threadType() { + let localContext = new ThreadTypeContext(this.context, this.state); + this.enterRule(localContext, 390, MySqlParser.RULE_threadType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4782; + _la = this.tokenStream.LA(1); + if (!(_la === 438 || _la === 639)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + untilOption() { + let localContext = new UntilOptionContext(this.context, this.state); + this.enterRule(localContext, 392, MySqlParser.RULE_untilOption); + let _la; + try { + this.state = 4809; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + localContext = new GtidsUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4784; + localContext._gtids = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 633 || _la === 635)) { + localContext._gtids = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4785; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4786; + this.gtuidSet(); + } + break; + case MySqlParser.KW_MASTER_LOG_FILE: + localContext = new MasterLogUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4787; + this.match(MySqlParser.KW_MASTER_LOG_FILE); + this.state = 4788; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4789; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4790; + this.match(MySqlParser.COMMA); + this.state = 4791; + this.match(MySqlParser.KW_MASTER_LOG_POS); + this.state = 4792; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4793; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SOURCE_LOG_FILE: + localContext = new SourceLogUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4794; + this.match(MySqlParser.KW_SOURCE_LOG_FILE); + this.state = 4795; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4796; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4797; + this.match(MySqlParser.COMMA); + this.state = 4798; + this.match(MySqlParser.KW_SOURCE_LOG_POS); + this.state = 4799; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4800; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_RELAY_LOG_FILE: + localContext = new RelayLogUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4801; + this.match(MySqlParser.KW_RELAY_LOG_FILE); + this.state = 4802; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4803; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4804; + this.match(MySqlParser.COMMA); + this.state = 4805; + this.match(MySqlParser.KW_RELAY_LOG_POS); + this.state = 4806; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4807; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + localContext = new SqlGapsUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4808; + this.match(MySqlParser.KW_SQL_AFTER_MTS_GAPS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + connectionOptions() { + let localContext = new ConnectionOptionsContext(this.context, this.state); + this.enterRule(localContext, 394, MySqlParser.RULE_connectionOptions); + try { + this.state = 4823; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_USER: + localContext = new UserConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4811; + this.match(MySqlParser.KW_USER); + this.state = 4812; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4813; + localContext._conOptUser = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PASSWORD: + localContext = new PasswordConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4814; + this.match(MySqlParser.KW_PASSWORD); + this.state = 4815; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4816; + localContext._conOptPassword = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_DEFAULT_AUTH: + localContext = new DefaultAuthConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4817; + this.match(MySqlParser.KW_DEFAULT_AUTH); + this.state = 4818; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4819; + localContext._conOptDefAuth = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PLUGIN_DIR: + localContext = new PluginDirConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4820; + this.match(MySqlParser.KW_PLUGIN_DIR); + this.state = 4821; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4822; + localContext._conOptPluginDir = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + gtuidSet() { + let localContext = new GtuidSetContext(this.context, this.state); + this.enterRule(localContext, 396, MySqlParser.RULE_gtuidSet); + try { + let alternative; + this.state = 4834; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 4825; + this.uuidSet(); + this.state = 4830; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 680, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4826; + this.match(MySqlParser.COMMA); + this.state = 4827; + this.uuidSet(); + } + } + } + this.state = 4832; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 680, this.context); + } + } + break; + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 2); + { + this.state = 4833; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaStartTransaction() { + let localContext = new XaStartTransactionContext(this.context, this.state); + this.enterRule(localContext, 398, MySqlParser.RULE_xaStartTransaction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4836; + this.match(MySqlParser.KW_XA); + this.state = 4837; + localContext._xaStart = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 317 || _la === 640)) { + localContext._xaStart = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4838; + this.xid(); + this.state = 4840; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 91 || _la === 577) { + { + this.state = 4839; + localContext._xaAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 91 || _la === 577)) { + localContext._xaAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaEndTransaction() { + let localContext = new XaEndTransactionContext(this.context, this.state); + this.enterRule(localContext, 400, MySqlParser.RULE_xaEndTransaction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4842; + this.match(MySqlParser.KW_XA); + this.state = 4843; + this.match(MySqlParser.KW_END); + this.state = 4844; + this.xid(); + this.state = 4850; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 654) { + { + this.state = 4845; + this.match(MySqlParser.KW_SUSPEND); + this.state = 4848; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4846; + this.match(MySqlParser.KW_FOR); + this.state = 4847; + this.match(MySqlParser.KW_MIGRATE); + } + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaPrepareStatement() { + let localContext = new XaPrepareStatementContext(this.context, this.state); + this.enterRule(localContext, 402, MySqlParser.RULE_xaPrepareStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4852; + this.match(MySqlParser.KW_XA); + this.state = 4853; + this.match(MySqlParser.KW_PREPARE); + this.state = 4854; + this.xid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaCommitWork() { + let localContext = new XaCommitWorkContext(this.context, this.state); + this.enterRule(localContext, 404, MySqlParser.RULE_xaCommitWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4856; + this.match(MySqlParser.KW_XA); + this.state = 4857; + this.match(MySqlParser.KW_COMMIT); + this.state = 4858; + this.xid(); + this.state = 4861; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 513) { + { + this.state = 4859; + this.match(MySqlParser.KW_ONE); + this.state = 4860; + this.match(MySqlParser.KW_PHASE); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaRollbackWork() { + let localContext = new XaRollbackWorkContext(this.context, this.state); + this.enterRule(localContext, 406, MySqlParser.RULE_xaRollbackWork); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4863; + this.match(MySqlParser.KW_XA); + this.state = 4864; + this.match(MySqlParser.KW_ROLLBACK); + this.state = 4865; + this.xid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaRecoverWork() { + let localContext = new XaRecoverWorkContext(this.context, this.state); + this.enterRule(localContext, 408, MySqlParser.RULE_xaRecoverWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4867; + this.match(MySqlParser.KW_XA); + this.state = 4868; + this.match(MySqlParser.KW_RECOVER); + this.state = 4871; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 33) { + { + this.state = 4869; + this.match(MySqlParser.KW_CONVERT); + this.state = 4870; + this.xid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + prepareStatement() { + let localContext = new PrepareStatementContext(this.context, this.state); + this.enterRule(localContext, 410, MySqlParser.RULE_prepareStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4873; + this.match(MySqlParser.KW_PREPARE); + this.state = 4874; + localContext._stmt_name = this.uid(); + this.state = 4875; + this.match(MySqlParser.KW_FROM); + this.state = 4878; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 4876; + localContext._query = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.LOCAL_ID: + { + this.state = 4877; + localContext._variable = this.match(MySqlParser.LOCAL_ID); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + executeStatement() { + let localContext = new ExecuteStatementContext(this.context, this.state); + this.enterRule(localContext, 412, MySqlParser.RULE_executeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4880; + this.match(MySqlParser.KW_EXECUTE); + this.state = 4881; + localContext._stmt_name = this.uid(); + this.state = 4884; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 4882; + this.match(MySqlParser.KW_USING); + this.state = 4883; + this.userVariables(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + deallocatePrepare() { + let localContext = new DeallocatePrepareContext(this.context, this.state); + this.enterRule(localContext, 414, MySqlParser.RULE_deallocatePrepare); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4886; + localContext._dropFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 51 || _la === 362)) { + localContext._dropFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4887; + this.match(MySqlParser.KW_PREPARE); + this.state = 4888; + localContext._stmt_name = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + routineBody() { + let localContext = new RoutineBodyContext(this.context, this.state); + this.enterRule(localContext, 416, MySqlParser.RULE_routineBody); + try { + this.state = 4892; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 689, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4890; + this.blockStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4891; + this.sqlStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + blockStatement() { + let localContext = new BlockStatementContext(this.context, this.state); + this.enterRule(localContext, 418, MySqlParser.RULE_blockStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4897; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 690, this.context)) { + case 1: + { + this.state = 4894; + localContext._begin = this.uid(); + this.state = 4895; + this.match(MySqlParser.COLON_SYMB); + } + break; + } + this.state = 4899; + this.match(MySqlParser.KW_BEGIN); + this.state = 4905; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 691, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4900; + this.declareVariable(); + this.state = 4901; + this.match(MySqlParser.SEMI); + } + } + } + this.state = 4907; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 691, this.context); + } + this.state = 4913; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 692, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4908; + this.declareCondition(); + this.state = 4909; + this.match(MySqlParser.SEMI); + } + } + } + this.state = 4915; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 692, this.context); + } + this.state = 4921; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 693, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4916; + this.declareCursor(); + this.state = 4917; + this.match(MySqlParser.SEMI); + } + } + } + this.state = 4923; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 693, this.context); + } + this.state = 4929; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 41) { + { + { + this.state = 4924; + this.declareHandler(); + this.state = 4925; + this.match(MySqlParser.SEMI); + } + } + this.state = 4931; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4935; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 695, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4932; + this.procedureSqlStatement(); + } + } + } + this.state = 4937; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 695, this.context); + } + this.state = 4938; + this.match(MySqlParser.KW_END); + this.state = 4940; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 696, this.context)) { + case 1: + { + this.state = 4939; + localContext._end = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + caseStatement() { + let localContext = new CaseStatementContext(this.context, this.state); + this.enterRule(localContext, 420, MySqlParser.RULE_caseStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4942; + this.match(MySqlParser.KW_CASE); + this.state = 4945; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 697, this.context)) { + case 1: + { + this.state = 4943; + localContext._case_value = this.uid(); + } + break; + case 2: + { + this.state = 4944; + this.expression(0); + } + break; + } + this.state = 4948; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 4947; + this.caseAlternative(); + } + } + this.state = 4950; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 191); + this.state = 4958; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 4952; + this.match(MySqlParser.KW_ELSE); + this.state = 4954; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4953; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4956; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 699, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + this.state = 4960; + this.match(MySqlParser.KW_END); + this.state = 4961; + this.match(MySqlParser.KW_CASE); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ifStatement() { + let localContext = new IfStatementContext(this.context, this.state); + this.enterRule(localContext, 422, MySqlParser.RULE_ifStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4963; + this.match(MySqlParser.KW_IF); + this.state = 4964; + this.expression(0); + this.state = 4965; + this.match(MySqlParser.KW_THEN); + this.state = 4967; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4966; + localContext._procedureSqlStatement = this.procedureSqlStatement(); + localContext._thenStatements.push(localContext._procedureSqlStatement); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4969; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 701, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 4974; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 54) { + { + { + this.state = 4971; + this.elifAlternative(); + } + } + this.state = 4976; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4983; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 4977; + this.match(MySqlParser.KW_ELSE); + this.state = 4979; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4978; + localContext._procedureSqlStatement = this.procedureSqlStatement(); + localContext._elseStatements.push(localContext._procedureSqlStatement); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4981; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 703, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + this.state = 4985; + this.match(MySqlParser.KW_END); + this.state = 4986; + this.match(MySqlParser.KW_IF); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + iterateStatement() { + let localContext = new IterateStatementContext(this.context, this.state); + this.enterRule(localContext, 424, MySqlParser.RULE_iterateStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4988; + this.match(MySqlParser.KW_ITERATE); + this.state = 4989; + localContext._label = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + leaveStatement() { + let localContext = new LeaveStatementContext(this.context, this.state); + this.enterRule(localContext, 426, MySqlParser.RULE_leaveStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4991; + this.match(MySqlParser.KW_LEAVE); + this.state = 4992; + localContext._label = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loopStatement() { + let localContext = new LoopStatementContext(this.context, this.state); + this.enterRule(localContext, 428, MySqlParser.RULE_loopStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4997; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4994; + localContext._begin_label = this.uid(); + this.state = 4995; + this.match(MySqlParser.COLON_SYMB); + } + } + this.state = 4999; + this.match(MySqlParser.KW_LOOP); + this.state = 5001; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5000; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5003; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 706, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 5005; + this.match(MySqlParser.KW_END); + this.state = 5006; + this.match(MySqlParser.KW_LOOP); + this.state = 5008; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5007; + localContext._end_label = this.uid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + repeatStatement() { + let localContext = new RepeatStatementContext(this.context, this.state); + this.enterRule(localContext, 430, MySqlParser.RULE_repeatStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5013; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 708, this.context)) { + case 1: + { + this.state = 5010; + localContext._begin_label = this.uid(); + this.state = 5011; + this.match(MySqlParser.COLON_SYMB); + } + break; + } + this.state = 5015; + this.match(MySqlParser.KW_REPEAT); + this.state = 5017; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5016; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5019; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 709, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 5021; + this.match(MySqlParser.KW_UNTIL); + this.state = 5022; + this.expression(0); + this.state = 5023; + this.match(MySqlParser.KW_END); + this.state = 5024; + this.match(MySqlParser.KW_REPEAT); + this.state = 5026; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5025; + localContext._end_label = this.uid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + returnStatement() { + let localContext = new ReturnStatementContext(this.context, this.state); + this.enterRule(localContext, 432, MySqlParser.RULE_returnStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5028; + this.match(MySqlParser.KW_RETURN); + this.state = 5029; + this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + whileStatement() { + let localContext = new WhileStatementContext(this.context, this.state); + this.enterRule(localContext, 434, MySqlParser.RULE_whileStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5034; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5031; + localContext._begin_label = this.uid(); + this.state = 5032; + this.match(MySqlParser.COLON_SYMB); + } + } + this.state = 5036; + this.match(MySqlParser.KW_WHILE); + this.state = 5037; + this.expression(0); + this.state = 5038; + this.match(MySqlParser.KW_DO); + this.state = 5040; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5039; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5042; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 712, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 5044; + this.match(MySqlParser.KW_END); + this.state = 5045; + this.match(MySqlParser.KW_WHILE); + this.state = 5047; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5046; + localContext._end_label = this.uid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + cursorStatement() { + let localContext = new CursorStatementContext(this.context, this.state); + this.enterRule(localContext, 436, MySqlParser.RULE_cursorStatement); + let _la; + try { + this.state = 5064; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CLOSE: + localContext = new CloseCursorContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5049; + this.match(MySqlParser.KW_CLOSE); + this.state = 5050; + localContext._cursor_name = this.uid(); + } + break; + case MySqlParser.KW_FETCH: + localContext = new FetchCursorContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5051; + this.match(MySqlParser.KW_FETCH); + this.state = 5056; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 715, this.context)) { + case 1: + { + this.state = 5053; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 501) { + { + this.state = 5052; + this.match(MySqlParser.KW_NEXT); + } + } + this.state = 5055; + this.match(MySqlParser.KW_FROM); + } + break; + } + this.state = 5058; + localContext._cursor_name = this.uid(); + this.state = 5059; + this.match(MySqlParser.KW_INTO); + this.state = 5060; + localContext._var_names = this.uidList(); + } + break; + case MySqlParser.KW_OPEN: + localContext = new OpenCursorContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5062; + this.match(MySqlParser.KW_OPEN); + this.state = 5063; + localContext._cursor_name = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareVariable() { + let localContext = new DeclareVariableContext(this.context, this.state); + this.enterRule(localContext, 438, MySqlParser.RULE_declareVariable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5066; + this.match(MySqlParser.KW_DECLARE); + this.state = 5067; + localContext._var_names = this.uidList(); + this.state = 5068; + this.dataType(); + this.state = 5071; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 5069; + this.match(MySqlParser.KW_DEFAULT); + this.state = 5070; + this.expression(0); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareCondition() { + let localContext = new DeclareConditionContext(this.context, this.state); + this.enterRule(localContext, 440, MySqlParser.RULE_declareCondition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5073; + this.match(MySqlParser.KW_DECLARE); + this.state = 5074; + localContext._condition_name = this.uid(); + this.state = 5075; + this.match(MySqlParser.KW_CONDITION); + this.state = 5076; + this.match(MySqlParser.KW_FOR); + this.state = 5083; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5077; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SQLSTATE: + { + this.state = 5078; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 5080; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 5079; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 5082; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareCursor() { + let localContext = new DeclareCursorContext(this.context, this.state); + this.enterRule(localContext, 442, MySqlParser.RULE_declareCursor); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5085; + this.match(MySqlParser.KW_DECLARE); + this.state = 5086; + localContext._condition_name = this.uid(); + this.state = 5087; + this.match(MySqlParser.KW_CURSOR); + this.state = 5088; + this.match(MySqlParser.KW_FOR); + this.state = 5089; + this.selectStatement(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareHandler() { + let localContext = new DeclareHandlerContext(this.context, this.state); + this.enterRule(localContext, 444, MySqlParser.RULE_declareHandler); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5091; + this.match(MySqlParser.KW_DECLARE); + this.state = 5092; + localContext._handlerAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 32 || _la === 61 || _la === 180)) { + localContext._handlerAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5093; + this.match(MySqlParser.KW_HANDLER); + this.state = 5094; + this.match(MySqlParser.KW_FOR); + this.state = 5095; + this.handlerConditionValue(); + this.state = 5100; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5096; + this.match(MySqlParser.COMMA); + this.state = 5097; + this.handlerConditionValue(); + } + } + this.state = 5102; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5103; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerConditionValue() { + let localContext = new HandlerConditionValueContext(this.context, this.state); + this.enterRule(localContext, 446, MySqlParser.RULE_handlerConditionValue); + let _la; + try { + this.state = 5116; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + localContext = new HandlerConditionCodeContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5105; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SQLSTATE: + localContext = new HandlerConditionStateContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5106; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 5108; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 5107; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 5110; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + localContext = new HandlerConditionNameContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5111; + localContext._condition_name = this.uid(); + } + break; + case MySqlParser.KW_SQLWARNING: + localContext = new HandlerConditionWarningContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 5112; + this.match(MySqlParser.KW_SQLWARNING); + } + break; + case MySqlParser.KW_NOT: + localContext = new HandlerConditionNotfoundContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 5113; + this.match(MySqlParser.KW_NOT); + this.state = 5114; + this.match(MySqlParser.KW_FOUND); + } + break; + case MySqlParser.KW_SQLEXCEPTION: + localContext = new HandlerConditionExceptionContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 5115; + this.match(MySqlParser.KW_SQLEXCEPTION); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + procedureSqlStatement() { + let localContext = new ProcedureSqlStatementContext(this.context, this.state); + this.enterRule(localContext, 448, MySqlParser.RULE_procedureSqlStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5120; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 723, this.context)) { + case 1: + { + this.state = 5118; + this.compoundStatement(); + } + break; + case 2: + { + this.state = 5119; + this.sqlStatement(); + } + break; + } + this.state = 5122; + this.match(MySqlParser.SEMI); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + caseAlternative() { + let localContext = new CaseAlternativeContext(this.context, this.state); + this.enterRule(localContext, 450, MySqlParser.RULE_caseAlternative); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5124; + this.match(MySqlParser.KW_WHEN); + this.state = 5127; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 724, this.context)) { + case 1: + { + this.state = 5125; + this.constant(); + } + break; + case 2: + { + this.state = 5126; + this.expression(0); + } + break; + } + this.state = 5129; + this.match(MySqlParser.KW_THEN); + this.state = 5131; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5130; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5133; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 725, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + elifAlternative() { + let localContext = new ElifAlternativeContext(this.context, this.state); + this.enterRule(localContext, 452, MySqlParser.RULE_elifAlternative); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5135; + this.match(MySqlParser.KW_ELSEIF); + this.state = 5136; + this.expression(0); + this.state = 5137; + this.match(MySqlParser.KW_THEN); + this.state = 5139; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5138; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5141; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 726, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterUser() { + let localContext = new AlterUserContext(this.context, this.state); + this.enterRule(localContext, 454, MySqlParser.RULE_alterUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5143; + this.match(MySqlParser.KW_ALTER); + this.state = 5144; + this.match(MySqlParser.KW_USER); + this.state = 5146; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 727, this.context)) { + case 1: + { + this.state = 5145; + this.ifExists(); + } + break; + } + this.state = 5204; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 739, this.context)) { + case 1: + { + { + this.state = 5148; + this.userSpecification(); + this.state = 5153; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5149; + this.match(MySqlParser.COMMA); + this.state = 5150; + this.userSpecification(); + } + } + this.state = 5155; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + case 2: + { + { + this.state = 5156; + this.alterUserAuthOption(); + this.state = 5161; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5157; + this.match(MySqlParser.COMMA); + this.state = 5158; + this.alterUserAuthOption(); + } + } + this.state = 5163; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5178; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 5164; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5176; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NONE: + { + this.state = 5165; + this.match(MySqlParser.KW_NONE); + } + break; + case MySqlParser.KW_SSL: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_X509: + { + this.state = 5166; + this.tlsOption(); + this.state = 5173; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 11 || _la === 169 || _la === 331 || _la === 441 || _la === 651 || _la === 693) { + { + { + this.state = 5168; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5167; + this.match(MySqlParser.KW_AND); + } + } + this.state = 5170; + this.tlsOption(); + } + } + this.state = 5175; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5186; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 735, this.context)) { + case 1: + { + this.state = 5180; + this.match(MySqlParser.KW_WITH); + this.state = 5182; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 5181; + this.userResourceOption(); + } + } + this.state = 5184; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 51) !== 0)); + } + break; + } + this.state = 5192; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 304 || _la === 395 || _la === 529 || _la === 530) { + { + this.state = 5190; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + { + this.state = 5188; + this.userPasswordOption(); + } + break; + case MySqlParser.KW_ACCOUNT: + { + this.state = 5189; + this.userLockOption(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + this.state = 5194; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5197; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 15 || _la === 340) { + { + this.state = 5195; + _la = this.tokenStream.LA(1); + if (!(_la === 15 || _la === 340)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5196; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + break; + case 3: + { + { + { + this.state = 5199; + this.userOrRoleName(); + } + this.state = 5200; + this.match(MySqlParser.KW_DEFAULT); + this.state = 5201; + this.match(MySqlParser.KW_ROLE); + this.state = 5202; + this.roleOption(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createUser() { + let localContext = new CreateUserContext(this.context, this.state); + this.enterRule(localContext, 456, MySqlParser.RULE_createUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5206; + this.match(MySqlParser.KW_CREATE); + this.state = 5207; + this.match(MySqlParser.KW_USER); + this.state = 5209; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5208; + this.ifNotExists(); + } + } + this.state = 5211; + this.userName(); + this.state = 5213; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 423) { + { + this.state = 5212; + this.createUserAuthOption(); + } + } + this.state = 5222; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5215; + this.match(MySqlParser.COMMA); + this.state = 5216; + this.userName(); + this.state = 5218; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 423) { + { + this.state = 5217; + this.createUserAuthOption(); + } + } + } + } + this.state = 5224; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5228; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 5225; + this.match(MySqlParser.KW_DEFAULT); + this.state = 5226; + this.match(MySqlParser.KW_ROLE); + this.state = 5227; + this.roleOption(); + } + } + this.state = 5244; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 5230; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5242; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NONE: + { + this.state = 5231; + this.match(MySqlParser.KW_NONE); + } + break; + case MySqlParser.KW_SSL: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_X509: + { + this.state = 5232; + this.tlsOption(); + this.state = 5239; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 11 || _la === 169 || _la === 331 || _la === 441 || _la === 651 || _la === 693) { + { + { + this.state = 5234; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5233; + this.match(MySqlParser.KW_AND); + } + } + this.state = 5236; + this.tlsOption(); + } + } + this.state = 5241; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5252; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 750, this.context)) { + case 1: + { + this.state = 5246; + this.match(MySqlParser.KW_WITH); + this.state = 5248; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 5247; + this.userResourceOption(); + } + } + this.state = 5250; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 51) !== 0)); + } + break; + } + this.state = 5258; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 304 || _la === 395 || _la === 529 || _la === 530) { + { + this.state = 5256; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + { + this.state = 5254; + this.userPasswordOption(); + } + break; + case MySqlParser.KW_ACCOUNT: + { + this.state = 5255; + this.userLockOption(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + this.state = 5260; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5263; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 15 || _la === 340) { + { + this.state = 5261; + _la = this.tokenStream.LA(1); + if (!(_la === 15 || _la === 340)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5262; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropUser() { + let localContext = new DropUserContext(this.context, this.state); + this.enterRule(localContext, 458, MySqlParser.RULE_dropUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5265; + this.match(MySqlParser.KW_DROP); + this.state = 5266; + this.match(MySqlParser.KW_USER); + this.state = 5268; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5267; + this.ifExists(); + } + } + this.state = 5270; + this.userName(); + this.state = 5275; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5271; + this.match(MySqlParser.COMMA); + this.state = 5272; + this.userName(); + } + } + this.state = 5277; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + grantStatement() { + let localContext = new GrantStatementContext(this.context, this.state); + this.enterRule(localContext, 460, MySqlParser.RULE_grantStatement); + let _la; + try { + let alternative; + this.state = 5367; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 773, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5278; + this.match(MySqlParser.KW_GRANT); + this.state = 5279; + this.privelegeClause(); + this.state = 5284; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5280; + this.match(MySqlParser.COMMA); + this.state = 5281; + this.privelegeClause(); + } + } + this.state = 5286; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5287; + this.match(MySqlParser.KW_ON); + this.state = 5289; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 757, this.context)) { + case 1: + { + this.state = 5288; + this.privilegeObjectType(); + } + break; + } + this.state = 5291; + this.privilegeLevel(); + this.state = 5292; + this.match(MySqlParser.KW_TO); + this.state = 5302; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 759, this.context)) { + case 1: + { + { + this.state = 5293; + this.userAuthOption(); + this.state = 5298; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5294; + this.match(MySqlParser.COMMA); + this.state = 5295; + this.userAuthOption(); + } + } + this.state = 5300; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + case 2: + { + this.state = 5301; + this.userOrRoleNames(); + } + break; + } + this.state = 5318; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 5304; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5316; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NONE: + { + this.state = 5305; + localContext._tlsNone = this.match(MySqlParser.KW_NONE); + } + break; + case MySqlParser.KW_SSL: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_X509: + { + this.state = 5306; + this.tlsOption(); + this.state = 5313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 11 || _la === 169 || _la === 331 || _la === 441 || _la === 651 || _la === 693) { + { + { + this.state = 5308; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5307; + this.match(MySqlParser.KW_AND); + } + } + this.state = 5310; + this.tlsOption(); + } + } + this.state = 5315; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5329; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 766, this.context)) { + case 1: + { + this.state = 5320; + this.match(MySqlParser.KW_WITH); + this.state = 5326; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 765, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + this.state = 5324; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_GRANT: + { + this.state = 5321; + this.match(MySqlParser.KW_GRANT); + this.state = 5322; + this.match(MySqlParser.KW_OPTION); + } + break; + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + { + this.state = 5323; + this.userResourceOption(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5328; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 765, this.context); + } + } + break; + } + this.state = 5338; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 5331; + this.match(MySqlParser.KW_AS); + this.state = 5332; + this.userName(); + this.state = 5336; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 767, this.context)) { + case 1: + { + this.state = 5333; + this.match(MySqlParser.KW_WITH); + this.state = 5334; + this.match(MySqlParser.KW_ROLE); + this.state = 5335; + this.roleOption(); + } + break; + } + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5340; + this.match(MySqlParser.KW_GRANT); + this.state = 5343; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 769, this.context)) { + case 1: + { + this.state = 5341; + this.match(MySqlParser.KW_PROXY); + this.state = 5342; + this.match(MySqlParser.KW_ON); + } + break; + } + { + this.state = 5345; + this.userOrRoleName(); + } + this.state = 5350; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5346; + this.match(MySqlParser.COMMA); + { + this.state = 5347; + this.userOrRoleName(); + } + } + } + this.state = 5352; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5353; + this.match(MySqlParser.KW_TO); + { + this.state = 5354; + this.userOrRoleName(); + } + this.state = 5359; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5355; + this.match(MySqlParser.COMMA); + { + this.state = 5356; + this.userOrRoleName(); + } + } + } + this.state = 5361; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5365; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 772, this.context)) { + case 1: + { + this.state = 5362; + this.match(MySqlParser.KW_WITH); + this.state = 5363; + this.match(MySqlParser.KW_ADMIN); + this.state = 5364; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + roleOption() { + let localContext = new RoleOptionContext(this.context, this.state); + this.enterRule(localContext, 462, MySqlParser.RULE_roleOption); + let _la; + try { + this.state = 5377; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 775, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5369; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5370; + this.match(MySqlParser.KW_NONE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5371; + this.match(MySqlParser.KW_ALL); + this.state = 5374; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 59) { + { + this.state = 5372; + this.match(MySqlParser.KW_EXCEPT); + this.state = 5373; + this.userOrRoleNames(); + } + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5376; + this.userOrRoleNames(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + grantProxy() { + let localContext = new GrantProxyContext(this.context, this.state); + this.enterRule(localContext, 464, MySqlParser.RULE_grantProxy); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5379; + this.match(MySqlParser.KW_GRANT); + this.state = 5380; + this.match(MySqlParser.KW_PROXY); + this.state = 5381; + this.match(MySqlParser.KW_ON); + this.state = 5382; + localContext._fromFirst = this.userName(); + this.state = 5383; + this.match(MySqlParser.KW_TO); + this.state = 5384; + localContext._toFirst = this.userName(); + this.state = 5389; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5385; + this.match(MySqlParser.COMMA); + this.state = 5386; + localContext._userName = this.userName(); + localContext._toOther.push(localContext._userName); + } + } + this.state = 5391; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5395; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 777, this.context)) { + case 1: + { + this.state = 5392; + this.match(MySqlParser.KW_WITH); + this.state = 5393; + this.match(MySqlParser.KW_GRANT); + this.state = 5394; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterResourceGroup() { + let localContext = new AlterResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 466, MySqlParser.RULE_alterResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5397; + this.match(MySqlParser.KW_ALTER); + this.state = 5398; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5399; + this.match(MySqlParser.KW_GROUP); + this.state = 5400; + this.groupName(); + this.state = 5406; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 190) { + { + this.state = 5401; + this.match(MySqlParser.KW_VCPU); + this.state = 5403; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5402; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5405; + this.resourceGroupVcpuSpec(); + } + } + this.state = 5413; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 837) { + { + this.state = 5408; + this.match(MySqlParser.KW_THREAD_PRIORITY); + this.state = 5410; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5409; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5412; + this.decimalLiteral(); + } + } + this.state = 5419; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 5415; + _la = this.tokenStream.LA(1); + if (!(_la === 368 || _la === 375)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5417; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 66) { + { + this.state = 5416; + this.match(MySqlParser.KW_FORCE); + } + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createResourceGroup() { + let localContext = new CreateResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 468, MySqlParser.RULE_createResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5421; + this.match(MySqlParser.KW_CREATE); + this.state = 5422; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5423; + this.match(MySqlParser.KW_GROUP); + this.state = 5424; + this.groupNameCreate(); + this.state = 5425; + this.match(MySqlParser.KW_TYPE); + this.state = 5426; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 5427; + _la = this.tokenStream.LA(1); + if (!(_la === 678 || _la === 835)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5433; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 190) { + { + this.state = 5428; + this.match(MySqlParser.KW_VCPU); + this.state = 5430; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5429; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5432; + this.resourceGroupVcpuSpec(); + } + } + this.state = 5440; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 837) { + { + this.state = 5435; + this.match(MySqlParser.KW_THREAD_PRIORITY); + this.state = 5437; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5436; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5439; + this.decimalLiteral(); + } + } + this.state = 5443; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 5442; + _la = this.tokenStream.LA(1); + if (!(_la === 368 || _la === 375)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropResourceGroup() { + let localContext = new DropResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 470, MySqlParser.RULE_dropResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5445; + this.match(MySqlParser.KW_DROP); + this.state = 5446; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5447; + this.match(MySqlParser.KW_GROUP); + this.state = 5448; + this.groupName(); + this.state = 5450; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 66) { + { + this.state = 5449; + this.match(MySqlParser.KW_FORCE); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setResourceGroup() { + let localContext = new SetResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 472, MySqlParser.RULE_setResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5452; + this.match(MySqlParser.KW_SET); + this.state = 5453; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5454; + this.match(MySqlParser.KW_GROUP); + this.state = 5455; + this.groupName(); + this.state = 5465; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 5456; + this.match(MySqlParser.KW_FOR); + this.state = 5457; + this.decimalLiteral(); + this.state = 5462; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5458; + this.match(MySqlParser.COMMA); + this.state = 5459; + this.decimalLiteral(); + } + } + this.state = 5464; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resourceGroupVcpuSpec() { + let localContext = new ResourceGroupVcpuSpecContext(this.context, this.state); + this.enterRule(localContext, 474, MySqlParser.RULE_resourceGroupVcpuSpec); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5472; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 792, this.context)) { + case 1: + { + this.state = 5467; + this.decimalLiteral(); + } + break; + case 2: + { + this.state = 5468; + this.decimalLiteral(); + this.state = 5469; + this.match(MySqlParser.MINUS); + this.state = 5470; + this.decimalLiteral(); + } + break; + } + this.state = 5478; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 793, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 5474; + this.match(MySqlParser.COMMA); + this.state = 5475; + this.resourceGroupVcpuSpec(); + } + } + } + this.state = 5480; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 793, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameUser() { + let localContext = new RenameUserContext(this.context, this.state); + this.enterRule(localContext, 476, MySqlParser.RULE_renameUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5481; + this.match(MySqlParser.KW_RENAME); + this.state = 5482; + this.match(MySqlParser.KW_USER); + this.state = 5483; + this.renameUserClause(); + this.state = 5488; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5484; + this.match(MySqlParser.COMMA); + this.state = 5485; + this.renameUserClause(); + } + } + this.state = 5490; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + revokeStatement() { + let localContext = new RevokeStatementContext(this.context, this.state); + this.enterRule(localContext, 478, MySqlParser.RULE_revokeStatement); + let _la; + try { + this.state = 5543; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 805, this.context)) { + case 1: + localContext = new DetailRevokeContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5491; + this.match(MySqlParser.KW_REVOKE); + this.state = 5493; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5492; + this.ifExists(); + } + } + this.state = 5495; + this.privelegeClause(); + this.state = 5500; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5496; + this.match(MySqlParser.COMMA); + this.state = 5497; + this.privelegeClause(); + } + } + this.state = 5502; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5503; + this.match(MySqlParser.KW_ON); + this.state = 5505; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 797, this.context)) { + case 1: + { + this.state = 5504; + this.privilegeObjectType(); + } + break; + } + this.state = 5507; + this.privilegeLevel(); + this.state = 5508; + this.match(MySqlParser.KW_FROM); + this.state = 5509; + this.userOrRoleNames(); + this.state = 5511; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 5510; + this.ignoreUnknownUser(); + } + } + } + break; + case 2: + localContext = new ShortRevokeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5513; + this.match(MySqlParser.KW_REVOKE); + this.state = 5515; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5514; + this.ifExists(); + } + } + this.state = 5517; + this.match(MySqlParser.KW_ALL); + this.state = 5519; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 734) { + { + this.state = 5518; + this.match(MySqlParser.KW_PRIVILEGES); + } + } + this.state = 5521; + this.match(MySqlParser.COMMA); + this.state = 5522; + this.match(MySqlParser.KW_GRANT); + this.state = 5523; + this.match(MySqlParser.KW_OPTION); + this.state = 5524; + this.match(MySqlParser.KW_FROM); + this.state = 5525; + this.userOrRoleNames(); + this.state = 5527; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 5526; + this.ignoreUnknownUser(); + } + } + } + break; + case 3: + localContext = new ProxyAndRoleRevokeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5529; + this.match(MySqlParser.KW_REVOKE); + this.state = 5531; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 802, this.context)) { + case 1: + { + this.state = 5530; + this.ifExists(); + } + break; + } + this.state = 5535; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 803, this.context)) { + case 1: + { + this.state = 5533; + this.match(MySqlParser.KW_PROXY); + this.state = 5534; + this.match(MySqlParser.KW_ON); + } + break; + } + this.state = 5537; + this.userOrRoleNames(); + this.state = 5538; + this.match(MySqlParser.KW_FROM); + this.state = 5539; + this.userOrRoleNames(); + this.state = 5541; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 5540; + this.ignoreUnknownUser(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ignoreUnknownUser() { + let localContext = new IgnoreUnknownUserContext(this.context, this.state); + this.enterRule(localContext, 480, MySqlParser.RULE_ignoreUnknownUser); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5545; + this.match(MySqlParser.KW_IGNORE); + this.state = 5546; + this.match(MySqlParser.KW_UNKNOWN); + this.state = 5547; + this.match(MySqlParser.KW_USER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilegeObjectType() { + let localContext = new PrivilegeObjectTypeContext(this.context, this.state); + this.enterRule(localContext, 482, MySqlParser.RULE_privilegeObjectType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5549; + _la = this.tokenStream.LA(1); + if (!(_la === 132 || _la === 173 || _la === 409)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setPasswordStatement() { + let localContext = new SetPasswordStatementContext(this.context, this.state); + this.enterRule(localContext, 484, MySqlParser.RULE_setPasswordStatement); + let _la; + try { + this.state = 5583; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 812, this.context)) { + case 1: + localContext = new V57Context(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5551; + this.match(MySqlParser.KW_SET); + this.state = 5552; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5555; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 5553; + this.match(MySqlParser.KW_FOR); + this.state = 5554; + this.userName(); + } + } + this.state = 5557; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 5560; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_PASSWORD: + { + this.state = 5558; + this.passwordFunctionClause(); + } + break; + case MySqlParser.STRING_LITERAL: + { + this.state = 5559; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + localContext = new V80Context(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5562; + this.match(MySqlParser.KW_SET); + this.state = 5563; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5566; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 5564; + this.match(MySqlParser.KW_FOR); + this.state = 5565; + this.userName(); + } + } + this.state = 5572; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TO: + { + this.state = 5568; + this.match(MySqlParser.KW_TO); + this.state = 5569; + this.match(MySqlParser.KW_RANDOM); + } + break; + case MySqlParser.EQUAL_SYMBOL: + { + this.state = 5570; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 5571; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5576; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 810, this.context)) { + case 1: + { + this.state = 5574; + this.match(MySqlParser.KW_REPLACE); + this.state = 5575; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + this.state = 5581; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 147) { + { + this.state = 5578; + this.match(MySqlParser.KW_RETAIN); + this.state = 5579; + this.match(MySqlParser.KW_CURRENT); + this.state = 5580; + this.match(MySqlParser.KW_PASSWORD); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userSpecification() { + let localContext = new UserSpecificationContext(this.context, this.state); + this.enterRule(localContext, 486, MySqlParser.RULE_userSpecification); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5585; + this.userName(); + this.state = 5586; + this.userPasswordOption(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterUserAuthOption() { + let localContext = new AlterUserAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 488, MySqlParser.RULE_alterUserAuthOption); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5588; + this.userName(); + this.state = 5614; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 815, this.context)) { + case 1: + { + this.state = 5589; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5590; + this.match(MySqlParser.KW_BY); + this.state = 5591; + this.match(MySqlParser.STRING_LITERAL); + this.state = 5592; + this.authOptionClause(); + } + break; + case 2: + { + this.state = 5593; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5594; + this.match(MySqlParser.KW_BY); + this.state = 5595; + this.match(MySqlParser.KW_RANDOM); + this.state = 5596; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5597; + this.authOptionClause(); + } + break; + case 3: + { + this.state = 5598; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5599; + this.match(MySqlParser.KW_WITH); + this.state = 5600; + this.authenticationRule(); + } + break; + case 4: + { + this.state = 5601; + this.match(MySqlParser.KW_DISCARD); + this.state = 5602; + this.match(MySqlParser.KW_OLD); + this.state = 5603; + this.match(MySqlParser.KW_PASSWORD); + } + break; + case 5: + { + this.state = 5609; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5604; + _la = this.tokenStream.LA(1); + if (!(_la === 6 || _la === 51 || _la === 492)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5605; + this.factor(); + this.state = 5607; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 423) { + { + this.state = 5606; + this.factorAuthOption(); + } + } + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5611; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 814, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + case 6: + { + this.state = 5613; + this.registrationOption(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createUserAuthOption() { + let localContext = new CreateUserAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 490, MySqlParser.RULE_createUserAuthOption); + let _la; + try { + this.state = 5652; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 822, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5616; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5617; + this.match(MySqlParser.KW_BY); + this.state = 5623; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5618; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + { + this.state = 5619; + this.match(MySqlParser.KW_RANDOM); + this.state = 5620; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + case MySqlParser.KW_PASSWORD: + { + { + this.state = 5621; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5622; + this.match(MySqlParser.STRING_LITERAL); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5627; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5625; + this.match(MySqlParser.KW_AND); + this.state = 5626; + this.createUserAuthOption(); + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5629; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5630; + this.match(MySqlParser.KW_WITH); + this.state = 5631; + localContext._authPlugin = this.uid(); + this.state = 5640; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BY: + { + { + this.state = 5632; + this.match(MySqlParser.KW_BY); + this.state = 5636; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5633; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + { + this.state = 5634; + this.match(MySqlParser.KW_RANDOM); + this.state = 5635; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + break; + case MySqlParser.KW_AS: + { + this.state = 5638; + this.match(MySqlParser.KW_AS); + this.state = 5639; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_AND: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_REQUIRE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + this.state = 5644; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5642; + this.match(MySqlParser.KW_AND); + this.state = 5643; + this.createUserAuthOption(); + } + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5646; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5647; + this.match(MySqlParser.KW_WITH); + this.state = 5648; + localContext._authPlugin = this.uid(); + this.state = 5650; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 427) { + { + this.state = 5649; + this.createUserInitialAuthOption(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createUserInitialAuthOption() { + let localContext = new CreateUserInitialAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 492, MySqlParser.RULE_createUserInitialAuthOption); + try { + this.state = 5671; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 824, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5654; + this.match(MySqlParser.KW_INITIAL); + this.state = 5655; + this.match(MySqlParser.KW_AUTHENTICATION); + this.state = 5656; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5657; + this.match(MySqlParser.KW_BY); + this.state = 5661; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_RANDOM: + { + { + this.state = 5658; + this.match(MySqlParser.KW_RANDOM); + this.state = 5659; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + case MySqlParser.STRING_LITERAL: + { + this.state = 5660; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5663; + this.match(MySqlParser.KW_INITIAL); + this.state = 5664; + this.match(MySqlParser.KW_AUTHENTICATION); + this.state = 5665; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5666; + this.match(MySqlParser.KW_WITH); + this.state = 5667; + localContext._authPlugin = this.uid(); + this.state = 5668; + this.match(MySqlParser.KW_AS); + this.state = 5669; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userAuthOption() { + let localContext = new UserAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 494, MySqlParser.RULE_userAuthOption); + try { + this.state = 5698; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 825, this.context)) { + case 1: + localContext = new HashAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5673; + this.userName(); + this.state = 5674; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5675; + this.match(MySqlParser.KW_BY); + this.state = 5676; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5677; + localContext._hashed = this.match(MySqlParser.STRING_LITERAL); + } + break; + case 2: + localContext = new RandomAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5679; + this.userName(); + this.state = 5680; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5681; + this.match(MySqlParser.KW_BY); + this.state = 5682; + this.match(MySqlParser.KW_RANDOM); + this.state = 5683; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5684; + this.authOptionClause(); + } + break; + case 3: + localContext = new StringAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5686; + this.userName(); + this.state = 5687; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5688; + this.match(MySqlParser.KW_BY); + this.state = 5689; + this.match(MySqlParser.STRING_LITERAL); + this.state = 5690; + this.authOptionClause(); + } + break; + case 4: + localContext = new ModuleAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 5692; + this.userName(); + this.state = 5693; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5694; + this.match(MySqlParser.KW_WITH); + this.state = 5695; + this.authenticationRule(); + } + break; + case 5: + localContext = new SimpleAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 5697; + this.userName(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + authOptionClause() { + let localContext = new AuthOptionClauseContext(this.context, this.state); + this.enterRule(localContext, 496, MySqlParser.RULE_authOptionClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5702; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 826, this.context)) { + case 1: + { + this.state = 5700; + this.match(MySqlParser.KW_REPLACE); + this.state = 5701; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + this.state = 5707; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 147) { + { + this.state = 5704; + this.match(MySqlParser.KW_RETAIN); + this.state = 5705; + this.match(MySqlParser.KW_CURRENT); + this.state = 5706; + this.match(MySqlParser.KW_PASSWORD); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + authenticationRule() { + let localContext = new AuthenticationRuleContext(this.context, this.state); + this.enterRule(localContext, 498, MySqlParser.RULE_authenticationRule); + let _la; + try { + this.state = 5723; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 830, this.context)) { + case 1: + localContext = new ModuleContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5709; + localContext._authPlugin = this.uid(); + this.state = 5717; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 829, this.context)) { + case 1: + { + this.state = 5710; + _la = this.tokenStream.LA(1); + if (!(_la === 13 || _la === 20 || _la === 188)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5714; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5711; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + this.state = 5712; + this.match(MySqlParser.KW_RANDOM); + this.state = 5713; + this.match(MySqlParser.KW_PASSWORD); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5716; + this.authOptionClause(); + } + break; + } + } + break; + case 2: + localContext = new PasswordModuleOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5719; + localContext._authPlugin = this.uid(); + this.state = 5720; + this.match(MySqlParser.KW_USING); + this.state = 5721; + this.passwordFunctionClause(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tlsOption() { + let localContext = new TlsOptionContext(this.context, this.state); + this.enterRule(localContext, 500, MySqlParser.RULE_tlsOption); + try { + this.state = 5733; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SSL: + this.enterOuterAlt(localContext, 1); + { + this.state = 5725; + this.match(MySqlParser.KW_SSL); + } + break; + case MySqlParser.KW_X509: + this.enterOuterAlt(localContext, 2); + { + this.state = 5726; + this.match(MySqlParser.KW_X509); + } + break; + case MySqlParser.KW_CIPHER: + this.enterOuterAlt(localContext, 3); + { + this.state = 5727; + this.match(MySqlParser.KW_CIPHER); + this.state = 5728; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ISSUER: + this.enterOuterAlt(localContext, 4); + { + this.state = 5729; + this.match(MySqlParser.KW_ISSUER); + this.state = 5730; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_SUBJECT: + this.enterOuterAlt(localContext, 5); + { + this.state = 5731; + this.match(MySqlParser.KW_SUBJECT); + this.state = 5732; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userResourceOption() { + let localContext = new UserResourceOptionContext(this.context, this.state); + this.enterRule(localContext, 502, MySqlParser.RULE_userResourceOption); + try { + this.state = 5743; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + this.enterOuterAlt(localContext, 1); + { + this.state = 5735; + this.match(MySqlParser.KW_MAX_QUERIES_PER_HOUR); + this.state = 5736; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + this.enterOuterAlt(localContext, 2); + { + this.state = 5737; + this.match(MySqlParser.KW_MAX_UPDATES_PER_HOUR); + this.state = 5738; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + this.enterOuterAlt(localContext, 3); + { + this.state = 5739; + this.match(MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR); + this.state = 5740; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MAX_USER_CONNECTIONS: + this.enterOuterAlt(localContext, 4); + { + this.state = 5741; + this.match(MySqlParser.KW_MAX_USER_CONNECTIONS); + this.state = 5742; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userPasswordOption() { + let localContext = new UserPasswordOptionContext(this.context, this.state); + this.enterRule(localContext, 504, MySqlParser.RULE_userPasswordOption); + let _la; + try { + this.state = 5783; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 838, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5745; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5746; + this.match(MySqlParser.KW_EXPIRE); + this.state = 5753; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 5747; + localContext._expireType = this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.KW_NEVER: + { + this.state = 5748; + localContext._expireType = this.match(MySqlParser.KW_NEVER); + } + break; + case MySqlParser.KW_INTERVAL: + { + this.state = 5749; + localContext._expireType = this.match(MySqlParser.KW_INTERVAL); + this.state = 5750; + this.decimalLiteral(); + this.state = 5751; + this.match(MySqlParser.KW_DAY); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5755; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5756; + this.match(MySqlParser.KW_HISTORY); + this.state = 5759; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 5757; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5758; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5761; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5762; + this.match(MySqlParser.KW_REUSE); + this.state = 5763; + this.match(MySqlParser.KW_INTERVAL); + this.state = 5768; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 5764; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5765; + this.decimalLiteral(); + this.state = 5766; + this.match(MySqlParser.KW_DAY); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5770; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5771; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5772; + this.match(MySqlParser.KW_CURRENT); + this.state = 5774; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42 || _la === 122) { + { + this.state = 5773; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 122)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 5776; + this.match(MySqlParser.KW_FAILED_LOGIN_ATTEMPTS); + this.state = 5777; + this.decimalLiteral(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 5778; + this.match(MySqlParser.KW_PASSWORD_LOCK_TIME); + this.state = 5781; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5779; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_UNBOUNDED: + { + this.state = 5780; + this.match(MySqlParser.KW_UNBOUNDED); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userLockOption() { + let localContext = new UserLockOptionContext(this.context, this.state); + this.enterRule(localContext, 506, MySqlParser.RULE_userLockOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5785; + this.match(MySqlParser.KW_ACCOUNT); + this.state = 5786; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 104 || _la === 183)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + factorAuthOption() { + let localContext = new FactorAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 508, MySqlParser.RULE_factorAuthOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5788; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5791; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 5789; + this.match(MySqlParser.KW_WITH); + this.state = 5790; + localContext._authPlugin = this.uid(); + } + } + this.state = 5801; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BY: + { + { + this.state = 5793; + this.match(MySqlParser.KW_BY); + this.state = 5797; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5794; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + { + this.state = 5795; + this.match(MySqlParser.KW_RANDOM); + this.state = 5796; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + break; + case MySqlParser.KW_AS: + { + this.state = 5799; + this.match(MySqlParser.KW_AS); + this.state = 5800; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + registrationOption() { + let localContext = new RegistrationOptionContext(this.context, this.state); + this.enterRule(localContext, 510, MySqlParser.RULE_registrationOption); + try { + this.state = 5818; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 842, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5803; + this.factor(); + this.state = 5804; + this.match(MySqlParser.KW_INITIATE); + this.state = 5805; + this.match(MySqlParser.KW_REGISTRATION); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5807; + this.factor(); + this.state = 5808; + this.match(MySqlParser.KW_FINISH); + this.state = 5809; + this.match(MySqlParser.KW_REGISTRATION); + this.state = 5810; + this.match(MySqlParser.KW_SET); + this.state = 5811; + this.match(MySqlParser.KW_CHALLENGE_RESPONSE); + this.state = 5812; + this.match(MySqlParser.KW_AS); + this.state = 5813; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5815; + this.factor(); + this.state = 5816; + this.match(MySqlParser.KW_UNREGISTER); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + factor() { + let localContext = new FactorContext(this.context, this.state); + this.enterRule(localContext, 512, MySqlParser.RULE_factor); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5820; + _la = this.tokenStream.LA(1); + if (!(_la === 873 || _la === 874)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5821; + this.match(MySqlParser.KW_FACTOR); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privelegeClause() { + let localContext = new PrivelegeClauseContext(this.context, this.state); + this.enterRule(localContext, 514, MySqlParser.RULE_privelegeClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5823; + this.privilege(); + this.state = 5828; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 5824; + this.match(MySqlParser.LR_BRACKET); + this.state = 5825; + this.columnNames(); + this.state = 5826; + this.match(MySqlParser.RR_BRACKET); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilege() { + let localContext = new PrivilegeContext(this.context, this.state); + this.enterRule(localContext, 516, MySqlParser.RULE_privilege); + let _la; + try { + this.state = 5923; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 848, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5830; + this.match(MySqlParser.KW_ALL); + this.state = 5832; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 734) { + { + this.state = 5831; + this.match(MySqlParser.KW_PRIVILEGES); + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5834; + this.match(MySqlParser.KW_ALTER); + this.state = 5836; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 743) { + { + this.state = 5835; + this.match(MySqlParser.KW_ROUTINE); + } + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5838; + this.match(MySqlParser.KW_CREATE); + this.state = 5846; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TEMPORARY: + { + this.state = 5839; + this.match(MySqlParser.KW_TEMPORARY); + this.state = 5840; + this.match(MySqlParser.KW_TABLES); + } + break; + case MySqlParser.KW_ROUTINE: + { + this.state = 5841; + this.match(MySqlParser.KW_ROUTINE); + } + break; + case MySqlParser.KW_VIEW: + { + this.state = 5842; + this.match(MySqlParser.KW_VIEW); + } + break; + case MySqlParser.KW_USER: + { + this.state = 5843; + this.match(MySqlParser.KW_USER); + } + break; + case MySqlParser.KW_TABLESPACE: + { + this.state = 5844; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case MySqlParser.KW_ROLE: + { + this.state = 5845; + this.match(MySqlParser.KW_ROLE); + } + break; + case MySqlParser.KW_ON: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + break; + default: + break; + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5848; + this.match(MySqlParser.KW_DELETE); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 5849; + this.match(MySqlParser.KW_DROP); + this.state = 5851; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 582) { + { + this.state = 5850; + this.match(MySqlParser.KW_ROLE); + } + } + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 5853; + this.match(MySqlParser.KW_EVENT); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 5854; + this.match(MySqlParser.KW_EXECUTE); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 5855; + this.match(MySqlParser.KW_FILE); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 5856; + this.match(MySqlParser.KW_GRANT); + this.state = 5857; + this.match(MySqlParser.KW_OPTION); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 5858; + this.match(MySqlParser.KW_INDEX); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 5859; + this.match(MySqlParser.KW_INSERT); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 5860; + this.match(MySqlParser.KW_LOCK); + this.state = 5861; + this.match(MySqlParser.KW_TABLES); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 5862; + this.match(MySqlParser.KW_PROCESS); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 5863; + this.match(MySqlParser.KW_PROXY); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 5864; + this.match(MySqlParser.KW_REFERENCES); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 5865; + this.match(MySqlParser.KW_RELOAD); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 5866; + this.match(MySqlParser.KW_REPLICATION); + this.state = 5867; + _la = this.tokenStream.LA(1); + if (!(_la === 333 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 18: + this.enterOuterAlt(localContext, 18); + { + this.state = 5868; + this.match(MySqlParser.KW_SELECT); + } + break; + case 19: + this.enterOuterAlt(localContext, 19); + { + this.state = 5869; + this.match(MySqlParser.KW_SHOW); + this.state = 5870; + _la = this.tokenStream.LA(1); + if (!(_la === 40 || _la === 684)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 20: + this.enterOuterAlt(localContext, 20); + { + this.state = 5871; + this.match(MySqlParser.KW_SHUTDOWN); + } + break; + case 21: + this.enterOuterAlt(localContext, 21); + { + this.state = 5872; + this.match(MySqlParser.KW_SUPER); + } + break; + case 22: + this.enterOuterAlt(localContext, 22); + { + this.state = 5873; + this.match(MySqlParser.KW_TRIGGER); + } + break; + case 23: + this.enterOuterAlt(localContext, 23); + { + this.state = 5874; + this.match(MySqlParser.KW_UPDATE); + } + break; + case 24: + this.enterOuterAlt(localContext, 24); + { + this.state = 5875; + this.match(MySqlParser.KW_USAGE); + } + break; + case 25: + this.enterOuterAlt(localContext, 25); + { + this.state = 5876; + this.match(MySqlParser.KW_APPLICATION_PASSWORD_ADMIN); + } + break; + case 26: + this.enterOuterAlt(localContext, 26); + { + this.state = 5877; + this.match(MySqlParser.KW_AUDIT_ABORT_EXEMPT); + } + break; + case 27: + this.enterOuterAlt(localContext, 27); + { + this.state = 5878; + this.match(MySqlParser.KW_AUDIT_ADMIN); + } + break; + case 28: + this.enterOuterAlt(localContext, 28); + { + this.state = 5879; + this.match(MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN); + } + break; + case 29: + this.enterOuterAlt(localContext, 29); + { + this.state = 5880; + this.match(MySqlParser.KW_BACKUP_ADMIN); + } + break; + case 30: + this.enterOuterAlt(localContext, 30); + { + this.state = 5881; + this.match(MySqlParser.KW_BINLOG_ADMIN); + } + break; + case 31: + this.enterOuterAlt(localContext, 31); + { + this.state = 5882; + this.match(MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN); + } + break; + case 32: + this.enterOuterAlt(localContext, 32); + { + this.state = 5883; + this.match(MySqlParser.KW_CLONE_ADMIN); + } + break; + case 33: + this.enterOuterAlt(localContext, 33); + { + this.state = 5884; + this.match(MySqlParser.KW_CONNECTION_ADMIN); + } + break; + case 34: + this.enterOuterAlt(localContext, 34); + { + this.state = 5885; + this.match(MySqlParser.KW_ENCRYPTION_KEY_ADMIN); + } + break; + case 35: + this.enterOuterAlt(localContext, 35); + { + this.state = 5886; + this.match(MySqlParser.KW_FIREWALL_ADMIN); + } + break; + case 36: + this.enterOuterAlt(localContext, 36); + { + this.state = 5887; + this.match(MySqlParser.KW_FIREWALL_EXEMPT); + } + break; + case 37: + this.enterOuterAlt(localContext, 37); + { + this.state = 5888; + this.match(MySqlParser.KW_FIREWALL_USER); + } + break; + case 38: + this.enterOuterAlt(localContext, 38); + { + this.state = 5889; + this.match(MySqlParser.KW_FLUSH_OPTIMIZER_COSTS); + } + break; + case 39: + this.enterOuterAlt(localContext, 39); + { + this.state = 5890; + this.match(MySqlParser.KW_FLUSH_STATUS); + } + break; + case 40: + this.enterOuterAlt(localContext, 40); + { + this.state = 5891; + this.match(MySqlParser.KW_FLUSH_TABLES); + } + break; + case 41: + this.enterOuterAlt(localContext, 41); + { + this.state = 5892; + this.match(MySqlParser.KW_FLUSH_USER_RESOURCES); + } + break; + case 42: + this.enterOuterAlt(localContext, 42); + { + this.state = 5893; + this.match(MySqlParser.KW_GROUP_REPLICATION_ADMIN); + } + break; + case 43: + this.enterOuterAlt(localContext, 43); + { + this.state = 5894; + this.match(MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE); + } + break; + case 44: + this.enterOuterAlt(localContext, 44); + { + this.state = 5895; + this.match(MySqlParser.KW_INNODB_REDO_LOG_ENABLE); + } + break; + case 45: + this.enterOuterAlt(localContext, 45); + { + this.state = 5896; + this.match(MySqlParser.KW_NDB_STORED_USER); + } + break; + case 46: + this.enterOuterAlt(localContext, 46); + { + this.state = 5897; + this.match(MySqlParser.KW_PASSWORDLESS_USER_ADMIN); + } + break; + case 47: + this.enterOuterAlt(localContext, 47); + { + this.state = 5898; + this.match(MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN); + } + break; + case 48: + this.enterOuterAlt(localContext, 48); + { + this.state = 5899; + this.match(MySqlParser.KW_REPLICATION_APPLIER); + } + break; + case 49: + this.enterOuterAlt(localContext, 49); + { + this.state = 5900; + this.match(MySqlParser.KW_REPLICATION_SLAVE_ADMIN); + } + break; + case 50: + this.enterOuterAlt(localContext, 50); + { + this.state = 5901; + this.match(MySqlParser.KW_RESOURCE_GROUP_ADMIN); + } + break; + case 51: + this.enterOuterAlt(localContext, 51); + { + this.state = 5902; + this.match(MySqlParser.KW_RESOURCE_GROUP_USER); + } + break; + case 52: + this.enterOuterAlt(localContext, 52); + { + this.state = 5903; + this.match(MySqlParser.KW_ROLE_ADMIN); + } + break; + case 53: + this.enterOuterAlt(localContext, 53); + { + this.state = 5904; + this.match(MySqlParser.KW_SERVICE_CONNECTION_ADMIN); + } + break; + case 54: + this.enterOuterAlt(localContext, 54); + { + this.state = 5905; + this.match(MySqlParser.KW_SESSION_VARIABLES_ADMIN); + } + break; + case 55: + this.enterOuterAlt(localContext, 55); + { + this.state = 5906; + this.match(MySqlParser.KW_SET_USER_ID); + } + break; + case 56: + this.enterOuterAlt(localContext, 56); + { + this.state = 5907; + this.match(MySqlParser.KW_SKIP_QUERY_REWRITE); + } + break; + case 57: + this.enterOuterAlt(localContext, 57); + { + this.state = 5908; + this.match(MySqlParser.KW_SHOW_ROUTINE); + } + break; + case 58: + this.enterOuterAlt(localContext, 58); + { + this.state = 5909; + this.match(MySqlParser.KW_SYSTEM_USER); + } + break; + case 59: + this.enterOuterAlt(localContext, 59); + { + this.state = 5910; + this.match(MySqlParser.KW_SYSTEM_VARIABLES_ADMIN); + } + break; + case 60: + this.enterOuterAlt(localContext, 60); + { + this.state = 5911; + this.match(MySqlParser.KW_TABLE_ENCRYPTION_ADMIN); + } + break; + case 61: + this.enterOuterAlt(localContext, 61); + { + this.state = 5912; + this.match(MySqlParser.KW_TP_CONNECTION_ADMIN); + } + break; + case 62: + this.enterOuterAlt(localContext, 62); + { + this.state = 5913; + this.match(MySqlParser.KW_VERSION_TOKEN_ADMIN); + } + break; + case 63: + this.enterOuterAlt(localContext, 63); + { + this.state = 5914; + this.match(MySqlParser.KW_XA_RECOVER_ADMIN); + } + break; + case 64: + this.enterOuterAlt(localContext, 64); + { + this.state = 5915; + this.match(MySqlParser.KW_LOAD); + this.state = 5916; + this.match(MySqlParser.KW_FROM); + this.state = 5917; + this.match(MySqlParser.KW_S3); + } + break; + case 65: + this.enterOuterAlt(localContext, 65); + { + this.state = 5918; + this.match(MySqlParser.KW_SELECT); + this.state = 5919; + this.match(MySqlParser.KW_INTO); + this.state = 5920; + this.match(MySqlParser.KW_S3); + } + break; + case 66: + this.enterOuterAlt(localContext, 66); + { + this.state = 5921; + this.match(MySqlParser.KW_INVOKE); + this.state = 5922; + this.match(MySqlParser.KW_LAMBDA); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilegeLevel() { + let localContext = new PrivilegeLevelContext(this.context, this.state); + this.enterRule(localContext, 518, MySqlParser.RULE_privilegeLevel); + try { + this.state = 5941; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 849, this.context)) { + case 1: + localContext = new CurrentSchemaPriviLevelContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5925; + this.match(MySqlParser.STAR); + } + break; + case 2: + localContext = new GlobalPrivLevelContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5926; + this.match(MySqlParser.STAR); + this.state = 5927; + this.match(MySqlParser.DOT); + this.state = 5928; + this.match(MySqlParser.STAR); + } + break; + case 3: + localContext = new DefiniteSchemaPrivLevelContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5929; + this.uid(); + this.state = 5930; + this.match(MySqlParser.DOT); + this.state = 5931; + this.match(MySqlParser.STAR); + } + break; + case 4: + localContext = new DefiniteFullTablePrivLevelContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 5933; + this.uid(); + this.state = 5934; + this.match(MySqlParser.DOT); + this.state = 5935; + this.uid(); + } + break; + case 5: + localContext = new DefiniteFullTablePrivLevel2Context(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 5937; + this.uid(); + this.state = 5938; + this.dottedId(); + } + break; + case 6: + localContext = new DefiniteTablePrivLevelContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 5940; + this.uid(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameUserClause() { + let localContext = new RenameUserClauseContext(this.context, this.state); + this.enterRule(localContext, 520, MySqlParser.RULE_renameUserClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5943; + localContext._fromFirst = this.userName(); + this.state = 5944; + this.match(MySqlParser.KW_TO); + this.state = 5945; + localContext._toFirst = this.userName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + analyzeTable() { + let localContext = new AnalyzeTableContext(this.context, this.state); + this.enterRule(localContext, 522, MySqlParser.RULE_analyzeTable); + let _la; + try { + this.state = 5995; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 856, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5947; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5949; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5948; + this.tableActionOption(); + } + } + this.state = 5951; + this.match(MySqlParser.KW_TABLE); + this.state = 5952; + this.tableNames(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5953; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5955; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5954; + this.tableActionOption(); + } + } + this.state = 5957; + this.match(MySqlParser.KW_TABLE); + this.state = 5958; + this.tableName(); + this.state = 5959; + this.match(MySqlParser.KW_UPDATE); + this.state = 5960; + this.match(MySqlParser.KW_HISTOGRAM); + this.state = 5961; + this.match(MySqlParser.KW_ON); + this.state = 5962; + this.columnNames(); + this.state = 5967; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 852, this.context)) { + case 1: + { + this.state = 5963; + this.match(MySqlParser.KW_WITH); + this.state = 5964; + this.decimalLiteral(); + this.state = 5965; + this.match(MySqlParser.KW_BUCKETS); + } + break; + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5969; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5971; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5970; + this.tableActionOption(); + } + } + this.state = 5973; + this.match(MySqlParser.KW_TABLE); + this.state = 5974; + this.tableName(); + this.state = 5975; + this.match(MySqlParser.KW_UPDATE); + this.state = 5976; + this.match(MySqlParser.KW_HISTOGRAM); + this.state = 5977; + this.match(MySqlParser.KW_ON); + this.state = 5978; + this.columnName(); + this.state = 5982; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 5979; + this.match(MySqlParser.KW_USING); + this.state = 5980; + this.match(MySqlParser.KW_DATA); + this.state = 5981; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5984; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5986; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5985; + this.tableActionOption(); + } + } + this.state = 5988; + this.match(MySqlParser.KW_TABLE); + this.state = 5989; + this.tableName(); + this.state = 5990; + this.match(MySqlParser.KW_DROP); + this.state = 5991; + this.match(MySqlParser.KW_HISTOGRAM); + this.state = 5992; + this.match(MySqlParser.KW_ON); + this.state = 5993; + this.columnNames(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checkTable() { + let localContext = new CheckTableContext(this.context, this.state); + this.enterRule(localContext, 524, MySqlParser.RULE_checkTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5997; + this.match(MySqlParser.KW_CHECK); + this.state = 5998; + this.match(MySqlParser.KW_TABLE); + this.state = 5999; + this.tableNames(); + this.state = 6003; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 65 || _la === 327 || _la === 392 || _la === 396 || _la === 484 || _la === 549) { + { + { + this.state = 6000; + this.checkTableOption(); + } + } + this.state = 6005; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checksumTable() { + let localContext = new ChecksumTableContext(this.context, this.state); + this.enterRule(localContext, 526, MySqlParser.RULE_checksumTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6006; + this.match(MySqlParser.KW_CHECKSUM); + this.state = 6007; + this.match(MySqlParser.KW_TABLE); + this.state = 6008; + this.tableNames(); + this.state = 6010; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392 || _la === 549) { + { + this.state = 6009; + localContext._actionOption = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 392 || _la === 549)) { + localContext._actionOption = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + optimizeTable() { + let localContext = new OptimizeTableContext(this.context, this.state); + this.enterRule(localContext, 528, MySqlParser.RULE_optimizeTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6012; + this.match(MySqlParser.KW_OPTIMIZE); + this.state = 6014; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 6013; + this.tableActionOption(); + } + } + this.state = 6016; + _la = this.tokenStream.LA(1); + if (!(_la === 173 || _la === 752)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6017; + this.tableNames(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + repairTable() { + let localContext = new RepairTableContext(this.context, this.state); + this.enterRule(localContext, 530, MySqlParser.RULE_repairTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6019; + this.match(MySqlParser.KW_REPAIR); + this.state = 6021; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 6020; + this.tableActionOption(); + } + } + this.state = 6023; + this.match(MySqlParser.KW_TABLE); + this.state = 6024; + this.tableNames(); + this.state = 6026; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 549) { + { + this.state = 6025; + this.match(MySqlParser.KW_QUICK); + } + } + this.state = 6029; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6028; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6032; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 679) { + { + this.state = 6031; + this.match(MySqlParser.KW_USE_FRM); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableActionOption() { + let localContext = new TableActionOptionContext(this.context, this.state); + this.enterRule(localContext, 532, MySqlParser.RULE_tableActionOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6034; + _la = this.tokenStream.LA(1); + if (!(_la === 115 || _la === 450)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checkTableOption() { + let localContext = new CheckTableOptionContext(this.context, this.state); + this.enterRule(localContext, 534, MySqlParser.RULE_checkTableOption); + try { + this.state = 6043; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FOR: + this.enterOuterAlt(localContext, 1); + { + this.state = 6036; + this.match(MySqlParser.KW_FOR); + this.state = 6037; + this.match(MySqlParser.KW_UPGRADE); + } + break; + case MySqlParser.KW_QUICK: + this.enterOuterAlt(localContext, 2); + { + this.state = 6038; + this.match(MySqlParser.KW_QUICK); + } + break; + case MySqlParser.KW_FAST: + this.enterOuterAlt(localContext, 3); + { + this.state = 6039; + this.match(MySqlParser.KW_FAST); + } + break; + case MySqlParser.KW_MEDIUM: + this.enterOuterAlt(localContext, 4); + { + this.state = 6040; + this.match(MySqlParser.KW_MEDIUM); + } + break; + case MySqlParser.KW_EXTENDED: + this.enterOuterAlt(localContext, 5); + { + this.state = 6041; + this.match(MySqlParser.KW_EXTENDED); + } + break; + case MySqlParser.KW_CHANGED: + this.enterOuterAlt(localContext, 6); + { + this.state = 6042; + this.match(MySqlParser.KW_CHANGED); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createFunction() { + let localContext = new CreateFunctionContext(this.context, this.state); + this.enterRule(localContext, 536, MySqlParser.RULE_createFunction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6045; + this.match(MySqlParser.KW_CREATE); + this.state = 6047; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 307) { + { + this.state = 6046; + this.match(MySqlParser.KW_AGGREGATE); + } + } + this.state = 6049; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6051; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 866, this.context)) { + case 1: + { + this.state = 6050; + this.ifNotExists(); + } + break; + } + this.state = 6053; + this.functionNameCreate(); + this.state = 6054; + this.match(MySqlParser.KW_RETURNS); + this.state = 6055; + localContext._returnType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 208)) & ~0x1F) === 0 && ((1 << (_la - 208)) & 261) !== 0) || _la === 649)) { + localContext._returnType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6056; + this.match(MySqlParser.KW_SONAME); + this.state = 6057; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + installComponent() { + let localContext = new InstallComponentContext(this.context, this.state); + this.enterRule(localContext, 538, MySqlParser.RULE_installComponent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6059; + this.match(MySqlParser.KW_INSTALL); + this.state = 6060; + this.match(MySqlParser.KW_COMPONENT); + this.state = 6061; + localContext._component_name = this.uid(); + this.state = 6066; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6062; + this.match(MySqlParser.COMMA); + this.state = 6063; + localContext._component_name = this.uid(); + } + } + this.state = 6068; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 6078; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 869, this.context)) { + case 1: + { + this.state = 6069; + this.match(MySqlParser.KW_SET); + this.state = 6070; + this.variableExpr(); + this.state = 6075; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6071; + this.match(MySqlParser.COMMA); + this.state = 6072; + this.variableExpr(); + } + } + this.state = 6077; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + variableExpr() { + let localContext = new VariableExprContext(this.context, this.state); + this.enterRule(localContext, 540, MySqlParser.RULE_variableExpr); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6080; + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 531 || _la === 893 || _la === 894)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6081; + localContext._system_var_name = this.fullId(); + this.state = 6082; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6083; + this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uninstallComponent() { + let localContext = new UninstallComponentContext(this.context, this.state); + this.enterRule(localContext, 542, MySqlParser.RULE_uninstallComponent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6085; + this.match(MySqlParser.KW_UNINSTALL); + this.state = 6086; + this.match(MySqlParser.KW_COMPONENT); + this.state = 6087; + localContext._component_name = this.uid(); + this.state = 6092; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6088; + this.match(MySqlParser.COMMA); + this.state = 6089; + localContext._component_name = this.uid(); + } + } + this.state = 6094; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + installPlugin() { + let localContext = new InstallPluginContext(this.context, this.state); + this.enterRule(localContext, 544, MySqlParser.RULE_installPlugin); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6095; + this.match(MySqlParser.KW_INSTALL); + this.state = 6096; + this.match(MySqlParser.KW_PLUGIN); + this.state = 6097; + localContext._pluginName = this.uid(); + this.state = 6098; + this.match(MySqlParser.KW_SONAME); + this.state = 6099; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uninstallPlugin() { + let localContext = new UninstallPluginContext(this.context, this.state); + this.enterRule(localContext, 546, MySqlParser.RULE_uninstallPlugin); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6101; + this.match(MySqlParser.KW_UNINSTALL); + this.state = 6102; + this.match(MySqlParser.KW_PLUGIN); + this.state = 6103; + localContext._pluginName = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + cloneStatement() { + let localContext = new CloneStatementContext(this.context, this.state); + this.enterRule(localContext, 548, MySqlParser.RULE_cloneStatement); + let _la; + try { + this.state = 6135; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 876, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6105; + this.match(MySqlParser.KW_CLONE); + this.state = 6106; + this.match(MySqlParser.KW_LOCAL); + this.state = 6107; + this.match(MySqlParser.KW_DATA); + this.state = 6108; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 6110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 6109; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 6112; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6113; + this.match(MySqlParser.KW_CLONE); + this.state = 6114; + this.match(MySqlParser.KW_INSTANCE); + this.state = 6115; + this.match(MySqlParser.KW_FROM); + this.state = 6116; + this.userHostPort(); + this.state = 6117; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 6118; + this.match(MySqlParser.KW_BY); + this.state = 6119; + this.match(MySqlParser.STRING_LITERAL); + this.state = 6126; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 360) { + { + this.state = 6120; + this.match(MySqlParser.KW_DATA); + this.state = 6121; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 6123; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 6122; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 6125; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 6133; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 6128; + this.match(MySqlParser.KW_REQUIRE); + this.state = 6130; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 6129; + this.match(MySqlParser.KW_NO); + } + } + this.state = 6132; + this.match(MySqlParser.KW_SSL); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setStatement() { + let localContext = new SetStatementContext(this.context, this.state); + this.enterRule(localContext, 550, MySqlParser.RULE_setStatement); + let _la; + try { + this.state = 6189; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 884, this.context)) { + case 1: + localContext = new SetVariableContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6137; + this.match(MySqlParser.KW_SET); + this.state = 6138; + this.variableClause(); + this.state = 6139; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6142; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 877, this.context)) { + case 1: + { + this.state = 6140; + this.expression(0); + } + break; + case 2: + { + this.state = 6141; + this.match(MySqlParser.KW_ON); + } + break; + } + this.state = 6153; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6144; + this.match(MySqlParser.COMMA); + this.state = 6145; + this.variableClause(); + this.state = 6146; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6149; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 878, this.context)) { + case 1: + { + this.state = 6147; + this.expression(0); + } + break; + case 2: + { + this.state = 6148; + this.match(MySqlParser.KW_ON); + } + break; + } + } + } + this.state = 6155; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + localContext = new SetCharsetContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6156; + this.match(MySqlParser.KW_SET); + this.state = 6157; + this.charSet(); + this.state = 6160; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 6158; + this.charsetName(); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 6159; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 3: + localContext = new SetNamesContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 6162; + this.match(MySqlParser.KW_SET); + this.state = 6163; + this.match(MySqlParser.KW_NAMES); + this.state = 6170; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 6164; + this.charsetName(); + this.state = 6167; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 28) { + { + this.state = 6165; + this.match(MySqlParser.KW_COLLATE); + this.state = 6166; + this.collationName(); + } + } + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 6169; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 4: + localContext = new SetPasswordContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 6172; + this.setPasswordStatement(); + } + break; + case 5: + localContext = new SetTransactionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 6173; + this.setTransactionStatement(); + } + break; + case 6: + localContext = new SetAutocommitContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 6174; + this.setAutocommitStatement(); + } + break; + case 7: + localContext = new SetNewValueInsideTriggerContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 6175; + this.match(MySqlParser.KW_SET); + this.state = 6176; + localContext._system_var_name = this.fullId(); + this.state = 6177; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6178; + this.expression(0); + this.state = 6186; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6179; + this.match(MySqlParser.COMMA); + this.state = 6180; + localContext._system_var_name = this.fullId(); + this.state = 6181; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6182; + this.expression(0); + } + } + this.state = 6188; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showStatement() { + let localContext = new ShowStatementContext(this.context, this.state); + this.enterRule(localContext, 552, MySqlParser.RULE_showStatement); + let _la; + try { + this.state = 6375; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 913, this.context)) { + case 1: + localContext = new ShowMasterLogsContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6191; + this.match(MySqlParser.KW_SHOW); + this.state = 6192; + localContext._logFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 228 || _la === 453)) { + localContext._logFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6193; + this.match(MySqlParser.KW_LOGS); + } + break; + case 2: + localContext = new ShowLogEventsContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6194; + this.match(MySqlParser.KW_SHOW); + this.state = 6195; + localContext._logFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 318 || _la === 559)) { + localContext._logFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6196; + this.match(MySqlParser.KW_EVENTS); + this.state = 6199; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 80) { + { + this.state = 6197; + this.match(MySqlParser.KW_IN); + this.state = 6198; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 6203; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68) { + { + this.state = 6201; + this.match(MySqlParser.KW_FROM); + this.state = 6202; + localContext._fromPosition = this.decimalLiteral(); + } + } + this.state = 6212; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 6205; + this.match(MySqlParser.KW_LIMIT); + this.state = 6209; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 887, this.context)) { + case 1: + { + this.state = 6206; + localContext._offset = this.decimalLiteral(); + this.state = 6207; + this.match(MySqlParser.COMMA); + } + break; + } + this.state = 6211; + localContext._rowCount = this.decimalLiteral(); + } + } + this.state = 6215; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6214; + this.channelOption(); + } + } + } + break; + case 3: + localContext = new ShowObjectFilterContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 6217; + this.match(MySqlParser.KW_SHOW); + this.state = 6218; + this.showCommonEntity(); + this.state = 6220; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6219; + this.showFilter(); + } + } + } + break; + case 4: + localContext = new ShowColumnsContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 6222; + this.match(MySqlParser.KW_SHOW); + this.state = 6224; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6223; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6227; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 408) { + { + this.state = 6226; + this.match(MySqlParser.KW_FULL); + } + } + this.state = 6229; + localContext._columnsFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 337 || _la === 398)) { + localContext._columnsFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6230; + localContext._tableFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._tableFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6231; + this.tableName(); + this.state = 6234; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6232; + localContext._schemaFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._schemaFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6233; + this.databaseName(); + } + } + this.state = 6237; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6236; + this.showFilter(); + } + } + } + break; + case 5: + localContext = new ShowCreateDbContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 6239; + this.match(MySqlParser.KW_SHOW); + this.state = 6240; + this.match(MySqlParser.KW_CREATE); + this.state = 6241; + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6243; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 895, this.context)) { + case 1: + { + this.state = 6242; + this.ifNotExists(); + } + break; + } + this.state = 6245; + this.databaseName(); + } + break; + case 6: + localContext = new ShowCreateFullIdObjectContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 6246; + this.match(MySqlParser.KW_SHOW); + this.state = 6247; + this.match(MySqlParser.KW_CREATE); + this.state = 6248; + _la = this.tokenStream.LA(1); + if (!(_la === 132 || _la === 178 || _la === 385)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6249; + this.fullId(); + } + break; + case 7: + localContext = new ShowCreateFunctionContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 6250; + this.match(MySqlParser.KW_SHOW); + this.state = 6251; + this.match(MySqlParser.KW_CREATE); + this.state = 6252; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6253; + this.functionName(); + } + break; + case 8: + localContext = new ShowCreateViewContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 6254; + this.match(MySqlParser.KW_SHOW); + this.state = 6255; + this.match(MySqlParser.KW_CREATE); + this.state = 6256; + this.match(MySqlParser.KW_VIEW); + this.state = 6257; + this.viewName(); + } + break; + case 9: + localContext = new ShowCreateTableContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 6258; + this.match(MySqlParser.KW_SHOW); + this.state = 6259; + this.match(MySqlParser.KW_CREATE); + this.state = 6260; + this.match(MySqlParser.KW_TABLE); + this.state = 6261; + this.tableName(); + } + break; + case 10: + localContext = new ShowCreateUserContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 6262; + this.match(MySqlParser.KW_SHOW); + this.state = 6263; + this.match(MySqlParser.KW_CREATE); + this.state = 6264; + this.match(MySqlParser.KW_USER); + this.state = 6265; + this.userName(); + } + break; + case 11: + localContext = new ShowEngineContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 6266; + this.match(MySqlParser.KW_SHOW); + this.state = 6267; + this.match(MySqlParser.KW_ENGINE); + this.state = 6268; + this.engineName(); + this.state = 6269; + localContext._engineOption = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 493 || _la === 645)) { + localContext._engineOption = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 12: + localContext = new ShowGlobalInfoContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 6271; + this.match(MySqlParser.KW_SHOW); + this.state = 6272; + this.showGlobalInfoClause(); + } + break; + case 13: + localContext = new ShowErrorsContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 6273; + this.match(MySqlParser.KW_SHOW); + this.state = 6274; + localContext._errorFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 383 || _la === 688)) { + localContext._errorFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6282; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 6275; + this.match(MySqlParser.KW_LIMIT); + this.state = 6279; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 896, this.context)) { + case 1: + { + this.state = 6276; + localContext._offset = this.decimalLiteral(); + this.state = 6277; + this.match(MySqlParser.COMMA); + } + break; + } + this.state = 6281; + localContext._rowCount = this.decimalLiteral(); + } + } + } + break; + case 14: + localContext = new ShowCountErrorsContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 6284; + this.match(MySqlParser.KW_SHOW); + this.state = 6285; + this.match(MySqlParser.KW_COUNT); + this.state = 6286; + this.match(MySqlParser.LR_BRACKET); + this.state = 6287; + this.match(MySqlParser.STAR); + this.state = 6288; + this.match(MySqlParser.RR_BRACKET); + this.state = 6289; + localContext._errorFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 383 || _la === 688)) { + localContext._errorFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 15: + localContext = new ShowSchemaFilterContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 6290; + this.match(MySqlParser.KW_SHOW); + this.state = 6291; + this.showSchemaEntity(); + this.state = 6294; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6292; + localContext._schemaFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._schemaFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6293; + this.databaseName(); + } + } + this.state = 6297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6296; + this.showFilter(); + } + } + } + break; + case 16: + localContext = new ShowPercedureCodeContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 6299; + this.match(MySqlParser.KW_SHOW); + this.state = 6300; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 6301; + this.match(MySqlParser.KW_CODE); + this.state = 6302; + localContext._proc_name = this.fullId(); + } + break; + case 17: + localContext = new ShowFunctionCodeContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 6303; + this.match(MySqlParser.KW_SHOW); + this.state = 6304; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6305; + this.match(MySqlParser.KW_CODE); + this.state = 6306; + this.functionName(); + } + break; + case 18: + localContext = new ShowGrantsContext(localContext); + this.enterOuterAlt(localContext, 18); + { + this.state = 6307; + this.match(MySqlParser.KW_SHOW); + this.state = 6308; + this.match(MySqlParser.KW_GRANTS); + this.state = 6315; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6309; + this.match(MySqlParser.KW_FOR); + this.state = 6310; + this.userOrRoleName(); + this.state = 6313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 6311; + this.match(MySqlParser.KW_USING); + this.state = 6312; + this.userOrRoleNames(); + } + } + } + } + } + break; + case 19: + localContext = new ShowIndexesContext(localContext); + this.enterOuterAlt(localContext, 19); + { + this.state = 6317; + this.match(MySqlParser.KW_SHOW); + this.state = 6319; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6318; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6321; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 93 || _la === 426)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6322; + localContext._tableFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._tableFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6323; + this.tableName(); + this.state = 6326; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6324; + localContext._schemaFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._schemaFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6325; + this.databaseName(); + } + } + this.state = 6330; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 6328; + this.match(MySqlParser.KW_WHERE); + this.state = 6329; + this.expression(0); + } + } + } + break; + case 20: + localContext = new ShowOpenTablesContext(localContext); + this.enterOuterAlt(localContext, 20); + { + this.state = 6332; + this.match(MySqlParser.KW_SHOW); + this.state = 6333; + this.match(MySqlParser.KW_OPEN); + this.state = 6334; + this.match(MySqlParser.KW_TABLES); + this.state = 6337; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6335; + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6336; + this.databaseName(); + } + } + this.state = 6340; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6339; + this.showFilter(); + } + } + } + break; + case 21: + localContext = new ShowProfileContext(localContext); + this.enterOuterAlt(localContext, 21); + { + this.state = 6342; + this.match(MySqlParser.KW_SHOW); + this.state = 6343; + this.match(MySqlParser.KW_PROFILE); + this.state = 6352; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 320 || _la === 355 || _la === 358 || _la === 439 || _la === 521 || _la === 605 || _la === 655 || _la === 802) { + { + this.state = 6344; + this.showProfileType(); + this.state = 6349; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6345; + this.match(MySqlParser.COMMA); + this.state = 6346; + this.showProfileType(); + } + } + this.state = 6351; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 6357; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6354; + this.match(MySqlParser.KW_FOR); + this.state = 6355; + this.match(MySqlParser.KW_QUERY); + this.state = 6356; + localContext._queryCount = this.decimalLiteral(); + } + } + this.state = 6365; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 6359; + this.match(MySqlParser.KW_LIMIT); + this.state = 6360; + localContext._rowCount = this.decimalLiteral(); + this.state = 6363; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 509) { + { + this.state = 6361; + this.match(MySqlParser.KW_OFFSET); + this.state = 6362; + localContext._offset = this.decimalLiteral(); + } + } + } + } + } + break; + case 22: + localContext = new ShowSlaveStatusContext(localContext); + this.enterOuterAlt(localContext, 22); + { + this.state = 6367; + this.match(MySqlParser.KW_SHOW); + this.state = 6368; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6369; + this.match(MySqlParser.KW_STATUS); + this.state = 6371; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6370; + this.channelOption(); + } + } + } + break; + case 23: + localContext = new ShowReplicasContext(localContext); + this.enterOuterAlt(localContext, 23); + { + this.state = 6373; + this.match(MySqlParser.KW_SHOW); + this.state = 6374; + this.match(MySqlParser.KW_REPLICAS); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + variableClause() { + let localContext = new VariableClauseContext(this.context, this.state); + this.enterRule(localContext, 554, MySqlParser.RULE_variableClause); + let _la; + try { + this.state = 6387; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LOCAL_ID: + this.enterOuterAlt(localContext, 1); + { + this.state = 6377; + this.match(MySqlParser.LOCAL_ID); + } + break; + case MySqlParser.GLOBAL_ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 6378; + this.match(MySqlParser.GLOBAL_ID); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PERSIST: + case MySqlParser.KW_PERSIST_ONLY: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.AT_SIGN: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 3); + { + this.state = 6384; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 915, this.context)) { + case 1: + { + this.state = 6381; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 870) { + { + this.state = 6379; + this.match(MySqlParser.AT_SIGN); + this.state = 6380; + this.match(MySqlParser.AT_SIGN); + } + } + this.state = 6383; + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 450 || _la === 531 || _la === 532 || _la === 593)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 6386; + localContext._target = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showCommonEntity() { + let localContext = new ShowCommonEntityContext(this.context, this.state); + this.enterRule(localContext, 556, MySqlParser.RULE_showCommonEntity); + let _la; + try { + this.state = 6403; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CHARACTER: + this.enterOuterAlt(localContext, 1); + { + this.state = 6389; + this.match(MySqlParser.KW_CHARACTER); + this.state = 6390; + this.match(MySqlParser.KW_SET); + } + break; + case MySqlParser.KW_CHARSET: + this.enterOuterAlt(localContext, 2); + { + this.state = 6391; + this.match(MySqlParser.KW_CHARSET); + } + break; + case MySqlParser.KW_COLLATION: + this.enterOuterAlt(localContext, 3); + { + this.state = 6392; + this.match(MySqlParser.KW_COLLATION); + } + break; + case MySqlParser.KW_DATABASES: + this.enterOuterAlt(localContext, 4); + { + this.state = 6393; + this.match(MySqlParser.KW_DATABASES); + } + break; + case MySqlParser.KW_SCHEMAS: + this.enterOuterAlt(localContext, 5); + { + this.state = 6394; + this.match(MySqlParser.KW_SCHEMAS); + } + break; + case MySqlParser.KW_FUNCTION: + this.enterOuterAlt(localContext, 6); + { + this.state = 6395; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6396; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_PROCEDURE: + this.enterOuterAlt(localContext, 7); + { + this.state = 6397; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 6398; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_VARIABLES: + this.enterOuterAlt(localContext, 8); + { + this.state = 6400; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 413 || _la === 593) { + { + this.state = 6399; + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 593)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6402; + _la = this.tokenStream.LA(1); + if (!(_la === 645 || _la === 683)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showFilter() { + let localContext = new ShowFilterContext(this.context, this.state); + this.enterRule(localContext, 558, MySqlParser.RULE_showFilter); + try { + this.state = 6409; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_LIKE: + this.enterOuterAlt(localContext, 1); + { + this.state = 6405; + this.match(MySqlParser.KW_LIKE); + this.state = 6406; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_WHERE: + this.enterOuterAlt(localContext, 2); + { + this.state = 6407; + this.match(MySqlParser.KW_WHERE); + this.state = 6408; + this.expression(0); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showGlobalInfoClause() { + let localContext = new ShowGlobalInfoClauseContext(this.context, this.state); + this.enterRule(localContext, 560, MySqlParser.RULE_showGlobalInfoClause); + let _la; + try { + this.state = 6428; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_STORAGE: + this.enterOuterAlt(localContext, 1); + { + this.state = 6412; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 647) { + { + this.state = 6411; + this.match(MySqlParser.KW_STORAGE); + } + } + this.state = 6414; + this.match(MySqlParser.KW_ENGINES); + } + break; + case MySqlParser.KW_MASTER: + this.enterOuterAlt(localContext, 2); + { + this.state = 6415; + this.match(MySqlParser.KW_MASTER); + this.state = 6416; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_PLUGINS: + this.enterOuterAlt(localContext, 3); + { + this.state = 6417; + this.match(MySqlParser.KW_PLUGINS); + } + break; + case MySqlParser.KW_PRIVILEGES: + this.enterOuterAlt(localContext, 4); + { + this.state = 6418; + this.match(MySqlParser.KW_PRIVILEGES); + } + break; + case MySqlParser.KW_FULL: + case MySqlParser.KW_PROCESSLIST: + this.enterOuterAlt(localContext, 5); + { + this.state = 6420; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 408) { + { + this.state = 6419; + this.match(MySqlParser.KW_FULL); + } + } + this.state = 6422; + this.match(MySqlParser.KW_PROCESSLIST); + } + break; + case MySqlParser.KW_PROFILES: + this.enterOuterAlt(localContext, 6); + { + this.state = 6423; + this.match(MySqlParser.KW_PROFILES); + } + break; + case MySqlParser.KW_SLAVE: + this.enterOuterAlt(localContext, 7); + { + this.state = 6424; + this.match(MySqlParser.KW_SLAVE); + this.state = 6425; + this.match(MySqlParser.KW_HOSTS); + } + break; + case MySqlParser.KW_AUTHORS: + this.enterOuterAlt(localContext, 8); + { + this.state = 6426; + this.match(MySqlParser.KW_AUTHORS); + } + break; + case MySqlParser.KW_CONTRIBUTORS: + this.enterOuterAlt(localContext, 9); + { + this.state = 6427; + this.match(MySqlParser.KW_CONTRIBUTORS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showSchemaEntity() { + let localContext = new ShowSchemaEntityContext(this.context, this.state); + this.enterRule(localContext, 562, MySqlParser.RULE_showSchemaEntity); + let _la; + try { + this.state = 6441; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_EVENTS: + this.enterOuterAlt(localContext, 1); + { + this.state = 6430; + this.match(MySqlParser.KW_EVENTS); + } + break; + case MySqlParser.KW_TABLE: + this.enterOuterAlt(localContext, 2); + { + this.state = 6431; + this.match(MySqlParser.KW_TABLE); + this.state = 6432; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_FULL: + case MySqlParser.KW_TABLES: + this.enterOuterAlt(localContext, 3); + { + this.state = 6434; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6433; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6437; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 408) { + { + this.state = 6436; + this.match(MySqlParser.KW_FULL); + } + } + this.state = 6439; + this.match(MySqlParser.KW_TABLES); + } + break; + case MySqlParser.KW_TRIGGERS: + this.enterOuterAlt(localContext, 4); + { + this.state = 6440; + this.match(MySqlParser.KW_TRIGGERS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showProfileType() { + let localContext = new ShowProfileTypeContext(this.context, this.state); + this.enterRule(localContext, 564, MySqlParser.RULE_showProfileType); + try { + this.state = 6455; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALL: + this.enterOuterAlt(localContext, 1); + { + this.state = 6443; + this.match(MySqlParser.KW_ALL); + } + break; + case MySqlParser.KW_BLOCK: + this.enterOuterAlt(localContext, 2); + { + this.state = 6444; + this.match(MySqlParser.KW_BLOCK); + this.state = 6445; + this.match(MySqlParser.KW_IO); + } + break; + case MySqlParser.KW_CONTEXT: + this.enterOuterAlt(localContext, 3); + { + this.state = 6446; + this.match(MySqlParser.KW_CONTEXT); + this.state = 6447; + this.match(MySqlParser.KW_SWITCHES); + } + break; + case MySqlParser.KW_CPU: + this.enterOuterAlt(localContext, 4); + { + this.state = 6448; + this.match(MySqlParser.KW_CPU); + } + break; + case MySqlParser.KW_IPC: + this.enterOuterAlt(localContext, 5); + { + this.state = 6449; + this.match(MySqlParser.KW_IPC); + } + break; + case MySqlParser.KW_MEMORY: + this.enterOuterAlt(localContext, 6); + { + this.state = 6450; + this.match(MySqlParser.KW_MEMORY); + } + break; + case MySqlParser.KW_PAGE: + this.enterOuterAlt(localContext, 7); + { + this.state = 6451; + this.match(MySqlParser.KW_PAGE); + this.state = 6452; + this.match(MySqlParser.KW_FAULTS); + } + break; + case MySqlParser.KW_SOURCE: + this.enterOuterAlt(localContext, 8); + { + this.state = 6453; + this.match(MySqlParser.KW_SOURCE); + } + break; + case MySqlParser.KW_SWAPS: + this.enterOuterAlt(localContext, 9); + { + this.state = 6454; + this.match(MySqlParser.KW_SWAPS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + binlogStatement() { + let localContext = new BinlogStatementContext(this.context, this.state); + this.enterRule(localContext, 566, MySqlParser.RULE_binlogStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6457; + this.match(MySqlParser.KW_BINLOG); + this.state = 6458; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + cacheIndexStatement() { + let localContext = new CacheIndexStatementContext(this.context, this.state); + this.enterRule(localContext, 568, MySqlParser.RULE_cacheIndexStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6460; + this.match(MySqlParser.KW_CACHE); + this.state = 6461; + this.match(MySqlParser.KW_INDEX); + this.state = 6479; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 929, this.context)) { + case 1: + { + this.state = 6462; + this.tableIndex(); + this.state = 6467; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6463; + this.match(MySqlParser.COMMA); + this.state = 6464; + this.tableIndex(); + } + } + this.state = 6469; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + { + this.state = 6470; + this.tableName(); + this.state = 6471; + this.match(MySqlParser.KW_PARTITION); + this.state = 6472; + this.match(MySqlParser.LR_BRACKET); + this.state = 6475; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 6473; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 6474; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6477; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 6481; + this.match(MySqlParser.KW_IN); + this.state = 6482; + this.databaseName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + flushStatement() { + let localContext = new FlushStatementContext(this.context, this.state); + this.enterRule(localContext, 570, MySqlParser.RULE_flushStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6484; + this.match(MySqlParser.KW_FLUSH); + this.state = 6486; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 6485; + this.tableActionOption(); + } + } + this.state = 6488; + this.flushOption(); + this.state = 6493; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6489; + this.match(MySqlParser.COMMA); + this.state = 6490; + this.flushOption(); + } + } + this.state = 6495; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + killStatement() { + let localContext = new KillStatementContext(this.context, this.state); + this.enterRule(localContext, 572, MySqlParser.RULE_killStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6496; + this.match(MySqlParser.KW_KILL); + this.state = 6498; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 932, this.context)) { + case 1: + { + this.state = 6497; + localContext._connectionFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 349 || _la === 548)) { + localContext._connectionFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 6500; + this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadIndexIntoCache() { + let localContext = new LoadIndexIntoCacheContext(this.context, this.state); + this.enterRule(localContext, 574, MySqlParser.RULE_loadIndexIntoCache); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6502; + this.match(MySqlParser.KW_LOAD); + this.state = 6503; + this.match(MySqlParser.KW_INDEX); + this.state = 6504; + this.match(MySqlParser.KW_INTO); + this.state = 6505; + this.match(MySqlParser.KW_CACHE); + this.state = 6506; + this.loadedTableIndexes(); + this.state = 6511; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6507; + this.match(MySqlParser.COMMA); + this.state = 6508; + this.loadedTableIndexes(); + } + } + this.state = 6513; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetStatement() { + let localContext = new ResetStatementContext(this.context, this.state); + this.enterRule(localContext, 576, MySqlParser.RULE_resetStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6514; + this.match(MySqlParser.KW_RESET); + this.state = 6515; + this.resetOption(); + this.state = 6520; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6516; + this.match(MySqlParser.COMMA); + this.state = 6517; + this.resetOption(); + } + } + this.state = 6522; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetOption() { + let localContext = new ResetOptionContext(this.context, this.state); + this.enterRule(localContext, 578, MySqlParser.RULE_resetOption); + try { + this.state = 6528; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_MASTER: + this.enterOuterAlt(localContext, 1); + { + this.state = 6523; + this.match(MySqlParser.KW_MASTER); + } + break; + case MySqlParser.KW_REPLICA: + this.enterOuterAlt(localContext, 2); + { + this.state = 6524; + this.match(MySqlParser.KW_REPLICA); + } + break; + case MySqlParser.KW_QUERY: + this.enterOuterAlt(localContext, 3); + { + this.state = 6525; + this.match(MySqlParser.KW_QUERY); + this.state = 6526; + this.match(MySqlParser.KW_CACHE); + } + break; + case MySqlParser.KW_SLAVE: + this.enterOuterAlt(localContext, 4); + { + this.state = 6527; + this.match(MySqlParser.KW_SLAVE); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetPersist() { + let localContext = new ResetPersistContext(this.context, this.state); + this.enterRule(localContext, 580, MySqlParser.RULE_resetPersist); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6530; + this.match(MySqlParser.KW_RESET); + this.state = 6531; + this.match(MySqlParser.KW_PERSIST); + this.state = 6536; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 937, this.context)) { + case 1: + { + this.state = 6533; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 936, this.context)) { + case 1: + { + this.state = 6532; + this.ifExists(); + } + break; + } + this.state = 6535; + localContext._system_var_name = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetAllChannel() { + let localContext = new ResetAllChannelContext(this.context, this.state); + this.enterRule(localContext, 582, MySqlParser.RULE_resetAllChannel); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6538; + this.match(MySqlParser.KW_RESET); + this.state = 6539; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6541; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7) { + { + this.state = 6540; + this.match(MySqlParser.KW_ALL); + } + } + this.state = 6544; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6543; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + reStartStatement() { + let localContext = new ReStartStatementContext(this.context, this.state); + this.enterRule(localContext, 584, MySqlParser.RULE_reStartStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6546; + this.match(MySqlParser.KW_RESTART); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + shutdownStatement() { + let localContext = new ShutdownStatementContext(this.context, this.state); + this.enterRule(localContext, 586, MySqlParser.RULE_shutdownStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6548; + this.match(MySqlParser.KW_SHUTDOWN); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableIndex() { + let localContext = new TableIndexContext(this.context, this.state); + this.enterRule(localContext, 588, MySqlParser.RULE_tableIndex); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6550; + this.tableName(); + this.state = 6556; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 6551; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6552; + this.match(MySqlParser.LR_BRACKET); + this.state = 6553; + this.indexNames(); + this.state = 6554; + this.match(MySqlParser.RR_BRACKET); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + flushOption() { + let localContext = new FlushOptionContext(this.context, this.state); + this.enterRule(localContext, 590, MySqlParser.RULE_flushOption); + let _la; + try { + this.state = 6590; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 947, this.context)) { + case 1: + localContext = new SimpleFlushOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6576; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DES_KEY_FILE: + { + this.state = 6558; + this.match(MySqlParser.KW_DES_KEY_FILE); + } + break; + case MySqlParser.KW_HOSTS: + { + this.state = 6559; + this.match(MySqlParser.KW_HOSTS); + } + break; + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_SLOW: + { + this.state = 6561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228 || ((((_la - 380)) & ~0x1F) === 0 && ((1 << (_la - 380)) & 1073741829) !== 0) || _la === 556 || _la === 599) { + { + this.state = 6560; + _la = this.tokenStream.LA(1); + if (!(_la === 228 || ((((_la - 380)) & ~0x1F) === 0 && ((1 << (_la - 380)) & 1073741829) !== 0) || _la === 556 || _la === 599)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6563; + this.match(MySqlParser.KW_LOGS); + } + break; + case MySqlParser.KW_OPTIMIZER_COSTS: + { + this.state = 6564; + this.match(MySqlParser.KW_OPTIMIZER_COSTS); + } + break; + case MySqlParser.KW_PRIVILEGES: + { + this.state = 6565; + this.match(MySqlParser.KW_PRIVILEGES); + } + break; + case MySqlParser.KW_QUERY: + { + this.state = 6566; + this.match(MySqlParser.KW_QUERY); + this.state = 6567; + this.match(MySqlParser.KW_CACHE); + } + break; + case MySqlParser.KW_STATUS: + { + this.state = 6568; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_USER_RESOURCES: + { + this.state = 6569; + this.match(MySqlParser.KW_USER_RESOURCES); + } + break; + case MySqlParser.KW_TABLES: + { + this.state = 6570; + this.match(MySqlParser.KW_TABLES); + this.state = 6574; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 942, this.context)) { + case 1: + { + this.state = 6571; + this.match(MySqlParser.KW_WITH); + this.state = 6572; + this.match(MySqlParser.KW_READ); + this.state = 6573; + this.match(MySqlParser.KW_LOCK); + } + break; + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + localContext = new ChannelFlushOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6578; + this.match(MySqlParser.KW_RELAY); + this.state = 6579; + this.match(MySqlParser.KW_LOGS); + this.state = 6581; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6580; + this.channelOption(); + } + } + } + break; + case 3: + localContext = new TableFlushOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 6583; + _la = this.tokenStream.LA(1); + if (!(_la === 173 || _la === 752)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6585; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 945, this.context)) { + case 1: + { + this.state = 6584; + this.tableNames(); + } + break; + } + this.state = 6588; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 946, this.context)) { + case 1: + { + this.state = 6587; + this.flushTableOption(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + flushTableOption() { + let localContext = new FlushTableOptionContext(this.context, this.state); + this.enterRule(localContext, 592, MySqlParser.RULE_flushTableOption); + try { + this.state = 6597; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_WITH: + this.enterOuterAlt(localContext, 1); + { + this.state = 6592; + this.match(MySqlParser.KW_WITH); + this.state = 6593; + this.match(MySqlParser.KW_READ); + this.state = 6594; + this.match(MySqlParser.KW_LOCK); + } + break; + case MySqlParser.KW_FOR: + this.enterOuterAlt(localContext, 2); + { + this.state = 6595; + this.match(MySqlParser.KW_FOR); + this.state = 6596; + this.match(MySqlParser.KW_EXPORT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadedTableIndexes() { + let localContext = new LoadedTableIndexesContext(this.context, this.state); + this.enterRule(localContext, 594, MySqlParser.RULE_loadedTableIndexes); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6599; + this.tableName(); + this.state = 6607; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 6600; + this.match(MySqlParser.KW_PARTITION); + this.state = 6601; + this.match(MySqlParser.LR_BRACKET); + this.state = 6604; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 6602; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 6603; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6606; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 6616; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 952, this.context)) { + case 1: + { + this.state = 6610; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 6609; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6612; + this.match(MySqlParser.LR_BRACKET); + this.state = 6613; + this.indexNames(); + this.state = 6614; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 6620; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 6618; + this.match(MySqlParser.KW_IGNORE); + this.state = 6619; + this.match(MySqlParser.KW_LEAVES); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleDescribeStatement() { + let localContext = new SimpleDescribeStatementContext(this.context, this.state); + this.enterRule(localContext, 596, MySqlParser.RULE_simpleDescribeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6622; + localContext._command = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 45)) & ~0x1F) === 0 && ((1 << (_la - 45)) & 131075) !== 0))) { + localContext._command = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6623; + this.tableName(); + this.state = 6626; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 954, this.context)) { + case 1: + { + this.state = 6624; + localContext._column = this.columnName(); + } + break; + case 2: + { + this.state = 6625; + localContext._pattern = this.match(MySqlParser.STRING_LITERAL); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fullDescribeStatement() { + let localContext = new FullDescribeStatementContext(this.context, this.state); + this.enterRule(localContext, 598, MySqlParser.RULE_fullDescribeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6628; + localContext._command = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 45)) & ~0x1F) === 0 && ((1 << (_la - 45)) & 131075) !== 0))) { + localContext._command = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6634; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_EXTENDED: + { + this.state = 6629; + this.match(MySqlParser.KW_EXTENDED); + } + break; + case MySqlParser.KW_PARTITIONS: + { + this.state = 6630; + this.match(MySqlParser.KW_PARTITIONS); + } + break; + case MySqlParser.KW_FORMAT: + { + this.state = 6631; + this.match(MySqlParser.KW_FORMAT); + this.state = 6632; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6633; + _la = this.tokenStream.LA(1); + if (!(_la === 442 || _la === 663 || _la === 666)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_DELETE: + case MySqlParser.KW_FOR: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_UPDATE: + case MySqlParser.LR_BRACKET: + break; + default: + break; + } + this.state = 6636; + this.describeObjectClause(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + analyzeDescribeStatement() { + let localContext = new AnalyzeDescribeStatementContext(this.context, this.state); + this.enterRule(localContext, 600, MySqlParser.RULE_analyzeDescribeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6638; + localContext._command = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 45)) & ~0x1F) === 0 && ((1 << (_la - 45)) & 131075) !== 0))) { + localContext._command = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6639; + this.match(MySqlParser.KW_ANALYZE); + this.state = 6643; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 826) { + { + this.state = 6640; + this.match(MySqlParser.KW_FORMAT); + this.state = 6641; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6642; + this.match(MySqlParser.KW_TREE); + } + } + this.state = 6645; + this.selectStatement(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + helpStatement() { + let localContext = new HelpStatementContext(this.context, this.state); + this.enterRule(localContext, 602, MySqlParser.RULE_helpStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6647; + this.match(MySqlParser.KW_HELP); + this.state = 6648; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + useStatement() { + let localContext = new UseStatementContext(this.context, this.state); + this.enterRule(localContext, 604, MySqlParser.RULE_useStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6650; + this.match(MySqlParser.KW_USE); + this.state = 6651; + this.databaseName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + signalStatement() { + let localContext = new SignalStatementContext(this.context, this.state); + this.enterRule(localContext, 606, MySqlParser.RULE_signalStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6653; + this.match(MySqlParser.KW_SIGNAL); + this.state = 6661; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SQLSTATE: + { + { + this.state = 6654; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 6656; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 6655; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 6658; + this.stringLiteral(); + } + } + break; + case MySqlParser.ID: + { + this.state = 6659; + this.match(MySqlParser.ID); + } + break; + case MySqlParser.REVERSE_QUOTE_ID: + { + this.state = 6660; + this.match(MySqlParser.REVERSE_QUOTE_ID); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6672; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 960, this.context)) { + case 1: + { + this.state = 6663; + this.match(MySqlParser.KW_SET); + this.state = 6664; + this.signalConditionInformation(); + this.state = 6669; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6665; + this.match(MySqlParser.COMMA); + this.state = 6666; + this.signalConditionInformation(); + } + } + this.state = 6671; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resignalStatement() { + let localContext = new ResignalStatementContext(this.context, this.state); + this.enterRule(localContext, 608, MySqlParser.RULE_resignalStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6674; + this.match(MySqlParser.KW_RESIGNAL); + this.state = 6682; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SQLSTATE: + { + { + this.state = 6675; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 6677; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 6676; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 6679; + this.stringLiteral(); + } + } + break; + case MySqlParser.ID: + { + this.state = 6680; + this.match(MySqlParser.ID); + } + break; + case MySqlParser.REVERSE_QUOTE_ID: + { + this.state = 6681; + this.match(MySqlParser.REVERSE_QUOTE_ID); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.SEMI: + break; + default: + break; + } + this.state = 6693; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 964, this.context)) { + case 1: + { + this.state = 6684; + this.match(MySqlParser.KW_SET); + this.state = 6685; + this.signalConditionInformation(); + this.state = 6690; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6686; + this.match(MySqlParser.COMMA); + this.state = 6687; + this.signalConditionInformation(); + } + } + this.state = 6692; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + signalConditionInformation() { + let localContext = new SignalConditionInformationContext(this.context, this.state); + this.enterRule(localContext, 610, MySqlParser.RULE_signalConditionInformation); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6695; + _la = this.tokenStream.LA(1); + if (!(((((_la - 332)) & ~0x1F) === 0 && ((1 << (_la - 332)) & 137887873) !== 0) || _la === 487 || _la === 495 || _la === 650 || _la === 657 || _la === 822 || _la === 832)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6696; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6701; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.START_NATIONAL_STRING_LITERAL: + case MySqlParser.STRING_LITERAL: + case MySqlParser.STRING_CHARSET_NAME: + { + this.state = 6697; + this.stringLiteral(); + } + break; + case MySqlParser.DECIMAL_LITERAL: + { + this.state = 6698; + this.match(MySqlParser.DECIMAL_LITERAL); + } + break; + case MySqlParser.LOCAL_ID: + case MySqlParser.GLOBAL_ID: + { + this.state = 6699; + this.mysqlVariable(); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.ID: + { + this.state = 6700; + this.simpleId(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + withStatement() { + let localContext = new WithStatementContext(this.context, this.state); + this.enterRule(localContext, 612, MySqlParser.RULE_withStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6703; + this.match(MySqlParser.KW_WITH); + this.state = 6705; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 966, this.context)) { + case 1: + { + this.state = 6704; + this.match(MySqlParser.KW_RECURSIVE); + } + break; + } + this.state = 6707; + this.commonTableExpressions(); + this.state = 6712; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6708; + this.match(MySqlParser.COMMA); + this.state = 6709; + this.commonTableExpressions(); + } + } + this.state = 6714; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableStatement() { + let localContext = new TableStatementContext(this.context, this.state); + this.enterRule(localContext, 614, MySqlParser.RULE_tableStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6715; + this.match(MySqlParser.KW_TABLE); + this.state = 6716; + this.tableName(); + this.state = 6718; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 968, this.context)) { + case 1: + { + this.state = 6717; + this.orderByClause(); + } + break; + } + this.state = 6721; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 969, this.context)) { + case 1: + { + this.state = 6720; + this.limitClause(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + diagnosticsStatement() { + let localContext = new DiagnosticsStatementContext(this.context, this.state); + this.enterRule(localContext, 616, MySqlParser.RULE_diagnosticsStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6723; + this.match(MySqlParser.KW_GET); + this.state = 6725; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 36 || _la === 170) { + { + this.state = 6724; + _la = this.tokenStream.LA(1); + if (!(_la === 36 || _la === 170)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6727; + this.match(MySqlParser.KW_DIAGNOSTICS); + this.state = 6759; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 974, this.context)) { + case 1: + { + { + this.state = 6728; + this.variableClause(); + this.state = 6729; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6730; + _la = this.tokenStream.LA(1); + if (!(_la === 117 || _la === 831)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6738; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6731; + this.match(MySqlParser.COMMA); + this.state = 6732; + this.variableClause(); + this.state = 6733; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6734; + _la = this.tokenStream.LA(1); + if (!(_la === 117 || _la === 831)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6740; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + case 2: + { + { + this.state = 6741; + this.match(MySqlParser.KW_CONDITION); + this.state = 6744; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 6742; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PERSIST: + case MySqlParser.KW_PERSIST_ONLY: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.AT_SIGN: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + case MySqlParser.LOCAL_ID: + case MySqlParser.GLOBAL_ID: + { + this.state = 6743; + this.variableClause(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6746; + this.variableClause(); + this.state = 6747; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6748; + this.diagnosticsConditionInformationName(); + this.state = 6756; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6749; + this.match(MySqlParser.COMMA); + this.state = 6750; + this.variableClause(); + this.state = 6751; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6752; + this.diagnosticsConditionInformationName(); + } + } + this.state = 6758; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + diagnosticsConditionInformationName() { + let localContext = new DiagnosticsConditionInformationNameContext(this.context, this.state); + this.enterRule(localContext, 618, MySqlParser.RULE_diagnosticsConditionInformationName); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6761; + _la = this.tokenStream.LA(1); + if (!(((((_la - 332)) & ~0x1F) === 0 && ((1 << (_la - 332)) & 137887873) !== 0) || _la === 487 || _la === 495 || _la === 578 || _la === 650 || _la === 657 || _la === 822 || _la === 832)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + describeObjectClause() { + let localContext = new DescribeObjectClauseContext(this.context, this.state); + this.enterRule(localContext, 620, MySqlParser.RULE_describeObjectClause); + try { + this.state = 6773; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DELETE: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_UPDATE: + case MySqlParser.LR_BRACKET: + localContext = new DescribeStatementsContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6768; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.LR_BRACKET: + { + this.state = 6763; + this.selectStatement(); + } + break; + case MySqlParser.KW_DELETE: + { + this.state = 6764; + this.deleteStatement(); + } + break; + case MySqlParser.KW_INSERT: + { + this.state = 6765; + this.insertStatement(); + } + break; + case MySqlParser.KW_REPLACE: + { + this.state = 6766; + this.replaceStatement(); + } + break; + case MySqlParser.KW_UPDATE: + { + this.state = 6767; + this.updateStatement(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_FOR: + localContext = new DescribeConnectionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6770; + this.match(MySqlParser.KW_FOR); + this.state = 6771; + this.match(MySqlParser.KW_CONNECTION); + this.state = 6772; + localContext._connection_id = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + databaseNameCreate() { + let localContext = new DatabaseNameCreateContext(this.context, this.state); + this.enterRule(localContext, 622, MySqlParser.RULE_databaseNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6775; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + databaseName() { + let localContext = new DatabaseNameContext(this.context, this.state); + this.enterRule(localContext, 624, MySqlParser.RULE_databaseName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6777; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionNameCreate() { + let localContext = new FunctionNameCreateContext(this.context, this.state); + this.enterRule(localContext, 626, MySqlParser.RULE_functionNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6779; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionName() { + let localContext = new FunctionNameContext(this.context, this.state); + this.enterRule(localContext, 628, MySqlParser.RULE_functionName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6781; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + viewNameCreate() { + let localContext = new ViewNameCreateContext(this.context, this.state); + this.enterRule(localContext, 630, MySqlParser.RULE_viewNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6783; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + viewName() { + let localContext = new ViewNameContext(this.context, this.state); + this.enterRule(localContext, 632, MySqlParser.RULE_viewName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6785; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexNameCreate() { + let localContext = new IndexNameCreateContext(this.context, this.state); + this.enterRule(localContext, 634, MySqlParser.RULE_indexNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6787; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexNames() { + let localContext = new IndexNamesContext(this.context, this.state); + this.enterRule(localContext, 636, MySqlParser.RULE_indexNames); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6789; + this.indexName(); + this.state = 6794; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6790; + this.match(MySqlParser.COMMA); + this.state = 6791; + this.indexName(); + } + } + this.state = 6796; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexName() { + let localContext = new IndexNameContext(this.context, this.state); + this.enterRule(localContext, 638, MySqlParser.RULE_indexName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6797; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupNameCreate() { + let localContext = new GroupNameCreateContext(this.context, this.state); + this.enterRule(localContext, 640, MySqlParser.RULE_groupNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6799; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupName() { + let localContext = new GroupNameContext(this.context, this.state); + this.enterRule(localContext, 642, MySqlParser.RULE_groupName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6801; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableNameCreate() { + let localContext = new TableNameCreateContext(this.context, this.state); + this.enterRule(localContext, 644, MySqlParser.RULE_tableNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6803; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableNames() { + let localContext = new TableNamesContext(this.context, this.state); + this.enterRule(localContext, 646, MySqlParser.RULE_tableNames); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 6805; + this.tableName(); + this.state = 6810; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 978, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 6806; + this.match(MySqlParser.COMMA); + this.state = 6807; + this.tableName(); + } + } + } + this.state = 6812; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 978, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableName() { + let localContext = new TableNameContext(this.context, this.state); + this.enterRule(localContext, 648, MySqlParser.RULE_tableName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6813; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userOrRoleNames() { + let localContext = new UserOrRoleNamesContext(this.context, this.state); + this.enterRule(localContext, 650, MySqlParser.RULE_userOrRoleNames); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6815; + this.userOrRoleName(); + this.state = 6820; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6816; + this.match(MySqlParser.COMMA); + this.state = 6817; + this.userOrRoleName(); + } + } + this.state = 6822; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userOrRoleName() { + let localContext = new UserOrRoleNameContext(this.context, this.state); + this.enterRule(localContext, 652, MySqlParser.RULE_userOrRoleName); + try { + this.state = 6825; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 980, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6823; + this.userName(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6824; + this.uid(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnNameCreate() { + let localContext = new ColumnNameCreateContext(this.context, this.state); + this.enterRule(localContext, 654, MySqlParser.RULE_columnNameCreate); + let _la; + try { + this.state = 6841; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 985, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6827; + this.uid(); + this.state = 6832; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 6828; + this.dottedId(); + this.state = 6830; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 6829; + this.dottedId(); + } + } + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6835; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 983, this.context)) { + case 1: + { + this.state = 6834; + this.matchWildcard(); + } + break; + } + this.state = 6837; + this.dottedId(); + this.state = 6839; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 6838; + this.dottedId(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnNames() { + let localContext = new ColumnNamesContext(this.context, this.state); + this.enterRule(localContext, 656, MySqlParser.RULE_columnNames); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 6843; + this.columnName(); + this.state = 6848; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 986, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 6844; + this.match(MySqlParser.COMMA); + this.state = 6845; + this.columnName(); + } + } + } + this.state = 6850; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 986, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnName() { + let localContext = new ColumnNameContext(this.context, this.state); + this.enterRule(localContext, 658, MySqlParser.RULE_columnName); + try { + this.state = 6866; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 991, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6851; + this.uid(); + this.state = 6856; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 988, this.context)) { + case 1: + { + this.state = 6852; + this.dottedId(); + this.state = 6854; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 987, this.context)) { + case 1: + { + this.state = 6853; + this.dottedId(); + } + break; + } + } + break; + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6859; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 989, this.context)) { + case 1: + { + this.state = 6858; + this.matchWildcard(); + } + break; + } + this.state = 6861; + this.dottedId(); + this.state = 6863; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 990, this.context)) { + case 1: + { + this.state = 6862; + this.dottedId(); + } + break; + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6865; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablespaceNameCreate() { + let localContext = new TablespaceNameCreateContext(this.context, this.state); + this.enterRule(localContext, 660, MySqlParser.RULE_tablespaceNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6868; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablespaceName() { + let localContext = new TablespaceNameContext(this.context, this.state); + this.enterRule(localContext, 662, MySqlParser.RULE_tablespaceName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6870; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionNameCreate() { + let localContext = new PartitionNameCreateContext(this.context, this.state); + this.enterRule(localContext, 664, MySqlParser.RULE_partitionNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6872; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionNames() { + let localContext = new PartitionNamesContext(this.context, this.state); + this.enterRule(localContext, 666, MySqlParser.RULE_partitionNames); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 6874; + this.partitionName(); + this.state = 6879; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 992, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 6875; + this.match(MySqlParser.COMMA); + this.state = 6876; + this.partitionName(); + } + } + } + this.state = 6881; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 992, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionName() { + let localContext = new PartitionNameContext(this.context, this.state); + this.enterRule(localContext, 668, MySqlParser.RULE_partitionName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6882; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexColumnName() { + let localContext = new IndexColumnNameContext(this.context, this.state); + this.enterRule(localContext, 670, MySqlParser.RULE_indexColumnName); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6892; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 994, this.context)) { + case 1: + { + this.state = 6884; + this.uid(); + this.state = 6889; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 993, this.context)) { + case 1: + { + this.state = 6885; + this.match(MySqlParser.LR_BRACKET); + this.state = 6886; + this.decimalLiteral(); + this.state = 6887; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 2: + { + this.state = 6891; + this.expression(0); + } + break; + } + this.state = 6895; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 995, this.context)) { + case 1: + { + this.state = 6894; + localContext._sortType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45)) { + localContext._sortType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userHostPort() { + let localContext = new UserHostPortContext(this.context, this.state); + this.enterRule(localContext, 672, MySqlParser.RULE_userHostPort); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6897; + this.userAtHost(); + this.state = 6898; + this.match(MySqlParser.COLON_SYMB); + this.state = 6899; + this.decimalLiteral(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userAtHost() { + let localContext = new UserAtHostContext(this.context, this.state); + this.enterRule(localContext, 674, MySqlParser.RULE_userAtHost); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6901; + this.simpleUserName(); + this.state = 6902; + this.match(MySqlParser.HOST_IP_ADDRESS); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleUserName() { + let localContext = new SimpleUserNameContext(this.context, this.state); + this.enterRule(localContext, 676, MySqlParser.RULE_simpleUserName); + try { + this.state = 6908; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 996, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6904; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6905; + this.match(MySqlParser.ID); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6906; + this.match(MySqlParser.KW_ADMIN); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 6907; + this.keywordsCanBeId(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + hostName() { + let localContext = new HostNameContext(this.context, this.state); + this.enterRule(localContext, 678, MySqlParser.RULE_hostName); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6910; + _la = this.tokenStream.LA(1); + if (!(((((_la - 870)) & ~0x1F) === 0 && ((1 << (_la - 870)) & 6291457) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userName() { + let localContext = new UserNameContext(this.context, this.state); + this.enterRule(localContext, 680, MySqlParser.RULE_userName); + let _la; + try { + this.state = 6917; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 998, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6912; + this.simpleUserName(); + this.state = 6914; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 870)) & ~0x1F) === 0 && ((1 << (_la - 870)) & 6291457) !== 0)) { + { + this.state = 6913; + this.hostName(); + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6916; + this.currentUserExpression(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + mysqlVariable() { + let localContext = new MysqlVariableContext(this.context, this.state); + this.enterRule(localContext, 682, MySqlParser.RULE_mysqlVariable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6919; + _la = this.tokenStream.LA(1); + if (!(_la === 892 || _la === 893)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + charsetName() { + let localContext = new CharsetNameContext(this.context, this.state); + this.enterRule(localContext, 684, MySqlParser.RULE_charsetName); + try { + this.state = 6925; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 999, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6921; + this.match(MySqlParser.KW_BINARY); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6922; + this.charsetNameBase(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6923; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 6924; + this.match(MySqlParser.CHARSET_REVERSE_QOUTE_STRING); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + collationName() { + let localContext = new CollationNameContext(this.context, this.state); + this.enterRule(localContext, 686, MySqlParser.RULE_collationName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6927; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + engineName() { + let localContext = new EngineNameContext(this.context, this.state); + this.enterRule(localContext, 688, MySqlParser.RULE_engineName); + try { + this.state = 6932; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + this.enterOuterAlt(localContext, 1); + { + this.state = 6929; + this.engineNameBase(); + } + break; + case MySqlParser.ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 6930; + this.match(MySqlParser.ID); + } + break; + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 3); + { + this.state = 6931; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + engineNameBase() { + let localContext = new EngineNameBaseContext(this.context, this.state); + this.enterRule(localContext, 690, MySqlParser.RULE_engineNameBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6934; + _la = this.tokenStream.LA(1); + if (!(_la === 348 || ((((_la - 797)) & ~0x1F) === 0 && ((1 << (_la - 797)) & 4095) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uuidSet() { + let localContext = new UuidSetContext(this.context, this.state); + this.enterRule(localContext, 692, MySqlParser.RULE_uuidSet); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6936; + this.decimalLiteral(); + this.state = 6937; + this.match(MySqlParser.MINUS); + this.state = 6938; + this.decimalLiteral(); + this.state = 6939; + this.match(MySqlParser.MINUS); + this.state = 6940; + this.decimalLiteral(); + this.state = 6941; + this.match(MySqlParser.MINUS); + this.state = 6942; + this.decimalLiteral(); + this.state = 6943; + this.match(MySqlParser.MINUS); + this.state = 6944; + this.decimalLiteral(); + this.state = 6950; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 6945; + this.match(MySqlParser.COLON_SYMB); + this.state = 6946; + this.decimalLiteral(); + this.state = 6947; + this.match(MySqlParser.MINUS); + this.state = 6948; + this.decimalLiteral(); + } + } + this.state = 6952; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 878); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xid() { + let localContext = new XidContext(this.context, this.state); + this.enterRule(localContext, 694, MySqlParser.RULE_xid); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6954; + localContext._globalTableUid = this.xuidStringId(); + this.state = 6961; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 6955; + this.match(MySqlParser.COMMA); + this.state = 6956; + localContext._qualifier = this.xuidStringId(); + this.state = 6959; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 6957; + this.match(MySqlParser.COMMA); + this.state = 6958; + localContext._idFormat = this.decimalLiteral(); + } + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xuidStringId() { + let localContext = new XuidStringIdContext(this.context, this.state); + this.enterRule(localContext, 696, MySqlParser.RULE_xuidStringId); + let _la; + try { + this.state = 6970; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 6963; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.BIT_STRING: + this.enterOuterAlt(localContext, 2); + { + this.state = 6964; + this.match(MySqlParser.BIT_STRING); + } + break; + case MySqlParser.HEXADECIMAL_LITERAL: + this.enterOuterAlt(localContext, 3); + { + this.state = 6966; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 6965; + this.match(MySqlParser.HEXADECIMAL_LITERAL); + } + } + this.state = 6968; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 884); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fullId() { + let localContext = new FullIdContext(this.context, this.state); + this.enterRule(localContext, 698, MySqlParser.RULE_fullId); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6972; + this.uid(); + this.state = 6974; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1006, this.context)) { + case 1: + { + this.state = 6973; + this.dottedId(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uidList() { + let localContext = new UidListContext(this.context, this.state); + this.enterRule(localContext, 700, MySqlParser.RULE_uidList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6976; + this.uid(); + this.state = 6981; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6977; + this.match(MySqlParser.COMMA); + this.state = 6978; + this.uid(); + } + } + this.state = 6983; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uid() { + let localContext = new UidContext(this.context, this.state); + this.enterRule(localContext, 702, MySqlParser.RULE_uid); + try { + this.state = 6987; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 1); + { + this.state = 6984; + this.simpleId(); + } + break; + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + this.enterOuterAlt(localContext, 2); + { + this.state = 6985; + this.match(MySqlParser.CHARSET_REVERSE_QOUTE_STRING); + } + break; + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 3); + { + this.state = 6986; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleId() { + let localContext = new SimpleIdContext(this.context, this.state); + this.enterRule(localContext, 704, MySqlParser.RULE_simpleId); + try { + this.state = 6998; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1009, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6989; + this.match(MySqlParser.ID); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6990; + this.charsetNameBase(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6991; + this.transactionLevelBase(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 6992; + this.engineNameBase(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 6993; + this.privilegesBase(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 6994; + this.intervalTypeBase(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 6995; + this.dataTypeBase(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 6996; + this.keywordsCanBeId(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 6997; + this.scalarFunctionName(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dottedId() { + let localContext = new DottedIdContext(this.context, this.state); + this.enterRule(localContext, 706, MySqlParser.RULE_dottedId); + try { + this.state = 7004; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1010, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7000; + this.match(MySqlParser.DOT); + this.state = 7001; + this.match(MySqlParser.ID); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7002; + this.match(MySqlParser.DOT); + this.state = 7003; + this.uid(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + decimalLiteral() { + let localContext = new DecimalLiteralContext(this.context, this.state); + this.enterRule(localContext, 708, MySqlParser.RULE_decimalLiteral); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7006; + _la = this.tokenStream.LA(1); + if (!(((((_la - 871)) & ~0x1F) === 0 && ((1 << (_la - 871)) & 20495) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fileSizeLiteral() { + let localContext = new FileSizeLiteralContext(this.context, this.state); + this.enterRule(localContext, 710, MySqlParser.RULE_fileSizeLiteral); + try { + this.state = 7010; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.FILESIZE_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 7008; + this.match(MySqlParser.FILESIZE_LITERAL); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + this.enterOuterAlt(localContext, 2); + { + this.state = 7009; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stringLiteral() { + let localContext = new StringLiteralContext(this.context, this.state); + this.enterRule(localContext, 712, MySqlParser.RULE_stringLiteral); + let _la; + try { + let alternative; + this.state = 7035; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1018, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7017; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + case MySqlParser.STRING_CHARSET_NAME: + { + this.state = 7013; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 888) { + { + this.state = 7012; + this.match(MySqlParser.STRING_CHARSET_NAME); + } + } + this.state = 7015; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.START_NATIONAL_STRING_LITERAL: + { + this.state = 7016; + this.match(MySqlParser.START_NATIONAL_STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7020; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 7019; + this.match(MySqlParser.STRING_LITERAL); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7022; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1014, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7029; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + case MySqlParser.STRING_CHARSET_NAME: + { + this.state = 7025; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 888) { + { + this.state = 7024; + this.match(MySqlParser.STRING_CHARSET_NAME); + } + } + this.state = 7027; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.START_NATIONAL_STRING_LITERAL: + { + this.state = 7028; + this.match(MySqlParser.START_NATIONAL_STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7033; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1017, this.context)) { + case 1: + { + this.state = 7031; + this.match(MySqlParser.KW_COLLATE); + this.state = 7032; + this.collationName(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + booleanLiteral() { + let localContext = new BooleanLiteralContext(this.context, this.state); + this.enterRule(localContext, 714, MySqlParser.RULE_booleanLiteral); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7037; + _la = this.tokenStream.LA(1); + if (!(_la === 63 || _la === 179)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + hexadecimalLiteral() { + let localContext = new HexadecimalLiteralContext(this.context, this.state); + this.enterRule(localContext, 716, MySqlParser.RULE_hexadecimalLiteral); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7040; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 888) { + { + this.state = 7039; + this.match(MySqlParser.STRING_CHARSET_NAME); + } + } + this.state = 7042; + this.match(MySqlParser.HEXADECIMAL_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + nullNotnull() { + let localContext = new NullNotnullContext(this.context, this.state); + this.enterRule(localContext, 718, MySqlParser.RULE_nullNotnull); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7045; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7044; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7047; + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 886)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + constant() { + let localContext = new ConstantContext(this.context, this.state); + this.enterRule(localContext, 720, MySqlParser.RULE_constant); + let _la; + try { + this.state = 7061; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1022, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7049; + this.stringLiteral(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7050; + this.decimalLiteral(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7051; + this.match(MySqlParser.MINUS); + this.state = 7052; + this.decimalLiteral(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7053; + this.hexadecimalLiteral(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 7054; + this.booleanLiteral(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 7055; + this.match(MySqlParser.REAL_LITERAL); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 7056; + this.match(MySqlParser.BIT_STRING); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 7058; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7057; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7060; + localContext._nullLiteral = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 886)) { + localContext._nullLiteral = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dataType() { + let localContext = new DataTypeContext(this.context, this.state); + this.enterRule(localContext, 722, MySqlParser.RULE_dataType); + let _la; + try { + this.state = 7189; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1051, this.context)) { + case 1: + localContext = new StringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7063; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 26 || ((((_la - 224)) & ~0x1F) === 0 && ((1 << (_la - 224)) & 31239) !== 0) || _la === 498)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7065; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 240) { + { + this.state = 7064; + this.match(MySqlParser.KW_VARYING); + } + } + this.state = 7068; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1024, this.context)) { + case 1: + { + this.state = 7067; + this.lengthOneDimension(); + } + break; + } + this.state = 7071; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1025, this.context)) { + case 1: + { + this.state = 7070; + this.match(MySqlParser.KW_BINARY); + } + break; + } + this.state = 7076; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7073; + this.charSet(); + this.state = 7074; + this.charsetName(); + } + } + this.state = 7081; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1027, this.context)) { + case 1: + { + this.state = 7078; + this.match(MySqlParser.KW_COLLATE); + this.state = 7079; + this.collationName(); + } + break; + case 2: + { + this.state = 7080; + this.match(MySqlParser.KW_BINARY); + } + break; + } + } + break; + case 2: + localContext = new NationalVaryingStringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7083; + this.match(MySqlParser.KW_NATIONAL); + this.state = 7084; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 26 || _la === 224)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7085; + this.match(MySqlParser.KW_VARYING); + this.state = 7087; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1028, this.context)) { + case 1: + { + this.state = 7086; + this.lengthOneDimension(); + } + break; + } + this.state = 7090; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7089; + this.match(MySqlParser.KW_BINARY); + } + } + } + break; + case 3: + localContext = new NationalStringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 7092; + this.match(MySqlParser.KW_NATIONAL); + this.state = 7093; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 26 || _la === 224 || _la === 225)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7095; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1030, this.context)) { + case 1: + { + this.state = 7094; + this.lengthOneDimension(); + } + break; + } + this.state = 7098; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7097; + this.match(MySqlParser.KW_BINARY); + } + } + } + break; + case 4: + localContext = new NationalStringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 7100; + this.match(MySqlParser.KW_NCHAR); + this.state = 7101; + localContext._typeName = this.match(MySqlParser.KW_VARCHAR); + this.state = 7103; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1032, this.context)) { + case 1: + { + this.state = 7102; + this.lengthOneDimension(); + } + break; + } + this.state = 7106; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7105; + this.match(MySqlParser.KW_BINARY); + } + } + } + break; + case 5: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 7108; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 198)) & ~0x1F) === 0 && ((1 << (_la - 198)) & 4095) !== 0))) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7110; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1034, this.context)) { + case 1: + { + this.state = 7109; + this.lengthOneDimension(); + } + break; + } + this.state = 7115; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7112; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7117; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 6: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 7118; + localContext._typeName = this.match(MySqlParser.KW_REAL); + this.state = 7120; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1036, this.context)) { + case 1: + { + this.state = 7119; + this.lengthTwoDimension(); + } + break; + } + this.state = 7125; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7122; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7127; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 7: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 7128; + localContext._typeName = this.match(MySqlParser.KW_DOUBLE); + this.state = 7130; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 212) { + { + this.state = 7129; + this.match(MySqlParser.KW_PRECISION); + } + } + this.state = 7133; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1039, this.context)) { + case 1: + { + this.state = 7132; + this.lengthTwoDimension(); + } + break; + } + this.state = 7138; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7135; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7140; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 8: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 7141; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 213)) & ~0x1F) === 0 && ((1 << (_la - 213)) & 63) !== 0) || _la === 403)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7143; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1041, this.context)) { + case 1: + { + this.state = 7142; + this.lengthTwoOptionalDimension(); + } + break; + } + this.state = 7148; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7145; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7150; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 9: + localContext = new SimpleDataTypeContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 7151; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 4237313) !== 0) || _la === 321 || _la === 322)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 10: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 7152; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 220)) & ~0x1F) === 0 && ((1 << (_la - 220)) & 2831) !== 0) || _la === 319)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7154; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1043, this.context)) { + case 1: + { + this.state = 7153; + this.lengthOneDimension(); + } + break; + } + } + break; + case 11: + localContext = new CollectionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 7156; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 155 || _la === 239)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7157; + this.collectionOptions(); + this.state = 7159; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7158; + this.match(MySqlParser.KW_BINARY); + } + } + this.state = 7164; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7161; + this.charSet(); + this.state = 7162; + this.charsetName(); + } + } + } + break; + case 12: + localContext = new SpatialDataTypeContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 7166; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 442 || ((((_la - 813)) & ~0x1F) === 0 && ((1 << (_la - 813)) & 511) !== 0))) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7169; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 834) { + { + this.state = 7167; + this.match(MySqlParser.KW_SRID); + this.state = 7168; + this.decimalLiteral(); + } + } + } + break; + case 13: + localContext = new LongVarcharDataTypeContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 7171; + localContext._typeName = this.match(MySqlParser.KW_LONG); + this.state = 7173; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 225) { + { + this.state = 7172; + this.match(MySqlParser.KW_VARCHAR); + } + } + this.state = 7176; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7175; + this.match(MySqlParser.KW_BINARY); + } + } + this.state = 7181; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7178; + this.charSet(); + this.state = 7179; + this.charsetName(); + } + } + this.state = 7185; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1050, this.context)) { + case 1: + { + this.state = 7183; + this.match(MySqlParser.KW_COLLATE); + this.state = 7184; + this.collationName(); + } + break; + } + } + break; + case 14: + localContext = new LongVarbinaryDataTypeContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 7187; + this.match(MySqlParser.KW_LONG); + this.state = 7188; + this.match(MySqlParser.KW_VARBINARY); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + collectionOptions() { + let localContext = new CollectionOptionsContext(this.context, this.state); + this.enterRule(localContext, 724, MySqlParser.RULE_collectionOptions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7191; + this.match(MySqlParser.LR_BRACKET); + this.state = 7192; + this.match(MySqlParser.STRING_LITERAL); + this.state = 7197; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7193; + this.match(MySqlParser.COMMA); + this.state = 7194; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 7199; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7200; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + convertedDataType() { + let localContext = new ConvertedDataTypeContext(this.context, this.state); + this.enterRule(localContext, 726, MySqlParser.RULE_convertedDataType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7224; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_NCHAR: + { + this.state = 7202; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 228 || _la === 498)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7204; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 7203; + this.lengthOneDimension(); + } + } + } + break; + case MySqlParser.KW_CHAR: + { + this.state = 7206; + localContext._typeName = this.match(MySqlParser.KW_CHAR); + this.state = 7208; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 7207; + this.lengthOneDimension(); + } + } + this.state = 7213; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7210; + this.charSet(); + this.state = 7211; + this.charsetName(); + } + } + } + break; + case MySqlParser.KW_INT: + case MySqlParser.KW_INTEGER: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_JSON: + { + this.state = 7215; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 202)) & ~0x1F) === 0 && ((1 << (_la - 202)) & 1441857) !== 0) || _la === 442)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_DECIMAL: + case MySqlParser.KW_DEC: + { + this.state = 7216; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 216 || _la === 217)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7218; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 7217; + this.lengthTwoOptionalDimension(); + } + } + } + break; + case MySqlParser.KW_UNSIGNED: + case MySqlParser.KW_SIGNED: + { + this.state = 7220; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7222; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 202 || _la === 208) { + { + this.state = 7221; + _la = this.tokenStream.LA(1); + if (!(_la === 202 || _la === 208)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7227; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 12) { + { + this.state = 7226; + this.match(MySqlParser.KW_ARRAY); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lengthOneDimension() { + let localContext = new LengthOneDimensionContext(this.context, this.state); + this.enterRule(localContext, 728, MySqlParser.RULE_lengthOneDimension); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7229; + this.match(MySqlParser.LR_BRACKET); + this.state = 7230; + this.decimalLiteral(); + this.state = 7231; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lengthTwoDimension() { + let localContext = new LengthTwoDimensionContext(this.context, this.state); + this.enterRule(localContext, 730, MySqlParser.RULE_lengthTwoDimension); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7233; + this.match(MySqlParser.LR_BRACKET); + this.state = 7234; + this.decimalLiteral(); + this.state = 7235; + this.match(MySqlParser.COMMA); + this.state = 7236; + this.decimalLiteral(); + this.state = 7237; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lengthTwoOptionalDimension() { + let localContext = new LengthTwoOptionalDimensionContext(this.context, this.state); + this.enterRule(localContext, 732, MySqlParser.RULE_lengthTwoOptionalDimension); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7239; + this.match(MySqlParser.LR_BRACKET); + this.state = 7240; + this.decimalLiteral(); + this.state = 7243; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 7241; + this.match(MySqlParser.COMMA); + this.state = 7242; + this.decimalLiteral(); + } + } + this.state = 7245; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexColumnNames() { + let localContext = new IndexColumnNamesContext(this.context, this.state); + this.enterRule(localContext, 734, MySqlParser.RULE_indexColumnNames); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7247; + this.match(MySqlParser.LR_BRACKET); + this.state = 7248; + this.indexColumnName(); + this.state = 7253; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7249; + this.match(MySqlParser.COMMA); + this.state = 7250; + this.indexColumnName(); + } + } + this.state = 7255; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7256; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expressions() { + let localContext = new ExpressionsContext(this.context, this.state); + this.enterRule(localContext, 736, MySqlParser.RULE_expressions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7258; + this.expression(0); + this.state = 7263; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7259; + this.match(MySqlParser.COMMA); + this.state = 7260; + this.expression(0); + } + } + this.state = 7265; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + valuesOrValueList() { + let localContext = new ValuesOrValueListContext(this.context, this.state); + this.enterRule(localContext, 738, MySqlParser.RULE_valuesOrValueList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7266; + _la = this.tokenStream.LA(1); + if (!(_la === 189 || _la === 682)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7267; + this.expressionsWithDefaults(); + this.state = 7272; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7268; + this.match(MySqlParser.COMMA); + this.state = 7269; + this.expressionsWithDefaults(); + } + } + this.state = 7274; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expressionsWithDefaults() { + let localContext = new ExpressionsWithDefaultsContext(this.context, this.state); + this.enterRule(localContext, 740, MySqlParser.RULE_expressionsWithDefaults); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7275; + this.match(MySqlParser.LR_BRACKET); + this.state = 7276; + this.expressionOrDefault(); + this.state = 7281; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7277; + this.match(MySqlParser.COMMA); + this.state = 7278; + this.expressionOrDefault(); + } + } + this.state = 7283; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7284; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expressionOrDefault() { + let localContext = new ExpressionOrDefaultContext(this.context, this.state); + this.enterRule(localContext, 742, MySqlParser.RULE_expressionOrDefault); + try { + this.state = 7288; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1065, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7286; + this.expression(0); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7287; + this.match(MySqlParser.KW_DEFAULT); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + constants() { + let localContext = new ConstantsContext(this.context, this.state); + this.enterRule(localContext, 744, MySqlParser.RULE_constants); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7290; + this.constant(); + this.state = 7295; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7291; + this.match(MySqlParser.COMMA); + this.state = 7292; + this.constant(); + } + } + this.state = 7297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleStrings() { + let localContext = new SimpleStringsContext(this.context, this.state); + this.enterRule(localContext, 746, MySqlParser.RULE_simpleStrings); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7298; + this.match(MySqlParser.STRING_LITERAL); + this.state = 7303; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7299; + this.match(MySqlParser.COMMA); + this.state = 7300; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 7305; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userVariables() { + let localContext = new UserVariablesContext(this.context, this.state); + this.enterRule(localContext, 748, MySqlParser.RULE_userVariables); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7306; + this.match(MySqlParser.LOCAL_ID); + this.state = 7311; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7307; + this.match(MySqlParser.COMMA); + this.state = 7308; + this.match(MySqlParser.LOCAL_ID); + } + } + this.state = 7313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + defaultValue() { + let localContext = new DefaultValueContext(this.context, this.state); + this.enterRule(localContext, 750, MySqlParser.RULE_defaultValue); + try { + this.state = 7340; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1071, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7314; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7315; + this.match(MySqlParser.KW_CAST); + this.state = 7316; + this.match(MySqlParser.LR_BRACKET); + this.state = 7317; + this.expression(0); + this.state = 7318; + this.match(MySqlParser.KW_AS); + this.state = 7319; + this.convertedDataType(); + this.state = 7320; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7323; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1069, this.context)) { + case 1: + { + this.state = 7322; + this.unaryOperator(); + } + break; + } + this.state = 7325; + this.constant(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7326; + this.currentTimestamp(); + this.state = 7330; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1070, this.context)) { + case 1: + { + this.state = 7327; + this.match(MySqlParser.KW_ON); + this.state = 7328; + this.match(MySqlParser.KW_UPDATE); + this.state = 7329; + this.currentTimestamp(); + } + break; + } + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 7332; + this.match(MySqlParser.LR_BRACKET); + this.state = 7333; + this.expression(0); + this.state = 7334; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 7336; + this.match(MySqlParser.LR_BRACKET); + this.state = 7337; + this.fullId(); + this.state = 7338; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + currentTimestamp() { + let localContext = new CurrentTimestampContext(this.context, this.state); + this.enterRule(localContext, 752, MySqlParser.RULE_currentTimestamp); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7356; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_LOCALTIMESTAMP: + { + this.state = 7342; + _la = this.tokenStream.LA(1); + if (!(((((_la - 287)) & ~0x1F) === 0 && ((1 << (_la - 287)) & 131) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7348; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1073, this.context)) { + case 1: + { + this.state = 7343; + this.match(MySqlParser.LR_BRACKET); + this.state = 7345; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 871)) & ~0x1F) === 0 && ((1 << (_la - 871)) & 20495) !== 0)) { + { + this.state = 7344; + this.decimalLiteral(); + } + } + this.state = 7347; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case MySqlParser.KW_NOW: + { + this.state = 7350; + this.match(MySqlParser.KW_NOW); + this.state = 7351; + this.match(MySqlParser.LR_BRACKET); + this.state = 7353; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 871)) & ~0x1F) === 0 && ((1 << (_la - 871)) & 20495) !== 0)) { + { + this.state = 7352; + this.decimalLiteral(); + } + } + this.state = 7355; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ifExists() { + let localContext = new IfExistsContext(this.context, this.state); + this.enterRule(localContext, 754, MySqlParser.RULE_ifExists); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7358; + this.match(MySqlParser.KW_IF); + this.state = 7359; + this.match(MySqlParser.KW_EXISTS); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ifNotExists() { + let localContext = new IfNotExistsContext(this.context, this.state); + this.enterRule(localContext, 756, MySqlParser.RULE_ifNotExists); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7361; + this.match(MySqlParser.KW_IF); + this.state = 7362; + this.match(MySqlParser.KW_NOT); + this.state = 7363; + this.match(MySqlParser.KW_EXISTS); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + orReplace() { + let localContext = new OrReplaceContext(this.context, this.state); + this.enterRule(localContext, 758, MySqlParser.RULE_orReplace); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7365; + this.match(MySqlParser.KW_OR); + this.state = 7366; + this.match(MySqlParser.KW_REPLACE); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionCall() { + let localContext = new FunctionCallContext(this.context, this.state); + this.enterRule(localContext, 760, MySqlParser.RULE_functionCall); + try { + this.state = 7390; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1078, this.context)) { + case 1: + localContext = new SpecificFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7368; + this.specificFunction(); + } + break; + case 2: + localContext = new AggregateFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7369; + this.aggregateWindowedFunction(); + } + break; + case 3: + localContext = new NonAggregateFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 7370; + this.nonAggregateWindowedFunction(); + } + break; + case 4: + localContext = new ScalarFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 7371; + this.scalarFunctionName(); + this.state = 7378; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1076, this.context)) { + case 1: + { + this.state = 7372; + this.match(MySqlParser.LR_BRACKET); + this.state = 7373; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 7374; + this.match(MySqlParser.LR_BRACKET); + this.state = 7375; + this.functionArgs(); + this.state = 7376; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 5: + localContext = new UdfFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 7380; + this.functionName(); + this.state = 7387; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1077, this.context)) { + case 1: + { + this.state = 7381; + this.match(MySqlParser.LR_BRACKET); + this.state = 7382; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 7383; + this.match(MySqlParser.LR_BRACKET); + this.state = 7384; + this.functionArgs(); + this.state = 7385; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 6: + localContext = new PasswordFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 7389; + this.passwordFunctionClause(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + specificFunction() { + let localContext = new SpecificFunctionContext(this.context, this.state); + this.enterRule(localContext, 762, MySqlParser.RULE_specificFunction); + let _la; + try { + this.state = 7571; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1102, this.context)) { + case 1: + localContext = new SimpleFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7392; + _la = this.tokenStream.LA(1); + if (!(_la === 152 || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 262159) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7395; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1079, this.context)) { + case 1: + { + this.state = 7393; + this.match(MySqlParser.LR_BRACKET); + this.state = 7394; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 2: + localContext = new CurrentUserContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7397; + this.currentUserExpression(); + } + break; + case 3: + localContext = new DataTypeFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 7398; + this.match(MySqlParser.KW_CONVERT); + this.state = 7399; + this.match(MySqlParser.LR_BRACKET); + this.state = 7400; + this.expression(0); + this.state = 7401; + localContext._separator = this.match(MySqlParser.COMMA); + this.state = 7402; + this.convertedDataType(); + this.state = 7403; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 4: + localContext = new DataTypeFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 7405; + this.match(MySqlParser.KW_CONVERT); + this.state = 7406; + this.match(MySqlParser.LR_BRACKET); + this.state = 7407; + this.expression(0); + this.state = 7408; + this.match(MySqlParser.KW_USING); + this.state = 7409; + this.charsetName(); + this.state = 7410; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 5: + localContext = new DataTypeFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 7412; + this.match(MySqlParser.KW_CAST); + this.state = 7413; + this.match(MySqlParser.LR_BRACKET); + this.state = 7414; + this.expression(0); + this.state = 7415; + this.match(MySqlParser.KW_AS); + this.state = 7416; + this.convertedDataType(); + this.state = 7417; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 6: + localContext = new ValuesFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 7419; + this.match(MySqlParser.KW_VALUES); + this.state = 7420; + this.match(MySqlParser.LR_BRACKET); + this.state = 7421; + this.columnName(); + this.state = 7422; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 7: + localContext = new CaseFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 7424; + this.match(MySqlParser.KW_CASE); + this.state = 7426; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 7425; + this.caseFuncAlternative(); + } + } + this.state = 7428; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 191); + this.state = 7432; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 7430; + this.match(MySqlParser.KW_ELSE); + this.state = 7431; + localContext._elseArg = this.functionArg(); + } + } + this.state = 7434; + this.match(MySqlParser.KW_END); + } + break; + case 8: + localContext = new CaseExpressionFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 7436; + this.match(MySqlParser.KW_CASE); + this.state = 7437; + this.expression(0); + this.state = 7439; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 7438; + this.caseFuncAlternative(); + } + } + this.state = 7441; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 191); + this.state = 7445; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 7443; + this.match(MySqlParser.KW_ELSE); + this.state = 7444; + localContext._elseArg = this.functionArg(); + } + } + this.state = 7447; + this.match(MySqlParser.KW_END); + } + break; + case 9: + localContext = new CharFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 7449; + this.match(MySqlParser.KW_CHAR); + this.state = 7450; + this.match(MySqlParser.LR_BRACKET); + this.state = 7451; + this.functionArgs(); + this.state = 7454; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 7452; + this.match(MySqlParser.KW_USING); + this.state = 7453; + this.charsetName(); + } + } + this.state = 7456; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 10: + localContext = new PositionFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 7458; + this.match(MySqlParser.KW_POSITION); + this.state = 7459; + this.match(MySqlParser.LR_BRACKET); + this.state = 7462; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1085, this.context)) { + case 1: + { + this.state = 7460; + localContext._positionString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7461; + localContext._positionExpression = this.expression(0); + } + break; + } + this.state = 7464; + this.match(MySqlParser.KW_IN); + this.state = 7467; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1086, this.context)) { + case 1: + { + this.state = 7465; + localContext._inString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7466; + localContext._inExpression = this.expression(0); + } + break; + } + this.state = 7469; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 11: + localContext = new SubstrFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 7471; + _la = this.tokenStream.LA(1); + if (!(_la === 297 || _la === 298)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7472; + this.match(MySqlParser.LR_BRACKET); + this.state = 7475; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1087, this.context)) { + case 1: + { + this.state = 7473; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7474; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7477; + this.match(MySqlParser.KW_FROM); + this.state = 7480; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1088, this.context)) { + case 1: + { + this.state = 7478; + localContext._fromDecimal = this.decimalLiteral(); + } + break; + case 2: + { + this.state = 7479; + localContext._fromExpression = this.expression(0); + } + break; + } + this.state = 7487; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 7482; + this.match(MySqlParser.KW_FOR); + this.state = 7485; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1089, this.context)) { + case 1: + { + this.state = 7483; + localContext._forDecimal = this.decimalLiteral(); + } + break; + case 2: + { + this.state = 7484; + localContext._forExpression = this.expression(0); + } + break; + } + } + } + this.state = 7489; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 12: + localContext = new TrimFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 7491; + this.match(MySqlParser.KW_TRIM); + this.state = 7492; + this.match(MySqlParser.LR_BRACKET); + this.state = 7493; + localContext._positioinForm = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 18 || _la === 96 || _la === 177)) { + localContext._positioinForm = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7496; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1091, this.context)) { + case 1: + { + this.state = 7494; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7495; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7498; + this.match(MySqlParser.KW_FROM); + this.state = 7501; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1092, this.context)) { + case 1: + { + this.state = 7499; + localContext._fromString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7500; + localContext._fromExpression = this.expression(0); + } + break; + } + this.state = 7503; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 13: + localContext = new TrimFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 7505; + this.match(MySqlParser.KW_TRIM); + this.state = 7506; + this.match(MySqlParser.LR_BRACKET); + this.state = 7509; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1093, this.context)) { + case 1: + { + this.state = 7507; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7508; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7511; + this.match(MySqlParser.KW_FROM); + this.state = 7514; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1094, this.context)) { + case 1: + { + this.state = 7512; + localContext._fromString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7513; + localContext._fromExpression = this.expression(0); + } + break; + } + this.state = 7516; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 14: + localContext = new WeightFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 7518; + this.match(MySqlParser.KW_WEIGHT_STRING); + this.state = 7519; + this.match(MySqlParser.LR_BRACKET); + this.state = 7522; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1095, this.context)) { + case 1: + { + this.state = 7520; + this.stringLiteral(); + } + break; + case 2: + { + this.state = 7521; + this.expression(0); + } + break; + } + this.state = 7530; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 7524; + this.match(MySqlParser.KW_AS); + this.state = 7525; + localContext._stringFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 224 || _la === 228)) { + localContext._stringFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7526; + this.match(MySqlParser.LR_BRACKET); + this.state = 7527; + this.decimalLiteral(); + this.state = 7528; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 7533; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 448) { + { + this.state = 7532; + this.levelsInWeightString(); + } + } + this.state = 7535; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 15: + localContext = new ExtractFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 7537; + this.match(MySqlParser.KW_EXTRACT); + this.state = 7538; + this.match(MySqlParser.LR_BRACKET); + this.state = 7539; + this.intervalType(); + this.state = 7540; + this.match(MySqlParser.KW_FROM); + this.state = 7543; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1098, this.context)) { + case 1: + { + this.state = 7541; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7542; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7545; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 16: + localContext = new GetFormatFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 7547; + this.match(MySqlParser.KW_GET_FORMAT); + this.state = 7548; + this.match(MySqlParser.LR_BRACKET); + this.state = 7549; + localContext._datetimeFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 11) !== 0))) { + localContext._datetimeFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7550; + this.match(MySqlParser.COMMA); + this.state = 7551; + this.stringLiteral(); + this.state = 7552; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 17: + localContext = new JsonValueFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 7554; + this.match(MySqlParser.KW_JSON_VALUE); + this.state = 7555; + this.match(MySqlParser.LR_BRACKET); + this.state = 7556; + this.expression(0); + this.state = 7557; + this.match(MySqlParser.COMMA); + this.state = 7558; + this.expression(0); + this.state = 7561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 579) { + { + this.state = 7559; + this.match(MySqlParser.KW_RETURNING); + this.state = 7560; + this.convertedDataType(); + } + } + this.state = 7564; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1100, this.context)) { + case 1: + { + this.state = 7563; + this.jsonOnEmpty(); + } + break; + } + this.state = 7567; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42 || _la === 116 || _la === 382) { + { + this.state = 7566; + this.jsonOnError(); + } + } + this.state = 7569; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + caseFuncAlternative() { + let localContext = new CaseFuncAlternativeContext(this.context, this.state); + this.enterRule(localContext, 764, MySqlParser.RULE_caseFuncAlternative); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7573; + this.match(MySqlParser.KW_WHEN); + this.state = 7574; + localContext._condition = this.functionArg(); + this.state = 7575; + this.match(MySqlParser.KW_THEN); + this.state = 7576; + localContext._consequent = this.functionArg(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + levelsInWeightString() { + let localContext = new LevelsInWeightStringContext(this.context, this.state); + this.enterRule(localContext, 766, MySqlParser.RULE_levelsInWeightString); + let _la; + try { + this.state = 7592; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1104, this.context)) { + case 1: + localContext = new LevelWeightListContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7578; + this.match(MySqlParser.KW_LEVEL); + this.state = 7579; + this.levelInWeightListElement(); + this.state = 7584; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7580; + this.match(MySqlParser.COMMA); + this.state = 7581; + this.levelInWeightListElement(); + } + } + this.state = 7586; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + localContext = new LevelWeightRangeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7587; + this.match(MySqlParser.KW_LEVEL); + this.state = 7588; + localContext._firstLevel = this.decimalLiteral(); + this.state = 7589; + this.match(MySqlParser.MINUS); + this.state = 7590; + localContext._lastLevel = this.decimalLiteral(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + levelInWeightListElement() { + let localContext = new LevelInWeightListElementContext(this.context, this.state); + this.enterRule(localContext, 768, MySqlParser.RULE_levelInWeightListElement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7594; + this.decimalLiteral(); + this.state = 7596; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 14 || _la === 45 || _la === 830) { + { + this.state = 7595; + localContext._orderType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45 || _la === 830)) { + localContext._orderType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + aggregateWindowedFunction() { + let localContext = new AggregateWindowedFunctionContext(this.context, this.state); + this.enterRule(localContext, 770, MySqlParser.RULE_aggregateWindowedFunction); + let _la; + try { + this.state = 7657; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AVG: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_SUM: + this.enterOuterAlt(localContext, 1); + { + this.state = 7598; + _la = this.tokenStream.LA(1); + if (!(((((_la - 258)) & ~0x1F) === 0 && ((1 << (_la - 258)) & 8400897) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7599; + this.match(MySqlParser.LR_BRACKET); + this.state = 7601; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1106, this.context)) { + case 1: + { + this.state = 7600; + localContext._aggregator = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._aggregator = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 7603; + this.functionArg(); + this.state = 7604; + this.match(MySqlParser.RR_BRACKET); + this.state = 7606; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1107, this.context)) { + case 1: + { + this.state = 7605; + this.overClause(); + } + break; + } + } + break; + case MySqlParser.KW_COUNT: + this.enterOuterAlt(localContext, 2); + { + this.state = 7608; + this.match(MySqlParser.KW_COUNT); + this.state = 7609; + this.match(MySqlParser.LR_BRACKET); + this.state = 7617; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1109, this.context)) { + case 1: + { + this.state = 7610; + localContext._starArg = this.match(MySqlParser.STAR); + } + break; + case 2: + { + this.state = 7612; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1108, this.context)) { + case 1: + { + this.state = 7611; + localContext._aggregator = this.match(MySqlParser.KW_ALL); + } + break; + } + this.state = 7614; + this.functionArg(); + } + break; + case 3: + { + this.state = 7615; + localContext._aggregator = this.match(MySqlParser.KW_DISTINCT); + this.state = 7616; + this.functionArgs(); + } + break; + } + this.state = 7619; + this.match(MySqlParser.RR_BRACKET); + this.state = 7621; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1110, this.context)) { + case 1: + { + this.state = 7620; + this.overClause(); + } + break; + } + } + break; + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + this.enterOuterAlt(localContext, 3); + { + this.state = 7623; + _la = this.tokenStream.LA(1); + if (!(((((_la - 259)) & ~0x1F) === 0 && ((1 << (_la - 259)) & 62652423) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7624; + this.match(MySqlParser.LR_BRACKET); + this.state = 7626; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1111, this.context)) { + case 1: + { + this.state = 7625; + localContext._aggregator = this.match(MySqlParser.KW_ALL); + } + break; + } + this.state = 7628; + this.functionArg(); + this.state = 7629; + this.match(MySqlParser.RR_BRACKET); + this.state = 7631; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1112, this.context)) { + case 1: + { + this.state = 7630; + this.overClause(); + } + break; + } + } + break; + case MySqlParser.KW_GROUP_CONCAT: + this.enterOuterAlt(localContext, 4); + { + this.state = 7633; + this.match(MySqlParser.KW_GROUP_CONCAT); + this.state = 7634; + this.match(MySqlParser.LR_BRACKET); + this.state = 7636; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1113, this.context)) { + case 1: + { + this.state = 7635; + localContext._aggregator = this.match(MySqlParser.KW_DISTINCT); + } + break; + } + this.state = 7638; + this.functionArgs(); + this.state = 7649; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 7639; + this.match(MySqlParser.KW_ORDER); + this.state = 7640; + this.match(MySqlParser.KW_BY); + this.state = 7641; + this.orderByExpression(); + this.state = 7646; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7642; + this.match(MySqlParser.COMMA); + this.state = 7643; + this.orderByExpression(); + } + } + this.state = 7648; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 7653; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 156) { + { + this.state = 7651; + this.match(MySqlParser.KW_SEPARATOR); + this.state = 7652; + localContext._separator = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 7655; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + nonAggregateWindowedFunction() { + let localContext = new NonAggregateWindowedFunctionContext(this.context, this.state); + this.enterRule(localContext, 772, MySqlParser.RULE_nonAggregateWindowedFunction); + let _la; + try { + this.state = 7697; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_LAG: + case MySqlParser.KW_LEAD: + this.enterOuterAlt(localContext, 1); + { + this.state = 7659; + _la = this.tokenStream.LA(1); + if (!(_la === 267 || _la === 269)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7660; + this.match(MySqlParser.LR_BRACKET); + this.state = 7661; + this.expression(0); + this.state = 7664; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1118, this.context)) { + case 1: + { + this.state = 7662; + this.match(MySqlParser.COMMA); + this.state = 7663; + this.decimalLiteral(); + } + break; + } + this.state = 7668; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 7666; + this.match(MySqlParser.COMMA); + this.state = 7667; + this.decimalLiteral(); + } + } + this.state = 7670; + this.match(MySqlParser.RR_BRACKET); + this.state = 7671; + this.overClause(); + } + break; + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_LAST_VALUE: + this.enterOuterAlt(localContext, 2); + { + this.state = 7673; + _la = this.tokenStream.LA(1); + if (!(_la === 265 || _la === 268)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7674; + this.match(MySqlParser.LR_BRACKET); + this.state = 7675; + this.expression(0); + this.state = 7676; + this.match(MySqlParser.RR_BRACKET); + this.state = 7677; + this.overClause(); + } + break; + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + this.enterOuterAlt(localContext, 3); + { + this.state = 7679; + _la = this.tokenStream.LA(1); + if (!(((((_la - 263)) & ~0x1F) === 0 && ((1 << (_la - 263)) & 14339) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7680; + this.match(MySqlParser.LR_BRACKET); + this.state = 7681; + this.match(MySqlParser.RR_BRACKET); + this.state = 7682; + this.overClause(); + } + break; + case MySqlParser.KW_NTH_VALUE: + this.enterOuterAlt(localContext, 4); + { + this.state = 7683; + this.match(MySqlParser.KW_NTH_VALUE); + this.state = 7684; + this.match(MySqlParser.LR_BRACKET); + this.state = 7685; + this.expression(0); + this.state = 7686; + this.match(MySqlParser.COMMA); + this.state = 7687; + this.decimalLiteral(); + this.state = 7688; + this.match(MySqlParser.RR_BRACKET); + this.state = 7689; + this.overClause(); + } + break; + case MySqlParser.KW_NTILE: + this.enterOuterAlt(localContext, 5); + { + this.state = 7691; + this.match(MySqlParser.KW_NTILE); + this.state = 7692; + this.match(MySqlParser.LR_BRACKET); + this.state = 7693; + this.decimalLiteral(); + this.state = 7694; + this.match(MySqlParser.RR_BRACKET); + this.state = 7695; + this.overClause(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + overClause() { + let localContext = new OverClauseContext(this.context, this.state); + this.enterRule(localContext, 774, MySqlParser.RULE_overClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7699; + this.match(MySqlParser.KW_OVER); + this.state = 7705; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LR_BRACKET: + { + this.state = 7700; + this.match(MySqlParser.LR_BRACKET); + this.state = 7701; + this.windowSpec(); + this.state = 7702; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 7704; + this.windowName(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + windowSpec() { + let localContext = new WindowSpecContext(this.context, this.state); + this.enterRule(localContext, 776, MySqlParser.RULE_windowSpec); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7708; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1122, this.context)) { + case 1: + { + this.state = 7707; + this.windowName(); + } + break; + } + this.state = 7711; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 7710; + this.partitionClause(); + } + } + this.state = 7714; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 7713; + this.orderByClause(); + } + } + this.state = 7717; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 134 || _la === 587) { + { + this.state = 7716; + this.frameClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + windowName() { + let localContext = new WindowNameContext(this.context, this.state); + this.enterRule(localContext, 778, MySqlParser.RULE_windowName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7719; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameClause() { + let localContext = new FrameClauseContext(this.context, this.state); + this.enterRule(localContext, 780, MySqlParser.RULE_frameClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7721; + this.frameUnits(); + this.state = 7722; + this.frameExtent(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameUnits() { + let localContext = new FrameUnitsContext(this.context, this.state); + this.enterRule(localContext, 782, MySqlParser.RULE_frameUnits); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7724; + _la = this.tokenStream.LA(1); + if (!(_la === 134 || _la === 587)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameExtent() { + let localContext = new FrameExtentContext(this.context, this.state); + this.enterRule(localContext, 784, MySqlParser.RULE_frameExtent); + try { + this.state = 7728; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1126, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7726; + this.frameRange(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7727; + this.frameBetween(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameBetween() { + let localContext = new FrameBetweenContext(this.context, this.state); + this.enterRule(localContext, 786, MySqlParser.RULE_frameBetween); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7730; + this.match(MySqlParser.KW_BETWEEN); + this.state = 7731; + this.frameRange(); + this.state = 7732; + this.match(MySqlParser.KW_AND); + this.state = 7733; + this.frameRange(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameRange() { + let localContext = new FrameRangeContext(this.context, this.state); + this.enterRule(localContext, 788, MySqlParser.RULE_frameRange); + let _la; + try { + this.state = 7742; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1127, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7735; + this.match(MySqlParser.KW_CURRENT); + this.state = 7736; + this.match(MySqlParser.KW_ROW); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7737; + this.match(MySqlParser.KW_UNBOUNDED); + this.state = 7738; + _la = this.tokenStream.LA(1); + if (!(_la === 405 || _la === 539)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7739; + this.expression(0); + this.state = 7740; + _la = this.tokenStream.LA(1); + if (!(_la === 405 || _la === 539)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionClause() { + let localContext = new PartitionClauseContext(this.context, this.state); + this.enterRule(localContext, 790, MySqlParser.RULE_partitionClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7744; + this.match(MySqlParser.KW_PARTITION); + this.state = 7745; + this.match(MySqlParser.KW_BY); + this.state = 7746; + this.expression(0); + this.state = 7751; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7747; + this.match(MySqlParser.COMMA); + this.state = 7748; + this.expression(0); + } + } + this.state = 7753; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + scalarFunctionName() { + let localContext = new ScalarFunctionNameContext(this.context, this.state); + this.enterRule(localContext, 792, MySqlParser.RULE_scalarFunctionName); + try { + this.state = 7778; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + this.enterOuterAlt(localContext, 1); + { + this.state = 7754; + this.functionNameBase(); + } + break; + case MySqlParser.KW_ASCII: + this.enterOuterAlt(localContext, 2); + { + this.state = 7755; + this.match(MySqlParser.KW_ASCII); + } + break; + case MySqlParser.KW_CURDATE: + this.enterOuterAlt(localContext, 3); + { + this.state = 7756; + this.match(MySqlParser.KW_CURDATE); + } + break; + case MySqlParser.KW_CURRENT_DATE: + this.enterOuterAlt(localContext, 4); + { + this.state = 7757; + this.match(MySqlParser.KW_CURRENT_DATE); + } + break; + case MySqlParser.KW_CURRENT_TIME: + this.enterOuterAlt(localContext, 5); + { + this.state = 7758; + this.match(MySqlParser.KW_CURRENT_TIME); + } + break; + case MySqlParser.KW_CURRENT_TIMESTAMP: + this.enterOuterAlt(localContext, 6); + { + this.state = 7759; + this.match(MySqlParser.KW_CURRENT_TIMESTAMP); + } + break; + case MySqlParser.KW_CURTIME: + this.enterOuterAlt(localContext, 7); + { + this.state = 7760; + this.match(MySqlParser.KW_CURTIME); + } + break; + case MySqlParser.KW_DATE_ADD: + this.enterOuterAlt(localContext, 8); + { + this.state = 7761; + this.match(MySqlParser.KW_DATE_ADD); + } + break; + case MySqlParser.KW_DATE_SUB: + this.enterOuterAlt(localContext, 9); + { + this.state = 7762; + this.match(MySqlParser.KW_DATE_SUB); + } + break; + case MySqlParser.KW_IF: + this.enterOuterAlt(localContext, 10); + { + this.state = 7763; + this.match(MySqlParser.KW_IF); + } + break; + case MySqlParser.KW_INSERT: + this.enterOuterAlt(localContext, 11); + { + this.state = 7764; + this.match(MySqlParser.KW_INSERT); + } + break; + case MySqlParser.KW_LOCALTIME: + this.enterOuterAlt(localContext, 12); + { + this.state = 7765; + this.match(MySqlParser.KW_LOCALTIME); + } + break; + case MySqlParser.KW_LOCALTIMESTAMP: + this.enterOuterAlt(localContext, 13); + { + this.state = 7766; + this.match(MySqlParser.KW_LOCALTIMESTAMP); + } + break; + case MySqlParser.KW_MID: + this.enterOuterAlt(localContext, 14); + { + this.state = 7767; + this.match(MySqlParser.KW_MID); + } + break; + case MySqlParser.KW_NOW: + this.enterOuterAlt(localContext, 15); + { + this.state = 7768; + this.match(MySqlParser.KW_NOW); + } + break; + case MySqlParser.KW_REPEAT: + this.enterOuterAlt(localContext, 16); + { + this.state = 7769; + this.match(MySqlParser.KW_REPEAT); + } + break; + case MySqlParser.KW_REPLACE: + this.enterOuterAlt(localContext, 17); + { + this.state = 7770; + this.match(MySqlParser.KW_REPLACE); + } + break; + case MySqlParser.KW_SUBSTR: + this.enterOuterAlt(localContext, 18); + { + this.state = 7771; + this.match(MySqlParser.KW_SUBSTR); + } + break; + case MySqlParser.KW_SUBSTRING: + this.enterOuterAlt(localContext, 19); + { + this.state = 7772; + this.match(MySqlParser.KW_SUBSTRING); + } + break; + case MySqlParser.KW_SYSDATE: + this.enterOuterAlt(localContext, 20); + { + this.state = 7773; + this.match(MySqlParser.KW_SYSDATE); + } + break; + case MySqlParser.KW_TRIM: + this.enterOuterAlt(localContext, 21); + { + this.state = 7774; + this.match(MySqlParser.KW_TRIM); + } + break; + case MySqlParser.KW_UTC_DATE: + this.enterOuterAlt(localContext, 22); + { + this.state = 7775; + this.match(MySqlParser.KW_UTC_DATE); + } + break; + case MySqlParser.KW_UTC_TIME: + this.enterOuterAlt(localContext, 23); + { + this.state = 7776; + this.match(MySqlParser.KW_UTC_TIME); + } + break; + case MySqlParser.KW_UTC_TIMESTAMP: + this.enterOuterAlt(localContext, 24); + { + this.state = 7777; + this.match(MySqlParser.KW_UTC_TIMESTAMP); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + passwordFunctionClause() { + let localContext = new PasswordFunctionClauseContext(this.context, this.state); + this.enterRule(localContext, 794, MySqlParser.RULE_passwordFunctionClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7780; + _la = this.tokenStream.LA(1); + if (!(_la === 512 || _la === 529)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7781; + this.match(MySqlParser.LR_BRACKET); + this.state = 7782; + this.functionArg(); + this.state = 7783; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionArgs() { + let localContext = new FunctionArgsContext(this.context, this.state); + this.enterRule(localContext, 796, MySqlParser.RULE_functionArgs); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7785; + this.functionArg(); + this.state = 7790; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7786; + this.match(MySqlParser.COMMA); + this.state = 7787; + this.functionArg(); + } + } + this.state = 7792; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionArg() { + let localContext = new FunctionArgContext(this.context, this.state); + this.enterRule(localContext, 798, MySqlParser.RULE_functionArg); + try { + this.state = 7796; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1131, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7793; + this.constant(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7794; + this.functionCall(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7795; + this.expression(0); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expression(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new ExpressionContext(this.context, parentState); + let previousContext = localContext; + let _startState = 800; + this.enterRecursionRule(localContext, 800, MySqlParser.RULE_expression, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 7809; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1133, this.context)) { + case 1: + { + localContext = new NotExpressionContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7799; + localContext._notOperator = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 114 || _la === 860)) { + localContext._notOperator = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7800; + this.expression(4); + } + break; + case 2: + { + localContext = new IsExpressionContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7801; + this.predicate(0); + this.state = 7802; + this.match(MySqlParser.KW_IS); + this.state = 7804; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7803; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7806; + localContext._testValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 63 || _la === 179 || _la === 674)) { + localContext._testValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 3: + { + localContext = new PredicateExpressionContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7808; + this.predicate(0); + } + break; + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 7817; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1134, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + { + localContext = new LogicalExpressionContext(new ExpressionContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expression); + this.state = 7811; + if (!(this.precpred(this.context, 3))) { + throw this.createFailedPredicateException("this.precpred(this.context, 3)"); + } + this.state = 7812; + this.logicalOperator(); + this.state = 7813; + this.expression(4); + } + } + } + this.state = 7819; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1134, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + predicate(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new PredicateContext(this.context, parentState); + let previousContext = localContext; + let _startState = 802; + this.enterRecursionRule(localContext, 802, MySqlParser.RULE_predicate, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + { + localContext = new ExpressionAtomPredicateContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7821; + this.expressionAtom(0); + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 7886; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1143, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + this.state = 7884; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1142, this.context)) { + case 1: + { + localContext = new BetweenPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7823; + if (!(this.precpred(this.context, 6))) { + throw this.createFailedPredicateException("this.precpred(this.context, 6)"); + } + this.state = 7825; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7824; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7827; + this.match(MySqlParser.KW_BETWEEN); + this.state = 7828; + this.predicate(0); + this.state = 7829; + this.match(MySqlParser.KW_AND); + this.state = 7830; + this.predicate(7); + } + break; + case 2: + { + localContext = new SoundsLikePredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7832; + if (!(this.precpred(this.context, 5))) { + throw this.createFailedPredicateException("this.precpred(this.context, 5)"); + } + this.state = 7833; + this.match(MySqlParser.KW_SOUNDS); + this.state = 7834; + this.match(MySqlParser.KW_LIKE); + this.state = 7835; + this.predicate(6); + } + break; + case 3: + { + localContext = new RegexpPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7836; + if (!(this.precpred(this.context, 3))) { + throw this.createFailedPredicateException("this.precpred(this.context, 3)"); + } + this.state = 7838; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7837; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7840; + localContext._regex = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 139 || _la === 151)) { + localContext._regex = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7841; + this.predicate(4); + } + break; + case 4: + { + localContext = new InPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7842; + if (!(this.precpred(this.context, 9))) { + throw this.createFailedPredicateException("this.precpred(this.context, 9)"); + } + this.state = 7844; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7843; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7846; + this.match(MySqlParser.KW_IN); + this.state = 7847; + this.match(MySqlParser.LR_BRACKET); + this.state = 7850; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1138, this.context)) { + case 1: + { + this.state = 7848; + this.selectStatement(); + } + break; + case 2: + { + this.state = 7849; + this.expressions(); + } + break; + } + this.state = 7852; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 5: + { + localContext = new IsNullPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7854; + if (!(this.precpred(this.context, 8))) { + throw this.createFailedPredicateException("this.precpred(this.context, 8)"); + } + this.state = 7855; + this.match(MySqlParser.KW_IS); + this.state = 7856; + this.nullNotnull(); + } + break; + case 6: + { + localContext = new BinaryComparisonPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7857; + if (!(this.precpred(this.context, 7))) { + throw this.createFailedPredicateException("this.precpred(this.context, 7)"); + } + this.state = 7858; + this.comparisonOperator(); + this.state = 7865; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1139, this.context)) { + case 1: + { + this.state = 7859; + localContext._quantifier = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 309 || _la === 602)) { + localContext._quantifier = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7860; + this.match(MySqlParser.LR_BRACKET); + this.state = 7861; + localContext._subQuery = this.selectStatement(); + this.state = 7862; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 7864; + localContext._right = this.predicate(0); + } + break; + } + } + break; + case 7: + { + localContext = new LikePredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7867; + if (!(this.precpred(this.context, 4))) { + throw this.createFailedPredicateException("this.precpred(this.context, 4)"); + } + this.state = 7869; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7868; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7871; + this.match(MySqlParser.KW_LIKE); + this.state = 7872; + this.predicate(0); + this.state = 7875; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1141, this.context)) { + case 1: + { + this.state = 7873; + this.match(MySqlParser.KW_ESCAPE); + this.state = 7874; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + } + break; + case 8: + { + localContext = new JsonMemberOfPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7877; + if (!(this.precpred(this.context, 2))) { + throw this.createFailedPredicateException("this.precpred(this.context, 2)"); + } + this.state = 7878; + this.match(MySqlParser.KW_MEMBER); + this.state = 7879; + this.match(MySqlParser.KW_OF); + this.state = 7880; + this.match(MySqlParser.LR_BRACKET); + this.state = 7881; + this.predicate(0); + this.state = 7882; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + this.state = 7888; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1143, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + expressionAtom(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new ExpressionAtomContext(this.context, parentState); + let previousContext = localContext; + let _startState = 804; + this.enterRecursionRule(localContext, 804, MySqlParser.RULE_expressionAtom, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 7937; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1146, this.context)) { + case 1: + { + localContext = new ConstantExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7890; + this.constant(); + } + break; + case 2: + { + localContext = new FunctionCallExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7891; + this.functionCall(); + } + break; + case 3: + { + localContext = new MysqlVariableExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7892; + this.mysqlVariable(); + } + break; + case 4: + { + localContext = new UnaryExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7893; + this.unaryOperator(); + this.state = 7894; + this.expressionAtom(12); + } + break; + case 5: + { + localContext = new BinaryExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7896; + this.match(MySqlParser.KW_BINARY); + this.state = 7897; + this.expressionAtom(11); + } + break; + case 6: + { + localContext = new VariableAssignExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7898; + this.match(MySqlParser.LOCAL_ID); + this.state = 7899; + this.match(MySqlParser.VAR_ASSIGN); + this.state = 7900; + this.expressionAtom(10); + } + break; + case 7: + { + localContext = new NestedExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7901; + this.match(MySqlParser.LR_BRACKET); + this.state = 7902; + this.expression(0); + this.state = 7907; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7903; + this.match(MySqlParser.COMMA); + this.state = 7904; + this.expression(0); + } + } + this.state = 7909; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7910; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 8: + { + localContext = new NestedRowExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7912; + this.match(MySqlParser.KW_ROW); + this.state = 7913; + this.match(MySqlParser.LR_BRACKET); + this.state = 7914; + this.expression(0); + this.state = 7917; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 7915; + this.match(MySqlParser.COMMA); + this.state = 7916; + this.expression(0); + } + } + this.state = 7919; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 868); + this.state = 7921; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 9: + { + localContext = new ExistsExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7923; + this.match(MySqlParser.KW_EXISTS); + this.state = 7924; + this.match(MySqlParser.LR_BRACKET); + this.state = 7925; + this.selectStatement(); + this.state = 7926; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 10: + { + localContext = new SubqueryExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7928; + this.match(MySqlParser.LR_BRACKET); + this.state = 7929; + this.selectStatement(); + this.state = 7930; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 11: + { + localContext = new IntervalExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7932; + this.match(MySqlParser.KW_INTERVAL); + this.state = 7933; + this.expression(0); + this.state = 7934; + this.intervalType(); + } + break; + case 12: + { + localContext = new ColumnNameExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7936; + this.columnName(); + } + break; + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 7956; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1148, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + this.state = 7954; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1147, this.context)) { + case 1: + { + localContext = new JsonExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + localContext._left = previousContext; + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7939; + if (!(this.precpred(this.context, 4))) { + throw this.createFailedPredicateException("this.precpred(this.context, 4)"); + } + this.state = 7940; + this.jsonOperator(); + this.state = 7941; + localContext._right = this.expressionAtom(5); + } + break; + case 2: + { + localContext = new BitExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + localContext._left = previousContext; + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7943; + if (!(this.precpred(this.context, 3))) { + throw this.createFailedPredicateException("this.precpred(this.context, 3)"); + } + this.state = 7944; + this.bitOperator(); + this.state = 7945; + localContext._right = this.expressionAtom(4); + } + break; + case 3: + { + localContext = new MathExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + localContext._left = previousContext; + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7947; + if (!(this.precpred(this.context, 2))) { + throw this.createFailedPredicateException("this.precpred(this.context, 2)"); + } + this.state = 7948; + this.mathOperator(); + this.state = 7949; + localContext._right = this.expressionAtom(3); + } + break; + case 4: + { + localContext = new CollateExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7951; + if (!(this.precpred(this.context, 14))) { + throw this.createFailedPredicateException("this.precpred(this.context, 14)"); + } + this.state = 7952; + this.match(MySqlParser.KW_COLLATE); + this.state = 7953; + this.collationName(); + } + break; + } + } + } + this.state = 7958; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1148, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + unaryOperator() { + let localContext = new UnaryOperatorContext(this.context, this.state); + this.enterRule(localContext, 806, MySqlParser.RULE_unaryOperator); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7959; + _la = this.tokenStream.LA(1); + if (!(_la === 114 || ((((_la - 853)) & ~0x1F) === 0 && ((1 << (_la - 853)) & 387) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + comparisonOperator() { + let localContext = new ComparisonOperatorContext(this.context, this.state); + this.enterRule(localContext, 808, MySqlParser.RULE_comparisonOperator); + try { + this.state = 7969; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1149, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7961; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7962; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7963; + this.match(MySqlParser.EXCLAMATION_SYMBOL); + this.state = 7964; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7965; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7966; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 7967; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7968; + this.comparisonBase(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + comparisonBase() { + let localContext = new ComparisonBaseContext(this.context, this.state); + this.enterRule(localContext, 810, MySqlParser.RULE_comparisonBase); + try { + this.state = 7978; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1150, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7971; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7972; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7973; + this.match(MySqlParser.GREATER_SYMBOL); + this.state = 7974; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7975; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7976; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 7977; + this.match(MySqlParser.LESS_SYMBOL); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + logicalOperator() { + let localContext = new LogicalOperatorContext(this.context, this.state); + this.enterRule(localContext, 812, MySqlParser.RULE_logicalOperator); + try { + this.state = 7987; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AND: + this.enterOuterAlt(localContext, 1); + { + this.state = 7980; + this.match(MySqlParser.KW_AND); + } + break; + case MySqlParser.BIT_AND_OP: + this.enterOuterAlt(localContext, 2); + { + this.state = 7981; + this.match(MySqlParser.BIT_AND_OP); + this.state = 7982; + this.match(MySqlParser.BIT_AND_OP); + } + break; + case MySqlParser.KW_XOR: + this.enterOuterAlt(localContext, 3); + { + this.state = 7983; + this.match(MySqlParser.KW_XOR); + } + break; + case MySqlParser.KW_OR: + this.enterOuterAlt(localContext, 4); + { + this.state = 7984; + this.match(MySqlParser.KW_OR); + } + break; + case MySqlParser.BIT_OR_OP: + this.enterOuterAlt(localContext, 5); + { + this.state = 7985; + this.match(MySqlParser.BIT_OR_OP); + this.state = 7986; + this.match(MySqlParser.BIT_OR_OP); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + bitOperator() { + let localContext = new BitOperatorContext(this.context, this.state); + this.enterRule(localContext, 814, MySqlParser.RULE_bitOperator); + try { + this.state = 7996; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LESS_SYMBOL: + this.enterOuterAlt(localContext, 1); + { + this.state = 7989; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7990; + this.match(MySqlParser.LESS_SYMBOL); + } + break; + case MySqlParser.GREATER_SYMBOL: + this.enterOuterAlt(localContext, 2); + { + this.state = 7991; + this.match(MySqlParser.GREATER_SYMBOL); + this.state = 7992; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case MySqlParser.BIT_AND_OP: + this.enterOuterAlt(localContext, 3); + { + this.state = 7993; + this.match(MySqlParser.BIT_AND_OP); + } + break; + case MySqlParser.BIT_XOR_OP: + this.enterOuterAlt(localContext, 4); + { + this.state = 7994; + this.match(MySqlParser.BIT_XOR_OP); + } + break; + case MySqlParser.BIT_OR_OP: + this.enterOuterAlt(localContext, 5); + { + this.state = 7995; + this.match(MySqlParser.BIT_OR_OP); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + mathOperator() { + let localContext = new MathOperatorContext(this.context, this.state); + this.enterRule(localContext, 816, MySqlParser.RULE_mathOperator); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7998; + _la = this.tokenStream.LA(1); + if (!(((((_la - 850)) & ~0x1F) === 0 && ((1 << (_la - 850)) & 127) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonOperator() { + let localContext = new JsonOperatorContext(this.context, this.state); + this.enterRule(localContext, 818, MySqlParser.RULE_jsonOperator); + try { + this.state = 8005; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1153, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 8000; + this.match(MySqlParser.MINUS); + this.state = 8001; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 8002; + this.match(MySqlParser.MINUS); + this.state = 8003; + this.match(MySqlParser.GREATER_SYMBOL); + this.state = 8004; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + charsetNameBase() { + let localContext = new CharsetNameBaseContext(this.context, this.state); + this.enterRule(localContext, 820, MySqlParser.RULE_charsetNameBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8007; + _la = this.tokenStream.LA(1); + if (!(_la === 228 || ((((_la - 756)) & ~0x1F) === 0 && ((1 << (_la - 756)) & 4294967295) !== 0) || ((((_la - 788)) & ~0x1F) === 0 && ((1 << (_la - 788)) & 511) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionLevelBase() { + let localContext = new TransactionLevelBaseContext(this.context, this.state); + this.enterRule(localContext, 822, MySqlParser.RULE_transactionLevelBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8009; + _la = this.tokenStream.LA(1); + if (!(((((_la - 809)) & ~0x1F) === 0 && ((1 << (_la - 809)) & 15) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilegesBase() { + let localContext = new PrivilegesBaseContext(this.context, this.state); + this.enterRule(localContext, 824, MySqlParser.RULE_privilegesBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8011; + _la = this.tokenStream.LA(1); + if (!(((((_la - 717)) & ~0x1F) === 0 && ((1 << (_la - 717)) & 68026371) !== 0) || ((((_la - 749)) & ~0x1F) === 0 && ((1 << (_la - 749)) & 11) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intervalTypeBase() { + let localContext = new IntervalTypeBaseContext(this.context, this.state); + this.enterRule(localContext, 826, MySqlParser.RULE_intervalTypeBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8013; + _la = this.tokenStream.LA(1); + if (!(((((_la - 696)) & ~0x1F) === 0 && ((1 << (_la - 696)) & 255) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dataTypeBase() { + let localContext = new DataTypeBaseContext(this.context, this.state); + this.enterRule(localContext, 828, MySqlParser.RULE_dataTypeBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8015; + _la = this.tokenStream.LA(1); + if (!(((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 1179679) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + keywordsCanBeId() { + let localContext = new KeywordsCanBeIdContext(this.context, this.state); + this.enterRule(localContext, 830, MySqlParser.RULE_keywordsCanBeId); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8017; + _la = this.tokenStream.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014211) !== 0) || _la === 74 || _la === 95 || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 16673) !== 0) || _la === 160 || _la === 170 || ((((_la - 241)) & ~0x1F) === 0 && ((1 << (_la - 241)) & 1648345089) !== 0) || ((((_la - 277)) & ~0x1F) === 0 && ((1 << (_la - 277)) & 4160749823) !== 0) || ((((_la - 309)) & ~0x1F) === 0 && ((1 << (_la - 309)) & 4292870141) !== 0) || ((((_la - 341)) & ~0x1F) === 0 && ((1 << (_la - 341)) & 4294967287) !== 0) || ((((_la - 373)) & ~0x1F) === 0 && ((1 << (_la - 373)) & 4024434671) !== 0) || ((((_la - 406)) & ~0x1F) === 0 && ((1 << (_la - 406)) & 3747609503) !== 0) || ((((_la - 438)) & ~0x1F) === 0 && ((1 << (_la - 438)) & 4227727359) !== 0) || ((((_la - 470)) & ~0x1F) === 0 && ((1 << (_la - 470)) & 3758096239) !== 0) || ((((_la - 502)) & ~0x1F) === 0 && ((1 << (_la - 502)) & 2678062559) !== 0) || ((((_la - 534)) & ~0x1F) === 0 && ((1 << (_la - 534)) & 2682256863) !== 0) || ((((_la - 566)) & ~0x1F) === 0 && ((1 << (_la - 566)) & 4294957695) !== 0) || ((((_la - 598)) & ~0x1F) === 0 && ((1 << (_la - 598)) & 255) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 2128608253) !== 0) || ((((_la - 704)) & ~0x1F) === 0 && ((1 << (_la - 704)) & 1053007341) !== 0) || ((((_la - 737)) & ~0x1F) === 0 && ((1 << (_la - 737)) & 478907) !== 0) || ((((_la - 802)) & ~0x1F) === 0 && ((1 << (_la - 802)) & 3230662657) !== 0) || _la === 838)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionNameBase() { + let localContext = new FunctionNameBaseContext(this.context, this.state); + this.enterRule(localContext, 832, MySqlParser.RULE_functionNameBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8019; + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 98 || _la === 150 || _la === 152 || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 23) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 16375299) !== 0) || _la === 296 || _la === 435 || ((((_la - 686)) & ~0x1F) === 0 && ((1 << (_la - 686)) & 261121) !== 0) || _la === 746 || ((((_la - 813)) & ~0x1F) === 0 && ((1 << (_la - 813)) & 145190393) !== 0) || _la === 856)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + sempred(localContext, ruleIndex, predIndex) { + switch (ruleIndex) { + case 104: + return this.queryExpressionBody_sempred(localContext, predIndex); + case 105: + return this.queryItem_sempred(localContext, predIndex); + case 329: + return this.columnName_sempred(localContext, predIndex); + case 400: + return this.expression_sempred(localContext, predIndex); + case 401: + return this.predicate_sempred(localContext, predIndex); + case 402: + return this.expressionAtom_sempred(localContext, predIndex); + } + return true; + } + queryExpressionBody_sempred(localContext, predIndex) { + switch (predIndex) { + case 0: + return this.precpred(this.context, 2); + case 1: + return this.precpred(this.context, 1); + } + return true; + } + queryItem_sempred(localContext, predIndex) { + switch (predIndex) { + case 2: + return this.precpred(this.context, 1); + } + return true; + } + columnName_sempred(localContext, predIndex) { + switch (predIndex) { + case 3: + return this.shouldMatchEmpty(); + } + return true; + } + expression_sempred(localContext, predIndex) { + switch (predIndex) { + case 4: + return this.precpred(this.context, 3); + } + return true; + } + predicate_sempred(localContext, predIndex) { + switch (predIndex) { + case 5: + return this.precpred(this.context, 6); + case 6: + return this.precpred(this.context, 5); + case 7: + return this.precpred(this.context, 3); + case 8: + return this.precpred(this.context, 9); + case 9: + return this.precpred(this.context, 8); + case 10: + return this.precpred(this.context, 7); + case 11: + return this.precpred(this.context, 4); + case 12: + return this.precpred(this.context, 2); + } + return true; + } + expressionAtom_sempred(localContext, predIndex) { + switch (predIndex) { + case 13: + return this.precpred(this.context, 4); + case 14: + return this.precpred(this.context, 3); + case 15: + return this.precpred(this.context, 2); + case 16: + return this.precpred(this.context, 14); + } + return true; + } + static get _ATN() { + if (!MySqlParser.__ATN) { + MySqlParser.__ATN = new antlr.ATNDeserializer().deserialize(MySqlParser._serializedATN); + } + return MySqlParser.__ATN; + } + get vocabulary() { + return MySqlParser.vocabulary; + } +} + +export { MySqlParser }; diff --git a/test/form/samples/object-tree-shaking-issue-5734/main.js b/test/form/samples/object-tree-shaking-issue-5734/main.js new file mode 100644 index 000000000..314988654 --- /dev/null +++ b/test/form/samples/object-tree-shaking-issue-5734/main.js @@ -0,0 +1 @@ +export { MySqlParser } from './module.js'; diff --git a/test/form/samples/object-tree-shaking-issue-5734/module.js b/test/form/samples/object-tree-shaking-issue-5734/module.js new file mode 100644 index 000000000..7ce43fdb7 --- /dev/null +++ b/test/form/samples/object-tree-shaking-issue-5734/module.js @@ -0,0 +1,45586 @@ +class MySqlParser extends SQLParserBase { + get grammarFileName() { return "MySqlParser.g4"; } + get literalNames() { return MySqlParser.literalNames; } + get symbolicNames() { return MySqlParser.symbolicNames; } + get ruleNames() { return MySqlParser.ruleNames; } + get serializedATN() { return MySqlParser._serializedATN; } + createFailedPredicateException(predicate, message) { + return new antlr.FailedPredicateException(this, predicate, message); + } + constructor(input) { + super(input); + this.interpreter = new antlr.ParserATNSimulator(this, MySqlParser._ATN, MySqlParser.decisionsToDFA, new antlr.PredictionContextCache()); + } + program() { + let localContext = new ProgramContext(this.context, this.state); + this.enterRule(localContext, 0, MySqlParser.RULE_program); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 837; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while ((((_la) & ~0x1F) === 0 && ((1 << _la) & 169870592) !== 0) || ((((_la - 34)) & ~0x1F) === 0 && ((1 << (_la - 34)) & 268573697) !== 0) || ((((_la - 72)) & ~0x1F) === 0 && ((1 << (_la - 72)) & 2151694339) !== 0) || ((((_la - 104)) & ~0x1F) === 0 && ((1 << (_la - 104)) & 536936449) !== 0) || ((((_la - 140)) & ~0x1F) === 0 && ((1 << (_la - 140)) & 442923) !== 0) || ((((_la - 173)) & ~0x1F) === 0 && ((1 << (_la - 173)) & 2184193) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 16781443) !== 0) || _la === 362 || _la === 371 || ((((_la - 404)) & ~0x1F) === 0 && ((1 << (_la - 404)) & 270573569) !== 0) || _la === 540 || _la === 562 || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 16643) !== 0) || ((((_la - 640)) & ~0x1F) === 0 && ((1 << (_la - 640)) & 268435521) !== 0) || _la === 673 || _la === 694 || _la === 713 || _la === 717 || _la === 749 || _la === 866 || _la === 869) { + { + { + this.state = 834; + this.singleStatement(); + } + } + this.state = 839; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 840; + this.match(MySqlParser.EOF); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + singleStatement() { + let localContext = new SingleStatementContext(this.context, this.state); + this.enterRule(localContext, 2, MySqlParser.RULE_singleStatement); + try { + this.state = 847; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + this.enterOuterAlt(localContext, 1); + { + this.state = 842; + this.sqlStatement(); + this.state = 844; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1, this.context)) { + case 1: + { + this.state = 843; + this.match(MySqlParser.SEMI); + } + break; + } + } + break; + case MySqlParser.SEMI: + this.enterOuterAlt(localContext, 2); + { + this.state = 846; + this.emptyStatement_(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + sqlStatement() { + let localContext = new SqlStatementContext(this.context, this.state); + this.enterRule(localContext, 4, MySqlParser.RULE_sqlStatement); + try { + this.state = 856; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 849; + this.ddlStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 850; + this.dmlStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 851; + this.transactionStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 852; + this.replicationStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 853; + this.preparedStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 854; + this.administrationStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 855; + this.utilityStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + emptyStatement_() { + let localContext = new EmptyStatement_Context(this.context, this.state); + this.enterRule(localContext, 6, MySqlParser.RULE_emptyStatement_); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 858; + this.match(MySqlParser.SEMI); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ddlStatement() { + let localContext = new DdlStatementContext(this.context, this.state); + this.enterRule(localContext, 8, MySqlParser.RULE_ddlStatement); + try { + this.state = 899; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 4, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 860; + this.createDatabase(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 861; + this.createEvent(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 862; + this.createIndex(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 863; + this.createLogfileGroup(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 864; + this.createProcedure(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 865; + this.createFunction(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 866; + this.createServer(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 867; + this.createTable(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 868; + this.createTablespaceInnodb(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 869; + this.createTablespaceNdb(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 870; + this.createTrigger(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 871; + this.createView(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 872; + this.createRole(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 873; + this.alterDatabase(); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 874; + this.alterEvent(); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 875; + this.alterFunction(); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 876; + this.alterInstance(); + } + break; + case 18: + this.enterOuterAlt(localContext, 18); + { + this.state = 877; + this.alterLogfileGroup(); + } + break; + case 19: + this.enterOuterAlt(localContext, 19); + { + this.state = 878; + this.alterProcedure(); + } + break; + case 20: + this.enterOuterAlt(localContext, 20); + { + this.state = 879; + this.alterServer(); + } + break; + case 21: + this.enterOuterAlt(localContext, 21); + { + this.state = 880; + this.alterTable(); + } + break; + case 22: + this.enterOuterAlt(localContext, 22); + { + this.state = 881; + this.alterTablespace(); + } + break; + case 23: + this.enterOuterAlt(localContext, 23); + { + this.state = 882; + this.alterView(); + } + break; + case 24: + this.enterOuterAlt(localContext, 24); + { + this.state = 883; + this.dropDatabase(); + } + break; + case 25: + this.enterOuterAlt(localContext, 25); + { + this.state = 884; + this.dropEvent(); + } + break; + case 26: + this.enterOuterAlt(localContext, 26); + { + this.state = 885; + this.dropIndex(); + } + break; + case 27: + this.enterOuterAlt(localContext, 27); + { + this.state = 886; + this.dropLogfileGroup(); + } + break; + case 28: + this.enterOuterAlt(localContext, 28); + { + this.state = 887; + this.dropProcedure(); + } + break; + case 29: + this.enterOuterAlt(localContext, 29); + { + this.state = 888; + this.dropFunction(); + } + break; + case 30: + this.enterOuterAlt(localContext, 30); + { + this.state = 889; + this.dropServer(); + } + break; + case 31: + this.enterOuterAlt(localContext, 31); + { + this.state = 890; + this.dropSpatial(); + } + break; + case 32: + this.enterOuterAlt(localContext, 32); + { + this.state = 891; + this.dropTable(); + } + break; + case 33: + this.enterOuterAlt(localContext, 33); + { + this.state = 892; + this.dropTablespace(); + } + break; + case 34: + this.enterOuterAlt(localContext, 34); + { + this.state = 893; + this.dropTrigger(); + } + break; + case 35: + this.enterOuterAlt(localContext, 35); + { + this.state = 894; + this.dropView(); + } + break; + case 36: + this.enterOuterAlt(localContext, 36); + { + this.state = 895; + this.dropRole(); + } + break; + case 37: + this.enterOuterAlt(localContext, 37); + { + this.state = 896; + this.setRole(); + } + break; + case 38: + this.enterOuterAlt(localContext, 38); + { + this.state = 897; + this.renameTable(); + } + break; + case 39: + this.enterOuterAlt(localContext, 39); + { + this.state = 898; + this.truncateTable(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dmlStatement() { + let localContext = new DmlStatementContext(this.context, this.state); + this.enterRule(localContext, 10, MySqlParser.RULE_dmlStatement); + try { + this.state = 918; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 5, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 901; + this.selectStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 902; + this.setOperations(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 903; + this.insertStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 904; + this.updateStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 905; + this.deleteStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 906; + this.replaceStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 907; + this.callStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 908; + this.interSectStatement(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 909; + this.loadDataStatement(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 910; + this.loadXmlStatement(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 911; + this.parenthesizedQuery(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 912; + this.doStatement(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 913; + this.handlerStatement(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 914; + this.importTableStatement(); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 915; + this.valuesStatement(); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 916; + this.withStatement(); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 917; + this.tableStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionStatement() { + let localContext = new TransactionStatementContext(this.context, this.state); + this.enterRule(localContext, 12, MySqlParser.RULE_transactionStatement); + try { + this.state = 929; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 6, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 920; + this.startTransaction(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 921; + this.beginWork(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 922; + this.commitWork(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 923; + this.rollbackWork(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 924; + this.savepointStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 925; + this.rollbackStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 926; + this.releaseStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 927; + this.lockTables(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 928; + this.unlockTables(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replicationStatement() { + let localContext = new ReplicationStatementContext(this.context, this.state); + this.enterRule(localContext, 14, MySqlParser.RULE_replicationStatement); + try { + this.state = 945; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 7, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 931; + this.changeMaster(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 932; + this.changeReplicationFilter(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 933; + this.changeReplicationSource(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 934; + this.purgeBinaryLogs(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 935; + this.startSlaveOrReplica(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 936; + this.stopSlaveOrReplica(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 937; + this.startGroupReplication(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 938; + this.stopGroupReplication(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 939; + this.xaStartTransaction(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 940; + this.xaEndTransaction(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 941; + this.xaPrepareStatement(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 942; + this.xaCommitWork(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 943; + this.xaRollbackWork(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 944; + this.xaRecoverWork(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + preparedStatement() { + let localContext = new PreparedStatementContext(this.context, this.state); + this.enterRule(localContext, 16, MySqlParser.RULE_preparedStatement); + try { + this.state = 950; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PREPARE: + this.enterOuterAlt(localContext, 1); + { + this.state = 947; + this.prepareStatement(); + } + break; + case MySqlParser.KW_EXECUTE: + this.enterOuterAlt(localContext, 2); + { + this.state = 948; + this.executeStatement(); + } + break; + case MySqlParser.KW_DROP: + case MySqlParser.KW_DEALLOCATE: + this.enterOuterAlt(localContext, 3); + { + this.state = 949; + this.deallocatePrepare(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + compoundStatement() { + let localContext = new CompoundStatementContext(this.context, this.state); + this.enterRule(localContext, 18, MySqlParser.RULE_compoundStatement); + try { + this.state = 962; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 9, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 952; + this.blockStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 953; + this.caseStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 954; + this.ifStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 955; + this.leaveStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 956; + this.loopStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 957; + this.repeatStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 958; + this.whileStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 959; + this.iterateStatement(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 960; + this.returnStatement(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 961; + this.cursorStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + administrationStatement() { + let localContext = new AdministrationStatementContext(this.context, this.state); + this.enterRule(localContext, 20, MySqlParser.RULE_administrationStatement); + try { + this.state = 997; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 10, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 964; + this.alterUser(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 965; + this.createUser(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 966; + this.dropUser(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 967; + this.grantStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 968; + this.grantProxy(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 969; + this.renameUser(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 970; + this.revokeStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 971; + this.alterResourceGroup(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 972; + this.createResourceGroup(); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 973; + this.dropResourceGroup(); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 974; + this.setResourceGroup(); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 975; + this.analyzeTable(); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 976; + this.checkTable(); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 977; + this.checksumTable(); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 978; + this.optimizeTable(); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 979; + this.repairTable(); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 980; + this.installComponent(); + } + break; + case 18: + this.enterOuterAlt(localContext, 18); + { + this.state = 981; + this.uninstallComponent(); + } + break; + case 19: + this.enterOuterAlt(localContext, 19); + { + this.state = 982; + this.installPlugin(); + } + break; + case 20: + this.enterOuterAlt(localContext, 20); + { + this.state = 983; + this.uninstallPlugin(); + } + break; + case 21: + this.enterOuterAlt(localContext, 21); + { + this.state = 984; + this.cloneStatement(); + } + break; + case 22: + this.enterOuterAlt(localContext, 22); + { + this.state = 985; + this.setStatement(); + } + break; + case 23: + this.enterOuterAlt(localContext, 23); + { + this.state = 986; + this.showStatement(); + } + break; + case 24: + this.enterOuterAlt(localContext, 24); + { + this.state = 987; + this.binlogStatement(); + } + break; + case 25: + this.enterOuterAlt(localContext, 25); + { + this.state = 988; + this.cacheIndexStatement(); + } + break; + case 26: + this.enterOuterAlt(localContext, 26); + { + this.state = 989; + this.flushStatement(); + } + break; + case 27: + this.enterOuterAlt(localContext, 27); + { + this.state = 990; + this.killStatement(); + } + break; + case 28: + this.enterOuterAlt(localContext, 28); + { + this.state = 991; + this.loadIndexIntoCache(); + } + break; + case 29: + this.enterOuterAlt(localContext, 29); + { + this.state = 992; + this.resetStatement(); + } + break; + case 30: + this.enterOuterAlt(localContext, 30); + { + this.state = 993; + this.resetPersist(); + } + break; + case 31: + this.enterOuterAlt(localContext, 31); + { + this.state = 994; + this.resetAllChannel(); + } + break; + case 32: + this.enterOuterAlt(localContext, 32); + { + this.state = 995; + this.reStartStatement(); + } + break; + case 33: + this.enterOuterAlt(localContext, 33); + { + this.state = 996; + this.shutdownStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + utilityStatement() { + let localContext = new UtilityStatementContext(this.context, this.state); + this.enterRule(localContext, 22, MySqlParser.RULE_utilityStatement); + try { + this.state = 1007; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 11, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 999; + this.fullDescribeStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1000; + this.simpleDescribeStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1001; + this.analyzeDescribeStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1002; + this.helpStatement(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 1003; + this.useStatement(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 1004; + this.signalStatement(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 1005; + this.resignalStatement(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 1006; + this.diagnosticsStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDatabase() { + let localContext = new CreateDatabaseContext(this.context, this.state); + this.enterRule(localContext, 24, MySqlParser.RULE_createDatabase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1009; + this.match(MySqlParser.KW_CREATE); + this.state = 1010; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1012; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 12, this.context)) { + case 1: + { + this.state = 1011; + this.ifNotExists(); + } + break; + } + this.state = 1014; + this.databaseNameCreate(); + this.state = 1018; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 135 || _la === 224 || _la === 376 || _la === 823) { + { + { + this.state = 1015; + this.createDatabaseOption(); + } + } + this.state = 1020; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createEvent() { + let localContext = new CreateEventContext(this.context, this.state); + this.enterRule(localContext, 26, MySqlParser.RULE_createEvent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1021; + this.match(MySqlParser.KW_CREATE); + this.state = 1023; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1022; + this.ownerStatement(); + } + } + this.state = 1025; + this.match(MySqlParser.KW_EVENT); + this.state = 1027; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 15, this.context)) { + case 1: + { + this.state = 1026; + this.ifNotExists(); + } + break; + } + this.state = 1029; + localContext._event_name = this.fullId(); + this.state = 1030; + this.match(MySqlParser.KW_ON); + this.state = 1031; + this.match(MySqlParser.KW_SCHEDULE); + this.state = 1032; + this.scheduleExpression(); + this.state = 1039; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 119) { + { + this.state = 1033; + this.match(MySqlParser.KW_ON); + this.state = 1034; + this.match(MySqlParser.KW_COMPLETION); + this.state = 1036; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 1035; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 1038; + this.match(MySqlParser.KW_PRESERVE); + } + } + this.state = 1042; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 1041; + this.enableType(); + } + } + this.state = 1046; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 1044; + this.match(MySqlParser.KW_COMMENT); + this.state = 1045; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1048; + this.match(MySqlParser.KW_DO); + this.state = 1049; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createIndex() { + let localContext = new CreateIndexContext(this.context, this.state); + this.enterRule(localContext, 28, MySqlParser.RULE_createIndex); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 1051; + this.match(MySqlParser.KW_CREATE); + this.state = 1053; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 508 || _la === 514) { + { + this.state = 1052; + localContext._intimeAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 508 || _la === 514)) { + localContext._intimeAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1056; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 69 || _la === 161 || _la === 182) { + { + this.state = 1055; + localContext._indexCategory = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 69 || _la === 161 || _la === 182)) { + localContext._indexCategory = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1058; + this.match(MySqlParser.KW_INDEX); + this.state = 1059; + this.indexNameCreate(); + this.state = 1061; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1060; + this.indexType(); + } + } + this.state = 1063; + this.match(MySqlParser.KW_ON); + this.state = 1064; + this.tableName(); + this.state = 1065; + this.indexColumnNames(); + this.state = 1069; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 23, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1066; + this.indexOption(); + } + } + } + this.state = 1071; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 23, this.context); + } + this.state = 1084; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 27, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + this.state = 1082; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALGORITHM: + { + this.state = 1072; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 1074; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1073; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1076; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 357 || _la === 430)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_LOCK: + { + this.state = 1077; + this.match(MySqlParser.KW_LOCK); + this.state = 1079; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1078; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1081; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 389 || _la === 505 || _la === 595)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 1086; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 27, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createLogfileGroup() { + let localContext = new CreateLogfileGroupContext(this.context, this.state); + this.enterRule(localContext, 30, MySqlParser.RULE_createLogfileGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1087; + this.match(MySqlParser.KW_CREATE); + this.state = 1088; + this.match(MySqlParser.KW_LOGFILE); + this.state = 1089; + this.match(MySqlParser.KW_GROUP); + this.state = 1090; + localContext._logfileGroupName = this.uid(); + this.state = 1091; + this.match(MySqlParser.KW_ADD); + this.state = 1092; + this.match(MySqlParser.KW_UNDOFILE); + this.state = 1093; + localContext._undoFile = this.match(MySqlParser.STRING_LITERAL); + this.state = 1099; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 1094; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 1096; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1095; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1098; + localContext._initSize = this.fileSizeLiteral(); + } + } + this.state = 1106; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 672) { + { + this.state = 1101; + this.match(MySqlParser.KW_UNDO_BUFFER_SIZE); + this.state = 1103; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1102; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1105; + localContext._undoSize = this.fileSizeLiteral(); + } + } + this.state = 1113; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 553) { + { + this.state = 1108; + this.match(MySqlParser.KW_REDO_BUFFER_SIZE); + this.state = 1110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1109; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1112; + localContext._redoSize = this.fileSizeLiteral(); + } + } + this.state = 1120; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 504) { + { + this.state = 1115; + this.match(MySqlParser.KW_NODEGROUP); + this.state = 1117; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1116; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1119; + localContext._nodegroup = this.uid(); + } + } + this.state = 1123; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 1122; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 1130; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 1125; + this.match(MySqlParser.KW_COMMENT); + this.state = 1127; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1126; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1129; + localContext._comment = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1132; + this.match(MySqlParser.KW_ENGINE); + this.state = 1134; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1133; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1136; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createProcedure() { + let localContext = new CreateProcedureContext(this.context, this.state); + this.enterRule(localContext, 32, MySqlParser.RULE_createProcedure); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 1138; + this.match(MySqlParser.KW_CREATE); + this.state = 1140; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1139; + this.ownerStatement(); + } + } + this.state = 1142; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 1144; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 41, this.context)) { + case 1: + { + this.state = 1143; + this.ifNotExists(); + } + break; + } + this.state = 1146; + localContext._sp_name = this.fullId(); + this.state = 1147; + this.match(MySqlParser.LR_BRACKET); + this.state = 1149; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18880593) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100680481) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1148; + this.procedureParameter(); + } + } + this.state = 1155; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1151; + this.match(MySqlParser.COMMA); + this.state = 1152; + this.procedureParameter(); + } + } + this.state = 1157; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1158; + this.match(MySqlParser.RR_BRACKET); + this.state = 1162; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 44, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1159; + this.routineOption(); + } + } + } + this.state = 1164; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 44, this.context); + } + this.state = 1165; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createRole() { + let localContext = new CreateRoleContext(this.context, this.state); + this.enterRule(localContext, 34, MySqlParser.RULE_createRole); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1167; + this.match(MySqlParser.KW_CREATE); + this.state = 1168; + this.match(MySqlParser.KW_ROLE); + this.state = 1170; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 45, this.context)) { + case 1: + { + this.state = 1169; + this.ifNotExists(); + } + break; + } + this.state = 1172; + this.userOrRoleNames(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createServer() { + let localContext = new CreateServerContext(this.context, this.state); + this.enterRule(localContext, 36, MySqlParser.RULE_createServer); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1174; + this.match(MySqlParser.KW_CREATE); + this.state = 1175; + this.match(MySqlParser.KW_SERVER); + this.state = 1176; + localContext._servername = this.uid(); + this.state = 1177; + this.match(MySqlParser.KW_FOREIGN); + this.state = 1178; + this.match(MySqlParser.KW_DATA); + this.state = 1179; + this.match(MySqlParser.KW_WRAPPER); + this.state = 1180; + localContext._wrapperName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 494 || _la === 882)) { + localContext._wrapperName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1181; + this.match(MySqlParser.KW_OPTIONS); + this.state = 1182; + this.match(MySqlParser.LR_BRACKET); + this.state = 1183; + this.serverOption(); + this.state = 1188; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1184; + this.match(MySqlParser.COMMA); + this.state = 1185; + this.serverOption(); + } + } + this.state = 1190; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1191; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTable() { + let localContext = new CreateTableContext(this.context, this.state); + this.enterRule(localContext, 38, MySqlParser.RULE_createTable); + let _la; + try { + let alternative; + this.state = 1271; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 65, this.context)) { + case 1: + localContext = new QueryCreateTableContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1193; + this.match(MySqlParser.KW_CREATE); + this.state = 1195; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 1194; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 1197; + this.match(MySqlParser.KW_TABLE); + this.state = 1199; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 48, this.context)) { + case 1: + { + this.state = 1198; + this.ifNotExists(); + } + break; + } + this.state = 1201; + localContext._tb = this.tableNameCreate(); + this.state = 1203; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 49, this.context)) { + case 1: + { + this.state = 1202; + localContext._col = this.createDefinitions(); + } + break; + } + this.state = 1215; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 82 || _la === 181 || _la === 224 || ((((_la - 314)) & ~0x1F) === 0 && ((1 << (_la - 314)) & 67141639) !== 0) || ((((_la - 346)) & ~0x1F) === 0 && ((1 << (_la - 346)) & 3221766153) !== 0) || _la === 380 || _la === 431 || _la === 443 || _la === 480 || _la === 490 || ((((_la - 520)) & ~0x1F) === 0 && ((1 << (_la - 520)) & 541) !== 0) || _la === 588 || ((((_la - 640)) & ~0x1F) === 0 && ((1 << (_la - 640)) & 34341021) !== 0) || ((((_la - 823)) & ~0x1F) === 0 && ((1 << (_la - 823)) & 1029) !== 0) || _la === 882) { + { + this.state = 1205; + this.tableOption(); + this.state = 1212; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 82 || _la === 181 || _la === 224 || ((((_la - 314)) & ~0x1F) === 0 && ((1 << (_la - 314)) & 67141639) !== 0) || ((((_la - 346)) & ~0x1F) === 0 && ((1 << (_la - 346)) & 3221766153) !== 0) || _la === 380 || _la === 431 || _la === 443 || _la === 480 || _la === 490 || ((((_la - 520)) & ~0x1F) === 0 && ((1 << (_la - 520)) & 541) !== 0) || _la === 588 || ((((_la - 640)) & ~0x1F) === 0 && ((1 << (_la - 640)) & 34341021) !== 0) || ((((_la - 823)) & ~0x1F) === 0 && ((1 << (_la - 823)) & 1029) !== 0) || _la === 868 || _la === 882) { + { + { + this.state = 1207; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 1206; + this.match(MySqlParser.COMMA); + } + } + this.state = 1209; + this.tableOption(); + } + } + this.state = 1214; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 1218; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 1217; + this.partitionDefinitions(); + } + } + this.state = 1221; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79 || _la === 143) { + { + this.state = 1220; + _la = this.tokenStream.LA(1); + if (!(_la === 79 || _la === 143)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1224; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 1223; + this.match(MySqlParser.KW_AS); + } + } + this.state = 1226; + this.selectStatement(); + } + break; + case 2: + localContext = new CopyCreateTableContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1228; + this.match(MySqlParser.KW_CREATE); + this.state = 1230; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 1229; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 1232; + this.match(MySqlParser.KW_TABLE); + this.state = 1234; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 57, this.context)) { + case 1: + { + this.state = 1233; + this.ifNotExists(); + } + break; + } + this.state = 1236; + this.tableNameCreate(); + this.state = 1244; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_LIKE: + { + this.state = 1237; + this.match(MySqlParser.KW_LIKE); + this.state = 1238; + this.tableName(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 1239; + this.match(MySqlParser.LR_BRACKET); + this.state = 1240; + this.match(MySqlParser.KW_LIKE); + this.state = 1241; + this.tableName(); + this.state = 1242; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 3: + localContext = new ColumnCreateTableContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1246; + this.match(MySqlParser.KW_CREATE); + this.state = 1248; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 1247; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 1250; + this.match(MySqlParser.KW_TABLE); + this.state = 1252; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 60, this.context)) { + case 1: + { + this.state = 1251; + this.ifNotExists(); + } + break; + } + this.state = 1254; + this.tableNameCreate(); + this.state = 1255; + this.createDefinitions(); + this.state = 1266; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 63, this.context)) { + case 1: + { + this.state = 1256; + this.tableOption(); + this.state = 1263; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 62, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1258; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 1257; + this.match(MySqlParser.COMMA); + } + } + this.state = 1260; + this.tableOption(); + } + } + } + this.state = 1265; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 62, this.context); + } + } + break; + } + this.state = 1269; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 1268; + this.partitionDefinitions(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTablespaceInnodb() { + let localContext = new CreateTablespaceInnodbContext(this.context, this.state); + this.enterRule(localContext, 40, MySqlParser.RULE_createTablespaceInnodb); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1273; + this.match(MySqlParser.KW_CREATE); + this.state = 1275; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 1274; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 1277; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 1278; + this.tablespaceNameCreate(); + this.state = 1282; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 6) { + { + this.state = 1279; + this.match(MySqlParser.KW_ADD); + this.state = 1280; + this.match(MySqlParser.KW_DATAFILE); + this.state = 1281; + localContext._datafile = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1289; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 314) { + { + this.state = 1284; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 1286; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1285; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1288; + localContext._autoextendSize = this.fileSizeLiteral(); + } + } + this.state = 1294; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 399) { + { + this.state = 1291; + this.match(MySqlParser.KW_FILE_BLOCK_SIZE); + this.state = 1292; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 1293; + localContext._fileBlockSize = this.fileSizeLiteral(); + } + } + this.state = 1301; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 380) { + { + this.state = 1296; + this.match(MySqlParser.KW_ENGINE); + this.state = 1298; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1297; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1300; + this.engineName(); + } + } + this.state = 1308; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 825) { + { + this.state = 1303; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 1305; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1304; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1307; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTablespaceNdb() { + let localContext = new CreateTablespaceNdbContext(this.context, this.state); + this.enterRule(localContext, 42, MySqlParser.RULE_createTablespaceNdb); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1310; + this.match(MySqlParser.KW_CREATE); + this.state = 1312; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 1311; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 1314; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 1315; + this.tablespaceNameCreate(); + this.state = 1316; + this.match(MySqlParser.KW_ADD); + this.state = 1317; + this.match(MySqlParser.KW_DATAFILE); + this.state = 1318; + localContext._datafile = this.match(MySqlParser.STRING_LITERAL); + this.state = 1319; + this.match(MySqlParser.KW_USE); + this.state = 1320; + this.match(MySqlParser.KW_LOGFILE); + this.state = 1321; + this.match(MySqlParser.KW_GROUP); + this.state = 1322; + localContext._logfileGroupName = this.uid(); + this.state = 1328; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 393) { + { + this.state = 1323; + this.match(MySqlParser.KW_EXTENT_SIZE); + this.state = 1325; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1324; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1327; + localContext._extentSize = this.fileSizeLiteral(); + } + } + this.state = 1335; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 1330; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 1332; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1331; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1334; + localContext._initialSize = this.fileSizeLiteral(); + } + } + this.state = 1342; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 314) { + { + this.state = 1337; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 1339; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1338; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1341; + localContext._autoextendSize = this.fileSizeLiteral(); + } + } + this.state = 1349; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 481) { + { + this.state = 1344; + this.match(MySqlParser.KW_MAX_SIZE); + this.state = 1346; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1345; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1348; + localContext._maxSize = this.fileSizeLiteral(); + } + } + this.state = 1356; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 504) { + { + this.state = 1351; + this.match(MySqlParser.KW_NODEGROUP); + this.state = 1353; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1352; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1355; + localContext._nodegroup = this.uid(); + } + } + this.state = 1359; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 1358; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 1366; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 1361; + this.match(MySqlParser.KW_COMMENT); + this.state = 1363; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1362; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1365; + localContext._comment = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 1368; + this.match(MySqlParser.KW_ENGINE); + this.state = 1370; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1369; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1372; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createTrigger() { + let localContext = new CreateTriggerContext(this.context, this.state); + this.enterRule(localContext, 44, MySqlParser.RULE_createTrigger); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1374; + this.match(MySqlParser.KW_CREATE); + this.state = 1376; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1375; + this.ownerStatement(); + } + } + this.state = 1378; + this.match(MySqlParser.KW_TRIGGER); + this.state = 1380; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 91, this.context)) { + case 1: + { + this.state = 1379; + this.ifNotExists(); + } + break; + } + this.state = 1382; + localContext._trigger_name = this.fullId(); + this.state = 1383; + localContext._triggerTime = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 16 || _la === 306)) { + localContext._triggerTime = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1384; + localContext._triggerEvent = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 44 || _la === 86 || _la === 185)) { + localContext._triggerEvent = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1385; + this.match(MySqlParser.KW_ON); + this.state = 1386; + this.tableName(); + this.state = 1387; + this.match(MySqlParser.KW_FOR); + this.state = 1388; + this.match(MySqlParser.KW_EACH); + this.state = 1389; + this.match(MySqlParser.KW_ROW); + this.state = 1392; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 92, this.context)) { + case 1: + { + this.state = 1390; + localContext._triggerPlace = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 406 || _la === 538)) { + localContext._triggerPlace = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1391; + localContext._other_trigger_name = this.fullId(); + } + break; + } + this.state = 1394; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + withClause() { + let localContext = new WithClauseContext(this.context, this.state); + this.enterRule(localContext, 46, MySqlParser.RULE_withClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1396; + this.match(MySqlParser.KW_WITH); + this.state = 1398; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 93, this.context)) { + case 1: + { + this.state = 1397; + this.match(MySqlParser.KW_RECURSIVE); + } + break; + } + this.state = 1400; + this.commonTableExpressions(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + commonTableExpressions() { + let localContext = new CommonTableExpressionsContext(this.context, this.state); + this.enterRule(localContext, 48, MySqlParser.RULE_commonTableExpressions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1402; + localContext._cteName = this.uid(); + this.state = 1414; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 1403; + this.match(MySqlParser.LR_BRACKET); + this.state = 1404; + localContext._cteColumnName = this.uid(); + this.state = 1409; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1405; + this.match(MySqlParser.COMMA); + this.state = 1406; + localContext._cteColumnName = this.uid(); + } + } + this.state = 1411; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1412; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 1416; + this.match(MySqlParser.KW_AS); + this.state = 1417; + this.match(MySqlParser.LR_BRACKET); + this.state = 1418; + this.dmlStatement(); + this.state = 1419; + this.match(MySqlParser.RR_BRACKET); + this.state = 1422; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 96, this.context)) { + case 1: + { + this.state = 1420; + this.match(MySqlParser.COMMA); + this.state = 1421; + this.commonTableExpressions(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createView() { + let localContext = new CreateViewContext(this.context, this.state); + this.enterRule(localContext, 50, MySqlParser.RULE_createView); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1424; + this.match(MySqlParser.KW_CREATE); + this.state = 1426; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 124) { + { + this.state = 1425; + this.orReplace(); + } + } + this.state = 1431; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 1428; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 1429; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 1430; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 486 || _la === 661 || _la === 670)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1434; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 1433; + this.ownerStatement(); + } + } + this.state = 1439; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 162) { + { + this.state = 1436; + this.match(MySqlParser.KW_SQL); + this.state = 1437; + this.match(MySqlParser.KW_SECURITY); + this.state = 1438; + localContext._secContext = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 364 || _la === 436)) { + localContext._secContext = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1441; + this.match(MySqlParser.KW_VIEW); + this.state = 1442; + this.viewNameCreate(); + this.state = 1454; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 1443; + this.match(MySqlParser.LR_BRACKET); + this.state = 1444; + this.columnNameCreate(); + this.state = 1449; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1445; + this.match(MySqlParser.COMMA); + this.state = 1446; + this.columnNameCreate(); + } + } + this.state = 1451; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1452; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 1456; + this.match(MySqlParser.KW_AS); + this.state = 1476; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 107, this.context)) { + case 1: + { + this.state = 1457; + this.match(MySqlParser.LR_BRACKET); + this.state = 1459; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 1458; + this.withClause(); + } + } + this.state = 1461; + this.selectStatement(); + this.state = 1462; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 1465; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 1464; + this.withClause(); + } + } + this.state = 1467; + this.selectStatement(); + this.state = 1474; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 106, this.context)) { + case 1: + { + this.state = 1468; + this.match(MySqlParser.KW_WITH); + this.state = 1470; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 325 || _la === 450) { + { + this.state = 1469; + localContext._checkOption = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 325 || _la === 450)) { + localContext._checkOption = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1472; + this.match(MySqlParser.KW_CHECK); + this.state = 1473; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDatabaseOption() { + let localContext = new CreateDatabaseOptionContext(this.context, this.state); + this.enterRule(localContext, 52, MySqlParser.RULE_createDatabaseOption); + let _la; + try { + this.state = 1511; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 116, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1479; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1478; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1481; + this.charSet(); + this.state = 1483; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1482; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1487; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 1485; + this.charsetName(); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 1486; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1490; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1489; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1492; + this.match(MySqlParser.KW_COLLATE); + this.state = 1494; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1493; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1496; + this.collationName(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1498; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1497; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1500; + this.match(MySqlParser.KW_ENCRYPTION); + this.state = 1502; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1501; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1504; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1505; + this.match(MySqlParser.KW_READ); + this.state = 1506; + this.match(MySqlParser.KW_ONLY); + this.state = 1508; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1507; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1510; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + charSet() { + let localContext = new CharSetContext(this.context, this.state); + this.enterRule(localContext, 54, MySqlParser.RULE_charSet); + try { + this.state = 1518; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CHARACTER: + this.enterOuterAlt(localContext, 1); + { + this.state = 1513; + this.match(MySqlParser.KW_CHARACTER); + this.state = 1514; + this.match(MySqlParser.KW_SET); + } + break; + case MySqlParser.KW_CHARSET: + this.enterOuterAlt(localContext, 2); + { + this.state = 1515; + this.match(MySqlParser.KW_CHARSET); + } + break; + case MySqlParser.KW_CHAR: + this.enterOuterAlt(localContext, 3); + { + this.state = 1516; + this.match(MySqlParser.KW_CHAR); + this.state = 1517; + this.match(MySqlParser.KW_SET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + currentUserExpression() { + let localContext = new CurrentUserExpressionContext(this.context, this.state); + this.enterRule(localContext, 56, MySqlParser.RULE_currentUserExpression); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1520; + _la = this.tokenStream.LA(1); + if (!(_la === 37 || _la === 678)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1523; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 118, this.context)) { + case 1: + { + this.state = 1521; + this.match(MySqlParser.LR_BRACKET); + this.state = 1522; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ownerStatement() { + let localContext = new OwnerStatementContext(this.context, this.state); + this.enterRule(localContext, 58, MySqlParser.RULE_ownerStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1525; + this.match(MySqlParser.KW_DEFINER); + this.state = 1526; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 1529; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 119, this.context)) { + case 1: + { + this.state = 1527; + this.userName(); + } + break; + case 2: + { + this.state = 1528; + this.currentUserExpression(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + scheduleExpression() { + let localContext = new ScheduleExpressionContext(this.context, this.state); + this.enterRule(localContext, 60, MySqlParser.RULE_scheduleExpression); + let _la; + try { + this.state = 1565; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AT: + localContext = new PreciseScheduleContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1531; + this.match(MySqlParser.KW_AT); + this.state = 1532; + this.timestampValue(); + this.state = 1536; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 853) { + { + { + this.state = 1533; + this.intervalExpr(); + } + } + this.state = 1538; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case MySqlParser.KW_EVERY: + localContext = new IntervalScheduleContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1539; + this.match(MySqlParser.KW_EVERY); + this.state = 1542; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 121, this.context)) { + case 1: + { + this.state = 1540; + this.decimalLiteral(); + } + break; + case 2: + { + this.state = 1541; + this.expression(0); + } + break; + } + this.state = 1544; + this.intervalType(); + this.state = 1553; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 641) { + { + this.state = 1545; + this.match(MySqlParser.KW_STARTS); + this.state = 1546; + localContext._startTimestamp = this.timestampValue(); + this.state = 1550; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 853) { + { + { + this.state = 1547; + localContext._intervalExpr = this.intervalExpr(); + localContext._startIntervals.push(localContext._intervalExpr); + } + } + this.state = 1552; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 1563; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 379) { + { + this.state = 1555; + this.match(MySqlParser.KW_ENDS); + this.state = 1556; + localContext._endTimestamp = this.timestampValue(); + this.state = 1560; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 853) { + { + { + this.state = 1557; + localContext._intervalExpr = this.intervalExpr(); + localContext._endIntervals.push(localContext._intervalExpr); + } + } + this.state = 1562; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + timestampValue() { + let localContext = new TimestampValueContext(this.context, this.state); + this.enterRule(localContext, 62, MySqlParser.RULE_timestampValue); + try { + this.state = 1571; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 127, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1567; + this.match(MySqlParser.KW_CURRENT_TIMESTAMP); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1568; + this.stringLiteral(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1569; + this.decimalLiteral(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1570; + this.expression(0); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intervalExpr() { + let localContext = new IntervalExprContext(this.context, this.state); + this.enterRule(localContext, 64, MySqlParser.RULE_intervalExpr); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1573; + this.match(MySqlParser.PLUS); + this.state = 1574; + this.match(MySqlParser.KW_INTERVAL); + this.state = 1577; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 128, this.context)) { + case 1: + { + this.state = 1575; + this.decimalLiteral(); + } + break; + case 2: + { + this.state = 1576; + this.expression(0); + } + break; + } + this.state = 1579; + this.intervalType(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intervalType() { + let localContext = new IntervalTypeContext(this.context, this.state); + this.enterRule(localContext, 66, MySqlParser.RULE_intervalType); + try { + this.state = 1594; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + this.enterOuterAlt(localContext, 1); + { + this.state = 1581; + this.intervalTypeBase(); + } + break; + case MySqlParser.KW_YEAR: + this.enterOuterAlt(localContext, 2); + { + this.state = 1582; + this.match(MySqlParser.KW_YEAR); + } + break; + case MySqlParser.KW_YEAR_MONTH: + this.enterOuterAlt(localContext, 3); + { + this.state = 1583; + this.match(MySqlParser.KW_YEAR_MONTH); + } + break; + case MySqlParser.KW_DAY_HOUR: + this.enterOuterAlt(localContext, 4); + { + this.state = 1584; + this.match(MySqlParser.KW_DAY_HOUR); + } + break; + case MySqlParser.KW_DAY_MINUTE: + this.enterOuterAlt(localContext, 5); + { + this.state = 1585; + this.match(MySqlParser.KW_DAY_MINUTE); + } + break; + case MySqlParser.KW_DAY_SECOND: + this.enterOuterAlt(localContext, 6); + { + this.state = 1586; + this.match(MySqlParser.KW_DAY_SECOND); + } + break; + case MySqlParser.KW_HOUR_MINUTE: + this.enterOuterAlt(localContext, 7); + { + this.state = 1587; + this.match(MySqlParser.KW_HOUR_MINUTE); + } + break; + case MySqlParser.KW_HOUR_SECOND: + this.enterOuterAlt(localContext, 8); + { + this.state = 1588; + this.match(MySqlParser.KW_HOUR_SECOND); + } + break; + case MySqlParser.KW_MINUTE_SECOND: + this.enterOuterAlt(localContext, 9); + { + this.state = 1589; + this.match(MySqlParser.KW_MINUTE_SECOND); + } + break; + case MySqlParser.KW_SECOND_MICROSECOND: + this.enterOuterAlt(localContext, 10); + { + this.state = 1590; + this.match(MySqlParser.KW_SECOND_MICROSECOND); + } + break; + case MySqlParser.KW_MINUTE_MICROSECOND: + this.enterOuterAlt(localContext, 11); + { + this.state = 1591; + this.match(MySqlParser.KW_MINUTE_MICROSECOND); + } + break; + case MySqlParser.KW_HOUR_MICROSECOND: + this.enterOuterAlt(localContext, 12); + { + this.state = 1592; + this.match(MySqlParser.KW_HOUR_MICROSECOND); + } + break; + case MySqlParser.KW_DAY_MICROSECOND: + this.enterOuterAlt(localContext, 13); + { + this.state = 1593; + this.match(MySqlParser.KW_DAY_MICROSECOND); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + enableType() { + let localContext = new EnableTypeContext(this.context, this.state); + this.enterRule(localContext, 68, MySqlParser.RULE_enableType); + try { + this.state = 1601; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 130, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1596; + this.match(MySqlParser.KW_ENABLE); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1597; + this.match(MySqlParser.KW_DISABLE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1598; + this.match(MySqlParser.KW_DISABLE); + this.state = 1599; + this.match(MySqlParser.KW_ON); + this.state = 1600; + this.match(MySqlParser.KW_SLAVE); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexType() { + let localContext = new IndexTypeContext(this.context, this.state); + this.enterRule(localContext, 70, MySqlParser.RULE_indexType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1603; + this.match(MySqlParser.KW_USING); + this.state = 1604; + _la = this.tokenStream.LA(1); + if (!(_la === 323 || _la === 418)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexOption() { + let localContext = new IndexOptionContext(this.context, this.state); + this.enterRule(localContext, 72, MySqlParser.RULE_indexOption); + let _la; + try { + this.state = 1628; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_KEY_BLOCK_SIZE: + this.enterOuterAlt(localContext, 1); + { + this.state = 1606; + this.match(MySqlParser.KW_KEY_BLOCK_SIZE); + this.state = 1608; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1607; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1610; + this.fileSizeLiteral(); + } + break; + case MySqlParser.KW_USING: + this.enterOuterAlt(localContext, 2); + { + this.state = 1611; + this.indexType(); + } + break; + case MySqlParser.KW_WITH: + this.enterOuterAlt(localContext, 3); + { + this.state = 1612; + this.match(MySqlParser.KW_WITH); + this.state = 1613; + this.match(MySqlParser.KW_PARSER); + this.state = 1614; + localContext._parserName = this.uid(); + } + break; + case MySqlParser.KW_COMMENT: + this.enterOuterAlt(localContext, 4); + { + this.state = 1615; + this.match(MySqlParser.KW_COMMENT); + this.state = 1616; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_VISIBLE: + this.enterOuterAlt(localContext, 5); + { + this.state = 1617; + _la = this.tokenStream.LA(1); + if (!(_la === 435 || _la === 686)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ENGINE_ATTRIBUTE: + this.enterOuterAlt(localContext, 6); + { + this.state = 1618; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 1620; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1619; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1622; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + this.enterOuterAlt(localContext, 7); + { + this.state = 1623; + this.match(MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE); + this.state = 1625; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1624; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1627; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + procedureParameter() { + let localContext = new ProcedureParameterContext(this.context, this.state); + this.enterRule(localContext, 74, MySqlParser.RULE_procedureParameter); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1631; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 80 || _la === 85 || _la === 126) { + { + this.state = 1630; + localContext._direction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 80 || _la === 85 || _la === 126)) { + localContext._direction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1633; + localContext._paramName = this.uid(); + this.state = 1634; + this.dataType(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + routineOption() { + let localContext = new RoutineOptionContext(this.context, this.state); + this.enterRule(localContext, 76, MySqlParser.RULE_routineOption); + let _la; + try { + this.state = 1659; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_COMMENT: + localContext = new RoutineCommentContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1636; + this.match(MySqlParser.KW_COMMENT); + this.state = 1637; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_LANGUAGE: + localContext = new RoutineLanguageContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1638; + this.match(MySqlParser.KW_LANGUAGE); + this.state = 1639; + this.match(MySqlParser.KW_SQL); + } + break; + case MySqlParser.KW_DETERMINISTIC: + case MySqlParser.KW_NOT: + localContext = new RoutineBehaviorContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1641; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 1640; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 1643; + this.match(MySqlParser.KW_DETERMINISTIC); + } + break; + case MySqlParser.KW_MODIFIES: + case MySqlParser.KW_READS: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_NO: + localContext = new RoutineDataContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 1654; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CONTAINS: + { + this.state = 1644; + this.match(MySqlParser.KW_CONTAINS); + this.state = 1645; + this.match(MySqlParser.KW_SQL); + } + break; + case MySqlParser.KW_NO: + { + this.state = 1646; + this.match(MySqlParser.KW_NO); + this.state = 1647; + this.match(MySqlParser.KW_SQL); + } + break; + case MySqlParser.KW_READS: + { + this.state = 1648; + this.match(MySqlParser.KW_READS); + this.state = 1649; + this.match(MySqlParser.KW_SQL); + this.state = 1650; + this.match(MySqlParser.KW_DATA); + } + break; + case MySqlParser.KW_MODIFIES: + { + this.state = 1651; + this.match(MySqlParser.KW_MODIFIES); + this.state = 1652; + this.match(MySqlParser.KW_SQL); + this.state = 1653; + this.match(MySqlParser.KW_DATA); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_SQL: + localContext = new RoutineSecurityContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 1656; + this.match(MySqlParser.KW_SQL); + this.state = 1657; + this.match(MySqlParser.KW_SECURITY); + this.state = 1658; + localContext._context = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 364 || _la === 436)) { + localContext._context = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + serverOption() { + let localContext = new ServerOptionContext(this.context, this.state); + this.enterRule(localContext, 78, MySqlParser.RULE_serverOption); + try { + this.state = 1675; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_HOST: + this.enterOuterAlt(localContext, 1); + { + this.state = 1661; + this.match(MySqlParser.KW_HOST); + this.state = 1662; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_DATABASE: + this.enterOuterAlt(localContext, 2); + { + this.state = 1663; + this.match(MySqlParser.KW_DATABASE); + this.state = 1664; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_USER: + this.enterOuterAlt(localContext, 3); + { + this.state = 1665; + this.match(MySqlParser.KW_USER); + this.state = 1666; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PASSWORD: + this.enterOuterAlt(localContext, 4); + { + this.state = 1667; + this.match(MySqlParser.KW_PASSWORD); + this.state = 1668; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_SOCKET: + this.enterOuterAlt(localContext, 5); + { + this.state = 1669; + this.match(MySqlParser.KW_SOCKET); + this.state = 1670; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_OWNER: + this.enterOuterAlt(localContext, 6); + { + this.state = 1671; + this.match(MySqlParser.KW_OWNER); + this.state = 1672; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PORT: + this.enterOuterAlt(localContext, 7); + { + this.state = 1673; + this.match(MySqlParser.KW_PORT); + this.state = 1674; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDefinitions() { + let localContext = new CreateDefinitionsContext(this.context, this.state); + this.enterRule(localContext, 80, MySqlParser.RULE_createDefinitions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1677; + this.match(MySqlParser.LR_BRACKET); + this.state = 1678; + this.createDefinition(); + this.state = 1683; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 1679; + this.match(MySqlParser.COMMA); + this.state = 1680; + this.createDefinition(); + } + } + this.state = 1685; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 1686; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createDefinition() { + let localContext = new CreateDefinitionContext(this.context, this.state); + this.enterRule(localContext, 82, MySqlParser.RULE_createDefinition); + let _la; + try { + this.state = 1771; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 157, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1688; + this.columnNameCreate(); + this.state = 1689; + this.columnDefinition(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1691; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1693; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1692; + this.indexName(); + } + } + this.state = 1696; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1695; + this.indexType(); + } + } + this.state = 1698; + this.indexColumnNames(); + this.state = 1702; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1699; + this.indexOption(); + } + } + this.state = 1704; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1705; + _la = this.tokenStream.LA(1); + if (!(_la === 69 || _la === 161)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1707; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 1706; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1710; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1709; + this.indexName(); + } + } + this.state = 1712; + this.indexColumnNames(); + this.state = 1716; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1713; + this.indexOption(); + } + } + this.state = 1718; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1720; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1719; + this.constraintSymbol(); + } + } + this.state = 1722; + this.match(MySqlParser.KW_PRIMARY); + this.state = 1723; + this.match(MySqlParser.KW_KEY); + this.state = 1725; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1724; + this.indexType(); + } + } + this.state = 1727; + this.indexColumnNames(); + this.state = 1731; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1728; + this.indexOption(); + } + } + this.state = 1733; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 1735; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1734; + this.constraintSymbol(); + } + } + this.state = 1737; + this.match(MySqlParser.KW_UNIQUE); + this.state = 1739; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 1738; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1742; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1741; + this.indexName(); + } + } + this.state = 1745; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 1744; + this.indexType(); + } + } + this.state = 1747; + this.indexColumnNames(); + this.state = 1751; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 188 || _la === 194 || _la === 340 || _la === 435 || _la === 443 || _la === 686 || _la === 825 || _la === 833) { + { + { + this.state = 1748; + this.indexOption(); + } + } + this.state = 1753; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 1755; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1754; + this.constraintSymbol(); + } + } + this.state = 1757; + this.match(MySqlParser.KW_FOREIGN); + this.state = 1758; + this.match(MySqlParser.KW_KEY); + this.state = 1760; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 1759; + this.indexName(); + } + } + this.state = 1762; + this.indexColumnNames(); + this.state = 1763; + this.referenceDefinition(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 1765; + this.match(MySqlParser.KW_CHECK); + this.state = 1766; + this.match(MySqlParser.LR_BRACKET); + this.state = 1767; + this.expression(0); + this.state = 1768; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 1770; + this.checkConstraintDefinition(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checkConstraintDefinition() { + let localContext = new CheckConstraintDefinitionContext(this.context, this.state); + this.enterRule(localContext, 84, MySqlParser.RULE_checkConstraintDefinition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1774; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 1773; + this.constraintSymbol(); + } + } + this.state = 1776; + this.match(MySqlParser.KW_CHECK); + this.state = 1777; + this.match(MySqlParser.LR_BRACKET); + this.state = 1778; + this.expression(0); + this.state = 1779; + this.match(MySqlParser.RR_BRACKET); + this.state = 1784; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 160, this.context)) { + case 1: + { + this.state = 1781; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 1780; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 1783; + this.match(MySqlParser.KW_ENFORCED); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + constraintSymbol() { + let localContext = new ConstraintSymbolContext(this.context, this.state); + this.enterRule(localContext, 86, MySqlParser.RULE_constraintSymbol); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1786; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 1788; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 161, this.context)) { + case 1: + { + this.state = 1787; + localContext._symbol_ = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnDefinition() { + let localContext = new ColumnDefinitionContext(this.context, this.state); + this.enterRule(localContext, 88, MySqlParser.RULE_columnDefinition); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 1790; + this.dataType(); + this.state = 1794; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 162, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 1791; + this.columnConstraint(); + } + } + } + this.state = 1796; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 162, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnConstraint() { + let localContext = new ColumnConstraintContext(this.context, this.state); + this.enterRule(localContext, 90, MySqlParser.RULE_columnConstraint); + let _la; + try { + this.state = 1840; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NOT: + case MySqlParser.KW_NULL_LITERAL: + case MySqlParser.NULL_SPEC_LITERAL: + localContext = new NullColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1797; + this.nullNotnull(); + } + break; + case MySqlParser.KW_DEFAULT: + localContext = new DefaultColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1798; + this.match(MySqlParser.KW_DEFAULT); + this.state = 1799; + this.defaultValue(); + } + break; + case MySqlParser.KW_VISIBLE: + localContext = new VisibilityColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1800; + this.match(MySqlParser.KW_VISIBLE); + } + break; + case MySqlParser.KW_INVISIBLE: + localContext = new InvisibilityColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 1801; + this.match(MySqlParser.KW_INVISIBLE); + } + break; + case MySqlParser.KW_ON: + case MySqlParser.KW_AUTO_INCREMENT: + localContext = new AutoIncrementColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 1806; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AUTO_INCREMENT: + { + this.state = 1802; + this.match(MySqlParser.KW_AUTO_INCREMENT); + } + break; + case MySqlParser.KW_ON: + { + this.state = 1803; + this.match(MySqlParser.KW_ON); + this.state = 1804; + this.match(MySqlParser.KW_UPDATE); + this.state = 1805; + this.currentTimestamp(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_KEY: + case MySqlParser.KW_PRIMARY: + localContext = new PrimaryKeyColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 1809; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 131) { + { + this.state = 1808; + this.match(MySqlParser.KW_PRIMARY); + } + } + this.state = 1811; + this.match(MySqlParser.KW_KEY); + } + break; + case MySqlParser.KW_UNIQUE: + localContext = new UniqueKeyColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 1812; + this.match(MySqlParser.KW_UNIQUE); + this.state = 1814; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 165, this.context)) { + case 1: + { + this.state = 1813; + this.match(MySqlParser.KW_KEY); + } + break; + } + } + break; + case MySqlParser.KW_COMMENT: + localContext = new CommentColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 1816; + this.match(MySqlParser.KW_COMMENT); + this.state = 1817; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_COLUMN_FORMAT: + localContext = new FormatColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 1818; + this.match(MySqlParser.KW_COLUMN_FORMAT); + this.state = 1819; + localContext._colformat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 374 || _la === 403)) { + localContext._colformat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_STORAGE: + localContext = new StorageColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 1820; + this.match(MySqlParser.KW_STORAGE); + this.state = 1821; + localContext._storageval = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 370 || _la === 802)) { + localContext._storageval = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_REFERENCES: + localContext = new ReferenceColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 1822; + this.referenceDefinition(); + } + break; + case MySqlParser.KW_COLLATE: + localContext = new CollateColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 1823; + this.match(MySqlParser.KW_COLLATE); + this.state = 1824; + this.collationName(); + } + break; + case MySqlParser.KW_AS: + case MySqlParser.KW_GENERATED: + localContext = new GeneratedColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 1827; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 71) { + { + this.state = 1825; + this.match(MySqlParser.KW_GENERATED); + this.state = 1826; + this.match(MySqlParser.KW_ALWAYS); + } + } + this.state = 1829; + this.match(MySqlParser.KW_AS); + this.state = 1830; + this.match(MySqlParser.LR_BRACKET); + this.state = 1831; + this.expression(0); + this.state = 1832; + this.match(MySqlParser.RR_BRACKET); + this.state = 1834; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 648 || _la === 685) { + { + this.state = 1833; + _la = this.tokenStream.LA(1); + if (!(_la === 648 || _la === 685)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + break; + case MySqlParser.KW_SERIAL: + localContext = new SerialDefaultColumnConstraintContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 1836; + this.match(MySqlParser.KW_SERIAL); + this.state = 1837; + this.match(MySqlParser.KW_DEFAULT); + this.state = 1838; + this.match(MySqlParser.KW_VALUE); + } + break; + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CONSTRAINT: + localContext = new CheckExprContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 1839; + this.checkConstraintDefinition(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + referenceDefinition() { + let localContext = new ReferenceDefinitionContext(this.context, this.state); + this.enterRule(localContext, 92, MySqlParser.RULE_referenceDefinition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 1842; + this.match(MySqlParser.KW_REFERENCES); + this.state = 1843; + this.tableName(); + this.state = 1845; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 169, this.context)) { + case 1: + { + this.state = 1844; + this.indexColumnNames(); + } + break; + } + this.state = 1849; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 110) { + { + this.state = 1847; + this.match(MySqlParser.KW_MATCH); + this.state = 1848; + localContext._matchType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 408 || _la === 526 || _la === 597)) { + localContext._matchType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 1852; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 171, this.context)) { + case 1: + { + this.state = 1851; + this.referenceAction(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + referenceAction() { + let localContext = new ReferenceActionContext(this.context, this.state); + this.enterRule(localContext, 94, MySqlParser.RULE_referenceAction); + try { + this.state = 1870; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 174, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1854; + this.match(MySqlParser.KW_ON); + this.state = 1855; + this.match(MySqlParser.KW_DELETE); + this.state = 1856; + localContext._onDelete = this.referenceControlType(); + this.state = 1860; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 172, this.context)) { + case 1: + { + this.state = 1857; + this.match(MySqlParser.KW_ON); + this.state = 1858; + this.match(MySqlParser.KW_UPDATE); + this.state = 1859; + localContext._onUpdate = this.referenceControlType(); + } + break; + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1862; + this.match(MySqlParser.KW_ON); + this.state = 1863; + this.match(MySqlParser.KW_UPDATE); + this.state = 1864; + localContext._onUpdate = this.referenceControlType(); + this.state = 1868; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 173, this.context)) { + case 1: + { + this.state = 1865; + this.match(MySqlParser.KW_ON); + this.state = 1866; + this.match(MySqlParser.KW_DELETE); + this.state = 1867; + localContext._onDelete = this.referenceControlType(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + referenceControlType() { + let localContext = new ReferenceControlTypeContext(this.context, this.state); + this.enterRule(localContext, 96, MySqlParser.RULE_referenceControlType); + try { + this.state = 1880; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 175, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 1872; + this.match(MySqlParser.KW_RESTRICT); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 1873; + this.match(MySqlParser.KW_CASCADE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 1874; + this.match(MySqlParser.KW_SET); + this.state = 1875; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 1876; + this.match(MySqlParser.KW_NO); + this.state = 1877; + this.match(MySqlParser.KW_ACTION); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 1878; + this.match(MySqlParser.KW_SET); + this.state = 1879; + this.match(MySqlParser.KW_DEFAULT); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableOption() { + let localContext = new TableOptionContext(this.context, this.state); + this.enterRule(localContext, 98, MySqlParser.RULE_tableOption); + let _la; + try { + this.state = 2067; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 213, this.context)) { + case 1: + localContext = new TableOptionEngineContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 1882; + this.match(MySqlParser.KW_ENGINE); + this.state = 1884; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1883; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1887; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 177, this.context)) { + case 1: + { + this.state = 1886; + this.engineName(); + } + break; + } + } + break; + case 2: + localContext = new TableOptionEngineAttributeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 1889; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 1891; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1890; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1893; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 3: + localContext = new TableOptionAutoextendSizeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 1894; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 1896; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1895; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1898; + this.decimalLiteral(); + } + break; + case 4: + localContext = new TableOptionAutoIncrementContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 1899; + this.match(MySqlParser.KW_AUTO_INCREMENT); + this.state = 1901; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1900; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1903; + this.decimalLiteral(); + } + break; + case 5: + localContext = new TableOptionAverageContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 1904; + this.match(MySqlParser.KW_AVG_ROW_LENGTH); + this.state = 1906; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1905; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1908; + this.decimalLiteral(); + } + break; + case 6: + localContext = new TableOptionCharsetContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 1910; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1909; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1912; + this.charSet(); + this.state = 1914; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1913; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1918; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 1916; + this.charsetName(); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 1917; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 7: + localContext = new TableOptionChecksumContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 1920; + _la = this.tokenStream.LA(1); + if (!(_la === 329 || _la === 522)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1922; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1921; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1924; + localContext._boolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 8: + localContext = new TableOptionCollateContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 1926; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 1925; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 1928; + this.match(MySqlParser.KW_COLLATE); + this.state = 1930; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1929; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1932; + this.collationName(); + } + break; + case 9: + localContext = new TableOptionCommentContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 1933; + this.match(MySqlParser.KW_COMMENT); + this.state = 1935; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1934; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1937; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 10: + localContext = new TableOptionCompressionContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 1938; + this.match(MySqlParser.KW_COMPRESSION); + this.state = 1940; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1939; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1942; + _la = this.tokenStream.LA(1); + if (!(_la === 882 || _la === 889)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 11: + localContext = new TableOptionConnectionContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 1943; + this.match(MySqlParser.KW_CONNECTION); + this.state = 1945; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1944; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1947; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 12: + localContext = new TableOptionDataDirectoryContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 1948; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 360)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1949; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 1951; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1950; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1953; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 13: + localContext = new TableOptionDelayContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 1954; + this.match(MySqlParser.KW_DELAY_KEY_WRITE); + this.state = 1956; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1955; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1958; + localContext._boolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 14: + localContext = new TableOptionEncryptionContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 1959; + this.match(MySqlParser.KW_ENCRYPTION); + this.state = 1961; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1960; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1963; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 15: + localContext = new TableOptionPageCompressedContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 1964; + _la = this.tokenStream.LA(1); + if (!(_la === 523 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1966; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1965; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1968; + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 16: + localContext = new TableOptionPageCompressionLevelContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 1969; + _la = this.tokenStream.LA(1); + if (!(_la === 524 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 1971; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1970; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1973; + this.decimalLiteral(); + } + break; + case 17: + localContext = new TableOptionEncryptionKeyIdContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 1974; + this.match(MySqlParser.KW_ENCRYPTION_KEY_ID); + this.state = 1976; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1975; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1978; + this.decimalLiteral(); + } + break; + case 18: + localContext = new TableOptionIndexDirectoryContext(localContext); + this.enterOuterAlt(localContext, 18); + { + this.state = 1979; + this.match(MySqlParser.KW_INDEX); + this.state = 1980; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 1982; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1981; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1984; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 19: + localContext = new TableOptionInsertMethodContext(localContext); + this.enterOuterAlt(localContext, 19); + { + this.state = 1985; + this.match(MySqlParser.KW_INSERT_METHOD); + this.state = 1987; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1986; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1989; + localContext._insertMethod = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 402 || _la === 445 || _la === 502)) { + localContext._insertMethod = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 20: + localContext = new TableOptionKeyBlockSizeContext(localContext); + this.enterOuterAlt(localContext, 20); + { + this.state = 1990; + this.match(MySqlParser.KW_KEY_BLOCK_SIZE); + this.state = 1992; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1991; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1994; + this.fileSizeLiteral(); + } + break; + case 21: + localContext = new TableOptionMaxRowsContext(localContext); + this.enterOuterAlt(localContext, 21); + { + this.state = 1995; + this.match(MySqlParser.KW_MAX_ROWS); + this.state = 1997; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 1996; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 1999; + this.decimalLiteral(); + } + break; + case 22: + localContext = new TableOptionMinRowsContext(localContext); + this.enterOuterAlt(localContext, 22); + { + this.state = 2000; + this.match(MySqlParser.KW_MIN_ROWS); + this.state = 2002; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2001; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2004; + this.decimalLiteral(); + } + break; + case 23: + localContext = new TableOptionPackKeysContext(localContext); + this.enterOuterAlt(localContext, 23); + { + this.state = 2005; + this.match(MySqlParser.KW_PACK_KEYS); + this.state = 2007; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2006; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2009; + localContext._extBoolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + localContext._extBoolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 24: + localContext = new TableOptionPasswordContext(localContext); + this.enterOuterAlt(localContext, 24); + { + this.state = 2010; + this.match(MySqlParser.KW_PASSWORD); + this.state = 2012; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2011; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2014; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 25: + localContext = new TableOptionRowFormatContext(localContext); + this.enterOuterAlt(localContext, 25); + { + this.state = 2015; + this.match(MySqlParser.KW_ROW_FORMAT); + this.state = 2017; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2016; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2019; + localContext._rowFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 342 || _la === 345 || _la === 374 || _la === 403 || _la === 554 || _la === 889)) { + localContext._rowFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 26: + localContext = new TableOptionStartTransactionContext(localContext); + this.enterOuterAlt(localContext, 26); + { + this.state = 2020; + this.match(MySqlParser.KW_START); + this.state = 2021; + this.match(MySqlParser.KW_TRANSACTION); + } + break; + case 27: + localContext = new TableOptionSecondaryEngineAttributeContext(localContext); + this.enterOuterAlt(localContext, 27); + { + this.state = 2022; + this.match(MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE); + this.state = 2024; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2023; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2026; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 28: + localContext = new TableOptionRecalculationContext(localContext); + this.enterOuterAlt(localContext, 28); + { + this.state = 2027; + this.match(MySqlParser.KW_STATS_AUTO_RECALC); + this.state = 2029; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2028; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2031; + localContext._extBoolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + localContext._extBoolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 29: + localContext = new TableOptionPersistentContext(localContext); + this.enterOuterAlt(localContext, 29); + { + this.state = 2032; + this.match(MySqlParser.KW_STATS_PERSISTENT); + this.state = 2034; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2033; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2036; + localContext._extBoolValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 871 || _la === 872)) { + localContext._extBoolValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 30: + localContext = new TableOptionSamplePageContext(localContext); + this.enterOuterAlt(localContext, 30); + { + this.state = 2037; + this.match(MySqlParser.KW_STATS_SAMPLE_PAGES); + this.state = 2039; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2038; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2043; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 2041; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 2042; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 31: + localContext = new TableOptionTablespaceContext(localContext); + this.enterOuterAlt(localContext, 31); + { + this.state = 2045; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 2046; + this.tablespaceName(); + this.state = 2048; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 210, this.context)) { + case 1: + { + this.state = 2047; + this.tablespaceStorage(); + } + break; + } + } + break; + case 32: + localContext = new TableOptionTableTypeContext(localContext); + this.enterOuterAlt(localContext, 32); + { + this.state = 2050; + this.match(MySqlParser.KW_TABLE_TYPE); + this.state = 2051; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2052; + this.tableType(); + } + break; + case 33: + localContext = new TableOptionTablespaceContext(localContext); + this.enterOuterAlt(localContext, 33); + { + this.state = 2053; + this.tablespaceStorage(); + } + break; + case 34: + localContext = new TableOptionTransactionalContext(localContext); + this.enterOuterAlt(localContext, 34); + { + this.state = 2054; + this.match(MySqlParser.KW_TRANSACTIONAL); + this.state = 2056; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2055; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2058; + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 35: + localContext = new TableOptionUnionContext(localContext); + this.enterOuterAlt(localContext, 35); + { + this.state = 2059; + this.match(MySqlParser.KW_UNION); + this.state = 2061; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2060; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2063; + this.match(MySqlParser.LR_BRACKET); + this.state = 2064; + this.tableNames(); + this.state = 2065; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableType() { + let localContext = new TableTypeContext(this.context, this.state); + this.enterRule(localContext, 100, MySqlParser.RULE_tableType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2069; + _la = this.tokenStream.LA(1); + if (!(_la === 494 || _la === 506)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablespaceStorage() { + let localContext = new TablespaceStorageContext(this.context, this.state); + this.enterRule(localContext, 102, MySqlParser.RULE_tablespaceStorage); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2071; + this.match(MySqlParser.KW_STORAGE); + this.state = 2072; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 370 || _la === 802)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinitions() { + let localContext = new PartitionDefinitionsContext(this.context, this.state); + this.enterRule(localContext, 104, MySqlParser.RULE_partitionDefinitions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2074; + this.match(MySqlParser.KW_PARTITION); + this.state = 2075; + this.match(MySqlParser.KW_BY); + this.state = 2076; + this.partitionFunctionDefinition(); + this.state = 2079; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 528) { + { + this.state = 2077; + this.match(MySqlParser.KW_PARTITIONS); + this.state = 2078; + localContext._count = this.decimalLiteral(); + } + } + this.state = 2088; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 652) { + { + this.state = 2081; + this.match(MySqlParser.KW_SUBPARTITION); + this.state = 2082; + this.match(MySqlParser.KW_BY); + this.state = 2083; + this.subpartitionFunctionDefinition(); + this.state = 2086; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 653) { + { + this.state = 2084; + this.match(MySqlParser.KW_SUBPARTITIONS); + this.state = 2085; + localContext._subCount = this.decimalLiteral(); + } + } + } + } + this.state = 2101; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 218, this.context)) { + case 1: + { + this.state = 2090; + this.match(MySqlParser.LR_BRACKET); + this.state = 2091; + this.partitionDefinition(); + this.state = 2096; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2092; + this.match(MySqlParser.COMMA); + this.state = 2093; + this.partitionDefinition(); + } + } + this.state = 2098; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2099; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionFunctionDefinition() { + let localContext = new PartitionFunctionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 106, MySqlParser.RULE_partitionFunctionDefinition); + let _la; + try { + this.state = 2149; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 225, this.context)) { + case 1: + localContext = new PartitionFunctionHashContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2104; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2103; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2106; + this.match(MySqlParser.KW_HASH); + this.state = 2107; + this.match(MySqlParser.LR_BRACKET); + this.state = 2108; + this.expression(0); + this.state = 2109; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + localContext = new PartitionFunctionKeyContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2112; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2111; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2114; + this.match(MySqlParser.KW_KEY); + this.state = 2118; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 2115; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2116; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2117; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 872 || _la === 873)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2120; + this.match(MySqlParser.LR_BRACKET); + this.state = 2122; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 222, this.context)) { + case 1: + { + this.state = 2121; + this.columnNames(); + } + break; + } + this.state = 2124; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 3: + localContext = new PartitionFunctionRangeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2125; + this.match(MySqlParser.KW_RANGE); + this.state = 2135; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LR_BRACKET: + { + this.state = 2126; + this.match(MySqlParser.LR_BRACKET); + this.state = 2127; + this.expression(0); + this.state = 2128; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_COLUMNS: + { + this.state = 2130; + this.match(MySqlParser.KW_COLUMNS); + this.state = 2131; + this.match(MySqlParser.LR_BRACKET); + this.state = 2132; + this.columnNames(); + this.state = 2133; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 4: + localContext = new PartitionFunctionListContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2137; + this.match(MySqlParser.KW_LIST); + this.state = 2147; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LR_BRACKET: + { + this.state = 2138; + this.match(MySqlParser.LR_BRACKET); + this.state = 2139; + this.expression(0); + this.state = 2140; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_COLUMNS: + { + this.state = 2142; + this.match(MySqlParser.KW_COLUMNS); + this.state = 2143; + this.match(MySqlParser.LR_BRACKET); + this.state = 2144; + this.columnNames(); + this.state = 2145; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + subpartitionFunctionDefinition() { + let localContext = new SubpartitionFunctionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 108, MySqlParser.RULE_subpartitionFunctionDefinition); + let _la; + try { + this.state = 2172; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 229, this.context)) { + case 1: + localContext = new SubPartitionFunctionHashContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2152; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2151; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2154; + this.match(MySqlParser.KW_HASH); + this.state = 2155; + this.match(MySqlParser.LR_BRACKET); + this.state = 2156; + this.expression(0); + this.state = 2157; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + localContext = new SubPartitionFunctionKeyContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2160; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 101) { + { + this.state = 2159; + this.match(MySqlParser.KW_LINEAR); + } + } + this.state = 2162; + this.match(MySqlParser.KW_KEY); + this.state = 2166; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 2163; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2164; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2165; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 872 || _la === 873)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2168; + this.match(MySqlParser.LR_BRACKET); + this.state = 2169; + this.columnNames(); + this.state = 2170; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinition() { + let localContext = new PartitionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 110, MySqlParser.RULE_partitionDefinition); + let _la; + try { + this.state = 2320; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 248, this.context)) { + case 1: + localContext = new PartitionComparisonContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2174; + this.match(MySqlParser.KW_PARTITION); + this.state = 2175; + this.partitionName(); + this.state = 2176; + this.match(MySqlParser.KW_VALUES); + this.state = 2177; + this.match(MySqlParser.KW_LESS); + this.state = 2178; + this.match(MySqlParser.KW_THAN); + this.state = 2179; + this.match(MySqlParser.LR_BRACKET); + this.state = 2180; + this.partitionDefinerAtom(); + this.state = 2185; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2181; + this.match(MySqlParser.COMMA); + this.state = 2182; + this.partitionDefinerAtom(); + } + } + this.state = 2187; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2188; + this.match(MySqlParser.RR_BRACKET); + this.state = 2192; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2189; + this.partitionOption(); + } + } + this.state = 2194; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2206; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2195; + this.match(MySqlParser.LR_BRACKET); + this.state = 2196; + this.subpartitionDefinition(); + this.state = 2201; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2197; + this.match(MySqlParser.COMMA); + this.state = 2198; + this.subpartitionDefinition(); + } + } + this.state = 2203; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2204; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 2: + localContext = new PartitionComparisonContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2208; + this.match(MySqlParser.KW_PARTITION); + this.state = 2209; + this.partitionName(); + this.state = 2210; + this.match(MySqlParser.KW_VALUES); + this.state = 2211; + this.match(MySqlParser.KW_LESS); + this.state = 2212; + this.match(MySqlParser.KW_THAN); + this.state = 2213; + this.partitionDefinerAtom(); + this.state = 2217; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2214; + this.partitionOption(); + } + } + this.state = 2219; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2231; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2220; + this.match(MySqlParser.LR_BRACKET); + this.state = 2221; + this.subpartitionDefinition(); + this.state = 2226; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2222; + this.match(MySqlParser.COMMA); + this.state = 2223; + this.subpartitionDefinition(); + } + } + this.state = 2228; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2229; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 3: + localContext = new PartitionListAtomContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2233; + this.match(MySqlParser.KW_PARTITION); + this.state = 2234; + this.partitionName(); + this.state = 2235; + this.match(MySqlParser.KW_VALUES); + this.state = 2236; + this.match(MySqlParser.KW_IN); + this.state = 2237; + this.match(MySqlParser.LR_BRACKET); + this.state = 2238; + this.partitionDefinerAtom(); + this.state = 2243; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2239; + this.match(MySqlParser.COMMA); + this.state = 2240; + this.partitionDefinerAtom(); + } + } + this.state = 2245; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2246; + this.match(MySqlParser.RR_BRACKET); + this.state = 2250; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2247; + this.partitionOption(); + } + } + this.state = 2252; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2264; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2253; + this.match(MySqlParser.LR_BRACKET); + this.state = 2254; + this.subpartitionDefinition(); + this.state = 2259; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2255; + this.match(MySqlParser.COMMA); + this.state = 2256; + this.subpartitionDefinition(); + } + } + this.state = 2261; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2262; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 4: + localContext = new PartitionListVectorContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2266; + this.match(MySqlParser.KW_PARTITION); + this.state = 2267; + this.partitionName(); + this.state = 2268; + this.match(MySqlParser.KW_VALUES); + this.state = 2269; + this.match(MySqlParser.KW_IN); + this.state = 2270; + this.match(MySqlParser.LR_BRACKET); + this.state = 2271; + this.partitionDefinerVector(); + this.state = 2276; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2272; + this.match(MySqlParser.COMMA); + this.state = 2273; + this.partitionDefinerVector(); + } + } + this.state = 2278; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2279; + this.match(MySqlParser.RR_BRACKET); + this.state = 2283; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2280; + this.partitionOption(); + } + } + this.state = 2285; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2286; + this.match(MySqlParser.LR_BRACKET); + this.state = 2287; + this.subpartitionDefinition(); + this.state = 2292; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2288; + this.match(MySqlParser.COMMA); + this.state = 2289; + this.subpartitionDefinition(); + } + } + this.state = 2294; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2295; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + case 5: + localContext = new PartitionSimpleContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2299; + this.match(MySqlParser.KW_PARTITION); + this.state = 2300; + this.partitionName(); + this.state = 2304; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2301; + this.partitionOption(); + } + } + this.state = 2306; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2318; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2307; + this.match(MySqlParser.LR_BRACKET); + this.state = 2308; + this.subpartitionDefinition(); + this.state = 2313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2309; + this.match(MySqlParser.COMMA); + this.state = 2310; + this.subpartitionDefinition(); + } + } + this.state = 2315; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2316; + this.match(MySqlParser.RR_BRACKET); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinerAtom() { + let localContext = new PartitionDefinerAtomContext(this.context, this.state); + this.enterRule(localContext, 112, MySqlParser.RULE_partitionDefinerAtom); + try { + this.state = 2325; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 249, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 2322; + this.constant(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 2323; + this.expression(0); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 2324; + this.match(MySqlParser.KW_MAXVALUE); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionDefinerVector() { + let localContext = new PartitionDefinerVectorContext(this.context, this.state); + this.enterRule(localContext, 114, MySqlParser.RULE_partitionDefinerVector); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2327; + this.match(MySqlParser.LR_BRACKET); + this.state = 2328; + this.partitionDefinerAtom(); + this.state = 2331; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 2329; + this.match(MySqlParser.COMMA); + this.state = 2330; + this.partitionDefinerAtom(); + } + } + this.state = 2333; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 868); + this.state = 2335; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + subpartitionDefinition() { + let localContext = new SubpartitionDefinitionContext(this.context, this.state); + this.enterRule(localContext, 116, MySqlParser.RULE_subpartitionDefinition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2337; + this.match(MySqlParser.KW_SUBPARTITION); + this.state = 2338; + localContext._logicalName = this.uid(); + this.state = 2342; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 42 || _la === 82 || _la === 340 || _la === 360 || _la === 380 || ((((_la - 480)) & ~0x1F) === 0 && ((1 << (_la - 480)) & 16778241) !== 0) || _la === 647 || _la === 658) { + { + { + this.state = 2339; + this.partitionOption(); + } + } + this.state = 2344; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionOption() { + let localContext = new PartitionOptionContext(this.context, this.state); + this.enterRule(localContext, 118, MySqlParser.RULE_partitionOption); + let _la; + try { + this.state = 2393; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_STORAGE: + localContext = new PartitionOptionEngineContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2346; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 2345; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 2349; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 647) { + { + this.state = 2348; + this.match(MySqlParser.KW_STORAGE); + } + } + this.state = 2351; + this.match(MySqlParser.KW_ENGINE); + this.state = 2353; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2352; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2355; + this.engineName(); + } + break; + case MySqlParser.KW_COMMENT: + localContext = new PartitionOptionCommentContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2356; + this.match(MySqlParser.KW_COMMENT); + this.state = 2358; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2357; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2360; + localContext._comment = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_DATA: + localContext = new PartitionOptionDataDirectoryContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2361; + this.match(MySqlParser.KW_DATA); + this.state = 2362; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 2364; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2363; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2366; + localContext._dataDirectory = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_INDEX: + localContext = new PartitionOptionIndexDirectoryContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2367; + this.match(MySqlParser.KW_INDEX); + this.state = 2368; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 2370; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2369; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2372; + localContext._indexDirectory = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_MAX_ROWS: + localContext = new PartitionOptionMaxRowsContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2373; + this.match(MySqlParser.KW_MAX_ROWS); + this.state = 2375; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2374; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2377; + localContext._maxRows = this.decimalLiteral(); + } + break; + case MySqlParser.KW_MIN_ROWS: + localContext = new PartitionOptionMinRowsContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 2378; + this.match(MySqlParser.KW_MIN_ROWS); + this.state = 2380; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2379; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2382; + localContext._minRows = this.decimalLiteral(); + } + break; + case MySqlParser.KW_TABLESPACE: + localContext = new PartitionOptionTablespaceContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 2383; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 2385; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2384; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2387; + this.tablespaceName(); + } + break; + case MySqlParser.KW_NODEGROUP: + localContext = new PartitionOptionNodeGroupContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 2388; + this.match(MySqlParser.KW_NODEGROUP); + this.state = 2390; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2389; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2392; + localContext._nodegroup = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterDatabase() { + let localContext = new AlterDatabaseContext(this.context, this.state); + this.enterRule(localContext, 120, MySqlParser.RULE_alterDatabase); + let _la; + try { + this.state = 2413; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 265, this.context)) { + case 1: + localContext = new AlterSimpleDatabaseContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2395; + this.match(MySqlParser.KW_ALTER); + this.state = 2396; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2398; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 263, this.context)) { + case 1: + { + this.state = 2397; + this.databaseName(); + } + break; + } + this.state = 2401; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 2400; + this.createDatabaseOption(); + } + } + this.state = 2403; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (((((_la - 26)) & ~0x1F) === 0 && ((1 << (_la - 26)) & 65541) !== 0) || _la === 135 || _la === 224 || _la === 376 || _la === 823); + } + break; + case 2: + localContext = new AlterUpgradeNameContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2405; + this.match(MySqlParser.KW_ALTER); + this.state = 2406; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2407; + this.databaseName(); + this.state = 2408; + this.match(MySqlParser.KW_UPGRADE); + this.state = 2409; + this.match(MySqlParser.KW_DATA); + this.state = 2410; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 2411; + this.match(MySqlParser.KW_NAME); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterEvent() { + let localContext = new AlterEventContext(this.context, this.state); + this.enterRule(localContext, 122, MySqlParser.RULE_alterEvent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2415; + this.match(MySqlParser.KW_ALTER); + this.state = 2417; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 2416; + this.ownerStatement(); + } + } + this.state = 2419; + this.match(MySqlParser.KW_EVENT); + this.state = 2420; + localContext._event_name = this.fullId(); + this.state = 2424; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 267, this.context)) { + case 1: + { + this.state = 2421; + this.match(MySqlParser.KW_ON); + this.state = 2422; + this.match(MySqlParser.KW_SCHEDULE); + this.state = 2423; + this.scheduleExpression(); + } + break; + } + this.state = 2432; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 119) { + { + this.state = 2426; + this.match(MySqlParser.KW_ON); + this.state = 2427; + this.match(MySqlParser.KW_COMPLETION); + this.state = 2429; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 2428; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 2431; + this.match(MySqlParser.KW_PRESERVE); + } + } + this.state = 2437; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 270, this.context)) { + case 1: + { + this.state = 2434; + this.match(MySqlParser.KW_RENAME); + this.state = 2435; + this.match(MySqlParser.KW_TO); + this.state = 2436; + localContext._new_event_name = this.fullId(); + } + break; + } + this.state = 2440; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 2439; + this.enableType(); + } + } + this.state = 2444; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 340) { + { + this.state = 2442; + this.match(MySqlParser.KW_COMMENT); + this.state = 2443; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 2448; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 273, this.context)) { + case 1: + { + this.state = 2446; + this.match(MySqlParser.KW_DO); + this.state = 2447; + this.routineBody(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterFunction() { + let localContext = new AlterFunctionContext(this.context, this.state); + this.enterRule(localContext, 124, MySqlParser.RULE_alterFunction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2450; + this.match(MySqlParser.KW_ALTER); + this.state = 2451; + this.match(MySqlParser.KW_FUNCTION); + this.state = 2452; + this.functionName(); + this.state = 2456; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 47 || ((((_la - 112)) & ~0x1F) === 0 && ((1 << (_la - 112)) & 16777221) !== 0) || _la === 162 || _la === 340 || _la === 354 || _la === 444 || _la === 502) { + { + { + this.state = 2453; + this.routineOption(); + } + } + this.state = 2458; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterInstance() { + let localContext = new AlterInstanceContext(this.context, this.state); + this.enterRule(localContext, 126, MySqlParser.RULE_alterInstance); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2459; + this.match(MySqlParser.KW_ALTER); + this.state = 2460; + this.match(MySqlParser.KW_INSTANCE); + this.state = 2461; + this.match(MySqlParser.KW_ROTATE); + this.state = 2462; + this.match(MySqlParser.KW_INNODB); + this.state = 2463; + this.match(MySqlParser.KW_MASTER); + this.state = 2464; + this.match(MySqlParser.KW_KEY); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterLogfileGroup() { + let localContext = new AlterLogfileGroupContext(this.context, this.state); + this.enterRule(localContext, 128, MySqlParser.RULE_alterLogfileGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2466; + this.match(MySqlParser.KW_ALTER); + this.state = 2467; + this.match(MySqlParser.KW_LOGFILE); + this.state = 2468; + this.match(MySqlParser.KW_GROUP); + this.state = 2469; + localContext._logfileGroupName = this.uid(); + this.state = 2470; + this.match(MySqlParser.KW_ADD); + this.state = 2471; + this.match(MySqlParser.KW_UNDOFILE); + this.state = 2472; + this.match(MySqlParser.STRING_LITERAL); + this.state = 2478; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 2473; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 2475; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2474; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2477; + this.fileSizeLiteral(); + } + } + this.state = 2481; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 2480; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 2483; + this.match(MySqlParser.KW_ENGINE); + this.state = 2485; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2484; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2487; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterProcedure() { + let localContext = new AlterProcedureContext(this.context, this.state); + this.enterRule(localContext, 130, MySqlParser.RULE_alterProcedure); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2489; + this.match(MySqlParser.KW_ALTER); + this.state = 2490; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 2491; + localContext._proc_name = this.fullId(); + this.state = 2495; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 47 || ((((_la - 112)) & ~0x1F) === 0 && ((1 << (_la - 112)) & 16777221) !== 0) || _la === 162 || _la === 340 || _la === 354 || _la === 444 || _la === 502) { + { + { + this.state = 2492; + this.routineOption(); + } + } + this.state = 2497; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterServer() { + let localContext = new AlterServerContext(this.context, this.state); + this.enterRule(localContext, 132, MySqlParser.RULE_alterServer); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2498; + this.match(MySqlParser.KW_ALTER); + this.state = 2499; + this.match(MySqlParser.KW_SERVER); + this.state = 2500; + localContext._serverName = this.uid(); + this.state = 2501; + this.match(MySqlParser.KW_OPTIONS); + this.state = 2502; + this.match(MySqlParser.LR_BRACKET); + this.state = 2503; + this.serverOption(); + this.state = 2508; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2504; + this.match(MySqlParser.COMMA); + this.state = 2505; + this.serverOption(); + } + } + this.state = 2510; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2511; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterTable() { + let localContext = new AlterTableContext(this.context, this.state); + this.enterRule(localContext, 134, MySqlParser.RULE_alterTable); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 2513; + this.match(MySqlParser.KW_ALTER); + this.state = 2514; + this.match(MySqlParser.KW_TABLE); + this.state = 2515; + this.tableName(); + this.state = 2524; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 282, this.context)) { + case 1: + { + this.state = 2516; + this.alterOption(); + this.state = 2521; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2517; + this.match(MySqlParser.COMMA); + this.state = 2518; + this.alterOption(); + } + } + this.state = 2523; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + this.state = 2533; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 284, this.context)) { + case 1: + { + this.state = 2526; + this.alterPartitionSpecification(); + this.state = 2530; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 283, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2527; + this.alterPartitionSpecification(); + } + } + } + this.state = 2532; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 283, this.context); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterTablespace() { + let localContext = new AlterTablespaceContext(this.context, this.state); + this.enterRule(localContext, 136, MySqlParser.RULE_alterTablespace); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2535; + this.match(MySqlParser.KW_ALTER); + this.state = 2537; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 2536; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 2539; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 2540; + this.tablespaceName(); + this.state = 2541; + _la = this.tokenStream.LA(1); + if (!(_la === 6 || _la === 51)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2542; + this.match(MySqlParser.KW_DATAFILE); + this.state = 2543; + this.match(MySqlParser.STRING_LITERAL); + this.state = 2549; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 428) { + { + this.state = 2544; + this.match(MySqlParser.KW_INITIAL_SIZE); + this.state = 2546; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2545; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2548; + this.fileSizeLiteral(); + } + } + this.state = 2552; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 687) { + { + this.state = 2551; + this.match(MySqlParser.KW_WAIT); + } + } + this.state = 2557; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 289, this.context)) { + case 1: + { + this.state = 2554; + this.match(MySqlParser.KW_RENAME); + this.state = 2555; + this.match(MySqlParser.KW_TO); + this.state = 2556; + this.tablespaceNameCreate(); + } + break; + } + this.state = 2564; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 314) { + { + this.state = 2559; + this.match(MySqlParser.KW_AUTOEXTEND_SIZE); + this.state = 2561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2560; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2563; + this.fileSizeLiteral(); + } + } + this.state = 2568; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 292, this.context)) { + case 1: + { + this.state = 2566; + this.match(MySqlParser.KW_SET); + this.state = 2567; + _la = this.tokenStream.LA(1); + if (!(_la === 5 || _la === 81)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 2575; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 376) { + { + this.state = 2570; + this.match(MySqlParser.KW_ENCRYPTION); + this.state = 2572; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2571; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2574; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 2582; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 380) { + { + this.state = 2577; + this.match(MySqlParser.KW_ENGINE); + this.state = 2579; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2578; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2581; + this.engineName(); + } + } + this.state = 2589; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 825) { + { + this.state = 2584; + this.match(MySqlParser.KW_ENGINE_ATTRIBUTE); + this.state = 2586; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2585; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2588; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterView() { + let localContext = new AlterViewContext(this.context, this.state); + this.enterRule(localContext, 138, MySqlParser.RULE_alterView); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2591; + this.match(MySqlParser.KW_ALTER); + this.state = 2595; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 308) { + { + this.state = 2592; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2593; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2594; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 486 || _la === 661 || _la === 670)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2598; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 364) { + { + this.state = 2597; + this.ownerStatement(); + } + } + this.state = 2603; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 162) { + { + this.state = 2600; + this.match(MySqlParser.KW_SQL); + this.state = 2601; + this.match(MySqlParser.KW_SECURITY); + this.state = 2602; + localContext._secContext = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 364 || _la === 436)) { + localContext._secContext = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2605; + this.match(MySqlParser.KW_VIEW); + this.state = 2606; + this.viewName(); + this.state = 2611; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 2607; + this.match(MySqlParser.LR_BRACKET); + this.state = 2608; + this.columnNames(); + this.state = 2609; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 2613; + this.match(MySqlParser.KW_AS); + this.state = 2614; + this.selectStatement(); + this.state = 2621; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 304, this.context)) { + case 1: + { + this.state = 2615; + this.match(MySqlParser.KW_WITH); + this.state = 2617; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 325 || _la === 450) { + { + this.state = 2616; + localContext._checkOpt = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 325 || _la === 450)) { + localContext._checkOpt = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2619; + this.match(MySqlParser.KW_CHECK); + this.state = 2620; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterOption() { + let localContext = new AlterOptionContext(this.context, this.state); + this.enterRule(localContext, 140, MySqlParser.RULE_alterOption); + let _la; + try { + let alternative; + this.state = 2887; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 348, this.context)) { + case 1: + localContext = new AlterByTableOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2623; + this.tableOption(); + this.state = 2630; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 306, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2625; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 2624; + this.match(MySqlParser.COMMA); + } + } + this.state = 2627; + this.tableOption(); + } + } + } + this.state = 2632; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 306, this.context); + } + } + break; + case 2: + localContext = new AlterByAddColumnContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2633; + this.match(MySqlParser.KW_ADD); + this.state = 2635; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 307, this.context)) { + case 1: + { + this.state = 2634; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2637; + this.columnName(); + this.state = 2638; + this.columnDefinition(); + this.state = 2642; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FIRST: + { + this.state = 2639; + this.match(MySqlParser.KW_FIRST); + } + break; + case MySqlParser.KW_AFTER: + { + this.state = 2640; + this.match(MySqlParser.KW_AFTER); + this.state = 2641; + this.columnName(); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ADD: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DO: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 3: + localContext = new AlterByAddColumnsContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2644; + this.match(MySqlParser.KW_ADD); + this.state = 2646; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 29) { + { + this.state = 2645; + this.match(MySqlParser.KW_COLUMN); + } + } + this.state = 2648; + this.match(MySqlParser.LR_BRACKET); + this.state = 2649; + this.columnName(); + this.state = 2650; + this.columnDefinition(); + this.state = 2657; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2651; + this.match(MySqlParser.COMMA); + this.state = 2652; + this.columnName(); + this.state = 2653; + this.columnDefinition(); + } + } + this.state = 2659; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2660; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 4: + localContext = new AlterByAddIndexContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2662; + this.match(MySqlParser.KW_ADD); + this.state = 2663; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2665; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2664; + this.indexName(); + } + } + this.state = 2668; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 2667; + this.indexType(); + } + } + this.state = 2670; + this.indexColumnNames(); + this.state = 2674; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 313, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2671; + this.indexOption(); + } + } + } + this.state = 2676; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 313, this.context); + } + } + break; + case 5: + localContext = new AlterByAddSpecialIndexContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2677; + this.match(MySqlParser.KW_ADD); + this.state = 2678; + _la = this.tokenStream.LA(1); + if (!(_la === 69 || _la === 161)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2680; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 2679; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2683; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2682; + this.indexName(); + } + } + this.state = 2685; + this.indexColumnNames(); + this.state = 2689; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 316, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2686; + this.indexOption(); + } + } + } + this.state = 2691; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 316, this.context); + } + } + break; + case 6: + localContext = new AlterByAddPrimaryKeyContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 2692; + this.match(MySqlParser.KW_ADD); + this.state = 2697; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 2693; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 2695; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 317, this.context)) { + case 1: + { + this.state = 2694; + localContext._symbol_ = this.uid(); + } + break; + } + } + } + this.state = 2699; + this.match(MySqlParser.KW_PRIMARY); + this.state = 2700; + this.match(MySqlParser.KW_KEY); + this.state = 2702; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 2701; + this.indexType(); + } + } + this.state = 2704; + this.indexColumnNames(); + this.state = 2708; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 320, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2705; + this.indexOption(); + } + } + } + this.state = 2710; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 320, this.context); + } + } + break; + case 7: + localContext = new AlterByAddUniqueKeyContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 2711; + this.match(MySqlParser.KW_ADD); + this.state = 2716; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 2712; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 2714; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2713; + localContext._symbol_ = this.uid(); + } + } + } + } + this.state = 2718; + this.match(MySqlParser.KW_UNIQUE); + this.state = 2720; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 2719; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2723; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2722; + this.indexName(); + } + } + this.state = 2726; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 2725; + this.indexType(); + } + } + this.state = 2728; + this.indexColumnNames(); + this.state = 2732; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 326, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 2729; + this.indexOption(); + } + } + } + this.state = 2734; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 326, this.context); + } + } + break; + case 8: + localContext = new AlterByAddForeignKeyContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 2735; + this.match(MySqlParser.KW_ADD); + this.state = 2740; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 31) { + { + this.state = 2736; + this.match(MySqlParser.KW_CONSTRAINT); + this.state = 2738; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2737; + localContext._symbol_ = this.uid(); + } + } + } + } + this.state = 2742; + this.match(MySqlParser.KW_FOREIGN); + this.state = 2743; + this.match(MySqlParser.KW_KEY); + this.state = 2745; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 2744; + this.indexName(); + } + } + this.state = 2747; + this.indexColumnNames(); + this.state = 2748; + this.referenceDefinition(); + } + break; + case 9: + localContext = new AlterByAddCheckTableConstraintContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 2750; + this.match(MySqlParser.KW_ADD); + this.state = 2752; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 330, this.context)) { + case 1: + { + this.state = 2751; + this.checkConstraintDefinition(); + } + break; + } + } + break; + case 10: + localContext = new AlterByDropConstraintCheckContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 2754; + this.match(MySqlParser.KW_DROP); + this.state = 2755; + _la = this.tokenStream.LA(1); + if (!(_la === 27 || _la === 31)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2756; + localContext._symbol_ = this.uid(); + } + break; + case 11: + localContext = new AlterByAlterCheckTableConstraintContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 2757; + this.match(MySqlParser.KW_ALTER); + this.state = 2758; + _la = this.tokenStream.LA(1); + if (!(_la === 27 || _la === 31)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2759; + localContext._symbol_ = this.uid(); + this.state = 2761; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 2760; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 2764; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 57) { + { + this.state = 2763; + this.match(MySqlParser.KW_ENFORCED); + } + } + } + break; + case 12: + localContext = new AlterBySetAlgorithmContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 2766; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 2768; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2767; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2770; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 357 || _la === 430 || _la === 434)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 13: + localContext = new AlterByAlterColumnDefaultContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 2771; + this.match(MySqlParser.KW_ALTER); + this.state = 2773; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 334, this.context)) { + case 1: + { + this.state = 2772; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2775; + this.columnName(); + this.state = 2783; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 335, this.context)) { + case 1: + { + this.state = 2776; + this.match(MySqlParser.KW_SET); + this.state = 2777; + this.match(MySqlParser.KW_DEFAULT); + this.state = 2778; + this.defaultValue(); + } + break; + case 2: + { + this.state = 2779; + this.match(MySqlParser.KW_SET); + this.state = 2780; + _la = this.tokenStream.LA(1); + if (!(_la === 435 || _la === 686)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 3: + { + this.state = 2781; + this.match(MySqlParser.KW_DROP); + this.state = 2782; + this.match(MySqlParser.KW_DEFAULT); + } + break; + } + } + break; + case 14: + localContext = new AlterByAlterIndexVisibilityContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 2785; + this.match(MySqlParser.KW_ALTER); + this.state = 2786; + this.match(MySqlParser.KW_INDEX); + this.state = 2787; + this.indexName(); + this.state = 2788; + _la = this.tokenStream.LA(1); + if (!(_la === 435 || _la === 686)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 15: + localContext = new AlterByChangeColumnContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 2790; + this.match(MySqlParser.KW_CHANGE); + this.state = 2792; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 336, this.context)) { + case 1: + { + this.state = 2791; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2794; + localContext._oldColumn = this.columnName(); + this.state = 2795; + localContext._newColumn = this.columnNameCreate(); + this.state = 2796; + this.columnDefinition(); + this.state = 2800; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FIRST: + { + this.state = 2797; + this.match(MySqlParser.KW_FIRST); + } + break; + case MySqlParser.KW_AFTER: + { + this.state = 2798; + this.match(MySqlParser.KW_AFTER); + this.state = 2799; + this.columnName(); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ADD: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DO: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 16: + localContext = new AlterByDefaultCharsetContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 2803; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 2802; + this.match(MySqlParser.KW_DEFAULT); + } + } + this.state = 2805; + this.match(MySqlParser.KW_CHARACTER); + this.state = 2806; + this.match(MySqlParser.KW_SET); + this.state = 2807; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 2808; + this.charsetName(); + this.state = 2814; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 28) { + { + this.state = 2809; + this.match(MySqlParser.KW_COLLATE); + this.state = 2811; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2810; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2813; + this.collationName(); + } + } + } + break; + case 17: + localContext = new AlterByConvertCharsetContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 2816; + this.match(MySqlParser.KW_CONVERT); + this.state = 2817; + this.match(MySqlParser.KW_TO); + this.state = 2821; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CHARSET: + { + this.state = 2818; + this.match(MySqlParser.KW_CHARSET); + } + break; + case MySqlParser.KW_CHARACTER: + { + this.state = 2819; + this.match(MySqlParser.KW_CHARACTER); + this.state = 2820; + this.match(MySqlParser.KW_SET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 2823; + this.charsetName(); + this.state = 2826; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 28) { + { + this.state = 2824; + this.match(MySqlParser.KW_COLLATE); + this.state = 2825; + this.collationName(); + } + } + } + break; + case 18: + localContext = new AlterKeysContext(localContext); + this.enterOuterAlt(localContext, 18); + { + this.state = 2828; + _la = this.tokenStream.LA(1); + if (!(_la === 368 || _la === 375)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2829; + this.match(MySqlParser.KW_KEYS); + } + break; + case 19: + localContext = new AlterTablespaceOptionContext(localContext); + this.enterOuterAlt(localContext, 19); + { + this.state = 2830; + _la = this.tokenStream.LA(1); + if (!(_la === 369 || _la === 425)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2831; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case 20: + localContext = new AlterByDropColumnContext(localContext); + this.enterOuterAlt(localContext, 20); + { + this.state = 2832; + this.match(MySqlParser.KW_DROP); + this.state = 2834; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 343, this.context)) { + case 1: + { + this.state = 2833; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2836; + this.columnName(); + } + break; + case 21: + localContext = new AlterByDropIndexContext(localContext); + this.enterOuterAlt(localContext, 21); + { + this.state = 2837; + this.match(MySqlParser.KW_DROP); + this.state = 2838; + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2839; + this.indexName(); + } + break; + case 22: + localContext = new AlterByDropPrimaryKeyContext(localContext); + this.enterOuterAlt(localContext, 22); + { + this.state = 2840; + this.match(MySqlParser.KW_DROP); + this.state = 2841; + this.match(MySqlParser.KW_PRIMARY); + this.state = 2842; + this.match(MySqlParser.KW_KEY); + } + break; + case 23: + localContext = new AlterByDropForeignKeyContext(localContext); + this.enterOuterAlt(localContext, 23); + { + this.state = 2843; + this.match(MySqlParser.KW_DROP); + this.state = 2844; + this.match(MySqlParser.KW_FOREIGN); + this.state = 2845; + this.match(MySqlParser.KW_KEY); + this.state = 2846; + localContext._fk_symbol = this.uid(); + } + break; + case 24: + localContext = new AlterByForceContext(localContext); + this.enterOuterAlt(localContext, 24); + { + this.state = 2847; + this.match(MySqlParser.KW_FORCE); + } + break; + case 25: + localContext = new AlterByLockContext(localContext); + this.enterOuterAlt(localContext, 25); + { + this.state = 2848; + this.match(MySqlParser.KW_LOCK); + this.state = 2850; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 2849; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 2852; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 389 || _la === 505 || _la === 595)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 26: + localContext = new AlterByModifyColumnContext(localContext); + this.enterOuterAlt(localContext, 26); + { + this.state = 2853; + this.match(MySqlParser.KW_MODIFY); + this.state = 2855; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 345, this.context)) { + case 1: + { + this.state = 2854; + this.match(MySqlParser.KW_COLUMN); + } + break; + } + this.state = 2857; + this.columnName(); + this.state = 2858; + this.columnDefinition(); + this.state = 2862; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FIRST: + { + this.state = 2859; + this.match(MySqlParser.KW_FIRST); + } + break; + case MySqlParser.KW_AFTER: + { + this.state = 2860; + this.match(MySqlParser.KW_AFTER); + this.state = 2861; + this.columnName(); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ADD: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DO: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 27: + localContext = new AlterByOrderContext(localContext); + this.enterOuterAlt(localContext, 27); + { + this.state = 2864; + this.match(MySqlParser.KW_ORDER); + this.state = 2865; + this.match(MySqlParser.KW_BY); + this.state = 2866; + this.columnNames(); + } + break; + case 28: + localContext = new AlterByRenameColumnContext(localContext); + this.enterOuterAlt(localContext, 28); + { + this.state = 2867; + this.match(MySqlParser.KW_RENAME); + this.state = 2868; + this.match(MySqlParser.KW_COLUMN); + this.state = 2869; + localContext._olcdColumn = this.columnName(); + this.state = 2870; + this.match(MySqlParser.KW_TO); + this.state = 2871; + localContext._newColumn = this.columnNameCreate(); + } + break; + case 29: + localContext = new AlterByRenameIndexContext(localContext); + this.enterOuterAlt(localContext, 29); + { + this.state = 2873; + this.match(MySqlParser.KW_RENAME); + this.state = 2874; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2875; + this.indexName(); + this.state = 2876; + this.match(MySqlParser.KW_TO); + this.state = 2877; + this.indexNameCreate(); + } + break; + case 30: + localContext = new AlterByRenameContext(localContext); + this.enterOuterAlt(localContext, 30); + { + this.state = 2879; + this.match(MySqlParser.KW_RENAME); + this.state = 2881; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13 || _la === 176) { + { + this.state = 2880; + localContext._renameFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 13 || _la === 176)) { + localContext._renameFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 2883; + this.tableNameCreate(); + } + break; + case 31: + localContext = new AlterByValidateContext(localContext); + this.enterOuterAlt(localContext, 31); + { + this.state = 2884; + _la = this.tokenStream.LA(1); + if (!(_la === 194 || _la === 690)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2885; + this.match(MySqlParser.KW_VALIDATION); + } + break; + case 32: + localContext = new AlterPartitionContext(localContext); + this.enterOuterAlt(localContext, 32); + { + this.state = 2886; + this.alterPartitionSpecification(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterPartitionSpecification() { + let localContext = new AlterPartitionSpecificationContext(this.context, this.state); + this.enterRule(localContext, 142, MySqlParser.RULE_alterPartitionSpecification); + let _la; + try { + this.state = 2987; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ADD: + localContext = new AlterByAddPartitionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 2889; + this.match(MySqlParser.KW_ADD); + this.state = 2890; + this.match(MySqlParser.KW_PARTITION); + this.state = 2891; + this.match(MySqlParser.LR_BRACKET); + this.state = 2892; + this.partitionDefinition(); + this.state = 2897; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2893; + this.match(MySqlParser.COMMA); + this.state = 2894; + this.partitionDefinition(); + } + } + this.state = 2899; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2900; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_DROP: + localContext = new AlterByDropPartitionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 2902; + this.match(MySqlParser.KW_DROP); + this.state = 2903; + this.match(MySqlParser.KW_PARTITION); + this.state = 2904; + this.partitionNames(); + } + break; + case MySqlParser.KW_DISCARD: + localContext = new AlterByDiscardPartitionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 2905; + this.match(MySqlParser.KW_DISCARD); + this.state = 2906; + this.match(MySqlParser.KW_PARTITION); + this.state = 2909; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2907; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2908; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 2911; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case MySqlParser.KW_IMPORT: + localContext = new AlterByImportPartitionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 2912; + this.match(MySqlParser.KW_IMPORT); + this.state = 2913; + this.match(MySqlParser.KW_PARTITION); + this.state = 2916; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2914; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2915; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 2918; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case MySqlParser.KW_TRUNCATE: + localContext = new AlterByTruncatePartitionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 2919; + this.match(MySqlParser.KW_TRUNCATE); + this.state = 2920; + this.match(MySqlParser.KW_PARTITION); + this.state = 2923; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2921; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2922; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_COALESCE: + localContext = new AlterByCoalescePartitionContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 2925; + this.match(MySqlParser.KW_COALESCE); + this.state = 2926; + this.match(MySqlParser.KW_PARTITION); + this.state = 2927; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_REORGANIZE: + localContext = new AlterByReorganizePartitionContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 2928; + this.match(MySqlParser.KW_REORGANIZE); + this.state = 2929; + this.match(MySqlParser.KW_PARTITION); + this.state = 2930; + this.partitionNames(); + this.state = 2931; + this.match(MySqlParser.KW_INTO); + this.state = 2932; + this.match(MySqlParser.LR_BRACKET); + this.state = 2933; + this.partitionDefinition(); + this.state = 2938; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 2934; + this.match(MySqlParser.COMMA); + this.state = 2935; + this.partitionDefinition(); + } + } + this.state = 2940; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 2941; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_EXCHANGE: + localContext = new AlterByExchangePartitionContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 2943; + this.match(MySqlParser.KW_EXCHANGE); + this.state = 2944; + this.match(MySqlParser.KW_PARTITION); + this.state = 2945; + this.partitionName(); + this.state = 2946; + this.match(MySqlParser.KW_WITH); + this.state = 2947; + this.match(MySqlParser.KW_TABLE); + this.state = 2948; + this.tableName(); + this.state = 2951; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 354, this.context)) { + case 1: + { + this.state = 2949; + localContext._validationFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 194 || _la === 690)) { + localContext._validationFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2950; + this.match(MySqlParser.KW_VALIDATION); + } + break; + } + } + break; + case MySqlParser.KW_ANALYZE: + localContext = new AlterByAnalyzePartitionContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 2953; + this.match(MySqlParser.KW_ANALYZE); + this.state = 2954; + this.match(MySqlParser.KW_PARTITION); + this.state = 2957; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2955; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2956; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_CHECK: + localContext = new AlterByCheckPartitionContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 2959; + this.match(MySqlParser.KW_CHECK); + this.state = 2960; + this.match(MySqlParser.KW_PARTITION); + this.state = 2963; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2961; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2962; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_OPTIMIZE: + localContext = new AlterByOptimizePartitionContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 2965; + this.match(MySqlParser.KW_OPTIMIZE); + this.state = 2966; + this.match(MySqlParser.KW_PARTITION); + this.state = 2969; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2967; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2968; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_REBUILD: + localContext = new AlterByRebuildPartitionContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 2971; + this.match(MySqlParser.KW_REBUILD); + this.state = 2972; + this.match(MySqlParser.KW_PARTITION); + this.state = 2975; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2973; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2974; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_REPAIR: + localContext = new AlterByRepairPartitionContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 2977; + this.match(MySqlParser.KW_REPAIR); + this.state = 2978; + this.match(MySqlParser.KW_PARTITION); + this.state = 2981; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 2979; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 2980; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_REMOVE: + localContext = new AlterByRemovePartitioningContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 2983; + this.match(MySqlParser.KW_REMOVE); + this.state = 2984; + this.match(MySqlParser.KW_PARTITIONING); + } + break; + case MySqlParser.KW_UPGRADE: + localContext = new AlterByUpgradePartitioningContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 2985; + this.match(MySqlParser.KW_UPGRADE); + this.state = 2986; + this.match(MySqlParser.KW_PARTITIONING); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropDatabase() { + let localContext = new DropDatabaseContext(this.context, this.state); + this.enterRule(localContext, 144, MySqlParser.RULE_dropDatabase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2989; + this.match(MySqlParser.KW_DROP); + this.state = 2990; + localContext._dbFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + localContext._dbFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 2992; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 361, this.context)) { + case 1: + { + this.state = 2991; + this.ifExists(); + } + break; + } + this.state = 2994; + this.databaseName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropEvent() { + let localContext = new DropEventContext(this.context, this.state); + this.enterRule(localContext, 146, MySqlParser.RULE_dropEvent); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 2996; + this.match(MySqlParser.KW_DROP); + this.state = 2997; + this.match(MySqlParser.KW_EVENT); + this.state = 2999; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 362, this.context)) { + case 1: + { + this.state = 2998; + this.ifExists(); + } + break; + } + this.state = 3001; + localContext._event_name = this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropIndex() { + let localContext = new DropIndexContext(this.context, this.state); + this.enterRule(localContext, 148, MySqlParser.RULE_dropIndex); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3003; + this.match(MySqlParser.KW_DROP); + this.state = 3004; + this.match(MySqlParser.KW_INDEX); + this.state = 3006; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 363, this.context)) { + case 1: + { + this.state = 3005; + localContext._intimeAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 508 || _la === 514)) { + localContext._intimeAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 3008; + this.indexName(); + this.state = 3009; + this.match(MySqlParser.KW_ON); + this.state = 3010; + this.tableName(); + this.state = 3023; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 367, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + this.state = 3021; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALGORITHM: + { + this.state = 3011; + this.match(MySqlParser.KW_ALGORITHM); + this.state = 3013; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3012; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3015; + localContext._algType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 357 || _la === 430)) { + localContext._algType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_LOCK: + { + this.state = 3016; + this.match(MySqlParser.KW_LOCK); + this.state = 3018; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3017; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3020; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 389 || _la === 505 || _la === 595)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 3025; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 367, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropLogfileGroup() { + let localContext = new DropLogfileGroupContext(this.context, this.state); + this.enterRule(localContext, 150, MySqlParser.RULE_dropLogfileGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3026; + this.match(MySqlParser.KW_DROP); + this.state = 3027; + this.match(MySqlParser.KW_LOGFILE); + this.state = 3028; + this.match(MySqlParser.KW_GROUP); + this.state = 3029; + localContext._logfileGroupName = this.uid(); + this.state = 3030; + this.match(MySqlParser.KW_ENGINE); + this.state = 3032; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3031; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3034; + this.engineName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropProcedure() { + let localContext = new DropProcedureContext(this.context, this.state); + this.enterRule(localContext, 152, MySqlParser.RULE_dropProcedure); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3036; + this.match(MySqlParser.KW_DROP); + this.state = 3037; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 3039; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 369, this.context)) { + case 1: + { + this.state = 3038; + this.ifExists(); + } + break; + } + this.state = 3041; + localContext._sp_name = this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropFunction() { + let localContext = new DropFunctionContext(this.context, this.state); + this.enterRule(localContext, 154, MySqlParser.RULE_dropFunction); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3043; + this.match(MySqlParser.KW_DROP); + this.state = 3044; + this.match(MySqlParser.KW_FUNCTION); + this.state = 3046; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 370, this.context)) { + case 1: + { + this.state = 3045; + this.ifExists(); + } + break; + } + this.state = 3048; + this.functionName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropServer() { + let localContext = new DropServerContext(this.context, this.state); + this.enterRule(localContext, 156, MySqlParser.RULE_dropServer); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3050; + this.match(MySqlParser.KW_DROP); + this.state = 3051; + this.match(MySqlParser.KW_SERVER); + this.state = 3053; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 371, this.context)) { + case 1: + { + this.state = 3052; + this.ifExists(); + } + break; + } + this.state = 3055; + localContext._serverName = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropSpatial() { + let localContext = new DropSpatialContext(this.context, this.state); + this.enterRule(localContext, 158, MySqlParser.RULE_dropSpatial); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3057; + this.match(MySqlParser.KW_DROP); + this.state = 3058; + this.match(MySqlParser.KW_SPATIAL); + this.state = 3059; + this.match(MySqlParser.KW_REFERENCE); + this.state = 3060; + this.match(MySqlParser.KW_SYSTEM); + this.state = 3062; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 3061; + this.ifExists(); + } + } + this.state = 3064; + this.match(MySqlParser.DECIMAL_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropTable() { + let localContext = new DropTableContext(this.context, this.state); + this.enterRule(localContext, 160, MySqlParser.RULE_dropTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3066; + this.match(MySqlParser.KW_DROP); + this.state = 3068; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 660) { + { + this.state = 3067; + this.match(MySqlParser.KW_TEMPORARY); + } + } + this.state = 3070; + this.match(MySqlParser.KW_TABLE); + this.state = 3072; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 374, this.context)) { + case 1: + { + this.state = 3071; + this.ifExists(); + } + break; + } + this.state = 3074; + this.tableNames(); + this.state = 3076; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 22 || _la === 146) { + { + this.state = 3075; + localContext._dropType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 22 || _la === 146)) { + localContext._dropType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropTablespace() { + let localContext = new DropTablespaceContext(this.context, this.state); + this.enterRule(localContext, 162, MySqlParser.RULE_dropTablespace); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3078; + this.match(MySqlParser.KW_DROP); + this.state = 3080; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 180) { + { + this.state = 3079; + this.match(MySqlParser.KW_UNDO); + } + } + this.state = 3082; + this.match(MySqlParser.KW_TABLESPACE); + this.state = 3083; + this.tablespaceName(); + this.state = 3089; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 380) { + { + this.state = 3084; + this.match(MySqlParser.KW_ENGINE); + this.state = 3086; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 3085; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 3088; + this.engineName(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropTrigger() { + let localContext = new DropTriggerContext(this.context, this.state); + this.enterRule(localContext, 164, MySqlParser.RULE_dropTrigger); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3091; + this.match(MySqlParser.KW_DROP); + this.state = 3092; + this.match(MySqlParser.KW_TRIGGER); + this.state = 3094; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 379, this.context)) { + case 1: + { + this.state = 3093; + this.ifExists(); + } + break; + } + this.state = 3096; + localContext._trigger_name = this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropView() { + let localContext = new DropViewContext(this.context, this.state); + this.enterRule(localContext, 166, MySqlParser.RULE_dropView); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3098; + this.match(MySqlParser.KW_DROP); + this.state = 3099; + this.match(MySqlParser.KW_VIEW); + this.state = 3101; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 380, this.context)) { + case 1: + { + this.state = 3100; + this.ifExists(); + } + break; + } + this.state = 3103; + this.viewName(); + this.state = 3108; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3104; + this.match(MySqlParser.COMMA); + this.state = 3105; + this.viewName(); + } + } + this.state = 3110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3112; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 22 || _la === 146) { + { + this.state = 3111; + localContext._dropType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 22 || _la === 146)) { + localContext._dropType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropRole() { + let localContext = new DropRoleContext(this.context, this.state); + this.enterRule(localContext, 168, MySqlParser.RULE_dropRole); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3114; + this.match(MySqlParser.KW_DROP); + this.state = 3115; + this.match(MySqlParser.KW_ROLE); + this.state = 3117; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 383, this.context)) { + case 1: + { + this.state = 3116; + this.ifExists(); + } + break; + } + this.state = 3119; + this.userOrRoleNames(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setRole() { + let localContext = new SetRoleContext(this.context, this.state); + this.enterRule(localContext, 170, MySqlParser.RULE_setRole); + let _la; + try { + this.state = 3141; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 386, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3121; + this.match(MySqlParser.KW_SET); + this.state = 3122; + this.match(MySqlParser.KW_DEFAULT); + this.state = 3123; + this.match(MySqlParser.KW_ROLE); + this.state = 3127; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 384, this.context)) { + case 1: + { + this.state = 3124; + this.match(MySqlParser.KW_NONE); + } + break; + case 2: + { + this.state = 3125; + this.match(MySqlParser.KW_ALL); + } + break; + case 3: + { + this.state = 3126; + this.userOrRoleNames(); + } + break; + } + this.state = 3129; + this.match(MySqlParser.KW_TO); + { + this.state = 3130; + this.userOrRoleName(); + } + this.state = 3135; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3131; + this.match(MySqlParser.COMMA); + { + this.state = 3132; + this.userOrRoleName(); + } + } + } + this.state = 3137; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3138; + this.match(MySqlParser.KW_SET); + this.state = 3139; + this.match(MySqlParser.KW_ROLE); + this.state = 3140; + this.roleOption(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameTable() { + let localContext = new RenameTableContext(this.context, this.state); + this.enterRule(localContext, 172, MySqlParser.RULE_renameTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3143; + this.match(MySqlParser.KW_RENAME); + this.state = 3144; + this.match(MySqlParser.KW_TABLE); + this.state = 3145; + this.renameTableClause(); + this.state = 3150; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3146; + this.match(MySqlParser.COMMA); + this.state = 3147; + this.renameTableClause(); + } + } + this.state = 3152; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameTableClause() { + let localContext = new RenameTableClauseContext(this.context, this.state); + this.enterRule(localContext, 174, MySqlParser.RULE_renameTableClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3153; + this.tableName(); + this.state = 3154; + this.match(MySqlParser.KW_TO); + this.state = 3155; + this.tableNameCreate(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + truncateTable() { + let localContext = new TruncateTableContext(this.context, this.state); + this.enterRule(localContext, 176, MySqlParser.RULE_truncateTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3157; + this.match(MySqlParser.KW_TRUNCATE); + this.state = 3159; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 173) { + { + this.state = 3158; + this.match(MySqlParser.KW_TABLE); + } + } + this.state = 3161; + this.tableName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + callStatement() { + let localContext = new CallStatementContext(this.context, this.state); + this.enterRule(localContext, 178, MySqlParser.RULE_callStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3163; + this.match(MySqlParser.KW_CALL); + this.state = 3164; + localContext._sp_name = this.fullId(); + this.state = 3171; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 390, this.context)) { + case 1: + { + this.state = 3165; + this.match(MySqlParser.LR_BRACKET); + this.state = 3168; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 389, this.context)) { + case 1: + { + this.state = 3166; + this.constants(); + } + break; + case 2: + { + this.state = 3167; + this.expressions(); + } + break; + } + this.state = 3170; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + deleteStatement() { + let localContext = new DeleteStatementContext(this.context, this.state); + this.enterRule(localContext, 180, MySqlParser.RULE_deleteStatement); + try { + this.state = 3175; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 391, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3173; + this.singleDeleteStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3174; + this.multipleDeleteStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + doStatement() { + let localContext = new DoStatementContext(this.context, this.state); + this.enterRule(localContext, 182, MySqlParser.RULE_doStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3177; + this.match(MySqlParser.KW_DO); + this.state = 3178; + this.expressions(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerStatement() { + let localContext = new HandlerStatementContext(this.context, this.state); + this.enterRule(localContext, 184, MySqlParser.RULE_handlerStatement); + try { + this.state = 3184; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 392, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3180; + this.handlerOpenStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3181; + this.handlerReadIndexStatement(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 3182; + this.handlerReadStatement(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 3183; + this.handlerCloseStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + insertStatement() { + let localContext = new InsertStatementContext(this.context, this.state); + this.enterRule(localContext, 186, MySqlParser.RULE_insertStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3186; + this.match(MySqlParser.KW_INSERT); + this.state = 3188; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 43 || _la === 76 || _la === 107) { + { + this.state = 3187; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 43 || _la === 76 || _la === 107)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3191; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3190; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3194; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3193; + this.match(MySqlParser.KW_INTO); + } + } + this.state = 3196; + this.tableName(); + this.state = 3203; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3197; + this.match(MySqlParser.KW_PARTITION); + this.state = 3198; + this.match(MySqlParser.LR_BRACKET); + this.state = 3200; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 3199; + this.partitionNames(); + } + } + this.state = 3202; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3216; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 401, this.context)) { + case 1: + { + this.state = 3206; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 398, this.context)) { + case 1: + { + this.state = 3205; + this.fullColumnNames(); + } + break; + } + this.state = 3210; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 399, this.context)) { + case 1: + { + this.state = 3208; + this.valuesOrValueList(); + } + break; + case 2: + { + this.state = 3209; + this.selectOrTableOrValues(); + } + break; + } + this.state = 3213; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 400, this.context)) { + case 1: + { + this.state = 3212; + this.asRowAlias(); + } + break; + } + } + break; + case 2: + { + this.state = 3215; + this.setAssignmentList(); + } + break; + } + this.state = 3219; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3218; + this.asRowAlias(); + } + } + this.state = 3233; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 119) { + { + this.state = 3221; + this.match(MySqlParser.KW_ON); + this.state = 3222; + this.match(MySqlParser.KW_DUPLICATE); + this.state = 3223; + this.match(MySqlParser.KW_KEY); + this.state = 3224; + this.match(MySqlParser.KW_UPDATE); + this.state = 3225; + localContext._duplicatedFirst = this.updatedElement(); + this.state = 3230; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3226; + this.match(MySqlParser.COMMA); + this.state = 3227; + localContext._updatedElement = this.updatedElement(); + localContext._duplicatedElements.push(localContext._updatedElement); + } + } + this.state = 3232; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + asRowAlias() { + let localContext = new AsRowAliasContext(this.context, this.state); + this.enterRule(localContext, 188, MySqlParser.RULE_asRowAlias); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3235; + this.match(MySqlParser.KW_AS); + this.state = 3236; + localContext._rowAlias = this.uid(); + this.state = 3238; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 405, this.context)) { + case 1: + { + this.state = 3237; + this.fullColumnNames(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectOrTableOrValues() { + let localContext = new SelectOrTableOrValuesContext(this.context, this.state); + this.enterRule(localContext, 190, MySqlParser.RULE_selectOrTableOrValues); + try { + this.state = 3244; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.LR_BRACKET: + this.enterOuterAlt(localContext, 1); + { + this.state = 3240; + this.selectStatement(); + } + break; + case MySqlParser.KW_TABLE: + this.enterOuterAlt(localContext, 2); + { + this.state = 3241; + this.match(MySqlParser.KW_TABLE); + this.state = 3242; + this.tableName(); + } + break; + case MySqlParser.KW_VALUES: + this.enterOuterAlt(localContext, 3); + { + this.state = 3243; + this.rowValuesList(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + interSectStatement() { + let localContext = new InterSectStatementContext(this.context, this.state); + this.enterRule(localContext, 192, MySqlParser.RULE_interSectStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3246; + this.interSectQuery(); + this.state = 3252; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 3247; + this.match(MySqlParser.KW_INTERSECT); + this.state = 3249; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3248; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3251; + this.interSectQuery(); + } + } + this.state = 3254; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 828); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + interSectQuery() { + let localContext = new InterSectQueryContext(this.context, this.state); + this.enterRule(localContext, 194, MySqlParser.RULE_interSectQuery); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3257; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 3256; + this.match(MySqlParser.LR_BRACKET); + } + } + this.state = 3259; + this.querySpecification(); + this.state = 3261; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 410, this.context)) { + case 1: + { + this.state = 3260; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadDataStatement() { + let localContext = new LoadDataStatementContext(this.context, this.state); + this.enterRule(localContext, 196, MySqlParser.RULE_loadDataStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3263; + this.match(MySqlParser.KW_LOAD); + this.state = 3264; + this.match(MySqlParser.KW_DATA); + this.state = 3266; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107 || _la === 347) { + { + this.state = 3265; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 107 || _la === 347)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3269; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 450) { + { + this.state = 3268; + this.match(MySqlParser.KW_LOCAL); + } + } + this.state = 3271; + this.match(MySqlParser.KW_INFILE); + this.state = 3272; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + this.state = 3274; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79 || _la === 143) { + { + this.state = 3273; + localContext._violation = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 79 || _la === 143)) { + localContext._violation = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3276; + this.match(MySqlParser.KW_INTO); + this.state = 3277; + this.match(MySqlParser.KW_TABLE); + this.state = 3278; + this.tableName(); + this.state = 3284; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3279; + this.match(MySqlParser.KW_PARTITION); + this.state = 3280; + this.match(MySqlParser.LR_BRACKET); + this.state = 3281; + this.partitionNames(); + this.state = 3282; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3289; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26) { + { + this.state = 3286; + this.match(MySqlParser.KW_CHARACTER); + this.state = 3287; + this.match(MySqlParser.KW_SET); + this.state = 3288; + localContext._charset = this.charsetName(); + } + } + this.state = 3297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 337 || _la === 398) { + { + this.state = 3291; + localContext._fieldsFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 337 || _la === 398)) { + localContext._fieldsFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3293; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 3292; + this.selectFieldsInto(); + } + } + this.state = 3295; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 56 || _la === 58 || _la === 123 || _la === 174); + } + } + this.state = 3305; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 102) { + { + this.state = 3299; + this.match(MySqlParser.KW_LINES); + this.state = 3301; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 3300; + this.selectLinesInto(); + } + } + this.state = 3303; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 171 || _la === 174); + } + } + this.state = 3311; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3307; + this.match(MySqlParser.KW_IGNORE); + this.state = 3308; + this.decimalLiteral(); + this.state = 3309; + localContext._linesFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 102 || _la === 587)) { + localContext._linesFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3324; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 422, this.context)) { + case 1: + { + this.state = 3313; + this.match(MySqlParser.LR_BRACKET); + this.state = 3314; + this.assignmentField(); + this.state = 3319; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3315; + this.match(MySqlParser.COMMA); + this.state = 3316; + this.assignmentField(); + } + } + this.state = 3321; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3322; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3335; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 424, this.context)) { + case 1: + { + this.state = 3326; + this.match(MySqlParser.KW_SET); + this.state = 3327; + this.updatedElement(); + this.state = 3332; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3328; + this.match(MySqlParser.COMMA); + this.state = 3329; + this.updatedElement(); + } + } + this.state = 3334; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadXmlStatement() { + let localContext = new LoadXmlStatementContext(this.context, this.state); + this.enterRule(localContext, 198, MySqlParser.RULE_loadXmlStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3337; + this.match(MySqlParser.KW_LOAD); + this.state = 3338; + this.match(MySqlParser.KW_XML); + this.state = 3340; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107 || _la === 347) { + { + this.state = 3339; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 107 || _la === 347)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3343; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 450) { + { + this.state = 3342; + this.match(MySqlParser.KW_LOCAL); + } + } + this.state = 3345; + this.match(MySqlParser.KW_INFILE); + this.state = 3346; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + this.state = 3348; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79 || _la === 143) { + { + this.state = 3347; + localContext._violation = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 79 || _la === 143)) { + localContext._violation = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3350; + this.match(MySqlParser.KW_INTO); + this.state = 3351; + this.match(MySqlParser.KW_TABLE); + this.state = 3352; + this.tableName(); + this.state = 3356; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26) { + { + this.state = 3353; + this.match(MySqlParser.KW_CHARACTER); + this.state = 3354; + this.match(MySqlParser.KW_SET); + this.state = 3355; + localContext._charset = this.charsetName(); + } + } + this.state = 3368; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 587) { + { + this.state = 3358; + this.match(MySqlParser.KW_ROWS); + this.state = 3359; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 3360; + this.match(MySqlParser.KW_BY); + this.state = 3362; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 859) { + { + this.state = 3361; + this.match(MySqlParser.LESS_SYMBOL); + } + } + this.state = 3364; + localContext._tag = this.match(MySqlParser.STRING_LITERAL); + this.state = 3366; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 858) { + { + this.state = 3365; + this.match(MySqlParser.GREATER_SYMBOL); + } + } + } + } + this.state = 3374; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3370; + this.match(MySqlParser.KW_IGNORE); + this.state = 3371; + this.decimalLiteral(); + this.state = 3372; + localContext._linesFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 102 || _la === 587)) { + localContext._linesFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3387; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 434, this.context)) { + case 1: + { + this.state = 3376; + this.match(MySqlParser.LR_BRACKET); + this.state = 3377; + this.assignmentField(); + this.state = 3382; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3378; + this.match(MySqlParser.COMMA); + this.state = 3379; + this.assignmentField(); + } + } + this.state = 3384; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3385; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3398; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 436, this.context)) { + case 1: + { + this.state = 3389; + this.match(MySqlParser.KW_SET); + this.state = 3390; + this.updatedElement(); + this.state = 3395; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3391; + this.match(MySqlParser.COMMA); + this.state = 3392; + this.updatedElement(); + } + } + this.state = 3397; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + parenthesizedQuery() { + let localContext = new ParenthesizedQueryContext(this.context, this.state); + this.enterRule(localContext, 200, MySqlParser.RULE_parenthesizedQuery); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3400; + this.match(MySqlParser.LR_BRACKET); + this.state = 3401; + this.parenthesizedQueryExpression(); + this.state = 3403; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3402; + this.orderByClause(); + } + } + this.state = 3406; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3405; + this.limitClause(); + } + } + this.state = 3408; + this.match(MySqlParser.RR_BRACKET); + this.state = 3410; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3409; + this.orderByClause(); + } + } + this.state = 3413; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3412; + this.limitClause(); + } + } + this.state = 3416; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3415; + this.intoClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replaceStatement() { + let localContext = new ReplaceStatementContext(this.context, this.state); + this.enterRule(localContext, 202, MySqlParser.RULE_replaceStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3418; + this.match(MySqlParser.KW_REPLACE); + this.state = 3420; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 43 || _la === 107) { + { + this.state = 3419; + localContext._priority = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 43 || _la === 107)) { + localContext._priority = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3423; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3422; + this.match(MySqlParser.KW_INTO); + } + } + this.state = 3425; + this.tableName(); + this.state = 3431; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3426; + this.match(MySqlParser.KW_PARTITION); + this.state = 3427; + this.match(MySqlParser.LR_BRACKET); + this.state = 3428; + this.partitionNames(); + this.state = 3429; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3441; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_VALUE: + case MySqlParser.LR_BRACKET: + { + this.state = 3437; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 445, this.context)) { + case 1: + { + this.state = 3433; + this.match(MySqlParser.LR_BRACKET); + this.state = 3434; + this.columnNames(); + this.state = 3435; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3439; + this.replaceStatementValuesOrSelectOrTable(); + } + break; + case MySqlParser.KW_SET: + { + this.state = 3440; + this.setAssignmentList(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectStatement() { + let localContext = new SelectStatementContext(this.context, this.state); + this.enterRule(localContext, 204, MySqlParser.RULE_selectStatement); + let _la; + try { + let alternative; + this.state = 3502; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + localContext = new UnionAndLateralSelectContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3443; + this.querySpecification(); + this.state = 3447; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 447, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3444; + this.unionStatement(); + } + } + } + this.state = 3449; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 447, this.context); + } + this.state = 3458; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 450, this.context)) { + case 1: + { + this.state = 3450; + this.match(MySqlParser.KW_UNION); + this.state = 3452; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3451; + localContext._unionType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._unionType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3456; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + { + this.state = 3454; + this.querySpecification(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 3455; + this.queryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + } + this.state = 3464; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 451, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3460; + this.match(MySqlParser.COMMA); + this.state = 3461; + this.lateralStatement(); + } + } + } + this.state = 3466; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 451, this.context); + } + this.state = 3468; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 452, this.context)) { + case 1: + { + this.state = 3467; + this.orderByClause(); + } + break; + } + this.state = 3471; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 453, this.context)) { + case 1: + { + this.state = 3470; + this.limitClause(); + } + break; + } + this.state = 3474; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 454, this.context)) { + case 1: + { + this.state = 3473; + this.lockClause(); + } + break; + } + this.state = 3477; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 455, this.context)) { + case 1: + { + this.state = 3476; + this.intoClause(); + } + break; + } + } + break; + case MySqlParser.LR_BRACKET: + localContext = new SelectExpressionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3479; + this.queryExpression(); + this.state = 3483; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 456, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3480; + this.unionStatement(); + } + } + } + this.state = 3485; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 456, this.context); + } + this.state = 3491; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 458, this.context)) { + case 1: + { + this.state = 3486; + this.match(MySqlParser.KW_UNION); + this.state = 3488; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3487; + localContext._unionType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._unionType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3490; + this.queryExpression(); + } + break; + } + this.state = 3494; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 459, this.context)) { + case 1: + { + this.state = 3493; + this.orderByClause(); + } + break; + } + this.state = 3497; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 460, this.context)) { + case 1: + { + this.state = 3496; + this.limitClause(); + } + break; + } + this.state = 3500; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 461, this.context)) { + case 1: + { + this.state = 3499; + this.lockClause(); + } + break; + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setOperations() { + let localContext = new SetOperationsContext(this.context, this.state); + this.enterRule(localContext, 206, MySqlParser.RULE_setOperations); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3505; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 3504; + this.withClause(); + } + } + this.state = 3507; + this.queryExpressionBody(0); + this.state = 3509; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3508; + this.orderByClause(); + } + } + this.state = 3512; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3511; + this.limitClause(); + } + } + this.state = 3515; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3514; + this.intoClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + queryExpressionBody(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new QueryExpressionBodyContext(this.context, parentState); + let previousContext = localContext; + let _startState = 208; + this.enterRecursionRule(localContext, 208, MySqlParser.RULE_queryExpressionBody, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + { + this.state = 3518; + this.queryItem(0); + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 3534; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 470, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + this.state = 3532; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 469, this.context)) { + case 1: + { + localContext = new QueryExpressionBodyContext(parentContext, parentState); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_queryExpressionBody); + this.state = 3520; + if (!(this.precpred(this.context, 2))) { + throw this.createFailedPredicateException("this.precpred(this.context, 2)"); + } + this.state = 3521; + this.match(MySqlParser.KW_UNION); + this.state = 3523; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3522; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3525; + this.queryItem(0); + } + break; + case 2: + { + localContext = new QueryExpressionBodyContext(parentContext, parentState); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_queryExpressionBody); + this.state = 3526; + if (!(this.precpred(this.context, 1))) { + throw this.createFailedPredicateException("this.precpred(this.context, 1)"); + } + this.state = 3527; + this.match(MySqlParser.KW_EXCEPT); + this.state = 3529; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3528; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3531; + this.queryItem(0); + } + break; + } + } + } + this.state = 3536; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 470, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + queryItem(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new QueryItemContext(this.context, parentState); + let previousContext = localContext; + let _startState = 210; + this.enterRecursionRule(localContext, 210, MySqlParser.RULE_queryItem, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + { + this.state = 3538; + this.queryPrimary(); + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 3548; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 472, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + { + localContext = new QueryItemContext(parentContext, parentState); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_queryItem); + this.state = 3540; + if (!(this.precpred(this.context, 1))) { + throw this.createFailedPredicateException("this.precpred(this.context, 1)"); + } + this.state = 3541; + this.match(MySqlParser.KW_INTERSECT); + this.state = 3543; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 3542; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3545; + this.queryPrimary(); + } + } + } + this.state = 3550; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 472, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + queryPrimary() { + let localContext = new QueryPrimaryContext(this.context, this.state); + this.enterRule(localContext, 212, MySqlParser.RULE_queryPrimary); + let _la; + try { + this.state = 3565; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 476, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3551; + this.queryBlock(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3552; + this.match(MySqlParser.LR_BRACKET); + this.state = 3553; + this.queryExpressionBody(0); + this.state = 3555; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3554; + this.orderByClause(); + } + } + this.state = 3558; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3557; + this.limitClause(); + } + } + this.state = 3561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3560; + this.intoClause(); + } + } + this.state = 3563; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + updateStatement() { + let localContext = new UpdateStatementContext(this.context, this.state); + this.enterRule(localContext, 214, MySqlParser.RULE_updateStatement); + try { + this.state = 3569; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 477, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3567; + this.singleUpdateStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3568; + this.multipleUpdateStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + valuesStatement() { + let localContext = new ValuesStatementContext(this.context, this.state); + this.enterRule(localContext, 216, MySqlParser.RULE_valuesStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3571; + this.rowValuesList(); + this.state = 3575; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 478, this.context)) { + case 1: + { + this.state = 3572; + this.match(MySqlParser.KW_ORDER); + this.state = 3573; + this.match(MySqlParser.KW_BY); + this.state = 3574; + this.indexColumnName(); + } + break; + } + this.state = 3579; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 479, this.context)) { + case 1: + { + this.state = 3577; + this.match(MySqlParser.KW_LIMIT); + this.state = 3578; + this.limitClauseAtom(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + parenthesizedQueryExpression() { + let localContext = new ParenthesizedQueryExpressionContext(this.context, this.state); + this.enterRule(localContext, 218, MySqlParser.RULE_parenthesizedQueryExpression); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3581; + this.queryBlock(); + this.state = 3586; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 59 || _la === 181 || _la === 828) { + { + { + this.state = 3582; + _la = this.tokenStream.LA(1); + if (!(_la === 59 || _la === 181 || _la === 828)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3583; + this.queryBlock(); + } + } + this.state = 3588; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3590; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 481, this.context)) { + case 1: + { + this.state = 3589; + this.orderByClause(); + } + break; + } + this.state = 3593; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 482, this.context)) { + case 1: + { + this.state = 3592; + this.limitClause(); + } + break; + } + this.state = 3596; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 88) { + { + this.state = 3595; + this.intoClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + queryBlock() { + let localContext = new QueryBlockContext(this.context, this.state); + this.enterRule(localContext, 220, MySqlParser.RULE_queryBlock); + try { + this.state = 3601; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.LR_BRACKET: + this.enterOuterAlt(localContext, 1); + { + this.state = 3598; + this.selectStatement(); + } + break; + case MySqlParser.KW_TABLE: + this.enterOuterAlt(localContext, 2); + { + this.state = 3599; + this.tableStatement(); + } + break; + case MySqlParser.KW_VALUES: + this.enterOuterAlt(localContext, 3); + { + this.state = 3600; + this.valuesStatement(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replaceStatementValuesOrSelectOrTable() { + let localContext = new ReplaceStatementValuesOrSelectOrTableContext(this.context, this.state); + this.enterRule(localContext, 222, MySqlParser.RULE_replaceStatementValuesOrSelectOrTable); + try { + this.state = 3608; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 485, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 3603; + this.selectStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 3604; + this.match(MySqlParser.KW_TABLE); + this.state = 3605; + this.tableName(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 3606; + this.valuesOrValueList(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 3607; + this.rowValuesList(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + rowValuesList() { + let localContext = new RowValuesListContext(this.context, this.state); + this.enterRule(localContext, 224, MySqlParser.RULE_rowValuesList); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3610; + this.match(MySqlParser.KW_VALUES); + this.state = 3611; + this.match(MySqlParser.KW_ROW); + this.state = 3612; + this.expressionsWithDefaults(); + this.state = 3618; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 486, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3613; + this.match(MySqlParser.COMMA); + this.state = 3614; + this.match(MySqlParser.KW_ROW); + this.state = 3615; + this.expressionsWithDefaults(); + } + } + } + this.state = 3620; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 486, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setAssignmentList() { + let localContext = new SetAssignmentListContext(this.context, this.state); + this.enterRule(localContext, 226, MySqlParser.RULE_setAssignmentList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3621; + this.match(MySqlParser.KW_SET); + this.state = 3622; + localContext._setFirst = this.updatedElement(); + this.state = 3627; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3623; + this.match(MySqlParser.COMMA); + this.state = 3624; + localContext._updatedElement = this.updatedElement(); + localContext._setElements.push(localContext._updatedElement); + } + } + this.state = 3629; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + updatedElement() { + let localContext = new UpdatedElementContext(this.context, this.state); + this.enterRule(localContext, 228, MySqlParser.RULE_updatedElement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3630; + this.columnName(); + this.state = 3631; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 3632; + this.expressionOrDefault(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + assignmentField() { + let localContext = new AssignmentFieldContext(this.context, this.state); + this.enterRule(localContext, 230, MySqlParser.RULE_assignmentField); + try { + this.state = 3636; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 1); + { + this.state = 3634; + localContext._var_name = this.uid(); + } + break; + case MySqlParser.LOCAL_ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 3635; + this.match(MySqlParser.LOCAL_ID); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockClause() { + let localContext = new LockClauseContext(this.context, this.state); + this.enterRule(localContext, 232, MySqlParser.RULE_lockClause); + let _la; + try { + let alternative; + this.state = 3659; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FOR: + this.enterOuterAlt(localContext, 1); + { + this.state = 3638; + this.match(MySqlParser.KW_FOR); + this.state = 3639; + _la = this.tokenStream.LA(1); + if (!(_la === 185 || _la === 594)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3649; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 490, this.context)) { + case 1: + { + this.state = 3640; + this.match(MySqlParser.KW_OF); + this.state = 3641; + this.tableName(); + this.state = 3646; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 489, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3642; + this.match(MySqlParser.COMMA); + this.state = 3643; + this.tableName(); + } + } + } + this.state = 3648; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 489, this.context); + } + } + break; + } + this.state = 3653; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 491, this.context)) { + case 1: + { + this.state = 3651; + _la = this.tokenStream.LA(1); + if (!(_la === 159 || _la === 503)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3652; + this.match(MySqlParser.KW_LOCKED); + } + break; + } + } + break; + case MySqlParser.KW_LOCK: + this.enterOuterAlt(localContext, 2); + { + this.state = 3655; + this.match(MySqlParser.KW_LOCK); + this.state = 3656; + this.match(MySqlParser.KW_IN); + this.state = 3657; + this.match(MySqlParser.KW_SHARE); + this.state = 3658; + this.match(MySqlParser.KW_MODE); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + singleDeleteStatement() { + let localContext = new SingleDeleteStatementContext(this.context, this.state); + this.enterRule(localContext, 234, MySqlParser.RULE_singleDeleteStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3661; + this.match(MySqlParser.KW_DELETE); + this.state = 3663; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3662; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3666; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 549) { + { + this.state = 3665; + this.match(MySqlParser.KW_QUICK); + } + } + this.state = 3669; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3668; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3671; + this.match(MySqlParser.KW_FROM); + this.state = 3672; + this.tableName(); + this.state = 3677; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 497, this.context)) { + case 1: + { + this.state = 3674; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3673; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3676; + localContext._table_alias = this.uid(); + } + break; + } + this.state = 3684; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 3679; + this.match(MySqlParser.KW_PARTITION); + this.state = 3680; + this.match(MySqlParser.LR_BRACKET); + this.state = 3681; + this.partitionNames(); + this.state = 3682; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 3688; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3686; + this.match(MySqlParser.KW_WHERE); + this.state = 3687; + this.expression(0); + } + } + this.state = 3691; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3690; + this.orderByClause(); + } + } + this.state = 3695; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3693; + this.match(MySqlParser.KW_LIMIT); + this.state = 3694; + this.limitClauseAtom(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + multipleDeleteStatement() { + let localContext = new MultipleDeleteStatementContext(this.context, this.state); + this.enterRule(localContext, 236, MySqlParser.RULE_multipleDeleteStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3697; + this.match(MySqlParser.KW_DELETE); + this.state = 3699; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3698; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3702; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 503, this.context)) { + case 1: + { + this.state = 3701; + this.match(MySqlParser.KW_QUICK); + } + break; + } + this.state = 3705; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3704; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3746; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 3707; + this.tableName(); + this.state = 3710; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3708; + this.match(MySqlParser.DOT); + this.state = 3709; + this.match(MySqlParser.STAR); + } + } + this.state = 3720; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3712; + this.match(MySqlParser.COMMA); + this.state = 3713; + this.tableName(); + this.state = 3716; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3714; + this.match(MySqlParser.DOT); + this.state = 3715; + this.match(MySqlParser.STAR); + } + } + } + } + this.state = 3722; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3723; + this.match(MySqlParser.KW_FROM); + this.state = 3724; + this.tableSources(); + } + break; + case MySqlParser.KW_FROM: + { + this.state = 3726; + this.match(MySqlParser.KW_FROM); + this.state = 3727; + this.tableName(); + this.state = 3730; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3728; + this.match(MySqlParser.DOT); + this.state = 3729; + this.match(MySqlParser.STAR); + } + } + this.state = 3740; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3732; + this.match(MySqlParser.COMMA); + this.state = 3733; + this.tableName(); + this.state = 3736; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 3734; + this.match(MySqlParser.DOT); + this.state = 3735; + this.match(MySqlParser.STAR); + } + } + } + } + this.state = 3742; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3743; + this.match(MySqlParser.KW_USING); + this.state = 3744; + this.tableSources(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 3750; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3748; + this.match(MySqlParser.KW_WHERE); + this.state = 3749; + this.expression(0); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerOpenStatement() { + let localContext = new HandlerOpenStatementContext(this.context, this.state); + this.enterRule(localContext, 238, MySqlParser.RULE_handlerOpenStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3752; + this.match(MySqlParser.KW_HANDLER); + this.state = 3753; + this.tableName(); + this.state = 3754; + this.match(MySqlParser.KW_OPEN); + this.state = 3759; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 514, this.context)) { + case 1: + { + this.state = 3756; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3755; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3758; + localContext._table_alias = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerReadIndexStatement() { + let localContext = new HandlerReadIndexStatementContext(this.context, this.state); + this.enterRule(localContext, 240, MySqlParser.RULE_handlerReadIndexStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3761; + this.match(MySqlParser.KW_HANDLER); + this.state = 3762; + this.tableName(); + this.state = 3763; + this.match(MySqlParser.KW_READ); + this.state = 3764; + this.indexName(); + this.state = 3771; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.EQUAL_SYMBOL: + case MySqlParser.GREATER_SYMBOL: + case MySqlParser.LESS_SYMBOL: + { + this.state = 3765; + this.comparisonBase(); + this.state = 3766; + this.match(MySqlParser.LR_BRACKET); + this.state = 3767; + this.constants(); + this.state = 3768; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_FIRST: + case MySqlParser.KW_LAST: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_PREV: + { + this.state = 3770; + localContext._moveOrder = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 402 || _la === 445 || _la === 501 || _la === 542)) { + localContext._moveOrder = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 3775; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3773; + this.match(MySqlParser.KW_WHERE); + this.state = 3774; + this.expression(0); + } + } + this.state = 3779; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3777; + this.match(MySqlParser.KW_LIMIT); + this.state = 3778; + this.limitClauseAtom(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerReadStatement() { + let localContext = new HandlerReadStatementContext(this.context, this.state); + this.enterRule(localContext, 242, MySqlParser.RULE_handlerReadStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3781; + this.match(MySqlParser.KW_HANDLER); + this.state = 3782; + this.tableName(); + this.state = 3783; + this.match(MySqlParser.KW_READ); + this.state = 3784; + localContext._moveOrder = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 402 || _la === 501)) { + localContext._moveOrder = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3787; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3785; + this.match(MySqlParser.KW_WHERE); + this.state = 3786; + this.expression(0); + } + } + this.state = 3791; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3789; + this.match(MySqlParser.KW_LIMIT); + this.state = 3790; + this.limitClauseAtom(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerCloseStatement() { + let localContext = new HandlerCloseStatementContext(this.context, this.state); + this.enterRule(localContext, 244, MySqlParser.RULE_handlerCloseStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3793; + this.match(MySqlParser.KW_HANDLER); + this.state = 3794; + this.tableName(); + this.state = 3795; + this.match(MySqlParser.KW_CLOSE); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + importTableStatement() { + let localContext = new ImportTableStatementContext(this.context, this.state); + this.enterRule(localContext, 246, MySqlParser.RULE_importTableStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3797; + this.match(MySqlParser.KW_IMPORT); + this.state = 3798; + this.match(MySqlParser.KW_TABLE); + this.state = 3799; + this.match(MySqlParser.KW_FROM); + this.state = 3800; + this.stringLiteral(); + this.state = 3805; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3801; + this.match(MySqlParser.COMMA); + this.state = 3802; + this.stringLiteral(); + } + } + this.state = 3807; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + singleUpdateStatement() { + let localContext = new SingleUpdateStatementContext(this.context, this.state); + this.enterRule(localContext, 248, MySqlParser.RULE_singleUpdateStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3808; + this.match(MySqlParser.KW_UPDATE); + this.state = 3810; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3809; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3813; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3812; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3815; + this.tableName(); + this.state = 3820; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074311168) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 3817; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3816; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3819; + localContext._table_alias = this.uid(); + } + } + this.state = 3822; + this.match(MySqlParser.KW_SET); + this.state = 3823; + this.updatedElement(); + this.state = 3828; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3824; + this.match(MySqlParser.COMMA); + this.state = 3825; + this.updatedElement(); + } + } + this.state = 3830; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3833; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3831; + this.match(MySqlParser.KW_WHERE); + this.state = 3832; + this.expression(0); + } + } + this.state = 3836; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 3835; + this.orderByClause(); + } + } + this.state = 3839; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 3838; + this.limitClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + multipleUpdateStatement() { + let localContext = new MultipleUpdateStatementContext(this.context, this.state); + this.enterRule(localContext, 250, MySqlParser.RULE_multipleUpdateStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3841; + this.match(MySqlParser.KW_UPDATE); + this.state = 3843; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 3842; + localContext._priority = this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 3846; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 3845; + this.match(MySqlParser.KW_IGNORE); + } + } + this.state = 3848; + this.tableSources(); + this.state = 3849; + this.match(MySqlParser.KW_SET); + this.state = 3850; + this.updatedElement(); + this.state = 3855; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 3851; + this.match(MySqlParser.COMMA); + this.state = 3852; + this.updatedElement(); + } + } + this.state = 3857; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3860; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 3858; + this.match(MySqlParser.KW_WHERE); + this.state = 3859; + this.expression(0); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + orderByClause() { + let localContext = new OrderByClauseContext(this.context, this.state); + this.enterRule(localContext, 252, MySqlParser.RULE_orderByClause); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3862; + this.match(MySqlParser.KW_ORDER); + this.state = 3863; + this.match(MySqlParser.KW_BY); + this.state = 3864; + this.orderByExpression(); + this.state = 3869; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 533, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3865; + this.match(MySqlParser.COMMA); + this.state = 3866; + this.orderByExpression(); + } + } + } + this.state = 3871; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 533, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + orderByExpression() { + let localContext = new OrderByExpressionContext(this.context, this.state); + this.enterRule(localContext, 254, MySqlParser.RULE_orderByExpression); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3872; + this.expression(0); + this.state = 3874; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 534, this.context)) { + case 1: + { + this.state = 3873; + localContext._order = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45)) { + localContext._order = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableSources() { + let localContext = new TableSourcesContext(this.context, this.state); + this.enterRule(localContext, 256, MySqlParser.RULE_tableSources); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 3876; + this.tableSource(); + this.state = 3881; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 535, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3877; + this.match(MySqlParser.COMMA); + this.state = 3878; + this.tableSource(); + } + } + } + this.state = 3883; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 535, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableSource() { + let localContext = new TableSourceContext(this.context, this.state); + this.enterRule(localContext, 258, MySqlParser.RULE_tableSource); + let _la; + try { + let alternative; + this.state = 3902; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 538, this.context)) { + case 1: + localContext = new TableSourceBaseContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3884; + this.tableSourceItem(); + this.state = 3888; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 536, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3885; + this.joinPart(); + } + } + } + this.state = 3890; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 536, this.context); + } + } + break; + case 2: + localContext = new TableSourceNestedContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3891; + this.match(MySqlParser.LR_BRACKET); + this.state = 3892; + this.tableSourceItem(); + this.state = 3896; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 35 || ((((_la - 84)) & ~0x1F) === 0 && ((1 << (_la - 84)) & 536887425) !== 0) || _la === 150 || _la === 172) { + { + { + this.state = 3893; + this.joinPart(); + } + } + this.state = 3898; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 3899; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 3: + localContext = new TableJsonContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 3901; + this.jsonTable(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableSourceItem() { + let localContext = new TableSourceItemContext(this.context, this.state); + this.enterRule(localContext, 260, MySqlParser.RULE_tableSourceItem); + let _la; + try { + let alternative; + this.state = 3949; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 548, this.context)) { + case 1: + localContext = new AtomTableItemContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3904; + this.tableName(); + this.state = 3910; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 539, this.context)) { + case 1: + { + this.state = 3905; + this.match(MySqlParser.KW_PARTITION); + this.state = 3906; + this.match(MySqlParser.LR_BRACKET); + this.state = 3907; + this.partitionNames(); + this.state = 3908; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3916; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 541, this.context)) { + case 1: + { + this.state = 3913; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3912; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3915; + localContext._alias = this.uid(); + } + break; + } + this.state = 3926; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 543, this.context)) { + case 1: + { + this.state = 3918; + this.indexHint(); + this.state = 3923; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 542, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3919; + this.match(MySqlParser.COMMA); + this.state = 3920; + this.indexHint(); + } + } + } + this.state = 3925; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 542, this.context); + } + } + break; + } + } + break; + case 2: + localContext = new SubqueryTableItemContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3929; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 95) { + { + this.state = 3928; + this.match(MySqlParser.KW_LATERAL); + } + } + this.state = 3936; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 545, this.context)) { + case 1: + { + this.state = 3931; + this.selectStatement(); + } + break; + case 2: + { + this.state = 3932; + this.match(MySqlParser.LR_BRACKET); + this.state = 3933; + localContext._parenthesisSubquery = this.selectStatement(); + this.state = 3934; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 3939; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 3938; + this.match(MySqlParser.KW_AS); + } + } + this.state = 3941; + localContext._alias = this.uid(); + this.state = 3943; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 547, this.context)) { + case 1: + { + this.state = 3942; + this.fullColumnNames(); + } + break; + } + } + break; + case 3: + localContext = new TableSourcesItemContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 3945; + this.match(MySqlParser.LR_BRACKET); + this.state = 3946; + this.tableSources(); + this.state = 3947; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fullColumnNames() { + let localContext = new FullColumnNamesContext(this.context, this.state); + this.enterRule(localContext, 262, MySqlParser.RULE_fullColumnNames); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3951; + this.match(MySqlParser.LR_BRACKET); + this.state = 3952; + this.columnNames(); + this.state = 3953; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexHint() { + let localContext = new IndexHintContext(this.context, this.state); + this.enterRule(localContext, 264, MySqlParser.RULE_indexHint); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 3955; + localContext._indexHintAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 66 || _la === 79 || _la === 187)) { + localContext._indexHintAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3956; + localContext._keyFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._keyFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3959; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 3957; + this.match(MySqlParser.KW_FOR); + this.state = 3958; + this.indexHintType(); + } + } + this.state = 3961; + this.match(MySqlParser.LR_BRACKET); + this.state = 3963; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 3962; + this.indexNames(); + } + } + this.state = 3965; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexHintType() { + let localContext = new IndexHintTypeContext(this.context, this.state); + this.enterRule(localContext, 266, MySqlParser.RULE_indexHintType); + try { + this.state = 3972; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_JOIN: + this.enterOuterAlt(localContext, 1); + { + this.state = 3967; + this.match(MySqlParser.KW_JOIN); + } + break; + case MySqlParser.KW_ORDER: + this.enterOuterAlt(localContext, 2); + { + this.state = 3968; + this.match(MySqlParser.KW_ORDER); + this.state = 3969; + this.match(MySqlParser.KW_BY); + } + break; + case MySqlParser.KW_GROUP: + this.enterOuterAlt(localContext, 3); + { + this.state = 3970; + this.match(MySqlParser.KW_GROUP); + this.state = 3971; + this.match(MySqlParser.KW_BY); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + joinPart() { + let localContext = new JoinPartContext(this.context, this.state); + this.enterRule(localContext, 268, MySqlParser.RULE_joinPart); + let _la; + try { + let alternative; + this.state = 4023; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CROSS: + case MySqlParser.KW_INNER: + case MySqlParser.KW_JOIN: + localContext = new InnerJoinContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 3975; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 35 || _la === 84) { + { + this.state = 3974; + _la = this.tokenStream.LA(1); + if (!(_la === 35 || _la === 84)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 3977; + this.match(MySqlParser.KW_JOIN); + this.state = 3979; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 553, this.context)) { + case 1: + { + this.state = 3978; + this.match(MySqlParser.KW_LATERAL); + } + break; + } + this.state = 3981; + this.tableSourceItem(); + this.state = 3985; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 554, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3982; + this.joinSpec(); + } + } + } + this.state = 3987; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 554, this.context); + } + } + break; + case MySqlParser.KW_STRAIGHT_JOIN: + localContext = new StraightJoinContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 3988; + this.match(MySqlParser.KW_STRAIGHT_JOIN); + this.state = 3989; + this.tableSourceItem(); + this.state = 3993; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 555, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 3990; + this.joinSpec(); + } + } + } + this.state = 3995; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 555, this.context); + } + } + break; + case MySqlParser.KW_LEFT: + case MySqlParser.KW_RIGHT: + localContext = new OuterJoinContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 3996; + _la = this.tokenStream.LA(1); + if (!(_la === 98 || _la === 150)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 3998; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 127) { + { + this.state = 3997; + this.match(MySqlParser.KW_OUTER); + } + } + this.state = 4000; + this.match(MySqlParser.KW_JOIN); + this.state = 4002; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 557, this.context)) { + case 1: + { + this.state = 4001; + this.match(MySqlParser.KW_LATERAL); + } + break; + } + this.state = 4004; + this.tableSourceItem(); + this.state = 4008; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 558, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4005; + this.joinSpec(); + } + } + } + this.state = 4010; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 558, this.context); + } + } + break; + case MySqlParser.KW_NATURAL: + localContext = new NaturalJoinContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4011; + this.match(MySqlParser.KW_NATURAL); + this.state = 4019; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 84 || _la === 98 || _la === 150) { + { + this.state = 4014; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_INNER: + { + this.state = 4012; + this.match(MySqlParser.KW_INNER); + } + break; + case MySqlParser.KW_LEFT: + case MySqlParser.KW_RIGHT: + { + this.state = 4013; + _la = this.tokenStream.LA(1); + if (!(_la === 98 || _la === 150)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4017; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 127) { + { + this.state = 4016; + this.match(MySqlParser.KW_OUTER); + } + } + } + } + this.state = 4021; + this.match(MySqlParser.KW_JOIN); + this.state = 4022; + this.tableSourceItem(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + joinSpec() { + let localContext = new JoinSpecContext(this.context, this.state); + this.enterRule(localContext, 270, MySqlParser.RULE_joinSpec); + try { + this.state = 4032; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ON: + this.enterOuterAlt(localContext, 1); + { + { + this.state = 4025; + this.match(MySqlParser.KW_ON); + this.state = 4026; + this.expression(0); + } + } + break; + case MySqlParser.KW_USING: + this.enterOuterAlt(localContext, 2); + { + this.state = 4027; + this.match(MySqlParser.KW_USING); + this.state = 4028; + this.match(MySqlParser.LR_BRACKET); + this.state = 4029; + this.columnNames(); + this.state = 4030; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + queryExpression() { + let localContext = new QueryExpressionContext(this.context, this.state); + this.enterRule(localContext, 272, MySqlParser.RULE_queryExpression); + try { + this.state = 4042; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 564, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4034; + this.match(MySqlParser.LR_BRACKET); + this.state = 4035; + this.querySpecification(); + this.state = 4036; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4038; + this.match(MySqlParser.LR_BRACKET); + this.state = 4039; + this.queryExpression(); + this.state = 4040; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + querySpecification() { + let localContext = new QuerySpecificationContext(this.context, this.state); + this.enterRule(localContext, 274, MySqlParser.RULE_querySpecification); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4044; + this.match(MySqlParser.KW_SELECT); + this.state = 4048; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 565, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4045; + this.selectSpec(); + } + } + } + this.state = 4050; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 565, this.context); + } + this.state = 4051; + this.selectElements(); + this.state = 4053; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 566, this.context)) { + case 1: + { + this.state = 4052; + this.intoClause(); + } + break; + } + this.state = 4055; + this.fromClause(); + this.state = 4057; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 567, this.context)) { + case 1: + { + this.state = 4056; + this.groupByClause(); + } + break; + } + this.state = 4060; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 568, this.context)) { + case 1: + { + this.state = 4059; + this.havingClause(); + } + break; + } + this.state = 4063; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 569, this.context)) { + case 1: + { + this.state = 4062; + this.windowClause(); + } + break; + } + this.state = 4066; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 570, this.context)) { + case 1: + { + this.state = 4065; + this.orderByClause(); + } + break; + } + this.state = 4069; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 571, this.context)) { + case 1: + { + this.state = 4068; + this.limitClause(); + } + break; + } + this.state = 4072; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 572, this.context)) { + case 1: + { + this.state = 4071; + this.intoClause(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + unionStatement() { + let localContext = new UnionStatementContext(this.context, this.state); + this.enterRule(localContext, 276, MySqlParser.RULE_unionStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4074; + this.match(MySqlParser.KW_UNION); + this.state = 4076; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 49) { + { + this.state = 4075; + localContext._unionType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._unionType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 4080; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + { + this.state = 4078; + this.querySpecification(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 4079; + this.queryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lateralStatement() { + let localContext = new LateralStatementContext(this.context, this.state); + this.enterRule(localContext, 278, MySqlParser.RULE_lateralStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4082; + this.match(MySqlParser.KW_LATERAL); + this.state = 4097; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 578, this.context)) { + case 1: + { + this.state = 4083; + this.querySpecification(); + } + break; + case 2: + { + this.state = 4084; + this.queryExpression(); + } + break; + case 3: + { + { + this.state = 4085; + this.match(MySqlParser.LR_BRACKET); + this.state = 4088; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + { + this.state = 4086; + this.querySpecification(); + } + break; + case MySqlParser.LR_BRACKET: + { + this.state = 4087; + this.queryExpression(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4090; + this.match(MySqlParser.RR_BRACKET); + this.state = 4095; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 577, this.context)) { + case 1: + { + this.state = 4092; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4091; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4094; + localContext._alias = this.uid(); + } + break; + } + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonTable() { + let localContext = new JsonTableContext(this.context, this.state); + this.enterRule(localContext, 280, MySqlParser.RULE_jsonTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4099; + this.match(MySqlParser.KW_JSON_TABLE); + this.state = 4100; + this.match(MySqlParser.LR_BRACKET); + this.state = 4101; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4102; + this.match(MySqlParser.COMMA); + this.state = 4103; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4104; + this.match(MySqlParser.KW_COLUMNS); + this.state = 4105; + this.match(MySqlParser.LR_BRACKET); + this.state = 4106; + this.jsonColumnList(); + this.state = 4107; + this.match(MySqlParser.RR_BRACKET); + this.state = 4108; + this.match(MySqlParser.RR_BRACKET); + this.state = 4113; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 580, this.context)) { + case 1: + { + this.state = 4110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4109; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4112; + localContext._alias = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonColumnList() { + let localContext = new JsonColumnListContext(this.context, this.state); + this.enterRule(localContext, 282, MySqlParser.RULE_jsonColumnList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4115; + this.jsonColumn(); + this.state = 4120; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4116; + this.match(MySqlParser.COMMA); + this.state = 4117; + this.jsonColumn(); + } + } + this.state = 4122; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonColumn() { + let localContext = new JsonColumnContext(this.context, this.state); + this.enterRule(localContext, 284, MySqlParser.RULE_jsonColumn); + let _la; + try { + this.state = 4152; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 587, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4123; + this.columnName(); + this.state = 4140; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FOR: + { + this.state = 4124; + this.match(MySqlParser.KW_FOR); + this.state = 4125; + this.match(MySqlParser.KW_ORDINALITY); + } + break; + case MySqlParser.KW_CHARACTER: + case MySqlParser.KW_SET: + case MySqlParser.KW_TINYINT: + case MySqlParser.KW_SMALLINT: + case MySqlParser.KW_MEDIUMINT: + case MySqlParser.KW_MIDDLEINT: + case MySqlParser.KW_INT: + case MySqlParser.KW_INT1: + case MySqlParser.KW_INT2: + case MySqlParser.KW_INT3: + case MySqlParser.KW_INT4: + case MySqlParser.KW_INT8: + case MySqlParser.KW_INTEGER: + case MySqlParser.KW_BIGINT: + case MySqlParser.KW_REAL: + case MySqlParser.KW_DOUBLE: + case MySqlParser.KW_FLOAT: + case MySqlParser.KW_FLOAT4: + case MySqlParser.KW_FLOAT8: + case MySqlParser.KW_DECIMAL: + case MySqlParser.KW_DEC: + case MySqlParser.KW_NUMERIC: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_CHAR: + case MySqlParser.KW_VARCHAR: + case MySqlParser.KW_NVARCHAR: + case MySqlParser.KW_NATIONAL: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_VARBINARY: + case MySqlParser.KW_TINYBLOB: + case MySqlParser.KW_BLOB: + case MySqlParser.KW_MEDIUMBLOB: + case MySqlParser.KW_LONG: + case MySqlParser.KW_LONGBLOB: + case MySqlParser.KW_TINYTEXT: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_MEDIUMTEXT: + case MySqlParser.KW_LONGTEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_JSON: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_GEOMCOLLECTION: + case MySqlParser.KW_GEOMETRY: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + { + this.state = 4126; + this.dataType(); + this.state = 4138; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PATH: + { + this.state = 4127; + this.match(MySqlParser.KW_PATH); + this.state = 4128; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4130; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 582, this.context)) { + case 1: + { + this.state = 4129; + this.jsonOnEmpty(); + } + break; + } + this.state = 4133; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42 || _la === 116 || _la === 382) { + { + this.state = 4132; + this.jsonOnError(); + } + } + } + break; + case MySqlParser.KW_EXISTS: + { + this.state = 4135; + this.match(MySqlParser.KW_EXISTS); + this.state = 4136; + this.match(MySqlParser.KW_PATH); + this.state = 4137; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4142; + this.match(MySqlParser.KW_NESTED); + this.state = 4144; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 257) { + { + this.state = 4143; + this.match(MySqlParser.KW_PATH); + } + } + this.state = 4146; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4147; + this.match(MySqlParser.KW_COLUMNS); + this.state = 4148; + this.match(MySqlParser.LR_BRACKET); + this.state = 4149; + this.jsonColumnList(); + this.state = 4150; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonOnEmpty() { + let localContext = new JsonOnEmptyContext(this.context, this.state); + this.enterRule(localContext, 286, MySqlParser.RULE_jsonOnEmpty); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4158; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NULL_LITERAL: + { + this.state = 4154; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case MySqlParser.KW_ERROR: + { + this.state = 4155; + this.match(MySqlParser.KW_ERROR); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 4156; + this.match(MySqlParser.KW_DEFAULT); + this.state = 4157; + this.defaultValue(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4160; + this.match(MySqlParser.KW_ON); + this.state = 4161; + this.match(MySqlParser.KW_EMPTY); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonOnError() { + let localContext = new JsonOnErrorContext(this.context, this.state); + this.enterRule(localContext, 288, MySqlParser.RULE_jsonOnError); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4167; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NULL_LITERAL: + { + this.state = 4163; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case MySqlParser.KW_ERROR: + { + this.state = 4164; + this.match(MySqlParser.KW_ERROR); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 4165; + this.match(MySqlParser.KW_DEFAULT); + this.state = 4166; + this.defaultValue(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4169; + this.match(MySqlParser.KW_ON); + this.state = 4170; + this.match(MySqlParser.KW_ERROR); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectSpec() { + let localContext = new SelectSpecContext(this.context, this.state); + this.enterRule(localContext, 290, MySqlParser.RULE_selectSpec); + let _la; + try { + this.state = 4180; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALL: + case MySqlParser.KW_DISTINCT: + case MySqlParser.KW_DISTINCTROW: + this.enterOuterAlt(localContext, 1); + { + this.state = 4172; + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49 || _la === 50)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_HIGH_PRIORITY: + this.enterOuterAlt(localContext, 2); + { + this.state = 4173; + this.match(MySqlParser.KW_HIGH_PRIORITY); + } + break; + case MySqlParser.KW_STRAIGHT_JOIN: + this.enterOuterAlt(localContext, 3); + { + this.state = 4174; + this.match(MySqlParser.KW_STRAIGHT_JOIN); + } + break; + case MySqlParser.KW_SQL_SMALL_RESULT: + this.enterOuterAlt(localContext, 4); + { + this.state = 4175; + this.match(MySqlParser.KW_SQL_SMALL_RESULT); + } + break; + case MySqlParser.KW_SQL_BIG_RESULT: + this.enterOuterAlt(localContext, 5); + { + this.state = 4176; + this.match(MySqlParser.KW_SQL_BIG_RESULT); + } + break; + case MySqlParser.KW_SQL_BUFFER_RESULT: + this.enterOuterAlt(localContext, 6); + { + this.state = 4177; + this.match(MySqlParser.KW_SQL_BUFFER_RESULT); + } + break; + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + this.enterOuterAlt(localContext, 7); + { + this.state = 4178; + _la = this.tokenStream.LA(1); + if (!(_la === 637 || _la === 638)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_SQL_CALC_FOUND_ROWS: + this.enterOuterAlt(localContext, 8); + { + this.state = 4179; + this.match(MySqlParser.KW_SQL_CALC_FOUND_ROWS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectElements() { + let localContext = new SelectElementsContext(this.context, this.state); + this.enterRule(localContext, 292, MySqlParser.RULE_selectElements); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4184; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 591, this.context)) { + case 1: + { + this.state = 4182; + localContext._star = this.match(MySqlParser.STAR); + } + break; + case 2: + { + this.state = 4183; + this.selectElement(); + } + break; + } + this.state = 4190; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 592, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4186; + this.match(MySqlParser.COMMA); + this.state = 4187; + this.selectElement(); + } + } + } + this.state = 4192; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 592, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectElement() { + let localContext = new SelectElementContext(this.context, this.state); + this.enterRule(localContext, 294, MySqlParser.RULE_selectElement); + let _la; + try { + this.state = 4222; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 600, this.context)) { + case 1: + localContext = new SelectExpressionElementContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4195; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 593, this.context)) { + case 1: + { + this.state = 4193; + this.match(MySqlParser.LOCAL_ID); + this.state = 4194; + this.match(MySqlParser.VAR_ASSIGN); + } + break; + } + this.state = 4197; + this.expression(0); + this.state = 4202; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 595, this.context)) { + case 1: + { + this.state = 4199; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4198; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4201; + localContext._alias = this.uid(); + } + break; + } + } + break; + case 2: + localContext = new SelectFunctionElementContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4204; + this.functionCall(); + this.state = 4209; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 597, this.context)) { + case 1: + { + this.state = 4206; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4205; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4208; + localContext._alias = this.uid(); + } + break; + } + } + break; + case 3: + localContext = new SelectStarElementContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4211; + localContext._select_element = this.fullId(); + this.state = 4212; + this.match(MySqlParser.DOT); + this.state = 4213; + this.match(MySqlParser.STAR); + } + break; + case 4: + localContext = new SelectColumnElementContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4215; + this.columnName(); + this.state = 4220; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 599, this.context)) { + case 1: + { + this.state = 4217; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4216; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4219; + localContext._alias = this.uid(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intoClause() { + let localContext = new IntoClauseContext(this.context, this.state); + this.enterRule(localContext, 296, MySqlParser.RULE_intoClause); + let _la; + try { + let alternative; + this.state = 4260; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 607, this.context)) { + case 1: + localContext = new SelectIntoVariablesContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4224; + this.match(MySqlParser.KW_INTO); + this.state = 4225; + this.assignmentField(); + this.state = 4230; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 601, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4226; + this.match(MySqlParser.COMMA); + this.state = 4227; + this.assignmentField(); + } + } + } + this.state = 4232; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 601, this.context); + } + } + break; + case 2: + localContext = new SelectIntoDumpFileContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4233; + this.match(MySqlParser.KW_INTO); + this.state = 4234; + this.match(MySqlParser.KW_DUMPFILE); + this.state = 4235; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 3: + localContext = new SelectIntoTextFileContext(localContext); + this.enterOuterAlt(localContext, 3); + { + { + this.state = 4236; + this.match(MySqlParser.KW_INTO); + this.state = 4237; + this.match(MySqlParser.KW_OUTFILE); + this.state = 4238; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + this.state = 4242; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 602, this.context)) { + case 1: + { + this.state = 4239; + this.match(MySqlParser.KW_CHARACTER); + this.state = 4240; + this.match(MySqlParser.KW_SET); + this.state = 4241; + localContext._charset = this.charsetName(); + } + break; + } + this.state = 4250; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 604, this.context)) { + case 1: + { + this.state = 4244; + localContext._fieldsFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 337 || _la === 398)) { + localContext._fieldsFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4246; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4245; + this.selectFieldsInto(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4248; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 603, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + } + this.state = 4258; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 606, this.context)) { + case 1: + { + this.state = 4252; + this.match(MySqlParser.KW_LINES); + this.state = 4254; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4253; + this.selectLinesInto(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4256; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 605, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectFieldsInto() { + let localContext = new SelectFieldsIntoContext(this.context, this.state); + this.enterRule(localContext, 298, MySqlParser.RULE_selectFieldsInto); + let _la; + try { + this.state = 4274; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TERMINATED: + this.enterOuterAlt(localContext, 1); + { + this.state = 4262; + this.match(MySqlParser.KW_TERMINATED); + this.state = 4263; + this.match(MySqlParser.KW_BY); + this.state = 4264; + localContext._terminationField = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ENCLOSED: + case MySqlParser.KW_OPTIONALLY: + this.enterOuterAlt(localContext, 2); + { + this.state = 4266; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 123) { + { + this.state = 4265; + this.match(MySqlParser.KW_OPTIONALLY); + } + } + this.state = 4268; + this.match(MySqlParser.KW_ENCLOSED); + this.state = 4269; + this.match(MySqlParser.KW_BY); + this.state = 4270; + localContext._enclosion = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ESCAPED: + this.enterOuterAlt(localContext, 3); + { + this.state = 4271; + this.match(MySqlParser.KW_ESCAPED); + this.state = 4272; + this.match(MySqlParser.KW_BY); + this.state = 4273; + localContext._escaping = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + selectLinesInto() { + let localContext = new SelectLinesIntoContext(this.context, this.state); + this.enterRule(localContext, 300, MySqlParser.RULE_selectLinesInto); + try { + this.state = 4282; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_STARTING: + this.enterOuterAlt(localContext, 1); + { + this.state = 4276; + this.match(MySqlParser.KW_STARTING); + this.state = 4277; + this.match(MySqlParser.KW_BY); + this.state = 4278; + localContext._starting = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_TERMINATED: + this.enterOuterAlt(localContext, 2); + { + this.state = 4279; + this.match(MySqlParser.KW_TERMINATED); + this.state = 4280; + this.match(MySqlParser.KW_BY); + this.state = 4281; + localContext._terminationLine = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fromClause() { + let localContext = new FromClauseContext(this.context, this.state); + this.enterRule(localContext, 302, MySqlParser.RULE_fromClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4286; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 611, this.context)) { + case 1: + { + this.state = 4284; + this.match(MySqlParser.KW_FROM); + this.state = 4285; + this.tableSources(); + } + break; + } + this.state = 4290; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 612, this.context)) { + case 1: + { + this.state = 4288; + this.match(MySqlParser.KW_WHERE); + this.state = 4289; + localContext._whereExpr = this.expression(0); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupByClause() { + let localContext = new GroupByClauseContext(this.context, this.state); + this.enterRule(localContext, 304, MySqlParser.RULE_groupByClause); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4292; + this.match(MySqlParser.KW_GROUP); + this.state = 4293; + this.match(MySqlParser.KW_BY); + this.state = 4294; + this.groupByItem(); + this.state = 4299; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 613, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4295; + this.match(MySqlParser.COMMA); + this.state = 4296; + this.groupByItem(); + } + } + } + this.state = 4301; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 613, this.context); + } + this.state = 4304; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 614, this.context)) { + case 1: + { + this.state = 4302; + this.match(MySqlParser.KW_WITH); + this.state = 4303; + this.match(MySqlParser.KW_ROLLUP); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + havingClause() { + let localContext = new HavingClauseContext(this.context, this.state); + this.enterRule(localContext, 306, MySqlParser.RULE_havingClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4306; + this.match(MySqlParser.KW_HAVING); + this.state = 4307; + localContext._havingExpr = this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + windowClause() { + let localContext = new WindowClauseContext(this.context, this.state); + this.enterRule(localContext, 308, MySqlParser.RULE_windowClause); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4309; + this.match(MySqlParser.KW_WINDOW); + this.state = 4310; + this.windowName(); + this.state = 4311; + this.match(MySqlParser.KW_AS); + this.state = 4312; + this.match(MySqlParser.LR_BRACKET); + this.state = 4313; + this.windowSpec(); + this.state = 4314; + this.match(MySqlParser.RR_BRACKET); + this.state = 4324; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 615, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4315; + this.match(MySqlParser.COMMA); + this.state = 4316; + this.windowName(); + this.state = 4317; + this.match(MySqlParser.KW_AS); + this.state = 4318; + this.match(MySqlParser.LR_BRACKET); + this.state = 4319; + this.windowSpec(); + this.state = 4320; + this.match(MySqlParser.RR_BRACKET); + } + } + } + this.state = 4326; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 615, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupByItem() { + let localContext = new GroupByItemContext(this.context, this.state); + this.enterRule(localContext, 310, MySqlParser.RULE_groupByItem); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4327; + this.expression(0); + this.state = 4329; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 616, this.context)) { + case 1: + { + this.state = 4328; + localContext._order = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45)) { + localContext._order = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + limitClause() { + let localContext = new LimitClauseContext(this.context, this.state); + this.enterRule(localContext, 312, MySqlParser.RULE_limitClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4331; + this.match(MySqlParser.KW_LIMIT); + this.state = 4342; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 618, this.context)) { + case 1: + { + this.state = 4335; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 617, this.context)) { + case 1: + { + this.state = 4332; + localContext._offset = this.limitClauseAtom(); + this.state = 4333; + this.match(MySqlParser.COMMA); + } + break; + } + this.state = 4337; + localContext._limit = this.limitClauseAtom(); + } + break; + case 2: + { + this.state = 4338; + localContext._limit = this.limitClauseAtom(); + this.state = 4339; + this.match(MySqlParser.KW_OFFSET); + this.state = 4340; + localContext._offset = this.limitClauseAtom(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + limitClauseAtom() { + let localContext = new LimitClauseAtomContext(this.context, this.state); + this.enterRule(localContext, 314, MySqlParser.RULE_limitClauseAtom); + try { + this.state = 4347; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 4344; + this.decimalLiteral(); + } + break; + case MySqlParser.LOCAL_ID: + case MySqlParser.GLOBAL_ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 4345; + this.mysqlVariable(); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 3); + { + this.state = 4346; + this.simpleId(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + startTransaction() { + let localContext = new StartTransactionContext(this.context, this.state); + this.enterRule(localContext, 316, MySqlParser.RULE_startTransaction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4349; + this.match(MySqlParser.KW_START); + this.state = 4350; + this.match(MySqlParser.KW_TRANSACTION); + this.state = 4359; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 621, this.context)) { + case 1: + { + this.state = 4351; + this.transactionMode(); + this.state = 4356; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4352; + this.match(MySqlParser.COMMA); + this.state = 4353; + this.transactionMode(); + } + } + this.state = 4358; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + beginWork() { + let localContext = new BeginWorkContext(this.context, this.state); + this.enterRule(localContext, 318, MySqlParser.RULE_beginWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4361; + this.match(MySqlParser.KW_BEGIN); + this.state = 4363; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4362; + this.match(MySqlParser.KW_WORK); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + commitWork() { + let localContext = new CommitWorkContext(this.context, this.state); + this.enterRule(localContext, 320, MySqlParser.RULE_commitWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4365; + this.match(MySqlParser.KW_COMMIT); + this.state = 4367; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4366; + this.match(MySqlParser.KW_WORK); + } + } + this.state = 4374; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 4369; + this.match(MySqlParser.KW_AND); + this.state = 4371; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4370; + localContext._nochain = this.match(MySqlParser.KW_NO); + } + } + this.state = 4373; + this.match(MySqlParser.KW_CHAIN); + } + } + this.state = 4380; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 627, this.context)) { + case 1: + { + this.state = 4377; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4376; + localContext._norelease = this.match(MySqlParser.KW_NO); + } + } + this.state = 4379; + this.match(MySqlParser.KW_RELEASE); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + rollbackWork() { + let localContext = new RollbackWorkContext(this.context, this.state); + this.enterRule(localContext, 322, MySqlParser.RULE_rollbackWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4382; + this.match(MySqlParser.KW_ROLLBACK); + this.state = 4384; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4383; + this.match(MySqlParser.KW_WORK); + } + } + this.state = 4391; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 4386; + this.match(MySqlParser.KW_AND); + this.state = 4388; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4387; + localContext._nochain = this.match(MySqlParser.KW_NO); + } + } + this.state = 4390; + this.match(MySqlParser.KW_CHAIN); + } + } + this.state = 4397; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 632, this.context)) { + case 1: + { + this.state = 4394; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 4393; + localContext._norelease = this.match(MySqlParser.KW_NO); + } + } + this.state = 4396; + this.match(MySqlParser.KW_RELEASE); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + savepointStatement() { + let localContext = new SavepointStatementContext(this.context, this.state); + this.enterRule(localContext, 324, MySqlParser.RULE_savepointStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4399; + this.match(MySqlParser.KW_SAVEPOINT); + this.state = 4400; + localContext._identifier = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + rollbackStatement() { + let localContext = new RollbackStatementContext(this.context, this.state); + this.enterRule(localContext, 326, MySqlParser.RULE_rollbackStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4402; + this.match(MySqlParser.KW_ROLLBACK); + this.state = 4404; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 691) { + { + this.state = 4403; + this.match(MySqlParser.KW_WORK); + } + } + this.state = 4406; + this.match(MySqlParser.KW_TO); + this.state = 4408; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 634, this.context)) { + case 1: + { + this.state = 4407; + this.match(MySqlParser.KW_SAVEPOINT); + } + break; + } + this.state = 4410; + localContext._identifier = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + releaseStatement() { + let localContext = new ReleaseStatementContext(this.context, this.state); + this.enterRule(localContext, 328, MySqlParser.RULE_releaseStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4412; + this.match(MySqlParser.KW_RELEASE); + this.state = 4413; + this.match(MySqlParser.KW_SAVEPOINT); + this.state = 4414; + localContext._identifier = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockTables() { + let localContext = new LockTablesContext(this.context, this.state); + this.enterRule(localContext, 330, MySqlParser.RULE_lockTables); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4416; + this.match(MySqlParser.KW_LOCK); + this.state = 4417; + _la = this.tokenStream.LA(1); + if (!(_la === 173 || _la === 752)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4418; + this.lockTableElement(); + this.state = 4423; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4419; + this.match(MySqlParser.COMMA); + this.state = 4420; + this.lockTableElement(); + } + } + this.state = 4425; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + unlockTables() { + let localContext = new UnlockTablesContext(this.context, this.state); + this.enterRule(localContext, 332, MySqlParser.RULE_unlockTables); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4426; + this.match(MySqlParser.KW_UNLOCK); + this.state = 4427; + this.match(MySqlParser.KW_TABLES); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setAutocommitStatement() { + let localContext = new SetAutocommitStatementContext(this.context, this.state); + this.enterRule(localContext, 334, MySqlParser.RULE_setAutocommitStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4429; + this.match(MySqlParser.KW_SET); + this.state = 4430; + this.match(MySqlParser.KW_AUTOCOMMIT); + this.state = 4431; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4432; + localContext._autocommitValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._autocommitValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setTransactionStatement() { + let localContext = new SetTransactionStatementContext(this.context, this.state); + this.enterRule(localContext, 336, MySqlParser.RULE_setTransactionStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4434; + this.match(MySqlParser.KW_SET); + this.state = 4436; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 413 || _la === 593) { + { + this.state = 4435; + localContext._transactionContext = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 593)) { + localContext._transactionContext = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 4438; + this.match(MySqlParser.KW_TRANSACTION); + this.state = 4439; + this.transactionOption(); + this.state = 4444; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4440; + this.match(MySqlParser.COMMA); + this.state = 4441; + this.transactionOption(); + } + } + this.state = 4446; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionMode() { + let localContext = new TransactionModeContext(this.context, this.state); + this.enterRule(localContext, 338, MySqlParser.RULE_transactionMode); + try { + this.state = 4454; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 638, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4447; + this.match(MySqlParser.KW_WITH); + this.state = 4448; + this.match(MySqlParser.KW_CONSISTENT); + this.state = 4449; + this.match(MySqlParser.KW_SNAPSHOT); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4450; + this.match(MySqlParser.KW_READ); + this.state = 4451; + this.match(MySqlParser.KW_WRITE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 4452; + this.match(MySqlParser.KW_READ); + this.state = 4453; + this.match(MySqlParser.KW_ONLY); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockTableElement() { + let localContext = new LockTableElementContext(this.context, this.state); + this.enterRule(localContext, 340, MySqlParser.RULE_lockTableElement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4456; + this.tableName(); + this.state = 4461; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074311168) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4458; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 4457; + this.match(MySqlParser.KW_AS); + } + } + this.state = 4460; + localContext._alias = this.uid(); + } + } + this.state = 4463; + this.lockAction(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lockAction() { + let localContext = new LockActionContext(this.context, this.state); + this.enterRule(localContext, 342, MySqlParser.RULE_lockAction); + let _la; + try { + this.state = 4473; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_READ: + this.enterOuterAlt(localContext, 1); + { + this.state = 4465; + this.match(MySqlParser.KW_READ); + this.state = 4467; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 450) { + { + this.state = 4466; + this.match(MySqlParser.KW_LOCAL); + } + } + } + break; + case MySqlParser.KW_LOW_PRIORITY: + case MySqlParser.KW_WRITE: + this.enterOuterAlt(localContext, 2); + { + this.state = 4470; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 107) { + { + this.state = 4469; + this.match(MySqlParser.KW_LOW_PRIORITY); + } + } + this.state = 4472; + this.match(MySqlParser.KW_WRITE); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionOption() { + let localContext = new TransactionOptionContext(this.context, this.state); + this.enterRule(localContext, 344, MySqlParser.RULE_transactionOption); + try { + this.state = 4482; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 644, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4475; + this.match(MySqlParser.KW_ISOLATION); + this.state = 4476; + this.match(MySqlParser.KW_LEVEL); + this.state = 4477; + this.transactionLevel(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4478; + this.match(MySqlParser.KW_READ); + this.state = 4479; + this.match(MySqlParser.KW_WRITE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 4480; + this.match(MySqlParser.KW_READ); + this.state = 4481; + this.match(MySqlParser.KW_ONLY); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionLevel() { + let localContext = new TransactionLevelContext(this.context, this.state); + this.enterRule(localContext, 346, MySqlParser.RULE_transactionLevel); + try { + this.state = 4491; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 645, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4484; + this.match(MySqlParser.KW_REPEATABLE); + this.state = 4485; + this.match(MySqlParser.KW_READ); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4486; + this.match(MySqlParser.KW_READ); + this.state = 4487; + this.match(MySqlParser.KW_COMMITTED); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 4488; + this.match(MySqlParser.KW_READ); + this.state = 4489; + this.match(MySqlParser.KW_UNCOMMITTED); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 4490; + this.match(MySqlParser.KW_SERIALIZABLE); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + changeMaster() { + let localContext = new ChangeMasterContext(this.context, this.state); + this.enterRule(localContext, 348, MySqlParser.RULE_changeMaster); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4493; + this.match(MySqlParser.KW_CHANGE); + this.state = 4494; + this.match(MySqlParser.KW_MASTER); + this.state = 4495; + this.match(MySqlParser.KW_TO); + this.state = 4496; + this.masterOption(); + this.state = 4501; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4497; + this.match(MySqlParser.COMMA); + this.state = 4498; + this.masterOption(); + } + } + this.state = 4503; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4505; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4504; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + changeReplicationFilter() { + let localContext = new ChangeReplicationFilterContext(this.context, this.state); + this.enterRule(localContext, 350, MySqlParser.RULE_changeReplicationFilter); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4507; + this.match(MySqlParser.KW_CHANGE); + this.state = 4508; + this.match(MySqlParser.KW_REPLICATION); + this.state = 4509; + this.match(MySqlParser.KW_FILTER); + this.state = 4510; + this.replicationFilter(); + this.state = 4515; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4511; + this.match(MySqlParser.COMMA); + this.state = 4512; + this.replicationFilter(); + } + } + this.state = 4517; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4519; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4518; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + changeReplicationSource() { + let localContext = new ChangeReplicationSourceContext(this.context, this.state); + this.enterRule(localContext, 352, MySqlParser.RULE_changeReplicationSource); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4521; + this.match(MySqlParser.KW_CHANGE); + this.state = 4522; + this.match(MySqlParser.KW_REPLICATION); + this.state = 4523; + this.match(MySqlParser.KW_SOURCE); + this.state = 4524; + this.match(MySqlParser.KW_TO); + this.state = 4525; + this.replicationSourceOption(); + this.state = 4530; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4526; + this.match(MySqlParser.COMMA); + this.state = 4527; + this.replicationSourceOption(); + } + } + this.state = 4532; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4534; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4533; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + purgeBinaryLogs() { + let localContext = new PurgeBinaryLogsContext(this.context, this.state); + this.enterRule(localContext, 354, MySqlParser.RULE_purgeBinaryLogs); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4536; + this.match(MySqlParser.KW_PURGE); + this.state = 4537; + localContext._purgeFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 228 || _la === 453)) { + localContext._purgeFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4538; + this.match(MySqlParser.KW_LOGS); + this.state = 4543; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TO: + { + this.state = 4539; + this.match(MySqlParser.KW_TO); + this.state = 4540; + localContext._fileName = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_BEFORE: + { + this.state = 4541; + this.match(MySqlParser.KW_BEFORE); + this.state = 4542; + localContext._timeValue = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + startSlaveOrReplica() { + let localContext = new StartSlaveOrReplicaContext(this.context, this.state); + this.enterRule(localContext, 356, MySqlParser.RULE_startSlaveOrReplica); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4545; + this.match(MySqlParser.KW_START); + this.state = 4546; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4555; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 438 || _la === 639) { + { + this.state = 4547; + this.threadType(); + this.state = 4552; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4548; + this.match(MySqlParser.COMMA); + this.state = 4549; + this.threadType(); + } + } + this.state = 4554; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4559; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 676) { + { + this.state = 4557; + this.match(MySqlParser.KW_UNTIL); + this.state = 4558; + this.untilOption(); + } + } + this.state = 4564; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 363 || _la === 529 || _la === 535 || _la === 678) { + { + { + this.state = 4561; + this.connectionOptions(); + } + } + this.state = 4566; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4568; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4567; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stopSlaveOrReplica() { + let localContext = new StopSlaveOrReplicaContext(this.context, this.state); + this.enterRule(localContext, 358, MySqlParser.RULE_stopSlaveOrReplica); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4570; + this.match(MySqlParser.KW_STOP); + this.state = 4571; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4580; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 438 || _la === 639) { + { + this.state = 4572; + this.threadType(); + this.state = 4577; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4573; + this.match(MySqlParser.COMMA); + this.state = 4574; + this.threadType(); + } + } + this.state = 4579; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4583; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4582; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + startGroupReplication() { + let localContext = new StartGroupReplicationContext(this.context, this.state); + this.enterRule(localContext, 360, MySqlParser.RULE_startGroupReplication); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4585; + this.match(MySqlParser.KW_START); + this.state = 4586; + this.match(MySqlParser.KW_GROUP_REPLICATION); + this.state = 4590; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 678) { + { + this.state = 4587; + this.match(MySqlParser.KW_USER); + this.state = 4588; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4589; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 4596; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 662, this.context)) { + case 1: + { + this.state = 4592; + this.match(MySqlParser.COMMA); + this.state = 4593; + this.match(MySqlParser.KW_PASSWORD); + this.state = 4594; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4595; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + this.state = 4602; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 4598; + this.match(MySqlParser.COMMA); + this.state = 4599; + this.match(MySqlParser.KW_DEFAULT_AUTH); + this.state = 4600; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4601; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stopGroupReplication() { + let localContext = new StopGroupReplicationContext(this.context, this.state); + this.enterRule(localContext, 362, MySqlParser.RULE_stopGroupReplication); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4604; + this.match(MySqlParser.KW_STOP); + this.state = 4605; + this.match(MySqlParser.KW_GROUP_REPLICATION); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + masterOption() { + let localContext = new MasterOptionContext(this.context, this.state); + this.enterRule(localContext, 364, MySqlParser.RULE_masterOption); + let _la; + try { + this.state = 4634; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_MASTER_BIND: + case MySqlParser.KW_MASTER_COMPRESSION_ALGORITHMS: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PUBLIC_KEY_PATH: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_CIPHERSUITES: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_NETWORK_NAMESPACE: + case MySqlParser.KW_RELAY_LOG_FILE: + localContext = new MasterStringOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4607; + this.stringMasterOption(); + this.state = 4608; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4609; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_ZSTD_COMPRESSION_LEVEL: + case MySqlParser.KW_RELAY_LOG_POS: + localContext = new MasterDecimalOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4611; + this.decimalMasterOption(); + this.state = 4612; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4613; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MASTER_SSL_VERIFY_SERVER_CERT: + case MySqlParser.KW_GET_MASTER_PUBLIC_KEY: + case MySqlParser.KW_GTID_ONLY: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_REQUIRE_ROW_FORMAT: + case MySqlParser.KW_SOURCE_CONNECTION_AUTO_FAILOVER: + localContext = new MasterBoolOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4615; + this.boolMasterOption(); + this.state = 4616; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4617; + localContext._boolVal = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolVal = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + localContext = new V8AddMasterOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4619; + this.v8NewMasterOption(); + } + break; + case MySqlParser.KW_IGNORE_SERVER_IDS: + localContext = new MasterUidListOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4620; + this.match(MySqlParser.KW_IGNORE_SERVER_IDS); + this.state = 4621; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4622; + this.match(MySqlParser.LR_BRACKET); + this.state = 4631; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4623; + localContext._server_id = this.uid(); + this.state = 4628; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4624; + this.match(MySqlParser.COMMA); + this.state = 4625; + localContext._server_id = this.uid(); + } + } + this.state = 4630; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4633; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stringMasterOption() { + let localContext = new StringMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 366, MySqlParser.RULE_stringMasterOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4636; + _la = this.tokenStream.LA(1); + if (!(_la === 108 || ((((_la - 455)) & ~0x1F) === 0 && ((1 << (_la - 455)) & 4190897) !== 0) || _la === 499 || _la === 557)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + decimalMasterOption() { + let localContext = new DecimalMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 368, MySqlParser.RULE_decimalMasterOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4638; + _la = this.tokenStream.LA(1); + if (!(((((_la - 456)) & ~0x1F) === 0 && ((1 << (_la - 456)) & 2097831) !== 0) || _la === 558)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + boolMasterOption() { + let localContext = new BoolMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 370, MySqlParser.RULE_boolMasterOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4640; + _la = this.tokenStream.LA(1); + if (!(_la === 109 || _la === 411 || _la === 416 || _la === 454 || _la === 466 || _la === 573 || _la === 617)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + v8NewMasterOption() { + let localContext = new V8NewMasterOptionContext(this.context, this.state); + this.enterRule(localContext, 372, MySqlParser.RULE_v8NewMasterOption); + let _la; + try { + this.state = 4655; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + this.enterOuterAlt(localContext, 1); + { + this.state = 4642; + this.match(MySqlParser.KW_PRIVILEGE_CHECKS_USER); + this.state = 4643; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4644; + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + this.enterOuterAlt(localContext, 2); + { + this.state = 4645; + this.match(MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK); + this.state = 4646; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4647; + _la = this.tokenStream.LA(1); + if (!(_la === 118 || _la === 119 || _la === 507)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + this.enterOuterAlt(localContext, 3); + { + this.state = 4648; + this.match(MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS); + this.state = 4649; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4653; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_OFF: + { + this.state = 4650; + this.match(MySqlParser.KW_OFF); + } + break; + case MySqlParser.KW_LOCAL: + { + this.state = 4651; + this.match(MySqlParser.KW_LOCAL); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.STRING_LITERAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 4652; + this.gtuidSet(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replicationSourceOption() { + let localContext = new ReplicationSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 374, MySqlParser.RULE_replicationSourceOption); + let _la; + try { + this.state = 4684; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NETWORK_NAMESPACE: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_SOURCE_BIND: + case MySqlParser.KW_SOURCE_HOST: + case MySqlParser.KW_SOURCE_USER: + case MySqlParser.KW_SOURCE_PASSWORD: + case MySqlParser.KW_SOURCE_LOG_FILE: + case MySqlParser.KW_SOURCE_COMPRESSION_ALGORITHMS: + case MySqlParser.KW_SOURCE_SSL_CA: + case MySqlParser.KW_SOURCE_SSL_CAPATH: + case MySqlParser.KW_SOURCE_SSL_CERT: + case MySqlParser.KW_SOURCE_SSL_CRL: + case MySqlParser.KW_SOURCE_SSL_CRLPATH: + case MySqlParser.KW_SOURCE_SSL_KEY: + case MySqlParser.KW_SOURCE_SSL_CIPHER: + case MySqlParser.KW_SOURCE_TLS_VERSION: + case MySqlParser.KW_SOURCE_TLS_CIPHERSUITES: + case MySqlParser.KW_SOURCE_PUBLIC_KEY_PATH: + localContext = new SourceStringOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4657; + this.stringSourceOption(); + this.state = 4658; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4659; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_SOURCE_PORT: + case MySqlParser.KW_SOURCE_LOG_POS: + case MySqlParser.KW_SOURCE_HEARTBEAT_PERIOD: + case MySqlParser.KW_SOURCE_CONNECT_RETRY: + case MySqlParser.KW_SOURCE_RETRY_COUNT: + case MySqlParser.KW_SOURCE_DELAY: + case MySqlParser.KW_SOURCE_ZSTD_COMPRESSION_LEVEL: + localContext = new SourceDecimalOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4661; + this.decimalSourceOption(); + this.state = 4662; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4663; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_GET_SOURCE_PUBLIC_KEY: + case MySqlParser.KW_GTID_ONLY: + case MySqlParser.KW_REQUIRE_ROW_FORMAT: + case MySqlParser.KW_SOURCE_AUTO_POSITION: + case MySqlParser.KW_SOURCE_CONNECTION_AUTO_FAILOVER: + case MySqlParser.KW_SOURCE_SSL: + case MySqlParser.KW_SOURCE_SSL_VERIFY_SERVER_CERT: + localContext = new SourceBoolOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4665; + this.boolSourceOption(); + this.state = 4666; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4667; + localContext._boolVal = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 871 || _la === 872)) { + localContext._boolVal = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + localContext = new SourceOtherOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4669; + this.otherSourceOption(); + } + break; + case MySqlParser.KW_IGNORE_SERVER_IDS: + localContext = new SourceUidListOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4670; + this.match(MySqlParser.KW_IGNORE_SERVER_IDS); + this.state = 4671; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4672; + this.match(MySqlParser.LR_BRACKET); + this.state = 4681; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4673; + localContext._server_id = this.uid(); + this.state = 4678; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4674; + this.match(MySqlParser.COMMA); + this.state = 4675; + localContext._server_id = this.uid(); + } + } + this.state = 4680; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 4683; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stringSourceOption() { + let localContext = new StringSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 376, MySqlParser.RULE_stringSourceOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4686; + _la = this.tokenStream.LA(1); + if (!(_la === 499 || _la === 557 || ((((_la - 606)) & ~0x1F) === 0 && ((1 << (_la - 606)) & 125771823) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + decimalSourceOption() { + let localContext = new DecimalSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 378, MySqlParser.RULE_decimalSourceOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4688; + _la = this.tokenStream.LA(1); + if (!(_la === 558 || ((((_la - 610)) & ~0x1F) === 0 && ((1 << (_la - 610)) & 1397) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + boolSourceOption() { + let localContext = new BoolSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 380, MySqlParser.RULE_boolSourceOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4690; + _la = this.tokenStream.LA(1); + if (!(_la === 412 || _la === 416 || _la === 573 || ((((_la - 613)) & ~0x1F) === 0 && ((1 << (_la - 613)) & 65809) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + otherSourceOption() { + let localContext = new OtherSourceOptionContext(this.context, this.state); + this.enterRule(localContext, 382, MySqlParser.RULE_otherSourceOption); + let _la; + try { + this.state = 4705; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_PRIVILEGE_CHECKS_USER: + this.enterOuterAlt(localContext, 1); + { + this.state = 4692; + this.match(MySqlParser.KW_PRIVILEGE_CHECKS_USER); + this.state = 4693; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4694; + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 882)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK: + this.enterOuterAlt(localContext, 2); + { + this.state = 4695; + this.match(MySqlParser.KW_REQUIRE_TABLE_PRIMARY_KEY_CHECK); + this.state = 4696; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4697; + _la = this.tokenStream.LA(1); + if (!(_la === 70 || _la === 118 || _la === 119 || _la === 507)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS: + this.enterOuterAlt(localContext, 3); + { + this.state = 4698; + this.match(MySqlParser.KW_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS); + this.state = 4699; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4703; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_OFF: + { + this.state = 4700; + this.match(MySqlParser.KW_OFF); + } + break; + case MySqlParser.KW_LOCAL: + { + this.state = 4701; + this.match(MySqlParser.KW_LOCAL); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.STRING_LITERAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 4702; + this.gtuidSet(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + channelOption() { + let localContext = new ChannelOptionContext(this.context, this.state); + this.enterRule(localContext, 384, MySqlParser.RULE_channelOption); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4707; + this.match(MySqlParser.KW_FOR); + this.state = 4708; + this.match(MySqlParser.KW_CHANNEL); + this.state = 4709; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + replicationFilter() { + let localContext = new ReplicationFilterContext(this.context, this.state); + this.enterRule(localContext, 386, MySqlParser.RULE_replicationFilter); + let _la; + try { + this.state = 4774; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_REPLICATE_DO_DB: + localContext = new DoDbReplicationContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4711; + this.match(MySqlParser.KW_REPLICATE_DO_DB); + this.state = 4712; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4713; + this.match(MySqlParser.LR_BRACKET); + this.state = 4714; + this.databaseName(); + this.state = 4719; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4715; + this.match(MySqlParser.COMMA); + this.state = 4716; + this.databaseName(); + } + } + this.state = 4721; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4722; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_IGNORE_DB: + localContext = new IgnoreDbReplicationContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4724; + this.match(MySqlParser.KW_REPLICATE_IGNORE_DB); + this.state = 4725; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4726; + this.match(MySqlParser.LR_BRACKET); + this.state = 4727; + this.databaseName(); + this.state = 4732; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4728; + this.match(MySqlParser.COMMA); + this.state = 4729; + this.databaseName(); + } + } + this.state = 4734; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4735; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_DO_TABLE: + localContext = new DoTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4737; + this.match(MySqlParser.KW_REPLICATE_DO_TABLE); + this.state = 4738; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4739; + this.match(MySqlParser.LR_BRACKET); + this.state = 4740; + this.tableNames(); + this.state = 4741; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + localContext = new IgnoreTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4743; + this.match(MySqlParser.KW_REPLICATE_IGNORE_TABLE); + this.state = 4744; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4745; + this.match(MySqlParser.LR_BRACKET); + this.state = 4746; + this.tableNames(); + this.state = 4747; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + localContext = new WildDoTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4749; + this.match(MySqlParser.KW_REPLICATE_WILD_DO_TABLE); + this.state = 4750; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4751; + this.match(MySqlParser.LR_BRACKET); + this.state = 4752; + this.simpleStrings(); + this.state = 4753; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + localContext = new WildIgnoreTableReplicationContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 4755; + this.match(MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE); + this.state = 4756; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4757; + this.match(MySqlParser.LR_BRACKET); + this.state = 4758; + this.simpleStrings(); + this.state = 4759; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_REPLICATE_REWRITE_DB: + localContext = new RewriteDbReplicationContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 4761; + this.match(MySqlParser.KW_REPLICATE_REWRITE_DB); + this.state = 4762; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4763; + this.match(MySqlParser.LR_BRACKET); + this.state = 4764; + this.tablePair(); + this.state = 4769; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 4765; + this.match(MySqlParser.COMMA); + this.state = 4766; + this.tablePair(); + } + } + this.state = 4771; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4772; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablePair() { + let localContext = new TablePairContext(this.context, this.state); + this.enterRule(localContext, 388, MySqlParser.RULE_tablePair); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4776; + this.match(MySqlParser.LR_BRACKET); + this.state = 4777; + localContext._firstTable = this.tableName(); + this.state = 4778; + this.match(MySqlParser.COMMA); + this.state = 4779; + localContext._secondTable = this.tableName(); + this.state = 4780; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + threadType() { + let localContext = new ThreadTypeContext(this.context, this.state); + this.enterRule(localContext, 390, MySqlParser.RULE_threadType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4782; + _la = this.tokenStream.LA(1); + if (!(_la === 438 || _la === 639)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + untilOption() { + let localContext = new UntilOptionContext(this.context, this.state); + this.enterRule(localContext, 392, MySqlParser.RULE_untilOption); + let _la; + try { + this.state = 4809; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + localContext = new GtidsUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4784; + localContext._gtids = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 633 || _la === 635)) { + localContext._gtids = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4785; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4786; + this.gtuidSet(); + } + break; + case MySqlParser.KW_MASTER_LOG_FILE: + localContext = new MasterLogUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4787; + this.match(MySqlParser.KW_MASTER_LOG_FILE); + this.state = 4788; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4789; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4790; + this.match(MySqlParser.COMMA); + this.state = 4791; + this.match(MySqlParser.KW_MASTER_LOG_POS); + this.state = 4792; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4793; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SOURCE_LOG_FILE: + localContext = new SourceLogUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4794; + this.match(MySqlParser.KW_SOURCE_LOG_FILE); + this.state = 4795; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4796; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4797; + this.match(MySqlParser.COMMA); + this.state = 4798; + this.match(MySqlParser.KW_SOURCE_LOG_POS); + this.state = 4799; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4800; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_RELAY_LOG_FILE: + localContext = new RelayLogUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4801; + this.match(MySqlParser.KW_RELAY_LOG_FILE); + this.state = 4802; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4803; + this.match(MySqlParser.STRING_LITERAL); + this.state = 4804; + this.match(MySqlParser.COMMA); + this.state = 4805; + this.match(MySqlParser.KW_RELAY_LOG_POS); + this.state = 4806; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4807; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + localContext = new SqlGapsUntilOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 4808; + this.match(MySqlParser.KW_SQL_AFTER_MTS_GAPS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + connectionOptions() { + let localContext = new ConnectionOptionsContext(this.context, this.state); + this.enterRule(localContext, 394, MySqlParser.RULE_connectionOptions); + try { + this.state = 4823; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_USER: + localContext = new UserConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 4811; + this.match(MySqlParser.KW_USER); + this.state = 4812; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4813; + localContext._conOptUser = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PASSWORD: + localContext = new PasswordConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 4814; + this.match(MySqlParser.KW_PASSWORD); + this.state = 4815; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4816; + localContext._conOptPassword = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_DEFAULT_AUTH: + localContext = new DefaultAuthConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 4817; + this.match(MySqlParser.KW_DEFAULT_AUTH); + this.state = 4818; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4819; + localContext._conOptDefAuth = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_PLUGIN_DIR: + localContext = new PluginDirConnectionOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 4820; + this.match(MySqlParser.KW_PLUGIN_DIR); + this.state = 4821; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 4822; + localContext._conOptPluginDir = this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + gtuidSet() { + let localContext = new GtuidSetContext(this.context, this.state); + this.enterRule(localContext, 396, MySqlParser.RULE_gtuidSet); + try { + let alternative; + this.state = 4834; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 4825; + this.uuidSet(); + this.state = 4830; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 680, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4826; + this.match(MySqlParser.COMMA); + this.state = 4827; + this.uuidSet(); + } + } + } + this.state = 4832; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 680, this.context); + } + } + break; + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 2); + { + this.state = 4833; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaStartTransaction() { + let localContext = new XaStartTransactionContext(this.context, this.state); + this.enterRule(localContext, 398, MySqlParser.RULE_xaStartTransaction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4836; + this.match(MySqlParser.KW_XA); + this.state = 4837; + localContext._xaStart = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 317 || _la === 640)) { + localContext._xaStart = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4838; + this.xid(); + this.state = 4840; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 91 || _la === 577) { + { + this.state = 4839; + localContext._xaAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 91 || _la === 577)) { + localContext._xaAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaEndTransaction() { + let localContext = new XaEndTransactionContext(this.context, this.state); + this.enterRule(localContext, 400, MySqlParser.RULE_xaEndTransaction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4842; + this.match(MySqlParser.KW_XA); + this.state = 4843; + this.match(MySqlParser.KW_END); + this.state = 4844; + this.xid(); + this.state = 4850; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 654) { + { + this.state = 4845; + this.match(MySqlParser.KW_SUSPEND); + this.state = 4848; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 4846; + this.match(MySqlParser.KW_FOR); + this.state = 4847; + this.match(MySqlParser.KW_MIGRATE); + } + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaPrepareStatement() { + let localContext = new XaPrepareStatementContext(this.context, this.state); + this.enterRule(localContext, 402, MySqlParser.RULE_xaPrepareStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4852; + this.match(MySqlParser.KW_XA); + this.state = 4853; + this.match(MySqlParser.KW_PREPARE); + this.state = 4854; + this.xid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaCommitWork() { + let localContext = new XaCommitWorkContext(this.context, this.state); + this.enterRule(localContext, 404, MySqlParser.RULE_xaCommitWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4856; + this.match(MySqlParser.KW_XA); + this.state = 4857; + this.match(MySqlParser.KW_COMMIT); + this.state = 4858; + this.xid(); + this.state = 4861; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 513) { + { + this.state = 4859; + this.match(MySqlParser.KW_ONE); + this.state = 4860; + this.match(MySqlParser.KW_PHASE); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaRollbackWork() { + let localContext = new XaRollbackWorkContext(this.context, this.state); + this.enterRule(localContext, 406, MySqlParser.RULE_xaRollbackWork); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4863; + this.match(MySqlParser.KW_XA); + this.state = 4864; + this.match(MySqlParser.KW_ROLLBACK); + this.state = 4865; + this.xid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xaRecoverWork() { + let localContext = new XaRecoverWorkContext(this.context, this.state); + this.enterRule(localContext, 408, MySqlParser.RULE_xaRecoverWork); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4867; + this.match(MySqlParser.KW_XA); + this.state = 4868; + this.match(MySqlParser.KW_RECOVER); + this.state = 4871; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 33) { + { + this.state = 4869; + this.match(MySqlParser.KW_CONVERT); + this.state = 4870; + this.xid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + prepareStatement() { + let localContext = new PrepareStatementContext(this.context, this.state); + this.enterRule(localContext, 410, MySqlParser.RULE_prepareStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4873; + this.match(MySqlParser.KW_PREPARE); + this.state = 4874; + localContext._stmt_name = this.uid(); + this.state = 4875; + this.match(MySqlParser.KW_FROM); + this.state = 4878; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 4876; + localContext._query = this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.LOCAL_ID: + { + this.state = 4877; + localContext._variable = this.match(MySqlParser.LOCAL_ID); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + executeStatement() { + let localContext = new ExecuteStatementContext(this.context, this.state); + this.enterRule(localContext, 412, MySqlParser.RULE_executeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4880; + this.match(MySqlParser.KW_EXECUTE); + this.state = 4881; + localContext._stmt_name = this.uid(); + this.state = 4884; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 4882; + this.match(MySqlParser.KW_USING); + this.state = 4883; + this.userVariables(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + deallocatePrepare() { + let localContext = new DeallocatePrepareContext(this.context, this.state); + this.enterRule(localContext, 414, MySqlParser.RULE_deallocatePrepare); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4886; + localContext._dropFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 51 || _la === 362)) { + localContext._dropFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 4887; + this.match(MySqlParser.KW_PREPARE); + this.state = 4888; + localContext._stmt_name = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + routineBody() { + let localContext = new RoutineBodyContext(this.context, this.state); + this.enterRule(localContext, 416, MySqlParser.RULE_routineBody); + try { + this.state = 4892; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 689, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 4890; + this.blockStatement(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 4891; + this.sqlStatement(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + blockStatement() { + let localContext = new BlockStatementContext(this.context, this.state); + this.enterRule(localContext, 418, MySqlParser.RULE_blockStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4897; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 690, this.context)) { + case 1: + { + this.state = 4894; + localContext._begin = this.uid(); + this.state = 4895; + this.match(MySqlParser.COLON_SYMB); + } + break; + } + this.state = 4899; + this.match(MySqlParser.KW_BEGIN); + this.state = 4905; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 691, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4900; + this.declareVariable(); + this.state = 4901; + this.match(MySqlParser.SEMI); + } + } + } + this.state = 4907; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 691, this.context); + } + this.state = 4913; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 692, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4908; + this.declareCondition(); + this.state = 4909; + this.match(MySqlParser.SEMI); + } + } + } + this.state = 4915; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 692, this.context); + } + this.state = 4921; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 693, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4916; + this.declareCursor(); + this.state = 4917; + this.match(MySqlParser.SEMI); + } + } + } + this.state = 4923; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 693, this.context); + } + this.state = 4929; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 41) { + { + { + this.state = 4924; + this.declareHandler(); + this.state = 4925; + this.match(MySqlParser.SEMI); + } + } + this.state = 4931; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4935; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 695, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 4932; + this.procedureSqlStatement(); + } + } + } + this.state = 4937; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 695, this.context); + } + this.state = 4938; + this.match(MySqlParser.KW_END); + this.state = 4940; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 696, this.context)) { + case 1: + { + this.state = 4939; + localContext._end = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + caseStatement() { + let localContext = new CaseStatementContext(this.context, this.state); + this.enterRule(localContext, 420, MySqlParser.RULE_caseStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4942; + this.match(MySqlParser.KW_CASE); + this.state = 4945; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 697, this.context)) { + case 1: + { + this.state = 4943; + localContext._case_value = this.uid(); + } + break; + case 2: + { + this.state = 4944; + this.expression(0); + } + break; + } + this.state = 4948; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 4947; + this.caseAlternative(); + } + } + this.state = 4950; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 191); + this.state = 4958; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 4952; + this.match(MySqlParser.KW_ELSE); + this.state = 4954; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4953; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4956; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 699, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + this.state = 4960; + this.match(MySqlParser.KW_END); + this.state = 4961; + this.match(MySqlParser.KW_CASE); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ifStatement() { + let localContext = new IfStatementContext(this.context, this.state); + this.enterRule(localContext, 422, MySqlParser.RULE_ifStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4963; + this.match(MySqlParser.KW_IF); + this.state = 4964; + this.expression(0); + this.state = 4965; + this.match(MySqlParser.KW_THEN); + this.state = 4967; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4966; + localContext._procedureSqlStatement = this.procedureSqlStatement(); + localContext._thenStatements.push(localContext._procedureSqlStatement); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4969; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 701, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 4974; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 54) { + { + { + this.state = 4971; + this.elifAlternative(); + } + } + this.state = 4976; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 4983; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 4977; + this.match(MySqlParser.KW_ELSE); + this.state = 4979; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 4978; + localContext._procedureSqlStatement = this.procedureSqlStatement(); + localContext._elseStatements.push(localContext._procedureSqlStatement); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 4981; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 703, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + this.state = 4985; + this.match(MySqlParser.KW_END); + this.state = 4986; + this.match(MySqlParser.KW_IF); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + iterateStatement() { + let localContext = new IterateStatementContext(this.context, this.state); + this.enterRule(localContext, 424, MySqlParser.RULE_iterateStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4988; + this.match(MySqlParser.KW_ITERATE); + this.state = 4989; + localContext._label = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + leaveStatement() { + let localContext = new LeaveStatementContext(this.context, this.state); + this.enterRule(localContext, 426, MySqlParser.RULE_leaveStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 4991; + this.match(MySqlParser.KW_LEAVE); + this.state = 4992; + localContext._label = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loopStatement() { + let localContext = new LoopStatementContext(this.context, this.state); + this.enterRule(localContext, 428, MySqlParser.RULE_loopStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 4997; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 4994; + localContext._begin_label = this.uid(); + this.state = 4995; + this.match(MySqlParser.COLON_SYMB); + } + } + this.state = 4999; + this.match(MySqlParser.KW_LOOP); + this.state = 5001; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5000; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5003; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 706, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 5005; + this.match(MySqlParser.KW_END); + this.state = 5006; + this.match(MySqlParser.KW_LOOP); + this.state = 5008; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5007; + localContext._end_label = this.uid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + repeatStatement() { + let localContext = new RepeatStatementContext(this.context, this.state); + this.enterRule(localContext, 430, MySqlParser.RULE_repeatStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5013; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 708, this.context)) { + case 1: + { + this.state = 5010; + localContext._begin_label = this.uid(); + this.state = 5011; + this.match(MySqlParser.COLON_SYMB); + } + break; + } + this.state = 5015; + this.match(MySqlParser.KW_REPEAT); + this.state = 5017; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5016; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5019; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 709, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 5021; + this.match(MySqlParser.KW_UNTIL); + this.state = 5022; + this.expression(0); + this.state = 5023; + this.match(MySqlParser.KW_END); + this.state = 5024; + this.match(MySqlParser.KW_REPEAT); + this.state = 5026; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5025; + localContext._end_label = this.uid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + returnStatement() { + let localContext = new ReturnStatementContext(this.context, this.state); + this.enterRule(localContext, 432, MySqlParser.RULE_returnStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5028; + this.match(MySqlParser.KW_RETURN); + this.state = 5029; + this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + whileStatement() { + let localContext = new WhileStatementContext(this.context, this.state); + this.enterRule(localContext, 434, MySqlParser.RULE_whileStatement); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5034; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5031; + localContext._begin_label = this.uid(); + this.state = 5032; + this.match(MySqlParser.COLON_SYMB); + } + } + this.state = 5036; + this.match(MySqlParser.KW_WHILE); + this.state = 5037; + this.expression(0); + this.state = 5038; + this.match(MySqlParser.KW_DO); + this.state = 5040; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5039; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5042; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 712, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + this.state = 5044; + this.match(MySqlParser.KW_END); + this.state = 5045; + this.match(MySqlParser.KW_WHILE); + this.state = 5047; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014219) !== 0) || ((((_la - 74)) & ~0x1F) === 0 && ((1 << (_la - 74)) & 18878481) !== 0) || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 100679969) !== 0) || ((((_la - 150)) & ~0x1F) === 0 && ((1 << (_la - 150)) & 1049605) !== 0) || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 5374495) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 4294967295) !== 0) || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 4261412607) !== 0) || ((((_la - 317)) & ~0x1F) === 0 && ((1 << (_la - 317)) & 4160741375) !== 0) || ((((_la - 349)) & ~0x1F) === 0 && ((1 << (_la - 349)) & 4026531839) !== 0) || ((((_la - 381)) & ~0x1F) === 0 && ((1 << (_la - 381)) & 1055907839) !== 0) || ((((_la - 413)) & ~0x1F) === 0 && ((1 << (_la - 413)) & 4294885367) !== 0) || ((((_la - 445)) & ~0x1F) === 0 && ((1 << (_la - 445)) & 3757571071) !== 0) || ((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 3755999231) !== 0) || ((((_la - 510)) & ~0x1F) === 0 && ((1 << (_la - 510)) & 3751780349) !== 0) || ((((_la - 542)) & ~0x1F) === 0 && ((1 << (_la - 542)) & 2141183997) !== 0) || ((((_la - 575)) & ~0x1F) === 0 && ((1 << (_la - 575)) & 2147483629) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 4278189053) !== 0) || ((((_la - 697)) & ~0x1F) === 0 && ((1 << (_la - 697)) & 1644099327) !== 0) || ((((_la - 729)) & ~0x1F) === 0 && ((1 << (_la - 729)) & 4294900735) !== 0) || ((((_la - 761)) & ~0x1F) === 0 && ((1 << (_la - 761)) & 4294967295) !== 0) || ((((_la - 793)) & ~0x1F) === 0 && ((1 << (_la - 793)) & 4288675839) !== 0) || ((((_la - 825)) & ~0x1F) === 0 && ((1 << (_la - 825)) & 2147527671) !== 0) || ((((_la - 879)) & ~0x1F) === 0 && ((1 << (_la - 879)) & 1033) !== 0)) { + { + this.state = 5046; + localContext._end_label = this.uid(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + cursorStatement() { + let localContext = new CursorStatementContext(this.context, this.state); + this.enterRule(localContext, 436, MySqlParser.RULE_cursorStatement); + let _la; + try { + this.state = 5064; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CLOSE: + localContext = new CloseCursorContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5049; + this.match(MySqlParser.KW_CLOSE); + this.state = 5050; + localContext._cursor_name = this.uid(); + } + break; + case MySqlParser.KW_FETCH: + localContext = new FetchCursorContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5051; + this.match(MySqlParser.KW_FETCH); + this.state = 5056; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 715, this.context)) { + case 1: + { + this.state = 5053; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 501) { + { + this.state = 5052; + this.match(MySqlParser.KW_NEXT); + } + } + this.state = 5055; + this.match(MySqlParser.KW_FROM); + } + break; + } + this.state = 5058; + localContext._cursor_name = this.uid(); + this.state = 5059; + this.match(MySqlParser.KW_INTO); + this.state = 5060; + localContext._var_names = this.uidList(); + } + break; + case MySqlParser.KW_OPEN: + localContext = new OpenCursorContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5062; + this.match(MySqlParser.KW_OPEN); + this.state = 5063; + localContext._cursor_name = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareVariable() { + let localContext = new DeclareVariableContext(this.context, this.state); + this.enterRule(localContext, 438, MySqlParser.RULE_declareVariable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5066; + this.match(MySqlParser.KW_DECLARE); + this.state = 5067; + localContext._var_names = this.uidList(); + this.state = 5068; + this.dataType(); + this.state = 5071; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 5069; + this.match(MySqlParser.KW_DEFAULT); + this.state = 5070; + this.expression(0); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareCondition() { + let localContext = new DeclareConditionContext(this.context, this.state); + this.enterRule(localContext, 440, MySqlParser.RULE_declareCondition); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5073; + this.match(MySqlParser.KW_DECLARE); + this.state = 5074; + localContext._condition_name = this.uid(); + this.state = 5075; + this.match(MySqlParser.KW_CONDITION); + this.state = 5076; + this.match(MySqlParser.KW_FOR); + this.state = 5083; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5077; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SQLSTATE: + { + this.state = 5078; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 5080; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 5079; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 5082; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareCursor() { + let localContext = new DeclareCursorContext(this.context, this.state); + this.enterRule(localContext, 442, MySqlParser.RULE_declareCursor); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5085; + this.match(MySqlParser.KW_DECLARE); + this.state = 5086; + localContext._condition_name = this.uid(); + this.state = 5087; + this.match(MySqlParser.KW_CURSOR); + this.state = 5088; + this.match(MySqlParser.KW_FOR); + this.state = 5089; + this.selectStatement(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + declareHandler() { + let localContext = new DeclareHandlerContext(this.context, this.state); + this.enterRule(localContext, 444, MySqlParser.RULE_declareHandler); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5091; + this.match(MySqlParser.KW_DECLARE); + this.state = 5092; + localContext._handlerAction = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 32 || _la === 61 || _la === 180)) { + localContext._handlerAction = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5093; + this.match(MySqlParser.KW_HANDLER); + this.state = 5094; + this.match(MySqlParser.KW_FOR); + this.state = 5095; + this.handlerConditionValue(); + this.state = 5100; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5096; + this.match(MySqlParser.COMMA); + this.state = 5097; + this.handlerConditionValue(); + } + } + this.state = 5102; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5103; + this.routineBody(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + handlerConditionValue() { + let localContext = new HandlerConditionValueContext(this.context, this.state); + this.enterRule(localContext, 446, MySqlParser.RULE_handlerConditionValue); + let _la; + try { + this.state = 5116; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + localContext = new HandlerConditionCodeContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5105; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_SQLSTATE: + localContext = new HandlerConditionStateContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5106; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 5108; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 5107; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 5110; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + localContext = new HandlerConditionNameContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5111; + localContext._condition_name = this.uid(); + } + break; + case MySqlParser.KW_SQLWARNING: + localContext = new HandlerConditionWarningContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 5112; + this.match(MySqlParser.KW_SQLWARNING); + } + break; + case MySqlParser.KW_NOT: + localContext = new HandlerConditionNotfoundContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 5113; + this.match(MySqlParser.KW_NOT); + this.state = 5114; + this.match(MySqlParser.KW_FOUND); + } + break; + case MySqlParser.KW_SQLEXCEPTION: + localContext = new HandlerConditionExceptionContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 5115; + this.match(MySqlParser.KW_SQLEXCEPTION); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + procedureSqlStatement() { + let localContext = new ProcedureSqlStatementContext(this.context, this.state); + this.enterRule(localContext, 448, MySqlParser.RULE_procedureSqlStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5120; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 723, this.context)) { + case 1: + { + this.state = 5118; + this.compoundStatement(); + } + break; + case 2: + { + this.state = 5119; + this.sqlStatement(); + } + break; + } + this.state = 5122; + this.match(MySqlParser.SEMI); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + caseAlternative() { + let localContext = new CaseAlternativeContext(this.context, this.state); + this.enterRule(localContext, 450, MySqlParser.RULE_caseAlternative); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5124; + this.match(MySqlParser.KW_WHEN); + this.state = 5127; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 724, this.context)) { + case 1: + { + this.state = 5125; + this.constant(); + } + break; + case 2: + { + this.state = 5126; + this.expression(0); + } + break; + } + this.state = 5129; + this.match(MySqlParser.KW_THEN); + this.state = 5131; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5130; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5133; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 725, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + elifAlternative() { + let localContext = new ElifAlternativeContext(this.context, this.state); + this.enterRule(localContext, 452, MySqlParser.RULE_elifAlternative); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5135; + this.match(MySqlParser.KW_ELSEIF); + this.state = 5136; + this.expression(0); + this.state = 5137; + this.match(MySqlParser.KW_THEN); + this.state = 5139; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5138; + this.procedureSqlStatement(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5141; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 726, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterUser() { + let localContext = new AlterUserContext(this.context, this.state); + this.enterRule(localContext, 454, MySqlParser.RULE_alterUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5143; + this.match(MySqlParser.KW_ALTER); + this.state = 5144; + this.match(MySqlParser.KW_USER); + this.state = 5146; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 727, this.context)) { + case 1: + { + this.state = 5145; + this.ifExists(); + } + break; + } + this.state = 5204; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 739, this.context)) { + case 1: + { + { + this.state = 5148; + this.userSpecification(); + this.state = 5153; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5149; + this.match(MySqlParser.COMMA); + this.state = 5150; + this.userSpecification(); + } + } + this.state = 5155; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + case 2: + { + { + this.state = 5156; + this.alterUserAuthOption(); + this.state = 5161; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5157; + this.match(MySqlParser.COMMA); + this.state = 5158; + this.alterUserAuthOption(); + } + } + this.state = 5163; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5178; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 5164; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5176; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NONE: + { + this.state = 5165; + this.match(MySqlParser.KW_NONE); + } + break; + case MySqlParser.KW_SSL: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_X509: + { + this.state = 5166; + this.tlsOption(); + this.state = 5173; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 11 || _la === 169 || _la === 331 || _la === 441 || _la === 651 || _la === 693) { + { + { + this.state = 5168; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5167; + this.match(MySqlParser.KW_AND); + } + } + this.state = 5170; + this.tlsOption(); + } + } + this.state = 5175; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5186; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 735, this.context)) { + case 1: + { + this.state = 5180; + this.match(MySqlParser.KW_WITH); + this.state = 5182; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 5181; + this.userResourceOption(); + } + } + this.state = 5184; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 51) !== 0)); + } + break; + } + this.state = 5192; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 304 || _la === 395 || _la === 529 || _la === 530) { + { + this.state = 5190; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + { + this.state = 5188; + this.userPasswordOption(); + } + break; + case MySqlParser.KW_ACCOUNT: + { + this.state = 5189; + this.userLockOption(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + this.state = 5194; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5197; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 15 || _la === 340) { + { + this.state = 5195; + _la = this.tokenStream.LA(1); + if (!(_la === 15 || _la === 340)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5196; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + break; + case 3: + { + { + { + this.state = 5199; + this.userOrRoleName(); + } + this.state = 5200; + this.match(MySqlParser.KW_DEFAULT); + this.state = 5201; + this.match(MySqlParser.KW_ROLE); + this.state = 5202; + this.roleOption(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createUser() { + let localContext = new CreateUserContext(this.context, this.state); + this.enterRule(localContext, 456, MySqlParser.RULE_createUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5206; + this.match(MySqlParser.KW_CREATE); + this.state = 5207; + this.match(MySqlParser.KW_USER); + this.state = 5209; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5208; + this.ifNotExists(); + } + } + this.state = 5211; + this.userName(); + this.state = 5213; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 423) { + { + this.state = 5212; + this.createUserAuthOption(); + } + } + this.state = 5222; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5215; + this.match(MySqlParser.COMMA); + this.state = 5216; + this.userName(); + this.state = 5218; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 423) { + { + this.state = 5217; + this.createUserAuthOption(); + } + } + } + } + this.state = 5224; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5228; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42) { + { + this.state = 5225; + this.match(MySqlParser.KW_DEFAULT); + this.state = 5226; + this.match(MySqlParser.KW_ROLE); + this.state = 5227; + this.roleOption(); + } + } + this.state = 5244; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 5230; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5242; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NONE: + { + this.state = 5231; + this.match(MySqlParser.KW_NONE); + } + break; + case MySqlParser.KW_SSL: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_X509: + { + this.state = 5232; + this.tlsOption(); + this.state = 5239; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 11 || _la === 169 || _la === 331 || _la === 441 || _la === 651 || _la === 693) { + { + { + this.state = 5234; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5233; + this.match(MySqlParser.KW_AND); + } + } + this.state = 5236; + this.tlsOption(); + } + } + this.state = 5241; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5252; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 750, this.context)) { + case 1: + { + this.state = 5246; + this.match(MySqlParser.KW_WITH); + this.state = 5248; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 5247; + this.userResourceOption(); + } + } + this.state = 5250; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (((((_la - 478)) & ~0x1F) === 0 && ((1 << (_la - 478)) & 51) !== 0)); + } + break; + } + this.state = 5258; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 304 || _la === 395 || _la === 529 || _la === 530) { + { + this.state = 5256; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + { + this.state = 5254; + this.userPasswordOption(); + } + break; + case MySqlParser.KW_ACCOUNT: + { + this.state = 5255; + this.userLockOption(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + this.state = 5260; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5263; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 15 || _la === 340) { + { + this.state = 5261; + _la = this.tokenStream.LA(1); + if (!(_la === 15 || _la === 340)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5262; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropUser() { + let localContext = new DropUserContext(this.context, this.state); + this.enterRule(localContext, 458, MySqlParser.RULE_dropUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5265; + this.match(MySqlParser.KW_DROP); + this.state = 5266; + this.match(MySqlParser.KW_USER); + this.state = 5268; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5267; + this.ifExists(); + } + } + this.state = 5270; + this.userName(); + this.state = 5275; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5271; + this.match(MySqlParser.COMMA); + this.state = 5272; + this.userName(); + } + } + this.state = 5277; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + grantStatement() { + let localContext = new GrantStatementContext(this.context, this.state); + this.enterRule(localContext, 460, MySqlParser.RULE_grantStatement); + let _la; + try { + let alternative; + this.state = 5367; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 773, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5278; + this.match(MySqlParser.KW_GRANT); + this.state = 5279; + this.privelegeClause(); + this.state = 5284; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5280; + this.match(MySqlParser.COMMA); + this.state = 5281; + this.privelegeClause(); + } + } + this.state = 5286; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5287; + this.match(MySqlParser.KW_ON); + this.state = 5289; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 757, this.context)) { + case 1: + { + this.state = 5288; + this.privilegeObjectType(); + } + break; + } + this.state = 5291; + this.privilegeLevel(); + this.state = 5292; + this.match(MySqlParser.KW_TO); + this.state = 5302; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 759, this.context)) { + case 1: + { + { + this.state = 5293; + this.userAuthOption(); + this.state = 5298; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5294; + this.match(MySqlParser.COMMA); + this.state = 5295; + this.userAuthOption(); + } + } + this.state = 5300; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + case 2: + { + this.state = 5301; + this.userOrRoleNames(); + } + break; + } + this.state = 5318; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 5304; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5316; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_NONE: + { + this.state = 5305; + localContext._tlsNone = this.match(MySqlParser.KW_NONE); + } + break; + case MySqlParser.KW_SSL: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_X509: + { + this.state = 5306; + this.tlsOption(); + this.state = 5313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 11 || _la === 169 || _la === 331 || _la === 441 || _la === 651 || _la === 693) { + { + { + this.state = 5308; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5307; + this.match(MySqlParser.KW_AND); + } + } + this.state = 5310; + this.tlsOption(); + } + } + this.state = 5315; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5329; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 766, this.context)) { + case 1: + { + this.state = 5320; + this.match(MySqlParser.KW_WITH); + this.state = 5326; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 765, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + this.state = 5324; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_GRANT: + { + this.state = 5321; + this.match(MySqlParser.KW_GRANT); + this.state = 5322; + this.match(MySqlParser.KW_OPTION); + } + break; + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + { + this.state = 5323; + this.userResourceOption(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + this.state = 5328; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 765, this.context); + } + } + break; + } + this.state = 5338; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 5331; + this.match(MySqlParser.KW_AS); + this.state = 5332; + this.userName(); + this.state = 5336; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 767, this.context)) { + case 1: + { + this.state = 5333; + this.match(MySqlParser.KW_WITH); + this.state = 5334; + this.match(MySqlParser.KW_ROLE); + this.state = 5335; + this.roleOption(); + } + break; + } + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5340; + this.match(MySqlParser.KW_GRANT); + this.state = 5343; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 769, this.context)) { + case 1: + { + this.state = 5341; + this.match(MySqlParser.KW_PROXY); + this.state = 5342; + this.match(MySqlParser.KW_ON); + } + break; + } + { + this.state = 5345; + this.userOrRoleName(); + } + this.state = 5350; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5346; + this.match(MySqlParser.COMMA); + { + this.state = 5347; + this.userOrRoleName(); + } + } + } + this.state = 5352; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5353; + this.match(MySqlParser.KW_TO); + { + this.state = 5354; + this.userOrRoleName(); + } + this.state = 5359; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5355; + this.match(MySqlParser.COMMA); + { + this.state = 5356; + this.userOrRoleName(); + } + } + } + this.state = 5361; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5365; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 772, this.context)) { + case 1: + { + this.state = 5362; + this.match(MySqlParser.KW_WITH); + this.state = 5363; + this.match(MySqlParser.KW_ADMIN); + this.state = 5364; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + roleOption() { + let localContext = new RoleOptionContext(this.context, this.state); + this.enterRule(localContext, 462, MySqlParser.RULE_roleOption); + let _la; + try { + this.state = 5377; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 775, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5369; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5370; + this.match(MySqlParser.KW_NONE); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5371; + this.match(MySqlParser.KW_ALL); + this.state = 5374; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 59) { + { + this.state = 5372; + this.match(MySqlParser.KW_EXCEPT); + this.state = 5373; + this.userOrRoleNames(); + } + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5376; + this.userOrRoleNames(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + grantProxy() { + let localContext = new GrantProxyContext(this.context, this.state); + this.enterRule(localContext, 464, MySqlParser.RULE_grantProxy); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5379; + this.match(MySqlParser.KW_GRANT); + this.state = 5380; + this.match(MySqlParser.KW_PROXY); + this.state = 5381; + this.match(MySqlParser.KW_ON); + this.state = 5382; + localContext._fromFirst = this.userName(); + this.state = 5383; + this.match(MySqlParser.KW_TO); + this.state = 5384; + localContext._toFirst = this.userName(); + this.state = 5389; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5385; + this.match(MySqlParser.COMMA); + this.state = 5386; + localContext._userName = this.userName(); + localContext._toOther.push(localContext._userName); + } + } + this.state = 5391; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5395; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 777, this.context)) { + case 1: + { + this.state = 5392; + this.match(MySqlParser.KW_WITH); + this.state = 5393; + this.match(MySqlParser.KW_GRANT); + this.state = 5394; + this.match(MySqlParser.KW_OPTION); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterResourceGroup() { + let localContext = new AlterResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 466, MySqlParser.RULE_alterResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5397; + this.match(MySqlParser.KW_ALTER); + this.state = 5398; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5399; + this.match(MySqlParser.KW_GROUP); + this.state = 5400; + this.groupName(); + this.state = 5406; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 190) { + { + this.state = 5401; + this.match(MySqlParser.KW_VCPU); + this.state = 5403; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5402; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5405; + this.resourceGroupVcpuSpec(); + } + } + this.state = 5413; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 837) { + { + this.state = 5408; + this.match(MySqlParser.KW_THREAD_PRIORITY); + this.state = 5410; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5409; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5412; + this.decimalLiteral(); + } + } + this.state = 5419; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 5415; + _la = this.tokenStream.LA(1); + if (!(_la === 368 || _la === 375)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5417; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 66) { + { + this.state = 5416; + this.match(MySqlParser.KW_FORCE); + } + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createResourceGroup() { + let localContext = new CreateResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 468, MySqlParser.RULE_createResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5421; + this.match(MySqlParser.KW_CREATE); + this.state = 5422; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5423; + this.match(MySqlParser.KW_GROUP); + this.state = 5424; + this.groupNameCreate(); + this.state = 5425; + this.match(MySqlParser.KW_TYPE); + this.state = 5426; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 5427; + _la = this.tokenStream.LA(1); + if (!(_la === 678 || _la === 835)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5433; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 190) { + { + this.state = 5428; + this.match(MySqlParser.KW_VCPU); + this.state = 5430; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5429; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5432; + this.resourceGroupVcpuSpec(); + } + } + this.state = 5440; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 837) { + { + this.state = 5435; + this.match(MySqlParser.KW_THREAD_PRIORITY); + this.state = 5437; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 5436; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 5439; + this.decimalLiteral(); + } + } + this.state = 5443; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 368 || _la === 375) { + { + this.state = 5442; + _la = this.tokenStream.LA(1); + if (!(_la === 368 || _la === 375)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dropResourceGroup() { + let localContext = new DropResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 470, MySqlParser.RULE_dropResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5445; + this.match(MySqlParser.KW_DROP); + this.state = 5446; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5447; + this.match(MySqlParser.KW_GROUP); + this.state = 5448; + this.groupName(); + this.state = 5450; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 66) { + { + this.state = 5449; + this.match(MySqlParser.KW_FORCE); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setResourceGroup() { + let localContext = new SetResourceGroupContext(this.context, this.state); + this.enterRule(localContext, 472, MySqlParser.RULE_setResourceGroup); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5452; + this.match(MySqlParser.KW_SET); + this.state = 5453; + this.match(MySqlParser.KW_RESOURCE); + this.state = 5454; + this.match(MySqlParser.KW_GROUP); + this.state = 5455; + this.groupName(); + this.state = 5465; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 5456; + this.match(MySqlParser.KW_FOR); + this.state = 5457; + this.decimalLiteral(); + this.state = 5462; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5458; + this.match(MySqlParser.COMMA); + this.state = 5459; + this.decimalLiteral(); + } + } + this.state = 5464; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resourceGroupVcpuSpec() { + let localContext = new ResourceGroupVcpuSpecContext(this.context, this.state); + this.enterRule(localContext, 474, MySqlParser.RULE_resourceGroupVcpuSpec); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5472; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 792, this.context)) { + case 1: + { + this.state = 5467; + this.decimalLiteral(); + } + break; + case 2: + { + this.state = 5468; + this.decimalLiteral(); + this.state = 5469; + this.match(MySqlParser.MINUS); + this.state = 5470; + this.decimalLiteral(); + } + break; + } + this.state = 5478; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 793, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 5474; + this.match(MySqlParser.COMMA); + this.state = 5475; + this.resourceGroupVcpuSpec(); + } + } + } + this.state = 5480; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 793, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameUser() { + let localContext = new RenameUserContext(this.context, this.state); + this.enterRule(localContext, 476, MySqlParser.RULE_renameUser); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5481; + this.match(MySqlParser.KW_RENAME); + this.state = 5482; + this.match(MySqlParser.KW_USER); + this.state = 5483; + this.renameUserClause(); + this.state = 5488; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5484; + this.match(MySqlParser.COMMA); + this.state = 5485; + this.renameUserClause(); + } + } + this.state = 5490; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + revokeStatement() { + let localContext = new RevokeStatementContext(this.context, this.state); + this.enterRule(localContext, 478, MySqlParser.RULE_revokeStatement); + let _la; + try { + this.state = 5543; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 805, this.context)) { + case 1: + localContext = new DetailRevokeContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5491; + this.match(MySqlParser.KW_REVOKE); + this.state = 5493; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5492; + this.ifExists(); + } + } + this.state = 5495; + this.privelegeClause(); + this.state = 5500; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 5496; + this.match(MySqlParser.COMMA); + this.state = 5497; + this.privelegeClause(); + } + } + this.state = 5502; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 5503; + this.match(MySqlParser.KW_ON); + this.state = 5505; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 797, this.context)) { + case 1: + { + this.state = 5504; + this.privilegeObjectType(); + } + break; + } + this.state = 5507; + this.privilegeLevel(); + this.state = 5508; + this.match(MySqlParser.KW_FROM); + this.state = 5509; + this.userOrRoleNames(); + this.state = 5511; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 5510; + this.ignoreUnknownUser(); + } + } + } + break; + case 2: + localContext = new ShortRevokeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5513; + this.match(MySqlParser.KW_REVOKE); + this.state = 5515; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 78) { + { + this.state = 5514; + this.ifExists(); + } + } + this.state = 5517; + this.match(MySqlParser.KW_ALL); + this.state = 5519; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 734) { + { + this.state = 5518; + this.match(MySqlParser.KW_PRIVILEGES); + } + } + this.state = 5521; + this.match(MySqlParser.COMMA); + this.state = 5522; + this.match(MySqlParser.KW_GRANT); + this.state = 5523; + this.match(MySqlParser.KW_OPTION); + this.state = 5524; + this.match(MySqlParser.KW_FROM); + this.state = 5525; + this.userOrRoleNames(); + this.state = 5527; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 5526; + this.ignoreUnknownUser(); + } + } + } + break; + case 3: + localContext = new ProxyAndRoleRevokeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5529; + this.match(MySqlParser.KW_REVOKE); + this.state = 5531; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 802, this.context)) { + case 1: + { + this.state = 5530; + this.ifExists(); + } + break; + } + this.state = 5535; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 803, this.context)) { + case 1: + { + this.state = 5533; + this.match(MySqlParser.KW_PROXY); + this.state = 5534; + this.match(MySqlParser.KW_ON); + } + break; + } + this.state = 5537; + this.userOrRoleNames(); + this.state = 5538; + this.match(MySqlParser.KW_FROM); + this.state = 5539; + this.userOrRoleNames(); + this.state = 5541; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 5540; + this.ignoreUnknownUser(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ignoreUnknownUser() { + let localContext = new IgnoreUnknownUserContext(this.context, this.state); + this.enterRule(localContext, 480, MySqlParser.RULE_ignoreUnknownUser); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5545; + this.match(MySqlParser.KW_IGNORE); + this.state = 5546; + this.match(MySqlParser.KW_UNKNOWN); + this.state = 5547; + this.match(MySqlParser.KW_USER); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilegeObjectType() { + let localContext = new PrivilegeObjectTypeContext(this.context, this.state); + this.enterRule(localContext, 482, MySqlParser.RULE_privilegeObjectType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5549; + _la = this.tokenStream.LA(1); + if (!(_la === 132 || _la === 173 || _la === 409)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setPasswordStatement() { + let localContext = new SetPasswordStatementContext(this.context, this.state); + this.enterRule(localContext, 484, MySqlParser.RULE_setPasswordStatement); + let _la; + try { + this.state = 5583; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 812, this.context)) { + case 1: + localContext = new V57Context(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5551; + this.match(MySqlParser.KW_SET); + this.state = 5552; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5555; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 5553; + this.match(MySqlParser.KW_FOR); + this.state = 5554; + this.userName(); + } + } + this.state = 5557; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 5560; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_PASSWORD: + { + this.state = 5558; + this.passwordFunctionClause(); + } + break; + case MySqlParser.STRING_LITERAL: + { + this.state = 5559; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + localContext = new V80Context(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5562; + this.match(MySqlParser.KW_SET); + this.state = 5563; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5566; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 5564; + this.match(MySqlParser.KW_FOR); + this.state = 5565; + this.userName(); + } + } + this.state = 5572; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TO: + { + this.state = 5568; + this.match(MySqlParser.KW_TO); + this.state = 5569; + this.match(MySqlParser.KW_RANDOM); + } + break; + case MySqlParser.EQUAL_SYMBOL: + { + this.state = 5570; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 5571; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5576; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 810, this.context)) { + case 1: + { + this.state = 5574; + this.match(MySqlParser.KW_REPLACE); + this.state = 5575; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + this.state = 5581; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 147) { + { + this.state = 5578; + this.match(MySqlParser.KW_RETAIN); + this.state = 5579; + this.match(MySqlParser.KW_CURRENT); + this.state = 5580; + this.match(MySqlParser.KW_PASSWORD); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userSpecification() { + let localContext = new UserSpecificationContext(this.context, this.state); + this.enterRule(localContext, 486, MySqlParser.RULE_userSpecification); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5585; + this.userName(); + this.state = 5586; + this.userPasswordOption(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + alterUserAuthOption() { + let localContext = new AlterUserAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 488, MySqlParser.RULE_alterUserAuthOption); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 5588; + this.userName(); + this.state = 5614; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 815, this.context)) { + case 1: + { + this.state = 5589; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5590; + this.match(MySqlParser.KW_BY); + this.state = 5591; + this.match(MySqlParser.STRING_LITERAL); + this.state = 5592; + this.authOptionClause(); + } + break; + case 2: + { + this.state = 5593; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5594; + this.match(MySqlParser.KW_BY); + this.state = 5595; + this.match(MySqlParser.KW_RANDOM); + this.state = 5596; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5597; + this.authOptionClause(); + } + break; + case 3: + { + this.state = 5598; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5599; + this.match(MySqlParser.KW_WITH); + this.state = 5600; + this.authenticationRule(); + } + break; + case 4: + { + this.state = 5601; + this.match(MySqlParser.KW_DISCARD); + this.state = 5602; + this.match(MySqlParser.KW_OLD); + this.state = 5603; + this.match(MySqlParser.KW_PASSWORD); + } + break; + case 5: + { + this.state = 5609; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 5604; + _la = this.tokenStream.LA(1); + if (!(_la === 6 || _la === 51 || _la === 492)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5605; + this.factor(); + this.state = 5607; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 423) { + { + this.state = 5606; + this.factorAuthOption(); + } + } + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5611; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 814, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + case 6: + { + this.state = 5613; + this.registrationOption(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createUserAuthOption() { + let localContext = new CreateUserAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 490, MySqlParser.RULE_createUserAuthOption); + let _la; + try { + this.state = 5652; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 822, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5616; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5617; + this.match(MySqlParser.KW_BY); + this.state = 5623; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5618; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + { + this.state = 5619; + this.match(MySqlParser.KW_RANDOM); + this.state = 5620; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + case MySqlParser.KW_PASSWORD: + { + { + this.state = 5621; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5622; + this.match(MySqlParser.STRING_LITERAL); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5627; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5625; + this.match(MySqlParser.KW_AND); + this.state = 5626; + this.createUserAuthOption(); + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5629; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5630; + this.match(MySqlParser.KW_WITH); + this.state = 5631; + localContext._authPlugin = this.uid(); + this.state = 5640; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BY: + { + { + this.state = 5632; + this.match(MySqlParser.KW_BY); + this.state = 5636; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5633; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + { + this.state = 5634; + this.match(MySqlParser.KW_RANDOM); + this.state = 5635; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + break; + case MySqlParser.KW_AS: + { + this.state = 5638; + this.match(MySqlParser.KW_AS); + this.state = 5639; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_AND: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_REQUIRE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + this.state = 5644; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 11) { + { + this.state = 5642; + this.match(MySqlParser.KW_AND); + this.state = 5643; + this.createUserAuthOption(); + } + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5646; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5647; + this.match(MySqlParser.KW_WITH); + this.state = 5648; + localContext._authPlugin = this.uid(); + this.state = 5650; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 427) { + { + this.state = 5649; + this.createUserInitialAuthOption(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createUserInitialAuthOption() { + let localContext = new CreateUserInitialAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 492, MySqlParser.RULE_createUserInitialAuthOption); + try { + this.state = 5671; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 824, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5654; + this.match(MySqlParser.KW_INITIAL); + this.state = 5655; + this.match(MySqlParser.KW_AUTHENTICATION); + this.state = 5656; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5657; + this.match(MySqlParser.KW_BY); + this.state = 5661; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_RANDOM: + { + { + this.state = 5658; + this.match(MySqlParser.KW_RANDOM); + this.state = 5659; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + case MySqlParser.STRING_LITERAL: + { + this.state = 5660; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5663; + this.match(MySqlParser.KW_INITIAL); + this.state = 5664; + this.match(MySqlParser.KW_AUTHENTICATION); + this.state = 5665; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5666; + this.match(MySqlParser.KW_WITH); + this.state = 5667; + localContext._authPlugin = this.uid(); + this.state = 5668; + this.match(MySqlParser.KW_AS); + this.state = 5669; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userAuthOption() { + let localContext = new UserAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 494, MySqlParser.RULE_userAuthOption); + try { + this.state = 5698; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 825, this.context)) { + case 1: + localContext = new HashAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5673; + this.userName(); + this.state = 5674; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5675; + this.match(MySqlParser.KW_BY); + this.state = 5676; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5677; + localContext._hashed = this.match(MySqlParser.STRING_LITERAL); + } + break; + case 2: + localContext = new RandomAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5679; + this.userName(); + this.state = 5680; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5681; + this.match(MySqlParser.KW_BY); + this.state = 5682; + this.match(MySqlParser.KW_RANDOM); + this.state = 5683; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5684; + this.authOptionClause(); + } + break; + case 3: + localContext = new StringAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5686; + this.userName(); + this.state = 5687; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5688; + this.match(MySqlParser.KW_BY); + this.state = 5689; + this.match(MySqlParser.STRING_LITERAL); + this.state = 5690; + this.authOptionClause(); + } + break; + case 4: + localContext = new ModuleAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 5692; + this.userName(); + this.state = 5693; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5694; + this.match(MySqlParser.KW_WITH); + this.state = 5695; + this.authenticationRule(); + } + break; + case 5: + localContext = new SimpleAuthOptionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 5697; + this.userName(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + authOptionClause() { + let localContext = new AuthOptionClauseContext(this.context, this.state); + this.enterRule(localContext, 496, MySqlParser.RULE_authOptionClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5702; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 826, this.context)) { + case 1: + { + this.state = 5700; + this.match(MySqlParser.KW_REPLACE); + this.state = 5701; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + this.state = 5707; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 147) { + { + this.state = 5704; + this.match(MySqlParser.KW_RETAIN); + this.state = 5705; + this.match(MySqlParser.KW_CURRENT); + this.state = 5706; + this.match(MySqlParser.KW_PASSWORD); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + authenticationRule() { + let localContext = new AuthenticationRuleContext(this.context, this.state); + this.enterRule(localContext, 498, MySqlParser.RULE_authenticationRule); + let _la; + try { + this.state = 5723; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 830, this.context)) { + case 1: + localContext = new ModuleContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5709; + localContext._authPlugin = this.uid(); + this.state = 5717; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 829, this.context)) { + case 1: + { + this.state = 5710; + _la = this.tokenStream.LA(1); + if (!(_la === 13 || _la === 20 || _la === 188)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5714; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5711; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + this.state = 5712; + this.match(MySqlParser.KW_RANDOM); + this.state = 5713; + this.match(MySqlParser.KW_PASSWORD); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 5716; + this.authOptionClause(); + } + break; + } + } + break; + case 2: + localContext = new PasswordModuleOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5719; + localContext._authPlugin = this.uid(); + this.state = 5720; + this.match(MySqlParser.KW_USING); + this.state = 5721; + this.passwordFunctionClause(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tlsOption() { + let localContext = new TlsOptionContext(this.context, this.state); + this.enterRule(localContext, 500, MySqlParser.RULE_tlsOption); + try { + this.state = 5733; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SSL: + this.enterOuterAlt(localContext, 1); + { + this.state = 5725; + this.match(MySqlParser.KW_SSL); + } + break; + case MySqlParser.KW_X509: + this.enterOuterAlt(localContext, 2); + { + this.state = 5726; + this.match(MySqlParser.KW_X509); + } + break; + case MySqlParser.KW_CIPHER: + this.enterOuterAlt(localContext, 3); + { + this.state = 5727; + this.match(MySqlParser.KW_CIPHER); + this.state = 5728; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_ISSUER: + this.enterOuterAlt(localContext, 4); + { + this.state = 5729; + this.match(MySqlParser.KW_ISSUER); + this.state = 5730; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_SUBJECT: + this.enterOuterAlt(localContext, 5); + { + this.state = 5731; + this.match(MySqlParser.KW_SUBJECT); + this.state = 5732; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userResourceOption() { + let localContext = new UserResourceOptionContext(this.context, this.state); + this.enterRule(localContext, 502, MySqlParser.RULE_userResourceOption); + try { + this.state = 5743; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + this.enterOuterAlt(localContext, 1); + { + this.state = 5735; + this.match(MySqlParser.KW_MAX_QUERIES_PER_HOUR); + this.state = 5736; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + this.enterOuterAlt(localContext, 2); + { + this.state = 5737; + this.match(MySqlParser.KW_MAX_UPDATES_PER_HOUR); + this.state = 5738; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + this.enterOuterAlt(localContext, 3); + { + this.state = 5739; + this.match(MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR); + this.state = 5740; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_MAX_USER_CONNECTIONS: + this.enterOuterAlt(localContext, 4); + { + this.state = 5741; + this.match(MySqlParser.KW_MAX_USER_CONNECTIONS); + this.state = 5742; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userPasswordOption() { + let localContext = new UserPasswordOptionContext(this.context, this.state); + this.enterRule(localContext, 504, MySqlParser.RULE_userPasswordOption); + let _la; + try { + this.state = 5783; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 838, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5745; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5746; + this.match(MySqlParser.KW_EXPIRE); + this.state = 5753; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 5747; + localContext._expireType = this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.KW_NEVER: + { + this.state = 5748; + localContext._expireType = this.match(MySqlParser.KW_NEVER); + } + break; + case MySqlParser.KW_INTERVAL: + { + this.state = 5749; + localContext._expireType = this.match(MySqlParser.KW_INTERVAL); + this.state = 5750; + this.decimalLiteral(); + this.state = 5751; + this.match(MySqlParser.KW_DAY); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + case MySqlParser.SEMI: + break; + default: + break; + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5755; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5756; + this.match(MySqlParser.KW_HISTORY); + this.state = 5759; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 5757; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5758; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5761; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5762; + this.match(MySqlParser.KW_REUSE); + this.state = 5763; + this.match(MySqlParser.KW_INTERVAL); + this.state = 5768; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DEFAULT: + { + this.state = 5764; + this.match(MySqlParser.KW_DEFAULT); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5765; + this.decimalLiteral(); + this.state = 5766; + this.match(MySqlParser.KW_DAY); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5770; + this.match(MySqlParser.KW_PASSWORD); + this.state = 5771; + this.match(MySqlParser.KW_REQUIRE); + this.state = 5772; + this.match(MySqlParser.KW_CURRENT); + this.state = 5774; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42 || _la === 122) { + { + this.state = 5773; + _la = this.tokenStream.LA(1); + if (!(_la === 42 || _la === 122)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 5776; + this.match(MySqlParser.KW_FAILED_LOGIN_ATTEMPTS); + this.state = 5777; + this.decimalLiteral(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 5778; + this.match(MySqlParser.KW_PASSWORD_LOCK_TIME); + this.state = 5781; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 5779; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_UNBOUNDED: + { + this.state = 5780; + this.match(MySqlParser.KW_UNBOUNDED); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userLockOption() { + let localContext = new UserLockOptionContext(this.context, this.state); + this.enterRule(localContext, 506, MySqlParser.RULE_userLockOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5785; + this.match(MySqlParser.KW_ACCOUNT); + this.state = 5786; + localContext._lockType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 104 || _la === 183)) { + localContext._lockType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + factorAuthOption() { + let localContext = new FactorAuthOptionContext(this.context, this.state); + this.enterRule(localContext, 508, MySqlParser.RULE_factorAuthOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5788; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 5791; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 194) { + { + this.state = 5789; + this.match(MySqlParser.KW_WITH); + this.state = 5790; + localContext._authPlugin = this.uid(); + } + } + this.state = 5801; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BY: + { + { + this.state = 5793; + this.match(MySqlParser.KW_BY); + this.state = 5797; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + { + this.state = 5794; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_RANDOM: + { + { + this.state = 5795; + this.match(MySqlParser.KW_RANDOM); + this.state = 5796; + this.match(MySqlParser.KW_PASSWORD); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + break; + case MySqlParser.KW_AS: + { + this.state = 5799; + this.match(MySqlParser.KW_AS); + this.state = 5800; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + registrationOption() { + let localContext = new RegistrationOptionContext(this.context, this.state); + this.enterRule(localContext, 510, MySqlParser.RULE_registrationOption); + try { + this.state = 5818; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 842, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5803; + this.factor(); + this.state = 5804; + this.match(MySqlParser.KW_INITIATE); + this.state = 5805; + this.match(MySqlParser.KW_REGISTRATION); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5807; + this.factor(); + this.state = 5808; + this.match(MySqlParser.KW_FINISH); + this.state = 5809; + this.match(MySqlParser.KW_REGISTRATION); + this.state = 5810; + this.match(MySqlParser.KW_SET); + this.state = 5811; + this.match(MySqlParser.KW_CHALLENGE_RESPONSE); + this.state = 5812; + this.match(MySqlParser.KW_AS); + this.state = 5813; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5815; + this.factor(); + this.state = 5816; + this.match(MySqlParser.KW_UNREGISTER); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + factor() { + let localContext = new FactorContext(this.context, this.state); + this.enterRule(localContext, 512, MySqlParser.RULE_factor); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5820; + _la = this.tokenStream.LA(1); + if (!(_la === 873 || _la === 874)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 5821; + this.match(MySqlParser.KW_FACTOR); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privelegeClause() { + let localContext = new PrivelegeClauseContext(this.context, this.state); + this.enterRule(localContext, 514, MySqlParser.RULE_privelegeClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5823; + this.privilege(); + this.state = 5828; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 5824; + this.match(MySqlParser.LR_BRACKET); + this.state = 5825; + this.columnNames(); + this.state = 5826; + this.match(MySqlParser.RR_BRACKET); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilege() { + let localContext = new PrivilegeContext(this.context, this.state); + this.enterRule(localContext, 516, MySqlParser.RULE_privilege); + let _la; + try { + this.state = 5923; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 848, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5830; + this.match(MySqlParser.KW_ALL); + this.state = 5832; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 734) { + { + this.state = 5831; + this.match(MySqlParser.KW_PRIVILEGES); + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5834; + this.match(MySqlParser.KW_ALTER); + this.state = 5836; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 743) { + { + this.state = 5835; + this.match(MySqlParser.KW_ROUTINE); + } + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5838; + this.match(MySqlParser.KW_CREATE); + this.state = 5846; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_TEMPORARY: + { + this.state = 5839; + this.match(MySqlParser.KW_TEMPORARY); + this.state = 5840; + this.match(MySqlParser.KW_TABLES); + } + break; + case MySqlParser.KW_ROUTINE: + { + this.state = 5841; + this.match(MySqlParser.KW_ROUTINE); + } + break; + case MySqlParser.KW_VIEW: + { + this.state = 5842; + this.match(MySqlParser.KW_VIEW); + } + break; + case MySqlParser.KW_USER: + { + this.state = 5843; + this.match(MySqlParser.KW_USER); + } + break; + case MySqlParser.KW_TABLESPACE: + { + this.state = 5844; + this.match(MySqlParser.KW_TABLESPACE); + } + break; + case MySqlParser.KW_ROLE: + { + this.state = 5845; + this.match(MySqlParser.KW_ROLE); + } + break; + case MySqlParser.KW_ON: + case MySqlParser.LR_BRACKET: + case MySqlParser.COMMA: + break; + default: + break; + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5848; + this.match(MySqlParser.KW_DELETE); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 5849; + this.match(MySqlParser.KW_DROP); + this.state = 5851; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 582) { + { + this.state = 5850; + this.match(MySqlParser.KW_ROLE); + } + } + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 5853; + this.match(MySqlParser.KW_EVENT); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 5854; + this.match(MySqlParser.KW_EXECUTE); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 5855; + this.match(MySqlParser.KW_FILE); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 5856; + this.match(MySqlParser.KW_GRANT); + this.state = 5857; + this.match(MySqlParser.KW_OPTION); + } + break; + case 10: + this.enterOuterAlt(localContext, 10); + { + this.state = 5858; + this.match(MySqlParser.KW_INDEX); + } + break; + case 11: + this.enterOuterAlt(localContext, 11); + { + this.state = 5859; + this.match(MySqlParser.KW_INSERT); + } + break; + case 12: + this.enterOuterAlt(localContext, 12); + { + this.state = 5860; + this.match(MySqlParser.KW_LOCK); + this.state = 5861; + this.match(MySqlParser.KW_TABLES); + } + break; + case 13: + this.enterOuterAlt(localContext, 13); + { + this.state = 5862; + this.match(MySqlParser.KW_PROCESS); + } + break; + case 14: + this.enterOuterAlt(localContext, 14); + { + this.state = 5863; + this.match(MySqlParser.KW_PROXY); + } + break; + case 15: + this.enterOuterAlt(localContext, 15); + { + this.state = 5864; + this.match(MySqlParser.KW_REFERENCES); + } + break; + case 16: + this.enterOuterAlt(localContext, 16); + { + this.state = 5865; + this.match(MySqlParser.KW_RELOAD); + } + break; + case 17: + this.enterOuterAlt(localContext, 17); + { + this.state = 5866; + this.match(MySqlParser.KW_REPLICATION); + this.state = 5867; + _la = this.tokenStream.LA(1); + if (!(_la === 333 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 18: + this.enterOuterAlt(localContext, 18); + { + this.state = 5868; + this.match(MySqlParser.KW_SELECT); + } + break; + case 19: + this.enterOuterAlt(localContext, 19); + { + this.state = 5869; + this.match(MySqlParser.KW_SHOW); + this.state = 5870; + _la = this.tokenStream.LA(1); + if (!(_la === 40 || _la === 684)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 20: + this.enterOuterAlt(localContext, 20); + { + this.state = 5871; + this.match(MySqlParser.KW_SHUTDOWN); + } + break; + case 21: + this.enterOuterAlt(localContext, 21); + { + this.state = 5872; + this.match(MySqlParser.KW_SUPER); + } + break; + case 22: + this.enterOuterAlt(localContext, 22); + { + this.state = 5873; + this.match(MySqlParser.KW_TRIGGER); + } + break; + case 23: + this.enterOuterAlt(localContext, 23); + { + this.state = 5874; + this.match(MySqlParser.KW_UPDATE); + } + break; + case 24: + this.enterOuterAlt(localContext, 24); + { + this.state = 5875; + this.match(MySqlParser.KW_USAGE); + } + break; + case 25: + this.enterOuterAlt(localContext, 25); + { + this.state = 5876; + this.match(MySqlParser.KW_APPLICATION_PASSWORD_ADMIN); + } + break; + case 26: + this.enterOuterAlt(localContext, 26); + { + this.state = 5877; + this.match(MySqlParser.KW_AUDIT_ABORT_EXEMPT); + } + break; + case 27: + this.enterOuterAlt(localContext, 27); + { + this.state = 5878; + this.match(MySqlParser.KW_AUDIT_ADMIN); + } + break; + case 28: + this.enterOuterAlt(localContext, 28); + { + this.state = 5879; + this.match(MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN); + } + break; + case 29: + this.enterOuterAlt(localContext, 29); + { + this.state = 5880; + this.match(MySqlParser.KW_BACKUP_ADMIN); + } + break; + case 30: + this.enterOuterAlt(localContext, 30); + { + this.state = 5881; + this.match(MySqlParser.KW_BINLOG_ADMIN); + } + break; + case 31: + this.enterOuterAlt(localContext, 31); + { + this.state = 5882; + this.match(MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN); + } + break; + case 32: + this.enterOuterAlt(localContext, 32); + { + this.state = 5883; + this.match(MySqlParser.KW_CLONE_ADMIN); + } + break; + case 33: + this.enterOuterAlt(localContext, 33); + { + this.state = 5884; + this.match(MySqlParser.KW_CONNECTION_ADMIN); + } + break; + case 34: + this.enterOuterAlt(localContext, 34); + { + this.state = 5885; + this.match(MySqlParser.KW_ENCRYPTION_KEY_ADMIN); + } + break; + case 35: + this.enterOuterAlt(localContext, 35); + { + this.state = 5886; + this.match(MySqlParser.KW_FIREWALL_ADMIN); + } + break; + case 36: + this.enterOuterAlt(localContext, 36); + { + this.state = 5887; + this.match(MySqlParser.KW_FIREWALL_EXEMPT); + } + break; + case 37: + this.enterOuterAlt(localContext, 37); + { + this.state = 5888; + this.match(MySqlParser.KW_FIREWALL_USER); + } + break; + case 38: + this.enterOuterAlt(localContext, 38); + { + this.state = 5889; + this.match(MySqlParser.KW_FLUSH_OPTIMIZER_COSTS); + } + break; + case 39: + this.enterOuterAlt(localContext, 39); + { + this.state = 5890; + this.match(MySqlParser.KW_FLUSH_STATUS); + } + break; + case 40: + this.enterOuterAlt(localContext, 40); + { + this.state = 5891; + this.match(MySqlParser.KW_FLUSH_TABLES); + } + break; + case 41: + this.enterOuterAlt(localContext, 41); + { + this.state = 5892; + this.match(MySqlParser.KW_FLUSH_USER_RESOURCES); + } + break; + case 42: + this.enterOuterAlt(localContext, 42); + { + this.state = 5893; + this.match(MySqlParser.KW_GROUP_REPLICATION_ADMIN); + } + break; + case 43: + this.enterOuterAlt(localContext, 43); + { + this.state = 5894; + this.match(MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE); + } + break; + case 44: + this.enterOuterAlt(localContext, 44); + { + this.state = 5895; + this.match(MySqlParser.KW_INNODB_REDO_LOG_ENABLE); + } + break; + case 45: + this.enterOuterAlt(localContext, 45); + { + this.state = 5896; + this.match(MySqlParser.KW_NDB_STORED_USER); + } + break; + case 46: + this.enterOuterAlt(localContext, 46); + { + this.state = 5897; + this.match(MySqlParser.KW_PASSWORDLESS_USER_ADMIN); + } + break; + case 47: + this.enterOuterAlt(localContext, 47); + { + this.state = 5898; + this.match(MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN); + } + break; + case 48: + this.enterOuterAlt(localContext, 48); + { + this.state = 5899; + this.match(MySqlParser.KW_REPLICATION_APPLIER); + } + break; + case 49: + this.enterOuterAlt(localContext, 49); + { + this.state = 5900; + this.match(MySqlParser.KW_REPLICATION_SLAVE_ADMIN); + } + break; + case 50: + this.enterOuterAlt(localContext, 50); + { + this.state = 5901; + this.match(MySqlParser.KW_RESOURCE_GROUP_ADMIN); + } + break; + case 51: + this.enterOuterAlt(localContext, 51); + { + this.state = 5902; + this.match(MySqlParser.KW_RESOURCE_GROUP_USER); + } + break; + case 52: + this.enterOuterAlt(localContext, 52); + { + this.state = 5903; + this.match(MySqlParser.KW_ROLE_ADMIN); + } + break; + case 53: + this.enterOuterAlt(localContext, 53); + { + this.state = 5904; + this.match(MySqlParser.KW_SERVICE_CONNECTION_ADMIN); + } + break; + case 54: + this.enterOuterAlt(localContext, 54); + { + this.state = 5905; + this.match(MySqlParser.KW_SESSION_VARIABLES_ADMIN); + } + break; + case 55: + this.enterOuterAlt(localContext, 55); + { + this.state = 5906; + this.match(MySqlParser.KW_SET_USER_ID); + } + break; + case 56: + this.enterOuterAlt(localContext, 56); + { + this.state = 5907; + this.match(MySqlParser.KW_SKIP_QUERY_REWRITE); + } + break; + case 57: + this.enterOuterAlt(localContext, 57); + { + this.state = 5908; + this.match(MySqlParser.KW_SHOW_ROUTINE); + } + break; + case 58: + this.enterOuterAlt(localContext, 58); + { + this.state = 5909; + this.match(MySqlParser.KW_SYSTEM_USER); + } + break; + case 59: + this.enterOuterAlt(localContext, 59); + { + this.state = 5910; + this.match(MySqlParser.KW_SYSTEM_VARIABLES_ADMIN); + } + break; + case 60: + this.enterOuterAlt(localContext, 60); + { + this.state = 5911; + this.match(MySqlParser.KW_TABLE_ENCRYPTION_ADMIN); + } + break; + case 61: + this.enterOuterAlt(localContext, 61); + { + this.state = 5912; + this.match(MySqlParser.KW_TP_CONNECTION_ADMIN); + } + break; + case 62: + this.enterOuterAlt(localContext, 62); + { + this.state = 5913; + this.match(MySqlParser.KW_VERSION_TOKEN_ADMIN); + } + break; + case 63: + this.enterOuterAlt(localContext, 63); + { + this.state = 5914; + this.match(MySqlParser.KW_XA_RECOVER_ADMIN); + } + break; + case 64: + this.enterOuterAlt(localContext, 64); + { + this.state = 5915; + this.match(MySqlParser.KW_LOAD); + this.state = 5916; + this.match(MySqlParser.KW_FROM); + this.state = 5917; + this.match(MySqlParser.KW_S3); + } + break; + case 65: + this.enterOuterAlt(localContext, 65); + { + this.state = 5918; + this.match(MySqlParser.KW_SELECT); + this.state = 5919; + this.match(MySqlParser.KW_INTO); + this.state = 5920; + this.match(MySqlParser.KW_S3); + } + break; + case 66: + this.enterOuterAlt(localContext, 66); + { + this.state = 5921; + this.match(MySqlParser.KW_INVOKE); + this.state = 5922; + this.match(MySqlParser.KW_LAMBDA); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilegeLevel() { + let localContext = new PrivilegeLevelContext(this.context, this.state); + this.enterRule(localContext, 518, MySqlParser.RULE_privilegeLevel); + try { + this.state = 5941; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 849, this.context)) { + case 1: + localContext = new CurrentSchemaPriviLevelContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 5925; + this.match(MySqlParser.STAR); + } + break; + case 2: + localContext = new GlobalPrivLevelContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 5926; + this.match(MySqlParser.STAR); + this.state = 5927; + this.match(MySqlParser.DOT); + this.state = 5928; + this.match(MySqlParser.STAR); + } + break; + case 3: + localContext = new DefiniteSchemaPrivLevelContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 5929; + this.uid(); + this.state = 5930; + this.match(MySqlParser.DOT); + this.state = 5931; + this.match(MySqlParser.STAR); + } + break; + case 4: + localContext = new DefiniteFullTablePrivLevelContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 5933; + this.uid(); + this.state = 5934; + this.match(MySqlParser.DOT); + this.state = 5935; + this.uid(); + } + break; + case 5: + localContext = new DefiniteFullTablePrivLevel2Context(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 5937; + this.uid(); + this.state = 5938; + this.dottedId(); + } + break; + case 6: + localContext = new DefiniteTablePrivLevelContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 5940; + this.uid(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + renameUserClause() { + let localContext = new RenameUserClauseContext(this.context, this.state); + this.enterRule(localContext, 520, MySqlParser.RULE_renameUserClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5943; + localContext._fromFirst = this.userName(); + this.state = 5944; + this.match(MySqlParser.KW_TO); + this.state = 5945; + localContext._toFirst = this.userName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + analyzeTable() { + let localContext = new AnalyzeTableContext(this.context, this.state); + this.enterRule(localContext, 522, MySqlParser.RULE_analyzeTable); + let _la; + try { + this.state = 5995; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 856, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 5947; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5949; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5948; + this.tableActionOption(); + } + } + this.state = 5951; + this.match(MySqlParser.KW_TABLE); + this.state = 5952; + this.tableNames(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 5953; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5955; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5954; + this.tableActionOption(); + } + } + this.state = 5957; + this.match(MySqlParser.KW_TABLE); + this.state = 5958; + this.tableName(); + this.state = 5959; + this.match(MySqlParser.KW_UPDATE); + this.state = 5960; + this.match(MySqlParser.KW_HISTOGRAM); + this.state = 5961; + this.match(MySqlParser.KW_ON); + this.state = 5962; + this.columnNames(); + this.state = 5967; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 852, this.context)) { + case 1: + { + this.state = 5963; + this.match(MySqlParser.KW_WITH); + this.state = 5964; + this.decimalLiteral(); + this.state = 5965; + this.match(MySqlParser.KW_BUCKETS); + } + break; + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 5969; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5971; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5970; + this.tableActionOption(); + } + } + this.state = 5973; + this.match(MySqlParser.KW_TABLE); + this.state = 5974; + this.tableName(); + this.state = 5975; + this.match(MySqlParser.KW_UPDATE); + this.state = 5976; + this.match(MySqlParser.KW_HISTOGRAM); + this.state = 5977; + this.match(MySqlParser.KW_ON); + this.state = 5978; + this.columnName(); + this.state = 5982; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 5979; + this.match(MySqlParser.KW_USING); + this.state = 5980; + this.match(MySqlParser.KW_DATA); + this.state = 5981; + this.match(MySqlParser.STRING_LITERAL); + } + } + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 5984; + this.match(MySqlParser.KW_ANALYZE); + this.state = 5986; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 5985; + this.tableActionOption(); + } + } + this.state = 5988; + this.match(MySqlParser.KW_TABLE); + this.state = 5989; + this.tableName(); + this.state = 5990; + this.match(MySqlParser.KW_DROP); + this.state = 5991; + this.match(MySqlParser.KW_HISTOGRAM); + this.state = 5992; + this.match(MySqlParser.KW_ON); + this.state = 5993; + this.columnNames(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checkTable() { + let localContext = new CheckTableContext(this.context, this.state); + this.enterRule(localContext, 524, MySqlParser.RULE_checkTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 5997; + this.match(MySqlParser.KW_CHECK); + this.state = 5998; + this.match(MySqlParser.KW_TABLE); + this.state = 5999; + this.tableNames(); + this.state = 6003; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 65 || _la === 327 || _la === 392 || _la === 396 || _la === 484 || _la === 549) { + { + { + this.state = 6000; + this.checkTableOption(); + } + } + this.state = 6005; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checksumTable() { + let localContext = new ChecksumTableContext(this.context, this.state); + this.enterRule(localContext, 526, MySqlParser.RULE_checksumTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6006; + this.match(MySqlParser.KW_CHECKSUM); + this.state = 6007; + this.match(MySqlParser.KW_TABLE); + this.state = 6008; + this.tableNames(); + this.state = 6010; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392 || _la === 549) { + { + this.state = 6009; + localContext._actionOption = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 392 || _la === 549)) { + localContext._actionOption = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + optimizeTable() { + let localContext = new OptimizeTableContext(this.context, this.state); + this.enterRule(localContext, 528, MySqlParser.RULE_optimizeTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6012; + this.match(MySqlParser.KW_OPTIMIZE); + this.state = 6014; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 6013; + this.tableActionOption(); + } + } + this.state = 6016; + _la = this.tokenStream.LA(1); + if (!(_la === 173 || _la === 752)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6017; + this.tableNames(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + repairTable() { + let localContext = new RepairTableContext(this.context, this.state); + this.enterRule(localContext, 530, MySqlParser.RULE_repairTable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6019; + this.match(MySqlParser.KW_REPAIR); + this.state = 6021; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 6020; + this.tableActionOption(); + } + } + this.state = 6023; + this.match(MySqlParser.KW_TABLE); + this.state = 6024; + this.tableNames(); + this.state = 6026; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 549) { + { + this.state = 6025; + this.match(MySqlParser.KW_QUICK); + } + } + this.state = 6029; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6028; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6032; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 679) { + { + this.state = 6031; + this.match(MySqlParser.KW_USE_FRM); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableActionOption() { + let localContext = new TableActionOptionContext(this.context, this.state); + this.enterRule(localContext, 532, MySqlParser.RULE_tableActionOption); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6034; + _la = this.tokenStream.LA(1); + if (!(_la === 115 || _la === 450)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + checkTableOption() { + let localContext = new CheckTableOptionContext(this.context, this.state); + this.enterRule(localContext, 534, MySqlParser.RULE_checkTableOption); + try { + this.state = 6043; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_FOR: + this.enterOuterAlt(localContext, 1); + { + this.state = 6036; + this.match(MySqlParser.KW_FOR); + this.state = 6037; + this.match(MySqlParser.KW_UPGRADE); + } + break; + case MySqlParser.KW_QUICK: + this.enterOuterAlt(localContext, 2); + { + this.state = 6038; + this.match(MySqlParser.KW_QUICK); + } + break; + case MySqlParser.KW_FAST: + this.enterOuterAlt(localContext, 3); + { + this.state = 6039; + this.match(MySqlParser.KW_FAST); + } + break; + case MySqlParser.KW_MEDIUM: + this.enterOuterAlt(localContext, 4); + { + this.state = 6040; + this.match(MySqlParser.KW_MEDIUM); + } + break; + case MySqlParser.KW_EXTENDED: + this.enterOuterAlt(localContext, 5); + { + this.state = 6041; + this.match(MySqlParser.KW_EXTENDED); + } + break; + case MySqlParser.KW_CHANGED: + this.enterOuterAlt(localContext, 6); + { + this.state = 6042; + this.match(MySqlParser.KW_CHANGED); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + createFunction() { + let localContext = new CreateFunctionContext(this.context, this.state); + this.enterRule(localContext, 536, MySqlParser.RULE_createFunction); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6045; + this.match(MySqlParser.KW_CREATE); + this.state = 6047; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 307) { + { + this.state = 6046; + this.match(MySqlParser.KW_AGGREGATE); + } + } + this.state = 6049; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6051; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 866, this.context)) { + case 1: + { + this.state = 6050; + this.ifNotExists(); + } + break; + } + this.state = 6053; + this.functionNameCreate(); + this.state = 6054; + this.match(MySqlParser.KW_RETURNS); + this.state = 6055; + localContext._returnType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 208)) & ~0x1F) === 0 && ((1 << (_la - 208)) & 261) !== 0) || _la === 649)) { + localContext._returnType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6056; + this.match(MySqlParser.KW_SONAME); + this.state = 6057; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + installComponent() { + let localContext = new InstallComponentContext(this.context, this.state); + this.enterRule(localContext, 538, MySqlParser.RULE_installComponent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6059; + this.match(MySqlParser.KW_INSTALL); + this.state = 6060; + this.match(MySqlParser.KW_COMPONENT); + this.state = 6061; + localContext._component_name = this.uid(); + this.state = 6066; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6062; + this.match(MySqlParser.COMMA); + this.state = 6063; + localContext._component_name = this.uid(); + } + } + this.state = 6068; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 6078; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 869, this.context)) { + case 1: + { + this.state = 6069; + this.match(MySqlParser.KW_SET); + this.state = 6070; + this.variableExpr(); + this.state = 6075; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6071; + this.match(MySqlParser.COMMA); + this.state = 6072; + this.variableExpr(); + } + } + this.state = 6077; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + variableExpr() { + let localContext = new VariableExprContext(this.context, this.state); + this.enterRule(localContext, 540, MySqlParser.RULE_variableExpr); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6080; + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 531 || _la === 893 || _la === 894)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6081; + localContext._system_var_name = this.fullId(); + this.state = 6082; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6083; + this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uninstallComponent() { + let localContext = new UninstallComponentContext(this.context, this.state); + this.enterRule(localContext, 542, MySqlParser.RULE_uninstallComponent); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6085; + this.match(MySqlParser.KW_UNINSTALL); + this.state = 6086; + this.match(MySqlParser.KW_COMPONENT); + this.state = 6087; + localContext._component_name = this.uid(); + this.state = 6092; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6088; + this.match(MySqlParser.COMMA); + this.state = 6089; + localContext._component_name = this.uid(); + } + } + this.state = 6094; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + installPlugin() { + let localContext = new InstallPluginContext(this.context, this.state); + this.enterRule(localContext, 544, MySqlParser.RULE_installPlugin); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6095; + this.match(MySqlParser.KW_INSTALL); + this.state = 6096; + this.match(MySqlParser.KW_PLUGIN); + this.state = 6097; + localContext._pluginName = this.uid(); + this.state = 6098; + this.match(MySqlParser.KW_SONAME); + this.state = 6099; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uninstallPlugin() { + let localContext = new UninstallPluginContext(this.context, this.state); + this.enterRule(localContext, 546, MySqlParser.RULE_uninstallPlugin); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6101; + this.match(MySqlParser.KW_UNINSTALL); + this.state = 6102; + this.match(MySqlParser.KW_PLUGIN); + this.state = 6103; + localContext._pluginName = this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + cloneStatement() { + let localContext = new CloneStatementContext(this.context, this.state); + this.enterRule(localContext, 548, MySqlParser.RULE_cloneStatement); + let _la; + try { + this.state = 6135; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 876, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6105; + this.match(MySqlParser.KW_CLONE); + this.state = 6106; + this.match(MySqlParser.KW_LOCAL); + this.state = 6107; + this.match(MySqlParser.KW_DATA); + this.state = 6108; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 6110; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 6109; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 6112; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6113; + this.match(MySqlParser.KW_CLONE); + this.state = 6114; + this.match(MySqlParser.KW_INSTANCE); + this.state = 6115; + this.match(MySqlParser.KW_FROM); + this.state = 6116; + this.userHostPort(); + this.state = 6117; + this.match(MySqlParser.KW_IDENTIFIED); + this.state = 6118; + this.match(MySqlParser.KW_BY); + this.state = 6119; + this.match(MySqlParser.STRING_LITERAL); + this.state = 6126; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 360) { + { + this.state = 6120; + this.match(MySqlParser.KW_DATA); + this.state = 6121; + this.match(MySqlParser.KW_DIRECTORY); + this.state = 6123; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 857) { + { + this.state = 6122; + this.match(MySqlParser.EQUAL_SYMBOL); + } + } + this.state = 6125; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 6133; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 144) { + { + this.state = 6128; + this.match(MySqlParser.KW_REQUIRE); + this.state = 6130; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 502) { + { + this.state = 6129; + this.match(MySqlParser.KW_NO); + } + } + this.state = 6132; + this.match(MySqlParser.KW_SSL); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + setStatement() { + let localContext = new SetStatementContext(this.context, this.state); + this.enterRule(localContext, 550, MySqlParser.RULE_setStatement); + let _la; + try { + this.state = 6189; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 884, this.context)) { + case 1: + localContext = new SetVariableContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6137; + this.match(MySqlParser.KW_SET); + this.state = 6138; + this.variableClause(); + this.state = 6139; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6142; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 877, this.context)) { + case 1: + { + this.state = 6140; + this.expression(0); + } + break; + case 2: + { + this.state = 6141; + this.match(MySqlParser.KW_ON); + } + break; + } + this.state = 6153; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6144; + this.match(MySqlParser.COMMA); + this.state = 6145; + this.variableClause(); + this.state = 6146; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6149; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 878, this.context)) { + case 1: + { + this.state = 6147; + this.expression(0); + } + break; + case 2: + { + this.state = 6148; + this.match(MySqlParser.KW_ON); + } + break; + } + } + } + this.state = 6155; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + localContext = new SetCharsetContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6156; + this.match(MySqlParser.KW_SET); + this.state = 6157; + this.charSet(); + this.state = 6160; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 6158; + this.charsetName(); + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 6159; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 3: + localContext = new SetNamesContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 6162; + this.match(MySqlParser.KW_SET); + this.state = 6163; + this.match(MySqlParser.KW_NAMES); + this.state = 6170; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + { + this.state = 6164; + this.charsetName(); + this.state = 6167; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 28) { + { + this.state = 6165; + this.match(MySqlParser.KW_COLLATE); + this.state = 6166; + this.collationName(); + } + } + } + break; + case MySqlParser.KW_DEFAULT: + { + this.state = 6169; + this.match(MySqlParser.KW_DEFAULT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 4: + localContext = new SetPasswordContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 6172; + this.setPasswordStatement(); + } + break; + case 5: + localContext = new SetTransactionContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 6173; + this.setTransactionStatement(); + } + break; + case 6: + localContext = new SetAutocommitContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 6174; + this.setAutocommitStatement(); + } + break; + case 7: + localContext = new SetNewValueInsideTriggerContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 6175; + this.match(MySqlParser.KW_SET); + this.state = 6176; + localContext._system_var_name = this.fullId(); + this.state = 6177; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6178; + this.expression(0); + this.state = 6186; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6179; + this.match(MySqlParser.COMMA); + this.state = 6180; + localContext._system_var_name = this.fullId(); + this.state = 6181; + _la = this.tokenStream.LA(1); + if (!(_la === 841 || _la === 857)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6182; + this.expression(0); + } + } + this.state = 6188; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showStatement() { + let localContext = new ShowStatementContext(this.context, this.state); + this.enterRule(localContext, 552, MySqlParser.RULE_showStatement); + let _la; + try { + this.state = 6375; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 913, this.context)) { + case 1: + localContext = new ShowMasterLogsContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6191; + this.match(MySqlParser.KW_SHOW); + this.state = 6192; + localContext._logFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 228 || _la === 453)) { + localContext._logFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6193; + this.match(MySqlParser.KW_LOGS); + } + break; + case 2: + localContext = new ShowLogEventsContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6194; + this.match(MySqlParser.KW_SHOW); + this.state = 6195; + localContext._logFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 318 || _la === 559)) { + localContext._logFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6196; + this.match(MySqlParser.KW_EVENTS); + this.state = 6199; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 80) { + { + this.state = 6197; + this.match(MySqlParser.KW_IN); + this.state = 6198; + localContext._filename = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 6203; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68) { + { + this.state = 6201; + this.match(MySqlParser.KW_FROM); + this.state = 6202; + localContext._fromPosition = this.decimalLiteral(); + } + } + this.state = 6212; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 6205; + this.match(MySqlParser.KW_LIMIT); + this.state = 6209; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 887, this.context)) { + case 1: + { + this.state = 6206; + localContext._offset = this.decimalLiteral(); + this.state = 6207; + this.match(MySqlParser.COMMA); + } + break; + } + this.state = 6211; + localContext._rowCount = this.decimalLiteral(); + } + } + this.state = 6215; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6214; + this.channelOption(); + } + } + } + break; + case 3: + localContext = new ShowObjectFilterContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 6217; + this.match(MySqlParser.KW_SHOW); + this.state = 6218; + this.showCommonEntity(); + this.state = 6220; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6219; + this.showFilter(); + } + } + } + break; + case 4: + localContext = new ShowColumnsContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 6222; + this.match(MySqlParser.KW_SHOW); + this.state = 6224; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6223; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6227; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 408) { + { + this.state = 6226; + this.match(MySqlParser.KW_FULL); + } + } + this.state = 6229; + localContext._columnsFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 337 || _la === 398)) { + localContext._columnsFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6230; + localContext._tableFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._tableFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6231; + this.tableName(); + this.state = 6234; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6232; + localContext._schemaFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._schemaFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6233; + this.databaseName(); + } + } + this.state = 6237; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6236; + this.showFilter(); + } + } + } + break; + case 5: + localContext = new ShowCreateDbContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 6239; + this.match(MySqlParser.KW_SHOW); + this.state = 6240; + this.match(MySqlParser.KW_CREATE); + this.state = 6241; + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 152)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6243; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 895, this.context)) { + case 1: + { + this.state = 6242; + this.ifNotExists(); + } + break; + } + this.state = 6245; + this.databaseName(); + } + break; + case 6: + localContext = new ShowCreateFullIdObjectContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 6246; + this.match(MySqlParser.KW_SHOW); + this.state = 6247; + this.match(MySqlParser.KW_CREATE); + this.state = 6248; + _la = this.tokenStream.LA(1); + if (!(_la === 132 || _la === 178 || _la === 385)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6249; + this.fullId(); + } + break; + case 7: + localContext = new ShowCreateFunctionContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 6250; + this.match(MySqlParser.KW_SHOW); + this.state = 6251; + this.match(MySqlParser.KW_CREATE); + this.state = 6252; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6253; + this.functionName(); + } + break; + case 8: + localContext = new ShowCreateViewContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 6254; + this.match(MySqlParser.KW_SHOW); + this.state = 6255; + this.match(MySqlParser.KW_CREATE); + this.state = 6256; + this.match(MySqlParser.KW_VIEW); + this.state = 6257; + this.viewName(); + } + break; + case 9: + localContext = new ShowCreateTableContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 6258; + this.match(MySqlParser.KW_SHOW); + this.state = 6259; + this.match(MySqlParser.KW_CREATE); + this.state = 6260; + this.match(MySqlParser.KW_TABLE); + this.state = 6261; + this.tableName(); + } + break; + case 10: + localContext = new ShowCreateUserContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 6262; + this.match(MySqlParser.KW_SHOW); + this.state = 6263; + this.match(MySqlParser.KW_CREATE); + this.state = 6264; + this.match(MySqlParser.KW_USER); + this.state = 6265; + this.userName(); + } + break; + case 11: + localContext = new ShowEngineContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 6266; + this.match(MySqlParser.KW_SHOW); + this.state = 6267; + this.match(MySqlParser.KW_ENGINE); + this.state = 6268; + this.engineName(); + this.state = 6269; + localContext._engineOption = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 493 || _la === 645)) { + localContext._engineOption = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 12: + localContext = new ShowGlobalInfoContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 6271; + this.match(MySqlParser.KW_SHOW); + this.state = 6272; + this.showGlobalInfoClause(); + } + break; + case 13: + localContext = new ShowErrorsContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 6273; + this.match(MySqlParser.KW_SHOW); + this.state = 6274; + localContext._errorFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 383 || _la === 688)) { + localContext._errorFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6282; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 6275; + this.match(MySqlParser.KW_LIMIT); + this.state = 6279; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 896, this.context)) { + case 1: + { + this.state = 6276; + localContext._offset = this.decimalLiteral(); + this.state = 6277; + this.match(MySqlParser.COMMA); + } + break; + } + this.state = 6281; + localContext._rowCount = this.decimalLiteral(); + } + } + } + break; + case 14: + localContext = new ShowCountErrorsContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 6284; + this.match(MySqlParser.KW_SHOW); + this.state = 6285; + this.match(MySqlParser.KW_COUNT); + this.state = 6286; + this.match(MySqlParser.LR_BRACKET); + this.state = 6287; + this.match(MySqlParser.STAR); + this.state = 6288; + this.match(MySqlParser.RR_BRACKET); + this.state = 6289; + localContext._errorFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 383 || _la === 688)) { + localContext._errorFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 15: + localContext = new ShowSchemaFilterContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 6290; + this.match(MySqlParser.KW_SHOW); + this.state = 6291; + this.showSchemaEntity(); + this.state = 6294; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6292; + localContext._schemaFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._schemaFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6293; + this.databaseName(); + } + } + this.state = 6297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6296; + this.showFilter(); + } + } + } + break; + case 16: + localContext = new ShowPercedureCodeContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 6299; + this.match(MySqlParser.KW_SHOW); + this.state = 6300; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 6301; + this.match(MySqlParser.KW_CODE); + this.state = 6302; + localContext._proc_name = this.fullId(); + } + break; + case 17: + localContext = new ShowFunctionCodeContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 6303; + this.match(MySqlParser.KW_SHOW); + this.state = 6304; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6305; + this.match(MySqlParser.KW_CODE); + this.state = 6306; + this.functionName(); + } + break; + case 18: + localContext = new ShowGrantsContext(localContext); + this.enterOuterAlt(localContext, 18); + { + this.state = 6307; + this.match(MySqlParser.KW_SHOW); + this.state = 6308; + this.match(MySqlParser.KW_GRANTS); + this.state = 6315; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6309; + this.match(MySqlParser.KW_FOR); + this.state = 6310; + this.userOrRoleName(); + this.state = 6313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 6311; + this.match(MySqlParser.KW_USING); + this.state = 6312; + this.userOrRoleNames(); + } + } + } + } + } + break; + case 19: + localContext = new ShowIndexesContext(localContext); + this.enterOuterAlt(localContext, 19); + { + this.state = 6317; + this.match(MySqlParser.KW_SHOW); + this.state = 6319; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6318; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6321; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 93 || _la === 426)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6322; + localContext._tableFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._tableFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6323; + this.tableName(); + this.state = 6326; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6324; + localContext._schemaFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + localContext._schemaFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6325; + this.databaseName(); + } + } + this.state = 6330; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 192) { + { + this.state = 6328; + this.match(MySqlParser.KW_WHERE); + this.state = 6329; + this.expression(0); + } + } + } + break; + case 20: + localContext = new ShowOpenTablesContext(localContext); + this.enterOuterAlt(localContext, 20); + { + this.state = 6332; + this.match(MySqlParser.KW_SHOW); + this.state = 6333; + this.match(MySqlParser.KW_OPEN); + this.state = 6334; + this.match(MySqlParser.KW_TABLES); + this.state = 6337; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 68 || _la === 80) { + { + this.state = 6335; + _la = this.tokenStream.LA(1); + if (!(_la === 68 || _la === 80)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6336; + this.databaseName(); + } + } + this.state = 6340; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 99 || _la === 192) { + { + this.state = 6339; + this.showFilter(); + } + } + } + break; + case 21: + localContext = new ShowProfileContext(localContext); + this.enterOuterAlt(localContext, 21); + { + this.state = 6342; + this.match(MySqlParser.KW_SHOW); + this.state = 6343; + this.match(MySqlParser.KW_PROFILE); + this.state = 6352; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7 || _la === 320 || _la === 355 || _la === 358 || _la === 439 || _la === 521 || _la === 605 || _la === 655 || _la === 802) { + { + this.state = 6344; + this.showProfileType(); + this.state = 6349; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6345; + this.match(MySqlParser.COMMA); + this.state = 6346; + this.showProfileType(); + } + } + this.state = 6351; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 6357; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6354; + this.match(MySqlParser.KW_FOR); + this.state = 6355; + this.match(MySqlParser.KW_QUERY); + this.state = 6356; + localContext._queryCount = this.decimalLiteral(); + } + } + this.state = 6365; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 100) { + { + this.state = 6359; + this.match(MySqlParser.KW_LIMIT); + this.state = 6360; + localContext._rowCount = this.decimalLiteral(); + this.state = 6363; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 509) { + { + this.state = 6361; + this.match(MySqlParser.KW_OFFSET); + this.state = 6362; + localContext._offset = this.decimalLiteral(); + } + } + } + } + } + break; + case 22: + localContext = new ShowSlaveStatusContext(localContext); + this.enterOuterAlt(localContext, 22); + { + this.state = 6367; + this.match(MySqlParser.KW_SHOW); + this.state = 6368; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6369; + this.match(MySqlParser.KW_STATUS); + this.state = 6371; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6370; + this.channelOption(); + } + } + } + break; + case 23: + localContext = new ShowReplicasContext(localContext); + this.enterOuterAlt(localContext, 23); + { + this.state = 6373; + this.match(MySqlParser.KW_SHOW); + this.state = 6374; + this.match(MySqlParser.KW_REPLICAS); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + variableClause() { + let localContext = new VariableClauseContext(this.context, this.state); + this.enterRule(localContext, 554, MySqlParser.RULE_variableClause); + let _la; + try { + this.state = 6387; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LOCAL_ID: + this.enterOuterAlt(localContext, 1); + { + this.state = 6377; + this.match(MySqlParser.LOCAL_ID); + } + break; + case MySqlParser.GLOBAL_ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 6378; + this.match(MySqlParser.GLOBAL_ID); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PERSIST: + case MySqlParser.KW_PERSIST_ONLY: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.AT_SIGN: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 3); + { + this.state = 6384; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 915, this.context)) { + case 1: + { + this.state = 6381; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 870) { + { + this.state = 6379; + this.match(MySqlParser.AT_SIGN); + this.state = 6380; + this.match(MySqlParser.AT_SIGN); + } + } + this.state = 6383; + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 450 || _la === 531 || _la === 532 || _la === 593)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 6386; + localContext._target = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showCommonEntity() { + let localContext = new ShowCommonEntityContext(this.context, this.state); + this.enterRule(localContext, 556, MySqlParser.RULE_showCommonEntity); + let _la; + try { + this.state = 6403; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CHARACTER: + this.enterOuterAlt(localContext, 1); + { + this.state = 6389; + this.match(MySqlParser.KW_CHARACTER); + this.state = 6390; + this.match(MySqlParser.KW_SET); + } + break; + case MySqlParser.KW_CHARSET: + this.enterOuterAlt(localContext, 2); + { + this.state = 6391; + this.match(MySqlParser.KW_CHARSET); + } + break; + case MySqlParser.KW_COLLATION: + this.enterOuterAlt(localContext, 3); + { + this.state = 6392; + this.match(MySqlParser.KW_COLLATION); + } + break; + case MySqlParser.KW_DATABASES: + this.enterOuterAlt(localContext, 4); + { + this.state = 6393; + this.match(MySqlParser.KW_DATABASES); + } + break; + case MySqlParser.KW_SCHEMAS: + this.enterOuterAlt(localContext, 5); + { + this.state = 6394; + this.match(MySqlParser.KW_SCHEMAS); + } + break; + case MySqlParser.KW_FUNCTION: + this.enterOuterAlt(localContext, 6); + { + this.state = 6395; + this.match(MySqlParser.KW_FUNCTION); + this.state = 6396; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_PROCEDURE: + this.enterOuterAlt(localContext, 7); + { + this.state = 6397; + this.match(MySqlParser.KW_PROCEDURE); + this.state = 6398; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_VARIABLES: + this.enterOuterAlt(localContext, 8); + { + this.state = 6400; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 413 || _la === 593) { + { + this.state = 6399; + _la = this.tokenStream.LA(1); + if (!(_la === 413 || _la === 593)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6402; + _la = this.tokenStream.LA(1); + if (!(_la === 645 || _la === 683)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showFilter() { + let localContext = new ShowFilterContext(this.context, this.state); + this.enterRule(localContext, 558, MySqlParser.RULE_showFilter); + try { + this.state = 6409; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_LIKE: + this.enterOuterAlt(localContext, 1); + { + this.state = 6405; + this.match(MySqlParser.KW_LIKE); + this.state = 6406; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.KW_WHERE: + this.enterOuterAlt(localContext, 2); + { + this.state = 6407; + this.match(MySqlParser.KW_WHERE); + this.state = 6408; + this.expression(0); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showGlobalInfoClause() { + let localContext = new ShowGlobalInfoClauseContext(this.context, this.state); + this.enterRule(localContext, 560, MySqlParser.RULE_showGlobalInfoClause); + let _la; + try { + this.state = 6428; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_STORAGE: + this.enterOuterAlt(localContext, 1); + { + this.state = 6412; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 647) { + { + this.state = 6411; + this.match(MySqlParser.KW_STORAGE); + } + } + this.state = 6414; + this.match(MySqlParser.KW_ENGINES); + } + break; + case MySqlParser.KW_MASTER: + this.enterOuterAlt(localContext, 2); + { + this.state = 6415; + this.match(MySqlParser.KW_MASTER); + this.state = 6416; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_PLUGINS: + this.enterOuterAlt(localContext, 3); + { + this.state = 6417; + this.match(MySqlParser.KW_PLUGINS); + } + break; + case MySqlParser.KW_PRIVILEGES: + this.enterOuterAlt(localContext, 4); + { + this.state = 6418; + this.match(MySqlParser.KW_PRIVILEGES); + } + break; + case MySqlParser.KW_FULL: + case MySqlParser.KW_PROCESSLIST: + this.enterOuterAlt(localContext, 5); + { + this.state = 6420; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 408) { + { + this.state = 6419; + this.match(MySqlParser.KW_FULL); + } + } + this.state = 6422; + this.match(MySqlParser.KW_PROCESSLIST); + } + break; + case MySqlParser.KW_PROFILES: + this.enterOuterAlt(localContext, 6); + { + this.state = 6423; + this.match(MySqlParser.KW_PROFILES); + } + break; + case MySqlParser.KW_SLAVE: + this.enterOuterAlt(localContext, 7); + { + this.state = 6424; + this.match(MySqlParser.KW_SLAVE); + this.state = 6425; + this.match(MySqlParser.KW_HOSTS); + } + break; + case MySqlParser.KW_AUTHORS: + this.enterOuterAlt(localContext, 8); + { + this.state = 6426; + this.match(MySqlParser.KW_AUTHORS); + } + break; + case MySqlParser.KW_CONTRIBUTORS: + this.enterOuterAlt(localContext, 9); + { + this.state = 6427; + this.match(MySqlParser.KW_CONTRIBUTORS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showSchemaEntity() { + let localContext = new ShowSchemaEntityContext(this.context, this.state); + this.enterRule(localContext, 562, MySqlParser.RULE_showSchemaEntity); + let _la; + try { + this.state = 6441; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_EVENTS: + this.enterOuterAlt(localContext, 1); + { + this.state = 6430; + this.match(MySqlParser.KW_EVENTS); + } + break; + case MySqlParser.KW_TABLE: + this.enterOuterAlt(localContext, 2); + { + this.state = 6431; + this.match(MySqlParser.KW_TABLE); + this.state = 6432; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_FULL: + case MySqlParser.KW_TABLES: + this.enterOuterAlt(localContext, 3); + { + this.state = 6434; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 392) { + { + this.state = 6433; + this.match(MySqlParser.KW_EXTENDED); + } + } + this.state = 6437; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 408) { + { + this.state = 6436; + this.match(MySqlParser.KW_FULL); + } + } + this.state = 6439; + this.match(MySqlParser.KW_TABLES); + } + break; + case MySqlParser.KW_TRIGGERS: + this.enterOuterAlt(localContext, 4); + { + this.state = 6440; + this.match(MySqlParser.KW_TRIGGERS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + showProfileType() { + let localContext = new ShowProfileTypeContext(this.context, this.state); + this.enterRule(localContext, 564, MySqlParser.RULE_showProfileType); + try { + this.state = 6455; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ALL: + this.enterOuterAlt(localContext, 1); + { + this.state = 6443; + this.match(MySqlParser.KW_ALL); + } + break; + case MySqlParser.KW_BLOCK: + this.enterOuterAlt(localContext, 2); + { + this.state = 6444; + this.match(MySqlParser.KW_BLOCK); + this.state = 6445; + this.match(MySqlParser.KW_IO); + } + break; + case MySqlParser.KW_CONTEXT: + this.enterOuterAlt(localContext, 3); + { + this.state = 6446; + this.match(MySqlParser.KW_CONTEXT); + this.state = 6447; + this.match(MySqlParser.KW_SWITCHES); + } + break; + case MySqlParser.KW_CPU: + this.enterOuterAlt(localContext, 4); + { + this.state = 6448; + this.match(MySqlParser.KW_CPU); + } + break; + case MySqlParser.KW_IPC: + this.enterOuterAlt(localContext, 5); + { + this.state = 6449; + this.match(MySqlParser.KW_IPC); + } + break; + case MySqlParser.KW_MEMORY: + this.enterOuterAlt(localContext, 6); + { + this.state = 6450; + this.match(MySqlParser.KW_MEMORY); + } + break; + case MySqlParser.KW_PAGE: + this.enterOuterAlt(localContext, 7); + { + this.state = 6451; + this.match(MySqlParser.KW_PAGE); + this.state = 6452; + this.match(MySqlParser.KW_FAULTS); + } + break; + case MySqlParser.KW_SOURCE: + this.enterOuterAlt(localContext, 8); + { + this.state = 6453; + this.match(MySqlParser.KW_SOURCE); + } + break; + case MySqlParser.KW_SWAPS: + this.enterOuterAlt(localContext, 9); + { + this.state = 6454; + this.match(MySqlParser.KW_SWAPS); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + binlogStatement() { + let localContext = new BinlogStatementContext(this.context, this.state); + this.enterRule(localContext, 566, MySqlParser.RULE_binlogStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6457; + this.match(MySqlParser.KW_BINLOG); + this.state = 6458; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + cacheIndexStatement() { + let localContext = new CacheIndexStatementContext(this.context, this.state); + this.enterRule(localContext, 568, MySqlParser.RULE_cacheIndexStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6460; + this.match(MySqlParser.KW_CACHE); + this.state = 6461; + this.match(MySqlParser.KW_INDEX); + this.state = 6479; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 929, this.context)) { + case 1: + { + this.state = 6462; + this.tableIndex(); + this.state = 6467; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6463; + this.match(MySqlParser.COMMA); + this.state = 6464; + this.tableIndex(); + } + } + this.state = 6469; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + { + this.state = 6470; + this.tableName(); + this.state = 6471; + this.match(MySqlParser.KW_PARTITION); + this.state = 6472; + this.match(MySqlParser.LR_BRACKET); + this.state = 6475; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 6473; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 6474; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6477; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 6481; + this.match(MySqlParser.KW_IN); + this.state = 6482; + this.databaseName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + flushStatement() { + let localContext = new FlushStatementContext(this.context, this.state); + this.enterRule(localContext, 570, MySqlParser.RULE_flushStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6484; + this.match(MySqlParser.KW_FLUSH); + this.state = 6486; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 115 || _la === 450) { + { + this.state = 6485; + this.tableActionOption(); + } + } + this.state = 6488; + this.flushOption(); + this.state = 6493; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6489; + this.match(MySqlParser.COMMA); + this.state = 6490; + this.flushOption(); + } + } + this.state = 6495; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + killStatement() { + let localContext = new KillStatementContext(this.context, this.state); + this.enterRule(localContext, 572, MySqlParser.RULE_killStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6496; + this.match(MySqlParser.KW_KILL); + this.state = 6498; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 932, this.context)) { + case 1: + { + this.state = 6497; + localContext._connectionFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 349 || _la === 548)) { + localContext._connectionFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 6500; + this.expression(0); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadIndexIntoCache() { + let localContext = new LoadIndexIntoCacheContext(this.context, this.state); + this.enterRule(localContext, 574, MySqlParser.RULE_loadIndexIntoCache); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6502; + this.match(MySqlParser.KW_LOAD); + this.state = 6503; + this.match(MySqlParser.KW_INDEX); + this.state = 6504; + this.match(MySqlParser.KW_INTO); + this.state = 6505; + this.match(MySqlParser.KW_CACHE); + this.state = 6506; + this.loadedTableIndexes(); + this.state = 6511; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6507; + this.match(MySqlParser.COMMA); + this.state = 6508; + this.loadedTableIndexes(); + } + } + this.state = 6513; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetStatement() { + let localContext = new ResetStatementContext(this.context, this.state); + this.enterRule(localContext, 576, MySqlParser.RULE_resetStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6514; + this.match(MySqlParser.KW_RESET); + this.state = 6515; + this.resetOption(); + this.state = 6520; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6516; + this.match(MySqlParser.COMMA); + this.state = 6517; + this.resetOption(); + } + } + this.state = 6522; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetOption() { + let localContext = new ResetOptionContext(this.context, this.state); + this.enterRule(localContext, 578, MySqlParser.RULE_resetOption); + try { + this.state = 6528; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_MASTER: + this.enterOuterAlt(localContext, 1); + { + this.state = 6523; + this.match(MySqlParser.KW_MASTER); + } + break; + case MySqlParser.KW_REPLICA: + this.enterOuterAlt(localContext, 2); + { + this.state = 6524; + this.match(MySqlParser.KW_REPLICA); + } + break; + case MySqlParser.KW_QUERY: + this.enterOuterAlt(localContext, 3); + { + this.state = 6525; + this.match(MySqlParser.KW_QUERY); + this.state = 6526; + this.match(MySqlParser.KW_CACHE); + } + break; + case MySqlParser.KW_SLAVE: + this.enterOuterAlt(localContext, 4); + { + this.state = 6527; + this.match(MySqlParser.KW_SLAVE); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetPersist() { + let localContext = new ResetPersistContext(this.context, this.state); + this.enterRule(localContext, 580, MySqlParser.RULE_resetPersist); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6530; + this.match(MySqlParser.KW_RESET); + this.state = 6531; + this.match(MySqlParser.KW_PERSIST); + this.state = 6536; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 937, this.context)) { + case 1: + { + this.state = 6533; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 936, this.context)) { + case 1: + { + this.state = 6532; + this.ifExists(); + } + break; + } + this.state = 6535; + localContext._system_var_name = this.uid(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resetAllChannel() { + let localContext = new ResetAllChannelContext(this.context, this.state); + this.enterRule(localContext, 582, MySqlParser.RULE_resetAllChannel); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6538; + this.match(MySqlParser.KW_RESET); + this.state = 6539; + _la = this.tokenStream.LA(1); + if (!(_la === 563 || _la === 598)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6541; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 7) { + { + this.state = 6540; + this.match(MySqlParser.KW_ALL); + } + } + this.state = 6544; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6543; + this.channelOption(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + reStartStatement() { + let localContext = new ReStartStatementContext(this.context, this.state); + this.enterRule(localContext, 584, MySqlParser.RULE_reStartStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6546; + this.match(MySqlParser.KW_RESTART); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + shutdownStatement() { + let localContext = new ShutdownStatementContext(this.context, this.state); + this.enterRule(localContext, 586, MySqlParser.RULE_shutdownStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6548; + this.match(MySqlParser.KW_SHUTDOWN); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableIndex() { + let localContext = new TableIndexContext(this.context, this.state); + this.enterRule(localContext, 588, MySqlParser.RULE_tableIndex); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6550; + this.tableName(); + this.state = 6556; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 6551; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6552; + this.match(MySqlParser.LR_BRACKET); + this.state = 6553; + this.indexNames(); + this.state = 6554; + this.match(MySqlParser.RR_BRACKET); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + flushOption() { + let localContext = new FlushOptionContext(this.context, this.state); + this.enterRule(localContext, 590, MySqlParser.RULE_flushOption); + let _la; + try { + this.state = 6590; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 947, this.context)) { + case 1: + localContext = new SimpleFlushOptionContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6576; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DES_KEY_FILE: + { + this.state = 6558; + this.match(MySqlParser.KW_DES_KEY_FILE); + } + break; + case MySqlParser.KW_HOSTS: + { + this.state = 6559; + this.match(MySqlParser.KW_HOSTS); + } + break; + case MySqlParser.KW_BINARY: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_SLOW: + { + this.state = 6561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228 || ((((_la - 380)) & ~0x1F) === 0 && ((1 << (_la - 380)) & 1073741829) !== 0) || _la === 556 || _la === 599) { + { + this.state = 6560; + _la = this.tokenStream.LA(1); + if (!(_la === 228 || ((((_la - 380)) & ~0x1F) === 0 && ((1 << (_la - 380)) & 1073741829) !== 0) || _la === 556 || _la === 599)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6563; + this.match(MySqlParser.KW_LOGS); + } + break; + case MySqlParser.KW_OPTIMIZER_COSTS: + { + this.state = 6564; + this.match(MySqlParser.KW_OPTIMIZER_COSTS); + } + break; + case MySqlParser.KW_PRIVILEGES: + { + this.state = 6565; + this.match(MySqlParser.KW_PRIVILEGES); + } + break; + case MySqlParser.KW_QUERY: + { + this.state = 6566; + this.match(MySqlParser.KW_QUERY); + this.state = 6567; + this.match(MySqlParser.KW_CACHE); + } + break; + case MySqlParser.KW_STATUS: + { + this.state = 6568; + this.match(MySqlParser.KW_STATUS); + } + break; + case MySqlParser.KW_USER_RESOURCES: + { + this.state = 6569; + this.match(MySqlParser.KW_USER_RESOURCES); + } + break; + case MySqlParser.KW_TABLES: + { + this.state = 6570; + this.match(MySqlParser.KW_TABLES); + this.state = 6574; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 942, this.context)) { + case 1: + { + this.state = 6571; + this.match(MySqlParser.KW_WITH); + this.state = 6572; + this.match(MySqlParser.KW_READ); + this.state = 6573; + this.match(MySqlParser.KW_LOCK); + } + break; + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case 2: + localContext = new ChannelFlushOptionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6578; + this.match(MySqlParser.KW_RELAY); + this.state = 6579; + this.match(MySqlParser.KW_LOGS); + this.state = 6581; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 6580; + this.channelOption(); + } + } + } + break; + case 3: + localContext = new TableFlushOptionContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 6583; + _la = this.tokenStream.LA(1); + if (!(_la === 173 || _la === 752)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6585; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 945, this.context)) { + case 1: + { + this.state = 6584; + this.tableNames(); + } + break; + } + this.state = 6588; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 946, this.context)) { + case 1: + { + this.state = 6587; + this.flushTableOption(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + flushTableOption() { + let localContext = new FlushTableOptionContext(this.context, this.state); + this.enterRule(localContext, 592, MySqlParser.RULE_flushTableOption); + try { + this.state = 6597; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_WITH: + this.enterOuterAlt(localContext, 1); + { + this.state = 6592; + this.match(MySqlParser.KW_WITH); + this.state = 6593; + this.match(MySqlParser.KW_READ); + this.state = 6594; + this.match(MySqlParser.KW_LOCK); + } + break; + case MySqlParser.KW_FOR: + this.enterOuterAlt(localContext, 2); + { + this.state = 6595; + this.match(MySqlParser.KW_FOR); + this.state = 6596; + this.match(MySqlParser.KW_EXPORT); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + loadedTableIndexes() { + let localContext = new LoadedTableIndexesContext(this.context, this.state); + this.enterRule(localContext, 594, MySqlParser.RULE_loadedTableIndexes); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6599; + this.tableName(); + this.state = 6607; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 6600; + this.match(MySqlParser.KW_PARTITION); + this.state = 6601; + this.match(MySqlParser.LR_BRACKET); + this.state = 6604; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 6602; + this.partitionNames(); + } + break; + case MySqlParser.KW_ALL: + { + this.state = 6603; + this.match(MySqlParser.KW_ALL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6606; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 6616; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 952, this.context)) { + case 1: + { + this.state = 6610; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 82 || _la === 92) { + { + this.state = 6609; + localContext._indexFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 82 || _la === 92)) { + localContext._indexFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6612; + this.match(MySqlParser.LR_BRACKET); + this.state = 6613; + this.indexNames(); + this.state = 6614; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + this.state = 6620; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 79) { + { + this.state = 6618; + this.match(MySqlParser.KW_IGNORE); + this.state = 6619; + this.match(MySqlParser.KW_LEAVES); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleDescribeStatement() { + let localContext = new SimpleDescribeStatementContext(this.context, this.state); + this.enterRule(localContext, 596, MySqlParser.RULE_simpleDescribeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6622; + localContext._command = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 45)) & ~0x1F) === 0 && ((1 << (_la - 45)) & 131075) !== 0))) { + localContext._command = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6623; + this.tableName(); + this.state = 6626; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 954, this.context)) { + case 1: + { + this.state = 6624; + localContext._column = this.columnName(); + } + break; + case 2: + { + this.state = 6625; + localContext._pattern = this.match(MySqlParser.STRING_LITERAL); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fullDescribeStatement() { + let localContext = new FullDescribeStatementContext(this.context, this.state); + this.enterRule(localContext, 598, MySqlParser.RULE_fullDescribeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6628; + localContext._command = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 45)) & ~0x1F) === 0 && ((1 << (_la - 45)) & 131075) !== 0))) { + localContext._command = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6634; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_EXTENDED: + { + this.state = 6629; + this.match(MySqlParser.KW_EXTENDED); + } + break; + case MySqlParser.KW_PARTITIONS: + { + this.state = 6630; + this.match(MySqlParser.KW_PARTITIONS); + } + break; + case MySqlParser.KW_FORMAT: + { + this.state = 6631; + this.match(MySqlParser.KW_FORMAT); + this.state = 6632; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6633; + _la = this.tokenStream.LA(1); + if (!(_la === 442 || _la === 663 || _la === 666)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_DELETE: + case MySqlParser.KW_FOR: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_UPDATE: + case MySqlParser.LR_BRACKET: + break; + default: + break; + } + this.state = 6636; + this.describeObjectClause(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + analyzeDescribeStatement() { + let localContext = new AnalyzeDescribeStatementContext(this.context, this.state); + this.enterRule(localContext, 600, MySqlParser.RULE_analyzeDescribeStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6638; + localContext._command = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 45)) & ~0x1F) === 0 && ((1 << (_la - 45)) & 131075) !== 0))) { + localContext._command = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6639; + this.match(MySqlParser.KW_ANALYZE); + this.state = 6643; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 826) { + { + this.state = 6640; + this.match(MySqlParser.KW_FORMAT); + this.state = 6641; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6642; + this.match(MySqlParser.KW_TREE); + } + } + this.state = 6645; + this.selectStatement(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + helpStatement() { + let localContext = new HelpStatementContext(this.context, this.state); + this.enterRule(localContext, 602, MySqlParser.RULE_helpStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6647; + this.match(MySqlParser.KW_HELP); + this.state = 6648; + this.match(MySqlParser.STRING_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + useStatement() { + let localContext = new UseStatementContext(this.context, this.state); + this.enterRule(localContext, 604, MySqlParser.RULE_useStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6650; + this.match(MySqlParser.KW_USE); + this.state = 6651; + this.databaseName(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + signalStatement() { + let localContext = new SignalStatementContext(this.context, this.state); + this.enterRule(localContext, 606, MySqlParser.RULE_signalStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6653; + this.match(MySqlParser.KW_SIGNAL); + this.state = 6661; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SQLSTATE: + { + { + this.state = 6654; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 6656; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 6655; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 6658; + this.stringLiteral(); + } + } + break; + case MySqlParser.ID: + { + this.state = 6659; + this.match(MySqlParser.ID); + } + break; + case MySqlParser.REVERSE_QUOTE_ID: + { + this.state = 6660; + this.match(MySqlParser.REVERSE_QUOTE_ID); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6672; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 960, this.context)) { + case 1: + { + this.state = 6663; + this.match(MySqlParser.KW_SET); + this.state = 6664; + this.signalConditionInformation(); + this.state = 6669; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6665; + this.match(MySqlParser.COMMA); + this.state = 6666; + this.signalConditionInformation(); + } + } + this.state = 6671; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + resignalStatement() { + let localContext = new ResignalStatementContext(this.context, this.state); + this.enterRule(localContext, 608, MySqlParser.RULE_resignalStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6674; + this.match(MySqlParser.KW_RESIGNAL); + this.state = 6682; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SQLSTATE: + { + { + this.state = 6675; + this.match(MySqlParser.KW_SQLSTATE); + this.state = 6677; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 682) { + { + this.state = 6676; + this.match(MySqlParser.KW_VALUE); + } + } + this.state = 6679; + this.stringLiteral(); + } + } + break; + case MySqlParser.ID: + { + this.state = 6680; + this.match(MySqlParser.ID); + } + break; + case MySqlParser.REVERSE_QUOTE_ID: + { + this.state = 6681; + this.match(MySqlParser.REVERSE_QUOTE_ID); + } + break; + case MySqlParser.EOF: + case MySqlParser.KW_ALTER: + case MySqlParser.KW_ANALYZE: + case MySqlParser.KW_CALL: + case MySqlParser.KW_CHANGE: + case MySqlParser.KW_CHECK: + case MySqlParser.KW_CREATE: + case MySqlParser.KW_DELETE: + case MySqlParser.KW_DESC: + case MySqlParser.KW_DESCRIBE: + case MySqlParser.KW_DROP: + case MySqlParser.KW_EXPLAIN: + case MySqlParser.KW_GET: + case MySqlParser.KW_GRANT: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_KILL: + case MySqlParser.KW_LOAD: + case MySqlParser.KW_LOCK: + case MySqlParser.KW_OPTIMIZE: + case MySqlParser.KW_PURGE: + case MySqlParser.KW_RELEASE: + case MySqlParser.KW_RENAME: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RESIGNAL: + case MySqlParser.KW_REVOKE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_SET: + case MySqlParser.KW_SHOW: + case MySqlParser.KW_SIGNAL: + case MySqlParser.KW_TABLE: + case MySqlParser.KW_UNLOCK: + case MySqlParser.KW_UPDATE: + case MySqlParser.KW_USE: + case MySqlParser.KW_VALUES: + case MySqlParser.KW_WITH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DO: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HELP: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESTART: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_START: + case MySqlParser.KW_STOP: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_XA: + case MySqlParser.KW_CLONE: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.LR_BRACKET: + case MySqlParser.SEMI: + break; + default: + break; + } + this.state = 6693; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 964, this.context)) { + case 1: + { + this.state = 6684; + this.match(MySqlParser.KW_SET); + this.state = 6685; + this.signalConditionInformation(); + this.state = 6690; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6686; + this.match(MySqlParser.COMMA); + this.state = 6687; + this.signalConditionInformation(); + } + } + this.state = 6692; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + signalConditionInformation() { + let localContext = new SignalConditionInformationContext(this.context, this.state); + this.enterRule(localContext, 610, MySqlParser.RULE_signalConditionInformation); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6695; + _la = this.tokenStream.LA(1); + if (!(((((_la - 332)) & ~0x1F) === 0 && ((1 << (_la - 332)) & 137887873) !== 0) || _la === 487 || _la === 495 || _la === 650 || _la === 657 || _la === 822 || _la === 832)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6696; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6701; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.START_NATIONAL_STRING_LITERAL: + case MySqlParser.STRING_LITERAL: + case MySqlParser.STRING_CHARSET_NAME: + { + this.state = 6697; + this.stringLiteral(); + } + break; + case MySqlParser.DECIMAL_LITERAL: + { + this.state = 6698; + this.match(MySqlParser.DECIMAL_LITERAL); + } + break; + case MySqlParser.LOCAL_ID: + case MySqlParser.GLOBAL_ID: + { + this.state = 6699; + this.mysqlVariable(); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.ID: + { + this.state = 6700; + this.simpleId(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + withStatement() { + let localContext = new WithStatementContext(this.context, this.state); + this.enterRule(localContext, 612, MySqlParser.RULE_withStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6703; + this.match(MySqlParser.KW_WITH); + this.state = 6705; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 966, this.context)) { + case 1: + { + this.state = 6704; + this.match(MySqlParser.KW_RECURSIVE); + } + break; + } + this.state = 6707; + this.commonTableExpressions(); + this.state = 6712; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6708; + this.match(MySqlParser.COMMA); + this.state = 6709; + this.commonTableExpressions(); + } + } + this.state = 6714; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableStatement() { + let localContext = new TableStatementContext(this.context, this.state); + this.enterRule(localContext, 614, MySqlParser.RULE_tableStatement); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6715; + this.match(MySqlParser.KW_TABLE); + this.state = 6716; + this.tableName(); + this.state = 6718; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 968, this.context)) { + case 1: + { + this.state = 6717; + this.orderByClause(); + } + break; + } + this.state = 6721; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 969, this.context)) { + case 1: + { + this.state = 6720; + this.limitClause(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + diagnosticsStatement() { + let localContext = new DiagnosticsStatementContext(this.context, this.state); + this.enterRule(localContext, 616, MySqlParser.RULE_diagnosticsStatement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6723; + this.match(MySqlParser.KW_GET); + this.state = 6725; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 36 || _la === 170) { + { + this.state = 6724; + _la = this.tokenStream.LA(1); + if (!(_la === 36 || _la === 170)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6727; + this.match(MySqlParser.KW_DIAGNOSTICS); + this.state = 6759; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 974, this.context)) { + case 1: + { + { + this.state = 6728; + this.variableClause(); + this.state = 6729; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6730; + _la = this.tokenStream.LA(1); + if (!(_la === 117 || _la === 831)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 6738; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6731; + this.match(MySqlParser.COMMA); + this.state = 6732; + this.variableClause(); + this.state = 6733; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6734; + _la = this.tokenStream.LA(1); + if (!(_la === 117 || _la === 831)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 6740; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + case 2: + { + { + this.state = 6741; + this.match(MySqlParser.KW_CONDITION); + this.state = 6744; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + { + this.state = 6742; + this.decimalLiteral(); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PERSIST: + case MySqlParser.KW_PERSIST_ONLY: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.AT_SIGN: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + case MySqlParser.LOCAL_ID: + case MySqlParser.GLOBAL_ID: + { + this.state = 6743; + this.variableClause(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 6746; + this.variableClause(); + this.state = 6747; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6748; + this.diagnosticsConditionInformationName(); + this.state = 6756; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6749; + this.match(MySqlParser.COMMA); + this.state = 6750; + this.variableClause(); + this.state = 6751; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 6752; + this.diagnosticsConditionInformationName(); + } + } + this.state = 6758; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + diagnosticsConditionInformationName() { + let localContext = new DiagnosticsConditionInformationNameContext(this.context, this.state); + this.enterRule(localContext, 618, MySqlParser.RULE_diagnosticsConditionInformationName); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6761; + _la = this.tokenStream.LA(1); + if (!(((((_la - 332)) & ~0x1F) === 0 && ((1 << (_la - 332)) & 137887873) !== 0) || _la === 487 || _la === 495 || _la === 578 || _la === 650 || _la === 657 || _la === 822 || _la === 832)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + describeObjectClause() { + let localContext = new DescribeObjectClauseContext(this.context, this.state); + this.enterRule(localContext, 620, MySqlParser.RULE_describeObjectClause); + try { + this.state = 6773; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DELETE: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_SELECT: + case MySqlParser.KW_UPDATE: + case MySqlParser.LR_BRACKET: + localContext = new DescribeStatementsContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 6768; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_SELECT: + case MySqlParser.LR_BRACKET: + { + this.state = 6763; + this.selectStatement(); + } + break; + case MySqlParser.KW_DELETE: + { + this.state = 6764; + this.deleteStatement(); + } + break; + case MySqlParser.KW_INSERT: + { + this.state = 6765; + this.insertStatement(); + } + break; + case MySqlParser.KW_REPLACE: + { + this.state = 6766; + this.replaceStatement(); + } + break; + case MySqlParser.KW_UPDATE: + { + this.state = 6767; + this.updateStatement(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + break; + case MySqlParser.KW_FOR: + localContext = new DescribeConnectionContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 6770; + this.match(MySqlParser.KW_FOR); + this.state = 6771; + this.match(MySqlParser.KW_CONNECTION); + this.state = 6772; + localContext._connection_id = this.uid(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + databaseNameCreate() { + let localContext = new DatabaseNameCreateContext(this.context, this.state); + this.enterRule(localContext, 622, MySqlParser.RULE_databaseNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6775; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + databaseName() { + let localContext = new DatabaseNameContext(this.context, this.state); + this.enterRule(localContext, 624, MySqlParser.RULE_databaseName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6777; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionNameCreate() { + let localContext = new FunctionNameCreateContext(this.context, this.state); + this.enterRule(localContext, 626, MySqlParser.RULE_functionNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6779; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionName() { + let localContext = new FunctionNameContext(this.context, this.state); + this.enterRule(localContext, 628, MySqlParser.RULE_functionName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6781; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + viewNameCreate() { + let localContext = new ViewNameCreateContext(this.context, this.state); + this.enterRule(localContext, 630, MySqlParser.RULE_viewNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6783; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + viewName() { + let localContext = new ViewNameContext(this.context, this.state); + this.enterRule(localContext, 632, MySqlParser.RULE_viewName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6785; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexNameCreate() { + let localContext = new IndexNameCreateContext(this.context, this.state); + this.enterRule(localContext, 634, MySqlParser.RULE_indexNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6787; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexNames() { + let localContext = new IndexNamesContext(this.context, this.state); + this.enterRule(localContext, 636, MySqlParser.RULE_indexNames); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6789; + this.indexName(); + this.state = 6794; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6790; + this.match(MySqlParser.COMMA); + this.state = 6791; + this.indexName(); + } + } + this.state = 6796; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexName() { + let localContext = new IndexNameContext(this.context, this.state); + this.enterRule(localContext, 638, MySqlParser.RULE_indexName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6797; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupNameCreate() { + let localContext = new GroupNameCreateContext(this.context, this.state); + this.enterRule(localContext, 640, MySqlParser.RULE_groupNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6799; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + groupName() { + let localContext = new GroupNameContext(this.context, this.state); + this.enterRule(localContext, 642, MySqlParser.RULE_groupName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6801; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableNameCreate() { + let localContext = new TableNameCreateContext(this.context, this.state); + this.enterRule(localContext, 644, MySqlParser.RULE_tableNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6803; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableNames() { + let localContext = new TableNamesContext(this.context, this.state); + this.enterRule(localContext, 646, MySqlParser.RULE_tableNames); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 6805; + this.tableName(); + this.state = 6810; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 978, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 6806; + this.match(MySqlParser.COMMA); + this.state = 6807; + this.tableName(); + } + } + } + this.state = 6812; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 978, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tableName() { + let localContext = new TableNameContext(this.context, this.state); + this.enterRule(localContext, 648, MySqlParser.RULE_tableName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6813; + this.fullId(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userOrRoleNames() { + let localContext = new UserOrRoleNamesContext(this.context, this.state); + this.enterRule(localContext, 650, MySqlParser.RULE_userOrRoleNames); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6815; + this.userOrRoleName(); + this.state = 6820; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6816; + this.match(MySqlParser.COMMA); + this.state = 6817; + this.userOrRoleName(); + } + } + this.state = 6822; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userOrRoleName() { + let localContext = new UserOrRoleNameContext(this.context, this.state); + this.enterRule(localContext, 652, MySqlParser.RULE_userOrRoleName); + try { + this.state = 6825; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 980, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6823; + this.userName(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6824; + this.uid(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnNameCreate() { + let localContext = new ColumnNameCreateContext(this.context, this.state); + this.enterRule(localContext, 654, MySqlParser.RULE_columnNameCreate); + let _la; + try { + this.state = 6841; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 985, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6827; + this.uid(); + this.state = 6832; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 6828; + this.dottedId(); + this.state = 6830; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 6829; + this.dottedId(); + } + } + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6835; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 983, this.context)) { + case 1: + { + this.state = 6834; + this.matchWildcard(); + } + break; + } + this.state = 6837; + this.dottedId(); + this.state = 6839; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 865) { + { + this.state = 6838; + this.dottedId(); + } + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnNames() { + let localContext = new ColumnNamesContext(this.context, this.state); + this.enterRule(localContext, 656, MySqlParser.RULE_columnNames); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 6843; + this.columnName(); + this.state = 6848; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 986, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 6844; + this.match(MySqlParser.COMMA); + this.state = 6845; + this.columnName(); + } + } + } + this.state = 6850; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 986, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + columnName() { + let localContext = new ColumnNameContext(this.context, this.state); + this.enterRule(localContext, 658, MySqlParser.RULE_columnName); + try { + this.state = 6866; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 991, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6851; + this.uid(); + this.state = 6856; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 988, this.context)) { + case 1: + { + this.state = 6852; + this.dottedId(); + this.state = 6854; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 987, this.context)) { + case 1: + { + this.state = 6853; + this.dottedId(); + } + break; + } + } + break; + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6859; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 989, this.context)) { + case 1: + { + this.state = 6858; + this.matchWildcard(); + } + break; + } + this.state = 6861; + this.dottedId(); + this.state = 6863; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 990, this.context)) { + case 1: + { + this.state = 6862; + this.dottedId(); + } + break; + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6865; + if (!(this.shouldMatchEmpty())) { + throw this.createFailedPredicateException("this.shouldMatchEmpty()"); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablespaceNameCreate() { + let localContext = new TablespaceNameCreateContext(this.context, this.state); + this.enterRule(localContext, 660, MySqlParser.RULE_tablespaceNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6868; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + tablespaceName() { + let localContext = new TablespaceNameContext(this.context, this.state); + this.enterRule(localContext, 662, MySqlParser.RULE_tablespaceName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6870; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionNameCreate() { + let localContext = new PartitionNameCreateContext(this.context, this.state); + this.enterRule(localContext, 664, MySqlParser.RULE_partitionNameCreate); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6872; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionNames() { + let localContext = new PartitionNamesContext(this.context, this.state); + this.enterRule(localContext, 666, MySqlParser.RULE_partitionNames); + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 6874; + this.partitionName(); + this.state = 6879; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 992, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + { + { + this.state = 6875; + this.match(MySqlParser.COMMA); + this.state = 6876; + this.partitionName(); + } + } + } + this.state = 6881; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 992, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionName() { + let localContext = new PartitionNameContext(this.context, this.state); + this.enterRule(localContext, 668, MySqlParser.RULE_partitionName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6882; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexColumnName() { + let localContext = new IndexColumnNameContext(this.context, this.state); + this.enterRule(localContext, 670, MySqlParser.RULE_indexColumnName); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6892; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 994, this.context)) { + case 1: + { + this.state = 6884; + this.uid(); + this.state = 6889; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 993, this.context)) { + case 1: + { + this.state = 6885; + this.match(MySqlParser.LR_BRACKET); + this.state = 6886; + this.decimalLiteral(); + this.state = 6887; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 2: + { + this.state = 6891; + this.expression(0); + } + break; + } + this.state = 6895; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 995, this.context)) { + case 1: + { + this.state = 6894; + localContext._sortType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45)) { + localContext._sortType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userHostPort() { + let localContext = new UserHostPortContext(this.context, this.state); + this.enterRule(localContext, 672, MySqlParser.RULE_userHostPort); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6897; + this.userAtHost(); + this.state = 6898; + this.match(MySqlParser.COLON_SYMB); + this.state = 6899; + this.decimalLiteral(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userAtHost() { + let localContext = new UserAtHostContext(this.context, this.state); + this.enterRule(localContext, 674, MySqlParser.RULE_userAtHost); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6901; + this.simpleUserName(); + this.state = 6902; + this.match(MySqlParser.HOST_IP_ADDRESS); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleUserName() { + let localContext = new SimpleUserNameContext(this.context, this.state); + this.enterRule(localContext, 676, MySqlParser.RULE_simpleUserName); + try { + this.state = 6908; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 996, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6904; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6905; + this.match(MySqlParser.ID); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6906; + this.match(MySqlParser.KW_ADMIN); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 6907; + this.keywordsCanBeId(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + hostName() { + let localContext = new HostNameContext(this.context, this.state); + this.enterRule(localContext, 678, MySqlParser.RULE_hostName); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6910; + _la = this.tokenStream.LA(1); + if (!(((((_la - 870)) & ~0x1F) === 0 && ((1 << (_la - 870)) & 6291457) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userName() { + let localContext = new UserNameContext(this.context, this.state); + this.enterRule(localContext, 680, MySqlParser.RULE_userName); + let _la; + try { + this.state = 6917; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 998, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6912; + this.simpleUserName(); + this.state = 6914; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 870)) & ~0x1F) === 0 && ((1 << (_la - 870)) & 6291457) !== 0)) { + { + this.state = 6913; + this.hostName(); + } + } + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6916; + this.currentUserExpression(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + mysqlVariable() { + let localContext = new MysqlVariableContext(this.context, this.state); + this.enterRule(localContext, 682, MySqlParser.RULE_mysqlVariable); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6919; + _la = this.tokenStream.LA(1); + if (!(_la === 892 || _la === 893)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + charsetName() { + let localContext = new CharsetNameContext(this.context, this.state); + this.enterRule(localContext, 684, MySqlParser.RULE_charsetName); + try { + this.state = 6925; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 999, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6921; + this.match(MySqlParser.KW_BINARY); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6922; + this.charsetNameBase(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6923; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 6924; + this.match(MySqlParser.CHARSET_REVERSE_QOUTE_STRING); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + collationName() { + let localContext = new CollationNameContext(this.context, this.state); + this.enterRule(localContext, 686, MySqlParser.RULE_collationName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6927; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + engineName() { + let localContext = new EngineNameContext(this.context, this.state); + this.enterRule(localContext, 688, MySqlParser.RULE_engineName); + try { + this.state = 6932; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + this.enterOuterAlt(localContext, 1); + { + this.state = 6929; + this.engineNameBase(); + } + break; + case MySqlParser.ID: + this.enterOuterAlt(localContext, 2); + { + this.state = 6930; + this.match(MySqlParser.ID); + } + break; + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 3); + { + this.state = 6931; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + engineNameBase() { + let localContext = new EngineNameBaseContext(this.context, this.state); + this.enterRule(localContext, 690, MySqlParser.RULE_engineNameBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6934; + _la = this.tokenStream.LA(1); + if (!(_la === 348 || ((((_la - 797)) & ~0x1F) === 0 && ((1 << (_la - 797)) & 4095) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uuidSet() { + let localContext = new UuidSetContext(this.context, this.state); + this.enterRule(localContext, 692, MySqlParser.RULE_uuidSet); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6936; + this.decimalLiteral(); + this.state = 6937; + this.match(MySqlParser.MINUS); + this.state = 6938; + this.decimalLiteral(); + this.state = 6939; + this.match(MySqlParser.MINUS); + this.state = 6940; + this.decimalLiteral(); + this.state = 6941; + this.match(MySqlParser.MINUS); + this.state = 6942; + this.decimalLiteral(); + this.state = 6943; + this.match(MySqlParser.MINUS); + this.state = 6944; + this.decimalLiteral(); + this.state = 6950; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 6945; + this.match(MySqlParser.COLON_SYMB); + this.state = 6946; + this.decimalLiteral(); + this.state = 6947; + this.match(MySqlParser.MINUS); + this.state = 6948; + this.decimalLiteral(); + } + } + this.state = 6952; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 878); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xid() { + let localContext = new XidContext(this.context, this.state); + this.enterRule(localContext, 694, MySqlParser.RULE_xid); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6954; + localContext._globalTableUid = this.xuidStringId(); + this.state = 6961; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 6955; + this.match(MySqlParser.COMMA); + this.state = 6956; + localContext._qualifier = this.xuidStringId(); + this.state = 6959; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 6957; + this.match(MySqlParser.COMMA); + this.state = 6958; + localContext._idFormat = this.decimalLiteral(); + } + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + xuidStringId() { + let localContext = new XuidStringIdContext(this.context, this.state); + this.enterRule(localContext, 696, MySqlParser.RULE_xuidStringId); + let _la; + try { + this.state = 6970; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 6963; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.BIT_STRING: + this.enterOuterAlt(localContext, 2); + { + this.state = 6964; + this.match(MySqlParser.BIT_STRING); + } + break; + case MySqlParser.HEXADECIMAL_LITERAL: + this.enterOuterAlt(localContext, 3); + { + this.state = 6966; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 6965; + this.match(MySqlParser.HEXADECIMAL_LITERAL); + } + } + this.state = 6968; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 884); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fullId() { + let localContext = new FullIdContext(this.context, this.state); + this.enterRule(localContext, 698, MySqlParser.RULE_fullId); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6972; + this.uid(); + this.state = 6974; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1006, this.context)) { + case 1: + { + this.state = 6973; + this.dottedId(); + } + break; + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uidList() { + let localContext = new UidListContext(this.context, this.state); + this.enterRule(localContext, 700, MySqlParser.RULE_uidList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 6976; + this.uid(); + this.state = 6981; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 6977; + this.match(MySqlParser.COMMA); + this.state = 6978; + this.uid(); + } + } + this.state = 6983; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + uid() { + let localContext = new UidContext(this.context, this.state); + this.enterRule(localContext, 702, MySqlParser.RULE_uid); + try { + this.state = 6987; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.ID: + this.enterOuterAlt(localContext, 1); + { + this.state = 6984; + this.simpleId(); + } + break; + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + this.enterOuterAlt(localContext, 2); + { + this.state = 6985; + this.match(MySqlParser.CHARSET_REVERSE_QOUTE_STRING); + } + break; + case MySqlParser.STRING_LITERAL: + this.enterOuterAlt(localContext, 3); + { + this.state = 6986; + this.match(MySqlParser.STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleId() { + let localContext = new SimpleIdContext(this.context, this.state); + this.enterRule(localContext, 704, MySqlParser.RULE_simpleId); + try { + this.state = 6998; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1009, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 6989; + this.match(MySqlParser.ID); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 6990; + this.charsetNameBase(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 6991; + this.transactionLevelBase(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 6992; + this.engineNameBase(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 6993; + this.privilegesBase(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 6994; + this.intervalTypeBase(); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 6995; + this.dataTypeBase(); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 6996; + this.keywordsCanBeId(); + } + break; + case 9: + this.enterOuterAlt(localContext, 9); + { + this.state = 6997; + this.scalarFunctionName(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dottedId() { + let localContext = new DottedIdContext(this.context, this.state); + this.enterRule(localContext, 706, MySqlParser.RULE_dottedId); + try { + this.state = 7004; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1010, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7000; + this.match(MySqlParser.DOT); + this.state = 7001; + this.match(MySqlParser.ID); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7002; + this.match(MySqlParser.DOT); + this.state = 7003; + this.uid(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + decimalLiteral() { + let localContext = new DecimalLiteralContext(this.context, this.state); + this.enterRule(localContext, 708, MySqlParser.RULE_decimalLiteral); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7006; + _la = this.tokenStream.LA(1); + if (!(((((_la - 871)) & ~0x1F) === 0 && ((1 << (_la - 871)) & 20495) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + fileSizeLiteral() { + let localContext = new FileSizeLiteralContext(this.context, this.state); + this.enterRule(localContext, 710, MySqlParser.RULE_fileSizeLiteral); + try { + this.state = 7010; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.FILESIZE_LITERAL: + this.enterOuterAlt(localContext, 1); + { + this.state = 7008; + this.match(MySqlParser.FILESIZE_LITERAL); + } + break; + case MySqlParser.ZERO_DECIMAL: + case MySqlParser.ONE_DECIMAL: + case MySqlParser.TWO_DECIMAL: + case MySqlParser.THREE_DECIMAL: + case MySqlParser.DECIMAL_LITERAL: + case MySqlParser.REAL_LITERAL: + this.enterOuterAlt(localContext, 2); + { + this.state = 7009; + this.decimalLiteral(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + stringLiteral() { + let localContext = new StringLiteralContext(this.context, this.state); + this.enterRule(localContext, 712, MySqlParser.RULE_stringLiteral); + let _la; + try { + let alternative; + this.state = 7035; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1018, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7017; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + case MySqlParser.STRING_CHARSET_NAME: + { + this.state = 7013; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 888) { + { + this.state = 7012; + this.match(MySqlParser.STRING_CHARSET_NAME); + } + } + this.state = 7015; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.START_NATIONAL_STRING_LITERAL: + { + this.state = 7016; + this.match(MySqlParser.START_NATIONAL_STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7020; + this.errorHandler.sync(this); + alternative = 1; + do { + switch (alternative) { + case 1: + { + { + this.state = 7019; + this.match(MySqlParser.STRING_LITERAL); + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7022; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1014, this.context); + } while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7029; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.STRING_LITERAL: + case MySqlParser.STRING_CHARSET_NAME: + { + this.state = 7025; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 888) { + { + this.state = 7024; + this.match(MySqlParser.STRING_CHARSET_NAME); + } + } + this.state = 7027; + this.match(MySqlParser.STRING_LITERAL); + } + break; + case MySqlParser.START_NATIONAL_STRING_LITERAL: + { + this.state = 7028; + this.match(MySqlParser.START_NATIONAL_STRING_LITERAL); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7033; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1017, this.context)) { + case 1: + { + this.state = 7031; + this.match(MySqlParser.KW_COLLATE); + this.state = 7032; + this.collationName(); + } + break; + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + booleanLiteral() { + let localContext = new BooleanLiteralContext(this.context, this.state); + this.enterRule(localContext, 714, MySqlParser.RULE_booleanLiteral); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7037; + _la = this.tokenStream.LA(1); + if (!(_la === 63 || _la === 179)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + hexadecimalLiteral() { + let localContext = new HexadecimalLiteralContext(this.context, this.state); + this.enterRule(localContext, 716, MySqlParser.RULE_hexadecimalLiteral); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7040; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 888) { + { + this.state = 7039; + this.match(MySqlParser.STRING_CHARSET_NAME); + } + } + this.state = 7042; + this.match(MySqlParser.HEXADECIMAL_LITERAL); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + nullNotnull() { + let localContext = new NullNotnullContext(this.context, this.state); + this.enterRule(localContext, 718, MySqlParser.RULE_nullNotnull); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7045; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7044; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7047; + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 886)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + constant() { + let localContext = new ConstantContext(this.context, this.state); + this.enterRule(localContext, 720, MySqlParser.RULE_constant); + let _la; + try { + this.state = 7061; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1022, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7049; + this.stringLiteral(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7050; + this.decimalLiteral(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7051; + this.match(MySqlParser.MINUS); + this.state = 7052; + this.decimalLiteral(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7053; + this.hexadecimalLiteral(); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 7054; + this.booleanLiteral(); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 7055; + this.match(MySqlParser.REAL_LITERAL); + } + break; + case 7: + this.enterOuterAlt(localContext, 7); + { + this.state = 7056; + this.match(MySqlParser.BIT_STRING); + } + break; + case 8: + this.enterOuterAlt(localContext, 8); + { + this.state = 7058; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7057; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7060; + localContext._nullLiteral = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 116 || _la === 886)) { + localContext._nullLiteral = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dataType() { + let localContext = new DataTypeContext(this.context, this.state); + this.enterRule(localContext, 722, MySqlParser.RULE_dataType); + let _la; + try { + this.state = 7189; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1051, this.context)) { + case 1: + localContext = new StringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7063; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 26 || ((((_la - 224)) & ~0x1F) === 0 && ((1 << (_la - 224)) & 31239) !== 0) || _la === 498)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7065; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 240) { + { + this.state = 7064; + this.match(MySqlParser.KW_VARYING); + } + } + this.state = 7068; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1024, this.context)) { + case 1: + { + this.state = 7067; + this.lengthOneDimension(); + } + break; + } + this.state = 7071; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1025, this.context)) { + case 1: + { + this.state = 7070; + this.match(MySqlParser.KW_BINARY); + } + break; + } + this.state = 7076; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7073; + this.charSet(); + this.state = 7074; + this.charsetName(); + } + } + this.state = 7081; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1027, this.context)) { + case 1: + { + this.state = 7078; + this.match(MySqlParser.KW_COLLATE); + this.state = 7079; + this.collationName(); + } + break; + case 2: + { + this.state = 7080; + this.match(MySqlParser.KW_BINARY); + } + break; + } + } + break; + case 2: + localContext = new NationalVaryingStringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7083; + this.match(MySqlParser.KW_NATIONAL); + this.state = 7084; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 26 || _la === 224)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7085; + this.match(MySqlParser.KW_VARYING); + this.state = 7087; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1028, this.context)) { + case 1: + { + this.state = 7086; + this.lengthOneDimension(); + } + break; + } + this.state = 7090; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7089; + this.match(MySqlParser.KW_BINARY); + } + } + } + break; + case 3: + localContext = new NationalStringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 7092; + this.match(MySqlParser.KW_NATIONAL); + this.state = 7093; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 26 || _la === 224 || _la === 225)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7095; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1030, this.context)) { + case 1: + { + this.state = 7094; + this.lengthOneDimension(); + } + break; + } + this.state = 7098; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7097; + this.match(MySqlParser.KW_BINARY); + } + } + } + break; + case 4: + localContext = new NationalStringDataTypeContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 7100; + this.match(MySqlParser.KW_NCHAR); + this.state = 7101; + localContext._typeName = this.match(MySqlParser.KW_VARCHAR); + this.state = 7103; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1032, this.context)) { + case 1: + { + this.state = 7102; + this.lengthOneDimension(); + } + break; + } + this.state = 7106; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7105; + this.match(MySqlParser.KW_BINARY); + } + } + } + break; + case 5: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 7108; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 198)) & ~0x1F) === 0 && ((1 << (_la - 198)) & 4095) !== 0))) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7110; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1034, this.context)) { + case 1: + { + this.state = 7109; + this.lengthOneDimension(); + } + break; + } + this.state = 7115; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7112; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7117; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 6: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 7118; + localContext._typeName = this.match(MySqlParser.KW_REAL); + this.state = 7120; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1036, this.context)) { + case 1: + { + this.state = 7119; + this.lengthTwoDimension(); + } + break; + } + this.state = 7125; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7122; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7127; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 7: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 7128; + localContext._typeName = this.match(MySqlParser.KW_DOUBLE); + this.state = 7130; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 212) { + { + this.state = 7129; + this.match(MySqlParser.KW_PRECISION); + } + } + this.state = 7133; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1039, this.context)) { + case 1: + { + this.state = 7132; + this.lengthTwoDimension(); + } + break; + } + this.state = 7138; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7135; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7140; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 8: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 7141; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 213)) & ~0x1F) === 0 && ((1 << (_la - 213)) & 63) !== 0) || _la === 403)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7143; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1041, this.context)) { + case 1: + { + this.state = 7142; + this.lengthTwoOptionalDimension(); + } + break; + } + this.state = 7148; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 184 || _la === 197 || _la === 596) { + { + { + this.state = 7145; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 197 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + this.state = 7150; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 9: + localContext = new SimpleDataTypeContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 7151; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 4237313) !== 0) || _la === 321 || _la === 322)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 10: + localContext = new DimensionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 7152; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 220)) & ~0x1F) === 0 && ((1 << (_la - 220)) & 2831) !== 0) || _la === 319)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7154; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1043, this.context)) { + case 1: + { + this.state = 7153; + this.lengthOneDimension(); + } + break; + } + } + break; + case 11: + localContext = new CollectionDataTypeContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 7156; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 155 || _la === 239)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7157; + this.collectionOptions(); + this.state = 7159; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7158; + this.match(MySqlParser.KW_BINARY); + } + } + this.state = 7164; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7161; + this.charSet(); + this.state = 7162; + this.charsetName(); + } + } + } + break; + case 12: + localContext = new SpatialDataTypeContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 7166; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 442 || ((((_la - 813)) & ~0x1F) === 0 && ((1 << (_la - 813)) & 511) !== 0))) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7169; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 834) { + { + this.state = 7167; + this.match(MySqlParser.KW_SRID); + this.state = 7168; + this.decimalLiteral(); + } + } + } + break; + case 13: + localContext = new LongVarcharDataTypeContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 7171; + localContext._typeName = this.match(MySqlParser.KW_LONG); + this.state = 7173; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 225) { + { + this.state = 7172; + this.match(MySqlParser.KW_VARCHAR); + } + } + this.state = 7176; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 228) { + { + this.state = 7175; + this.match(MySqlParser.KW_BINARY); + } + } + this.state = 7181; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7178; + this.charSet(); + this.state = 7179; + this.charsetName(); + } + } + this.state = 7185; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1050, this.context)) { + case 1: + { + this.state = 7183; + this.match(MySqlParser.KW_COLLATE); + this.state = 7184; + this.collationName(); + } + break; + } + } + break; + case 14: + localContext = new LongVarbinaryDataTypeContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 7187; + this.match(MySqlParser.KW_LONG); + this.state = 7188; + this.match(MySqlParser.KW_VARBINARY); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + collectionOptions() { + let localContext = new CollectionOptionsContext(this.context, this.state); + this.enterRule(localContext, 724, MySqlParser.RULE_collectionOptions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7191; + this.match(MySqlParser.LR_BRACKET); + this.state = 7192; + this.match(MySqlParser.STRING_LITERAL); + this.state = 7197; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7193; + this.match(MySqlParser.COMMA); + this.state = 7194; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 7199; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7200; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + convertedDataType() { + let localContext = new ConvertedDataTypeContext(this.context, this.state); + this.enterRule(localContext, 726, MySqlParser.RULE_convertedDataType); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7224; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_BINARY: + case MySqlParser.KW_NCHAR: + { + this.state = 7202; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 228 || _la === 498)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7204; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 7203; + this.lengthOneDimension(); + } + } + } + break; + case MySqlParser.KW_CHAR: + { + this.state = 7206; + localContext._typeName = this.match(MySqlParser.KW_CHAR); + this.state = 7208; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 7207; + this.lengthOneDimension(); + } + } + this.state = 7213; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 26 || _la === 224 || _la === 823) { + { + this.state = 7210; + this.charSet(); + this.state = 7211; + this.charsetName(); + } + } + } + break; + case MySqlParser.KW_INT: + case MySqlParser.KW_INTEGER: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_JSON: + { + this.state = 7215; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 202)) & ~0x1F) === 0 && ((1 << (_la - 202)) & 1441857) !== 0) || _la === 442)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case MySqlParser.KW_DECIMAL: + case MySqlParser.KW_DEC: + { + this.state = 7216; + localContext._typeName = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 216 || _la === 217)) { + localContext._typeName = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7218; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 866) { + { + this.state = 7217; + this.lengthTwoOptionalDimension(); + } + } + } + break; + case MySqlParser.KW_UNSIGNED: + case MySqlParser.KW_SIGNED: + { + this.state = 7220; + _la = this.tokenStream.LA(1); + if (!(_la === 184 || _la === 596)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7222; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 202 || _la === 208) { + { + this.state = 7221; + _la = this.tokenStream.LA(1); + if (!(_la === 202 || _la === 208)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + break; + default: + throw new antlr.NoViableAltException(this); + } + this.state = 7227; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 12) { + { + this.state = 7226; + this.match(MySqlParser.KW_ARRAY); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lengthOneDimension() { + let localContext = new LengthOneDimensionContext(this.context, this.state); + this.enterRule(localContext, 728, MySqlParser.RULE_lengthOneDimension); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7229; + this.match(MySqlParser.LR_BRACKET); + this.state = 7230; + this.decimalLiteral(); + this.state = 7231; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lengthTwoDimension() { + let localContext = new LengthTwoDimensionContext(this.context, this.state); + this.enterRule(localContext, 730, MySqlParser.RULE_lengthTwoDimension); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7233; + this.match(MySqlParser.LR_BRACKET); + this.state = 7234; + this.decimalLiteral(); + this.state = 7235; + this.match(MySqlParser.COMMA); + this.state = 7236; + this.decimalLiteral(); + this.state = 7237; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + lengthTwoOptionalDimension() { + let localContext = new LengthTwoOptionalDimensionContext(this.context, this.state); + this.enterRule(localContext, 732, MySqlParser.RULE_lengthTwoOptionalDimension); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7239; + this.match(MySqlParser.LR_BRACKET); + this.state = 7240; + this.decimalLiteral(); + this.state = 7243; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 7241; + this.match(MySqlParser.COMMA); + this.state = 7242; + this.decimalLiteral(); + } + } + this.state = 7245; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + indexColumnNames() { + let localContext = new IndexColumnNamesContext(this.context, this.state); + this.enterRule(localContext, 734, MySqlParser.RULE_indexColumnNames); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7247; + this.match(MySqlParser.LR_BRACKET); + this.state = 7248; + this.indexColumnName(); + this.state = 7253; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7249; + this.match(MySqlParser.COMMA); + this.state = 7250; + this.indexColumnName(); + } + } + this.state = 7255; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7256; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expressions() { + let localContext = new ExpressionsContext(this.context, this.state); + this.enterRule(localContext, 736, MySqlParser.RULE_expressions); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7258; + this.expression(0); + this.state = 7263; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7259; + this.match(MySqlParser.COMMA); + this.state = 7260; + this.expression(0); + } + } + this.state = 7265; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + valuesOrValueList() { + let localContext = new ValuesOrValueListContext(this.context, this.state); + this.enterRule(localContext, 738, MySqlParser.RULE_valuesOrValueList); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7266; + _la = this.tokenStream.LA(1); + if (!(_la === 189 || _la === 682)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7267; + this.expressionsWithDefaults(); + this.state = 7272; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7268; + this.match(MySqlParser.COMMA); + this.state = 7269; + this.expressionsWithDefaults(); + } + } + this.state = 7274; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expressionsWithDefaults() { + let localContext = new ExpressionsWithDefaultsContext(this.context, this.state); + this.enterRule(localContext, 740, MySqlParser.RULE_expressionsWithDefaults); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7275; + this.match(MySqlParser.LR_BRACKET); + this.state = 7276; + this.expressionOrDefault(); + this.state = 7281; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7277; + this.match(MySqlParser.COMMA); + this.state = 7278; + this.expressionOrDefault(); + } + } + this.state = 7283; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7284; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expressionOrDefault() { + let localContext = new ExpressionOrDefaultContext(this.context, this.state); + this.enterRule(localContext, 742, MySqlParser.RULE_expressionOrDefault); + try { + this.state = 7288; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1065, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7286; + this.expression(0); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7287; + this.match(MySqlParser.KW_DEFAULT); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + constants() { + let localContext = new ConstantsContext(this.context, this.state); + this.enterRule(localContext, 744, MySqlParser.RULE_constants); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7290; + this.constant(); + this.state = 7295; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7291; + this.match(MySqlParser.COMMA); + this.state = 7292; + this.constant(); + } + } + this.state = 7297; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + simpleStrings() { + let localContext = new SimpleStringsContext(this.context, this.state); + this.enterRule(localContext, 746, MySqlParser.RULE_simpleStrings); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7298; + this.match(MySqlParser.STRING_LITERAL); + this.state = 7303; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7299; + this.match(MySqlParser.COMMA); + this.state = 7300; + this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 7305; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + userVariables() { + let localContext = new UserVariablesContext(this.context, this.state); + this.enterRule(localContext, 748, MySqlParser.RULE_userVariables); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7306; + this.match(MySqlParser.LOCAL_ID); + this.state = 7311; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7307; + this.match(MySqlParser.COMMA); + this.state = 7308; + this.match(MySqlParser.LOCAL_ID); + } + } + this.state = 7313; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + defaultValue() { + let localContext = new DefaultValueContext(this.context, this.state); + this.enterRule(localContext, 750, MySqlParser.RULE_defaultValue); + try { + this.state = 7340; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1071, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7314; + this.match(MySqlParser.KW_NULL_LITERAL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7315; + this.match(MySqlParser.KW_CAST); + this.state = 7316; + this.match(MySqlParser.LR_BRACKET); + this.state = 7317; + this.expression(0); + this.state = 7318; + this.match(MySqlParser.KW_AS); + this.state = 7319; + this.convertedDataType(); + this.state = 7320; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7323; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1069, this.context)) { + case 1: + { + this.state = 7322; + this.unaryOperator(); + } + break; + } + this.state = 7325; + this.constant(); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7326; + this.currentTimestamp(); + this.state = 7330; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1070, this.context)) { + case 1: + { + this.state = 7327; + this.match(MySqlParser.KW_ON); + this.state = 7328; + this.match(MySqlParser.KW_UPDATE); + this.state = 7329; + this.currentTimestamp(); + } + break; + } + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 7332; + this.match(MySqlParser.LR_BRACKET); + this.state = 7333; + this.expression(0); + this.state = 7334; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 6: + this.enterOuterAlt(localContext, 6); + { + this.state = 7336; + this.match(MySqlParser.LR_BRACKET); + this.state = 7337; + this.fullId(); + this.state = 7338; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + currentTimestamp() { + let localContext = new CurrentTimestampContext(this.context, this.state); + this.enterRule(localContext, 752, MySqlParser.RULE_currentTimestamp); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7356; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_LOCALTIMESTAMP: + { + this.state = 7342; + _la = this.tokenStream.LA(1); + if (!(((((_la - 287)) & ~0x1F) === 0 && ((1 << (_la - 287)) & 131) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7348; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1073, this.context)) { + case 1: + { + this.state = 7343; + this.match(MySqlParser.LR_BRACKET); + this.state = 7345; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 871)) & ~0x1F) === 0 && ((1 << (_la - 871)) & 20495) !== 0)) { + { + this.state = 7344; + this.decimalLiteral(); + } + } + this.state = 7347; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case MySqlParser.KW_NOW: + { + this.state = 7350; + this.match(MySqlParser.KW_NOW); + this.state = 7351; + this.match(MySqlParser.LR_BRACKET); + this.state = 7353; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (((((_la - 871)) & ~0x1F) === 0 && ((1 << (_la - 871)) & 20495) !== 0)) { + { + this.state = 7352; + this.decimalLiteral(); + } + } + this.state = 7355; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ifExists() { + let localContext = new IfExistsContext(this.context, this.state); + this.enterRule(localContext, 754, MySqlParser.RULE_ifExists); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7358; + this.match(MySqlParser.KW_IF); + this.state = 7359; + this.match(MySqlParser.KW_EXISTS); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + ifNotExists() { + let localContext = new IfNotExistsContext(this.context, this.state); + this.enterRule(localContext, 756, MySqlParser.RULE_ifNotExists); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7361; + this.match(MySqlParser.KW_IF); + this.state = 7362; + this.match(MySqlParser.KW_NOT); + this.state = 7363; + this.match(MySqlParser.KW_EXISTS); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + orReplace() { + let localContext = new OrReplaceContext(this.context, this.state); + this.enterRule(localContext, 758, MySqlParser.RULE_orReplace); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7365; + this.match(MySqlParser.KW_OR); + this.state = 7366; + this.match(MySqlParser.KW_REPLACE); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionCall() { + let localContext = new FunctionCallContext(this.context, this.state); + this.enterRule(localContext, 760, MySqlParser.RULE_functionCall); + try { + this.state = 7390; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1078, this.context)) { + case 1: + localContext = new SpecificFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7368; + this.specificFunction(); + } + break; + case 2: + localContext = new AggregateFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7369; + this.aggregateWindowedFunction(); + } + break; + case 3: + localContext = new NonAggregateFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 7370; + this.nonAggregateWindowedFunction(); + } + break; + case 4: + localContext = new ScalarFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 7371; + this.scalarFunctionName(); + this.state = 7378; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1076, this.context)) { + case 1: + { + this.state = 7372; + this.match(MySqlParser.LR_BRACKET); + this.state = 7373; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 7374; + this.match(MySqlParser.LR_BRACKET); + this.state = 7375; + this.functionArgs(); + this.state = 7376; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 5: + localContext = new UdfFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 7380; + this.functionName(); + this.state = 7387; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1077, this.context)) { + case 1: + { + this.state = 7381; + this.match(MySqlParser.LR_BRACKET); + this.state = 7382; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 7383; + this.match(MySqlParser.LR_BRACKET); + this.state = 7384; + this.functionArgs(); + this.state = 7385; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 6: + localContext = new PasswordFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 7389; + this.passwordFunctionClause(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + specificFunction() { + let localContext = new SpecificFunctionContext(this.context, this.state); + this.enterRule(localContext, 762, MySqlParser.RULE_specificFunction); + let _la; + try { + this.state = 7571; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1102, this.context)) { + case 1: + localContext = new SimpleFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7392; + _la = this.tokenStream.LA(1); + if (!(_la === 152 || ((((_la - 285)) & ~0x1F) === 0 && ((1 << (_la - 285)) & 262159) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7395; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1079, this.context)) { + case 1: + { + this.state = 7393; + this.match(MySqlParser.LR_BRACKET); + this.state = 7394; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + break; + case 2: + localContext = new CurrentUserContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7397; + this.currentUserExpression(); + } + break; + case 3: + localContext = new DataTypeFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 3); + { + this.state = 7398; + this.match(MySqlParser.KW_CONVERT); + this.state = 7399; + this.match(MySqlParser.LR_BRACKET); + this.state = 7400; + this.expression(0); + this.state = 7401; + localContext._separator = this.match(MySqlParser.COMMA); + this.state = 7402; + this.convertedDataType(); + this.state = 7403; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 4: + localContext = new DataTypeFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 4); + { + this.state = 7405; + this.match(MySqlParser.KW_CONVERT); + this.state = 7406; + this.match(MySqlParser.LR_BRACKET); + this.state = 7407; + this.expression(0); + this.state = 7408; + this.match(MySqlParser.KW_USING); + this.state = 7409; + this.charsetName(); + this.state = 7410; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 5: + localContext = new DataTypeFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 5); + { + this.state = 7412; + this.match(MySqlParser.KW_CAST); + this.state = 7413; + this.match(MySqlParser.LR_BRACKET); + this.state = 7414; + this.expression(0); + this.state = 7415; + this.match(MySqlParser.KW_AS); + this.state = 7416; + this.convertedDataType(); + this.state = 7417; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 6: + localContext = new ValuesFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 6); + { + this.state = 7419; + this.match(MySqlParser.KW_VALUES); + this.state = 7420; + this.match(MySqlParser.LR_BRACKET); + this.state = 7421; + this.columnName(); + this.state = 7422; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 7: + localContext = new CaseFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 7); + { + this.state = 7424; + this.match(MySqlParser.KW_CASE); + this.state = 7426; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 7425; + this.caseFuncAlternative(); + } + } + this.state = 7428; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 191); + this.state = 7432; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 7430; + this.match(MySqlParser.KW_ELSE); + this.state = 7431; + localContext._elseArg = this.functionArg(); + } + } + this.state = 7434; + this.match(MySqlParser.KW_END); + } + break; + case 8: + localContext = new CaseExpressionFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 8); + { + this.state = 7436; + this.match(MySqlParser.KW_CASE); + this.state = 7437; + this.expression(0); + this.state = 7439; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 7438; + this.caseFuncAlternative(); + } + } + this.state = 7441; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 191); + this.state = 7445; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 53) { + { + this.state = 7443; + this.match(MySqlParser.KW_ELSE); + this.state = 7444; + localContext._elseArg = this.functionArg(); + } + } + this.state = 7447; + this.match(MySqlParser.KW_END); + } + break; + case 9: + localContext = new CharFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 9); + { + this.state = 7449; + this.match(MySqlParser.KW_CHAR); + this.state = 7450; + this.match(MySqlParser.LR_BRACKET); + this.state = 7451; + this.functionArgs(); + this.state = 7454; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 188) { + { + this.state = 7452; + this.match(MySqlParser.KW_USING); + this.state = 7453; + this.charsetName(); + } + } + this.state = 7456; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 10: + localContext = new PositionFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 10); + { + this.state = 7458; + this.match(MySqlParser.KW_POSITION); + this.state = 7459; + this.match(MySqlParser.LR_BRACKET); + this.state = 7462; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1085, this.context)) { + case 1: + { + this.state = 7460; + localContext._positionString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7461; + localContext._positionExpression = this.expression(0); + } + break; + } + this.state = 7464; + this.match(MySqlParser.KW_IN); + this.state = 7467; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1086, this.context)) { + case 1: + { + this.state = 7465; + localContext._inString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7466; + localContext._inExpression = this.expression(0); + } + break; + } + this.state = 7469; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 11: + localContext = new SubstrFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 11); + { + this.state = 7471; + _la = this.tokenStream.LA(1); + if (!(_la === 297 || _la === 298)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7472; + this.match(MySqlParser.LR_BRACKET); + this.state = 7475; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1087, this.context)) { + case 1: + { + this.state = 7473; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7474; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7477; + this.match(MySqlParser.KW_FROM); + this.state = 7480; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1088, this.context)) { + case 1: + { + this.state = 7478; + localContext._fromDecimal = this.decimalLiteral(); + } + break; + case 2: + { + this.state = 7479; + localContext._fromExpression = this.expression(0); + } + break; + } + this.state = 7487; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 65) { + { + this.state = 7482; + this.match(MySqlParser.KW_FOR); + this.state = 7485; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1089, this.context)) { + case 1: + { + this.state = 7483; + localContext._forDecimal = this.decimalLiteral(); + } + break; + case 2: + { + this.state = 7484; + localContext._forExpression = this.expression(0); + } + break; + } + } + } + this.state = 7489; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 12: + localContext = new TrimFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 12); + { + this.state = 7491; + this.match(MySqlParser.KW_TRIM); + this.state = 7492; + this.match(MySqlParser.LR_BRACKET); + this.state = 7493; + localContext._positioinForm = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 18 || _la === 96 || _la === 177)) { + localContext._positioinForm = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7496; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1091, this.context)) { + case 1: + { + this.state = 7494; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7495; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7498; + this.match(MySqlParser.KW_FROM); + this.state = 7501; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1092, this.context)) { + case 1: + { + this.state = 7499; + localContext._fromString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7500; + localContext._fromExpression = this.expression(0); + } + break; + } + this.state = 7503; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 13: + localContext = new TrimFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 13); + { + this.state = 7505; + this.match(MySqlParser.KW_TRIM); + this.state = 7506; + this.match(MySqlParser.LR_BRACKET); + this.state = 7509; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1093, this.context)) { + case 1: + { + this.state = 7507; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7508; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7511; + this.match(MySqlParser.KW_FROM); + this.state = 7514; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1094, this.context)) { + case 1: + { + this.state = 7512; + localContext._fromString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7513; + localContext._fromExpression = this.expression(0); + } + break; + } + this.state = 7516; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 14: + localContext = new WeightFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 14); + { + this.state = 7518; + this.match(MySqlParser.KW_WEIGHT_STRING); + this.state = 7519; + this.match(MySqlParser.LR_BRACKET); + this.state = 7522; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1095, this.context)) { + case 1: + { + this.state = 7520; + this.stringLiteral(); + } + break; + case 2: + { + this.state = 7521; + this.expression(0); + } + break; + } + this.state = 7530; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 13) { + { + this.state = 7524; + this.match(MySqlParser.KW_AS); + this.state = 7525; + localContext._stringFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 224 || _la === 228)) { + localContext._stringFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7526; + this.match(MySqlParser.LR_BRACKET); + this.state = 7527; + this.decimalLiteral(); + this.state = 7528; + this.match(MySqlParser.RR_BRACKET); + } + } + this.state = 7533; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 448) { + { + this.state = 7532; + this.levelsInWeightString(); + } + } + this.state = 7535; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 15: + localContext = new ExtractFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 15); + { + this.state = 7537; + this.match(MySqlParser.KW_EXTRACT); + this.state = 7538; + this.match(MySqlParser.LR_BRACKET); + this.state = 7539; + this.intervalType(); + this.state = 7540; + this.match(MySqlParser.KW_FROM); + this.state = 7543; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1098, this.context)) { + case 1: + { + this.state = 7541; + localContext._sourceString = this.stringLiteral(); + } + break; + case 2: + { + this.state = 7542; + localContext._sourceExpression = this.expression(0); + } + break; + } + this.state = 7545; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 16: + localContext = new GetFormatFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 16); + { + this.state = 7547; + this.match(MySqlParser.KW_GET_FORMAT); + this.state = 7548; + this.match(MySqlParser.LR_BRACKET); + this.state = 7549; + localContext._datetimeFormat = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 11) !== 0))) { + localContext._datetimeFormat = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7550; + this.match(MySqlParser.COMMA); + this.state = 7551; + this.stringLiteral(); + this.state = 7552; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 17: + localContext = new JsonValueFunctionCallContext(localContext); + this.enterOuterAlt(localContext, 17); + { + this.state = 7554; + this.match(MySqlParser.KW_JSON_VALUE); + this.state = 7555; + this.match(MySqlParser.LR_BRACKET); + this.state = 7556; + this.expression(0); + this.state = 7557; + this.match(MySqlParser.COMMA); + this.state = 7558; + this.expression(0); + this.state = 7561; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 579) { + { + this.state = 7559; + this.match(MySqlParser.KW_RETURNING); + this.state = 7560; + this.convertedDataType(); + } + } + this.state = 7564; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1100, this.context)) { + case 1: + { + this.state = 7563; + this.jsonOnEmpty(); + } + break; + } + this.state = 7567; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 42 || _la === 116 || _la === 382) { + { + this.state = 7566; + this.jsonOnError(); + } + } + this.state = 7569; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + caseFuncAlternative() { + let localContext = new CaseFuncAlternativeContext(this.context, this.state); + this.enterRule(localContext, 764, MySqlParser.RULE_caseFuncAlternative); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7573; + this.match(MySqlParser.KW_WHEN); + this.state = 7574; + localContext._condition = this.functionArg(); + this.state = 7575; + this.match(MySqlParser.KW_THEN); + this.state = 7576; + localContext._consequent = this.functionArg(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + levelsInWeightString() { + let localContext = new LevelsInWeightStringContext(this.context, this.state); + this.enterRule(localContext, 766, MySqlParser.RULE_levelsInWeightString); + let _la; + try { + this.state = 7592; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1104, this.context)) { + case 1: + localContext = new LevelWeightListContext(localContext); + this.enterOuterAlt(localContext, 1); + { + this.state = 7578; + this.match(MySqlParser.KW_LEVEL); + this.state = 7579; + this.levelInWeightListElement(); + this.state = 7584; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7580; + this.match(MySqlParser.COMMA); + this.state = 7581; + this.levelInWeightListElement(); + } + } + this.state = 7586; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + break; + case 2: + localContext = new LevelWeightRangeContext(localContext); + this.enterOuterAlt(localContext, 2); + { + this.state = 7587; + this.match(MySqlParser.KW_LEVEL); + this.state = 7588; + localContext._firstLevel = this.decimalLiteral(); + this.state = 7589; + this.match(MySqlParser.MINUS); + this.state = 7590; + localContext._lastLevel = this.decimalLiteral(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + levelInWeightListElement() { + let localContext = new LevelInWeightListElementContext(this.context, this.state); + this.enterRule(localContext, 768, MySqlParser.RULE_levelInWeightListElement); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7594; + this.decimalLiteral(); + this.state = 7596; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 14 || _la === 45 || _la === 830) { + { + this.state = 7595; + localContext._orderType = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 14 || _la === 45 || _la === 830)) { + localContext._orderType = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + aggregateWindowedFunction() { + let localContext = new AggregateWindowedFunctionContext(this.context, this.state); + this.enterRule(localContext, 770, MySqlParser.RULE_aggregateWindowedFunction); + let _la; + try { + this.state = 7657; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AVG: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_SUM: + this.enterOuterAlt(localContext, 1); + { + this.state = 7598; + _la = this.tokenStream.LA(1); + if (!(((((_la - 258)) & ~0x1F) === 0 && ((1 << (_la - 258)) & 8400897) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7599; + this.match(MySqlParser.LR_BRACKET); + this.state = 7601; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1106, this.context)) { + case 1: + { + this.state = 7600; + localContext._aggregator = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 49)) { + localContext._aggregator = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + this.state = 7603; + this.functionArg(); + this.state = 7604; + this.match(MySqlParser.RR_BRACKET); + this.state = 7606; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1107, this.context)) { + case 1: + { + this.state = 7605; + this.overClause(); + } + break; + } + } + break; + case MySqlParser.KW_COUNT: + this.enterOuterAlt(localContext, 2); + { + this.state = 7608; + this.match(MySqlParser.KW_COUNT); + this.state = 7609; + this.match(MySqlParser.LR_BRACKET); + this.state = 7617; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1109, this.context)) { + case 1: + { + this.state = 7610; + localContext._starArg = this.match(MySqlParser.STAR); + } + break; + case 2: + { + this.state = 7612; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1108, this.context)) { + case 1: + { + this.state = 7611; + localContext._aggregator = this.match(MySqlParser.KW_ALL); + } + break; + } + this.state = 7614; + this.functionArg(); + } + break; + case 3: + { + this.state = 7615; + localContext._aggregator = this.match(MySqlParser.KW_DISTINCT); + this.state = 7616; + this.functionArgs(); + } + break; + } + this.state = 7619; + this.match(MySqlParser.RR_BRACKET); + this.state = 7621; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1110, this.context)) { + case 1: + { + this.state = 7620; + this.overClause(); + } + break; + } + } + break; + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + this.enterOuterAlt(localContext, 3); + { + this.state = 7623; + _la = this.tokenStream.LA(1); + if (!(((((_la - 259)) & ~0x1F) === 0 && ((1 << (_la - 259)) & 62652423) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7624; + this.match(MySqlParser.LR_BRACKET); + this.state = 7626; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1111, this.context)) { + case 1: + { + this.state = 7625; + localContext._aggregator = this.match(MySqlParser.KW_ALL); + } + break; + } + this.state = 7628; + this.functionArg(); + this.state = 7629; + this.match(MySqlParser.RR_BRACKET); + this.state = 7631; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1112, this.context)) { + case 1: + { + this.state = 7630; + this.overClause(); + } + break; + } + } + break; + case MySqlParser.KW_GROUP_CONCAT: + this.enterOuterAlt(localContext, 4); + { + this.state = 7633; + this.match(MySqlParser.KW_GROUP_CONCAT); + this.state = 7634; + this.match(MySqlParser.LR_BRACKET); + this.state = 7636; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1113, this.context)) { + case 1: + { + this.state = 7635; + localContext._aggregator = this.match(MySqlParser.KW_DISTINCT); + } + break; + } + this.state = 7638; + this.functionArgs(); + this.state = 7649; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 7639; + this.match(MySqlParser.KW_ORDER); + this.state = 7640; + this.match(MySqlParser.KW_BY); + this.state = 7641; + this.orderByExpression(); + this.state = 7646; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7642; + this.match(MySqlParser.COMMA); + this.state = 7643; + this.orderByExpression(); + } + } + this.state = 7648; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + this.state = 7653; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 156) { + { + this.state = 7651; + this.match(MySqlParser.KW_SEPARATOR); + this.state = 7652; + localContext._separator = this.match(MySqlParser.STRING_LITERAL); + } + } + this.state = 7655; + this.match(MySqlParser.RR_BRACKET); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + nonAggregateWindowedFunction() { + let localContext = new NonAggregateWindowedFunctionContext(this.context, this.state); + this.enterRule(localContext, 772, MySqlParser.RULE_nonAggregateWindowedFunction); + let _la; + try { + this.state = 7697; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_LAG: + case MySqlParser.KW_LEAD: + this.enterOuterAlt(localContext, 1); + { + this.state = 7659; + _la = this.tokenStream.LA(1); + if (!(_la === 267 || _la === 269)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7660; + this.match(MySqlParser.LR_BRACKET); + this.state = 7661; + this.expression(0); + this.state = 7664; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1118, this.context)) { + case 1: + { + this.state = 7662; + this.match(MySqlParser.COMMA); + this.state = 7663; + this.decimalLiteral(); + } + break; + } + this.state = 7668; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 868) { + { + this.state = 7666; + this.match(MySqlParser.COMMA); + this.state = 7667; + this.decimalLiteral(); + } + } + this.state = 7670; + this.match(MySqlParser.RR_BRACKET); + this.state = 7671; + this.overClause(); + } + break; + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_LAST_VALUE: + this.enterOuterAlt(localContext, 2); + { + this.state = 7673; + _la = this.tokenStream.LA(1); + if (!(_la === 265 || _la === 268)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7674; + this.match(MySqlParser.LR_BRACKET); + this.state = 7675; + this.expression(0); + this.state = 7676; + this.match(MySqlParser.RR_BRACKET); + this.state = 7677; + this.overClause(); + } + break; + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + this.enterOuterAlt(localContext, 3); + { + this.state = 7679; + _la = this.tokenStream.LA(1); + if (!(((((_la - 263)) & ~0x1F) === 0 && ((1 << (_la - 263)) & 14339) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7680; + this.match(MySqlParser.LR_BRACKET); + this.state = 7681; + this.match(MySqlParser.RR_BRACKET); + this.state = 7682; + this.overClause(); + } + break; + case MySqlParser.KW_NTH_VALUE: + this.enterOuterAlt(localContext, 4); + { + this.state = 7683; + this.match(MySqlParser.KW_NTH_VALUE); + this.state = 7684; + this.match(MySqlParser.LR_BRACKET); + this.state = 7685; + this.expression(0); + this.state = 7686; + this.match(MySqlParser.COMMA); + this.state = 7687; + this.decimalLiteral(); + this.state = 7688; + this.match(MySqlParser.RR_BRACKET); + this.state = 7689; + this.overClause(); + } + break; + case MySqlParser.KW_NTILE: + this.enterOuterAlt(localContext, 5); + { + this.state = 7691; + this.match(MySqlParser.KW_NTILE); + this.state = 7692; + this.match(MySqlParser.LR_BRACKET); + this.state = 7693; + this.decimalLiteral(); + this.state = 7694; + this.match(MySqlParser.RR_BRACKET); + this.state = 7695; + this.overClause(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + overClause() { + let localContext = new OverClauseContext(this.context, this.state); + this.enterRule(localContext, 774, MySqlParser.RULE_overClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7699; + this.match(MySqlParser.KW_OVER); + this.state = 7705; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LR_BRACKET: + { + this.state = 7700; + this.match(MySqlParser.LR_BRACKET); + this.state = 7701; + this.windowSpec(); + this.state = 7702; + this.match(MySqlParser.RR_BRACKET); + } + break; + case MySqlParser.KW_ARRAY: + case MySqlParser.KW_ATTRIBUTE: + case MySqlParser.KW_BUCKETS: + case MySqlParser.KW_CONDITION: + case MySqlParser.KW_CURRENT: + case MySqlParser.KW_CURRENT_USER: + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_DEFAULT: + case MySqlParser.KW_DIAGNOSTICS: + case MySqlParser.KW_EMPTY: + case MySqlParser.KW_ENFORCED: + case MySqlParser.KW_EXCEPT: + case MySqlParser.KW_GROUP: + case MySqlParser.KW_IF: + case MySqlParser.KW_INSERT: + case MySqlParser.KW_LATERAL: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_NUMBER: + case MySqlParser.KW_OPTIONAL: + case MySqlParser.KW_ORDER: + case MySqlParser.KW_PRIMARY: + case MySqlParser.KW_REPEAT: + case MySqlParser.KW_REPLACE: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_SKIP_QUERY_REWRITE: + case MySqlParser.KW_STACKED: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_DATETIME: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_BINARY: + case MySqlParser.KW_TEXT: + case MySqlParser.KW_ENUM: + case MySqlParser.KW_SERIAL: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_NESTED: + case MySqlParser.KW_ORDINALITY: + case MySqlParser.KW_PATH: + case MySqlParser.KW_AVG: + case MySqlParser.KW_BIT_AND: + case MySqlParser.KW_BIT_OR: + case MySqlParser.KW_BIT_XOR: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_GROUP_CONCAT: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_MAX: + case MySqlParser.KW_MIN: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_STD: + case MySqlParser.KW_STDDEV: + case MySqlParser.KW_STDDEV_POP: + case MySqlParser.KW_STDDEV_SAMP: + case MySqlParser.KW_SUM: + case MySqlParser.KW_VAR_POP: + case MySqlParser.KW_VAR_SAMP: + case MySqlParser.KW_VARIANCE: + case MySqlParser.KW_CURRENT_DATE: + case MySqlParser.KW_CURRENT_TIME: + case MySqlParser.KW_CURRENT_TIMESTAMP: + case MySqlParser.KW_LOCALTIME: + case MySqlParser.KW_CURDATE: + case MySqlParser.KW_CURTIME: + case MySqlParser.KW_DATE_ADD: + case MySqlParser.KW_DATE_SUB: + case MySqlParser.KW_LOCALTIMESTAMP: + case MySqlParser.KW_NOW: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_SUBSTR: + case MySqlParser.KW_SUBSTRING: + case MySqlParser.KW_SYSDATE: + case MySqlParser.KW_TRIM: + case MySqlParser.KW_UTC_DATE: + case MySqlParser.KW_UTC_TIME: + case MySqlParser.KW_UTC_TIMESTAMP: + case MySqlParser.KW_ACCOUNT: + case MySqlParser.KW_ACTION: + case MySqlParser.KW_AFTER: + case MySqlParser.KW_AGGREGATE: + case MySqlParser.KW_ALGORITHM: + case MySqlParser.KW_ANY: + case MySqlParser.KW_AT: + case MySqlParser.KW_AUTHORS: + case MySqlParser.KW_AUTOCOMMIT: + case MySqlParser.KW_AUTOEXTEND_SIZE: + case MySqlParser.KW_AUTO_INCREMENT: + case MySqlParser.KW_AVG_ROW_LENGTH: + case MySqlParser.KW_BEGIN: + case MySqlParser.KW_BINLOG: + case MySqlParser.KW_BIT: + case MySqlParser.KW_BLOCK: + case MySqlParser.KW_BOOL: + case MySqlParser.KW_BOOLEAN: + case MySqlParser.KW_BTREE: + case MySqlParser.KW_CACHE: + case MySqlParser.KW_CASCADED: + case MySqlParser.KW_CHAIN: + case MySqlParser.KW_CHANGED: + case MySqlParser.KW_CHANNEL: + case MySqlParser.KW_CHECKSUM: + case MySqlParser.KW_CIPHER: + case MySqlParser.KW_CLASS_ORIGIN: + case MySqlParser.KW_CLIENT: + case MySqlParser.KW_CLOSE: + case MySqlParser.KW_COALESCE: + case MySqlParser.KW_CODE: + case MySqlParser.KW_COLUMNS: + case MySqlParser.KW_COLUMN_FORMAT: + case MySqlParser.KW_COLUMN_NAME: + case MySqlParser.KW_COMMENT: + case MySqlParser.KW_COMMIT: + case MySqlParser.KW_COMPACT: + case MySqlParser.KW_COMPLETION: + case MySqlParser.KW_COMPRESSED: + case MySqlParser.KW_COMPRESSION: + case MySqlParser.KW_CONCURRENT: + case MySqlParser.KW_CONNECT: + case MySqlParser.KW_CONNECTION: + case MySqlParser.KW_CONSISTENT: + case MySqlParser.KW_CONSTRAINT_CATALOG: + case MySqlParser.KW_CONSTRAINT_SCHEMA: + case MySqlParser.KW_CONSTRAINT_NAME: + case MySqlParser.KW_CONTAINS: + case MySqlParser.KW_CONTEXT: + case MySqlParser.KW_CONTRIBUTORS: + case MySqlParser.KW_COPY: + case MySqlParser.KW_CPU: + case MySqlParser.KW_CURSOR_NAME: + case MySqlParser.KW_DATA: + case MySqlParser.KW_DATAFILE: + case MySqlParser.KW_DEALLOCATE: + case MySqlParser.KW_DEFAULT_AUTH: + case MySqlParser.KW_DEFINER: + case MySqlParser.KW_DELAY_KEY_WRITE: + case MySqlParser.KW_DES_KEY_FILE: + case MySqlParser.KW_DIRECTORY: + case MySqlParser.KW_DISABLE: + case MySqlParser.KW_DISCARD: + case MySqlParser.KW_DISK: + case MySqlParser.KW_DO: + case MySqlParser.KW_DUMPFILE: + case MySqlParser.KW_DUPLICATE: + case MySqlParser.KW_DYNAMIC: + case MySqlParser.KW_ENABLE: + case MySqlParser.KW_ENCRYPTION: + case MySqlParser.KW_END: + case MySqlParser.KW_ENDS: + case MySqlParser.KW_ENGINE: + case MySqlParser.KW_ENGINES: + case MySqlParser.KW_ERROR: + case MySqlParser.KW_ERRORS: + case MySqlParser.KW_ESCAPE: + case MySqlParser.KW_EVENT: + case MySqlParser.KW_EVENTS: + case MySqlParser.KW_EVERY: + case MySqlParser.KW_EXCHANGE: + case MySqlParser.KW_EXCLUSIVE: + case MySqlParser.KW_EXPIRE: + case MySqlParser.KW_EXPORT: + case MySqlParser.KW_EXTENDED: + case MySqlParser.KW_EXTENT_SIZE: + case MySqlParser.KW_FAILED_LOGIN_ATTEMPTS: + case MySqlParser.KW_FAST: + case MySqlParser.KW_FAULTS: + case MySqlParser.KW_FIELDS: + case MySqlParser.KW_FILE_BLOCK_SIZE: + case MySqlParser.KW_FILTER: + case MySqlParser.KW_FIRST: + case MySqlParser.KW_FIXED: + case MySqlParser.KW_FLUSH: + case MySqlParser.KW_FOLLOWS: + case MySqlParser.KW_FOUND: + case MySqlParser.KW_FULL: + case MySqlParser.KW_FUNCTION: + case MySqlParser.KW_GENERAL: + case MySqlParser.KW_GLOBAL: + case MySqlParser.KW_GRANTS: + case MySqlParser.KW_GROUP_REPLICATION: + case MySqlParser.KW_HANDLER: + case MySqlParser.KW_HASH: + case MySqlParser.KW_HELP: + case MySqlParser.KW_HISTORY: + case MySqlParser.KW_HOST: + case MySqlParser.KW_HOSTS: + case MySqlParser.KW_IDENTIFIED: + case MySqlParser.KW_IGNORE_SERVER_IDS: + case MySqlParser.KW_IMPORT: + case MySqlParser.KW_INDEXES: + case MySqlParser.KW_INITIAL_SIZE: + case MySqlParser.KW_INPLACE: + case MySqlParser.KW_INSERT_METHOD: + case MySqlParser.KW_INSTALL: + case MySqlParser.KW_INSTANCE: + case MySqlParser.KW_INSTANT: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_INVOKER: + case MySqlParser.KW_IO: + case MySqlParser.KW_IO_THREAD: + case MySqlParser.KW_IPC: + case MySqlParser.KW_ISOLATION: + case MySqlParser.KW_ISSUER: + case MySqlParser.KW_JSON: + case MySqlParser.KW_KEY_BLOCK_SIZE: + case MySqlParser.KW_LANGUAGE: + case MySqlParser.KW_LAST: + case MySqlParser.KW_LEAVES: + case MySqlParser.KW_LESS: + case MySqlParser.KW_LEVEL: + case MySqlParser.KW_LIST: + case MySqlParser.KW_LOCAL: + case MySqlParser.KW_LOGFILE: + case MySqlParser.KW_LOGS: + case MySqlParser.KW_MASTER: + case MySqlParser.KW_MASTER_AUTO_POSITION: + case MySqlParser.KW_MASTER_CONNECT_RETRY: + case MySqlParser.KW_MASTER_DELAY: + case MySqlParser.KW_MASTER_HEARTBEAT_PERIOD: + case MySqlParser.KW_MASTER_HOST: + case MySqlParser.KW_MASTER_LOG_FILE: + case MySqlParser.KW_MASTER_LOG_POS: + case MySqlParser.KW_MASTER_PASSWORD: + case MySqlParser.KW_MASTER_PORT: + case MySqlParser.KW_MASTER_RETRY_COUNT: + case MySqlParser.KW_MASTER_SSL: + case MySqlParser.KW_MASTER_SSL_CA: + case MySqlParser.KW_MASTER_SSL_CAPATH: + case MySqlParser.KW_MASTER_SSL_CERT: + case MySqlParser.KW_MASTER_SSL_CIPHER: + case MySqlParser.KW_MASTER_SSL_CRL: + case MySqlParser.KW_MASTER_SSL_CRLPATH: + case MySqlParser.KW_MASTER_SSL_KEY: + case MySqlParser.KW_MASTER_TLS_VERSION: + case MySqlParser.KW_MASTER_USER: + case MySqlParser.KW_MAX_CONNECTIONS_PER_HOUR: + case MySqlParser.KW_MAX_QUERIES_PER_HOUR: + case MySqlParser.KW_MAX_ROWS: + case MySqlParser.KW_MAX_SIZE: + case MySqlParser.KW_MAX_UPDATES_PER_HOUR: + case MySqlParser.KW_MAX_USER_CONNECTIONS: + case MySqlParser.KW_MEDIUM: + case MySqlParser.KW_MEMBER: + case MySqlParser.KW_MERGE: + case MySqlParser.KW_MESSAGE_TEXT: + case MySqlParser.KW_MID: + case MySqlParser.KW_MIGRATE: + case MySqlParser.KW_MIN_ROWS: + case MySqlParser.KW_MODE: + case MySqlParser.KW_MODIFY: + case MySqlParser.KW_MUTEX: + case MySqlParser.KW_MYSQL: + case MySqlParser.KW_MYSQL_ERRNO: + case MySqlParser.KW_NAME: + case MySqlParser.KW_NAMES: + case MySqlParser.KW_NCHAR: + case MySqlParser.KW_NEVER: + case MySqlParser.KW_NEXT: + case MySqlParser.KW_NO: + case MySqlParser.KW_NOWAIT: + case MySqlParser.KW_NODEGROUP: + case MySqlParser.KW_NONE: + case MySqlParser.KW_ODBC: + case MySqlParser.KW_OFFLINE: + case MySqlParser.KW_OFFSET: + case MySqlParser.KW_OF: + case MySqlParser.KW_OLD_PASSWORD: + case MySqlParser.KW_ONE: + case MySqlParser.KW_ONLINE: + case MySqlParser.KW_ONLY: + case MySqlParser.KW_OPEN: + case MySqlParser.KW_OPTIMIZER_COSTS: + case MySqlParser.KW_OPTIONS: + case MySqlParser.KW_OWNER: + case MySqlParser.KW_PACK_KEYS: + case MySqlParser.KW_PAGE: + case MySqlParser.KW_PAGE_CHECKSUM: + case MySqlParser.KW_PARSER: + case MySqlParser.KW_PARTIAL: + case MySqlParser.KW_PARTITIONING: + case MySqlParser.KW_PARTITIONS: + case MySqlParser.KW_PASSWORD: + case MySqlParser.KW_PASSWORD_LOCK_TIME: + case MySqlParser.KW_PHASE: + case MySqlParser.KW_PLUGIN: + case MySqlParser.KW_PLUGIN_DIR: + case MySqlParser.KW_PLUGINS: + case MySqlParser.KW_PORT: + case MySqlParser.KW_PRECEDES: + case MySqlParser.KW_PREPARE: + case MySqlParser.KW_PRESERVE: + case MySqlParser.KW_PREV: + case MySqlParser.KW_PROCESSLIST: + case MySqlParser.KW_PROFILE: + case MySqlParser.KW_PROFILES: + case MySqlParser.KW_PROXY: + case MySqlParser.KW_QUERY: + case MySqlParser.KW_QUICK: + case MySqlParser.KW_REBUILD: + case MySqlParser.KW_RECOVER: + case MySqlParser.KW_RECURSIVE: + case MySqlParser.KW_REDO_BUFFER_SIZE: + case MySqlParser.KW_REDUNDANT: + case MySqlParser.KW_RELAY: + case MySqlParser.KW_RELAY_LOG_FILE: + case MySqlParser.KW_RELAY_LOG_POS: + case MySqlParser.KW_RELAYLOG: + case MySqlParser.KW_REMOVE: + case MySqlParser.KW_REORGANIZE: + case MySqlParser.KW_REPAIR: + case MySqlParser.KW_REPLICATE_DO_DB: + case MySqlParser.KW_REPLICATE_DO_TABLE: + case MySqlParser.KW_REPLICATE_IGNORE_DB: + case MySqlParser.KW_REPLICATE_IGNORE_TABLE: + case MySqlParser.KW_REPLICATE_REWRITE_DB: + case MySqlParser.KW_REPLICATE_WILD_DO_TABLE: + case MySqlParser.KW_REPLICATE_WILD_IGNORE_TABLE: + case MySqlParser.KW_REPLICATION: + case MySqlParser.KW_RESET: + case MySqlParser.KW_RESUME: + case MySqlParser.KW_RETURNED_SQLSTATE: + case MySqlParser.KW_RETURNS: + case MySqlParser.KW_REUSE: + case MySqlParser.KW_ROLE: + case MySqlParser.KW_ROLLBACK: + case MySqlParser.KW_ROLLUP: + case MySqlParser.KW_ROTATE: + case MySqlParser.KW_ROW: + case MySqlParser.KW_ROWS: + case MySqlParser.KW_ROW_FORMAT: + case MySqlParser.KW_SAVEPOINT: + case MySqlParser.KW_SCHEDULE: + case MySqlParser.KW_SECURITY: + case MySqlParser.KW_SERVER: + case MySqlParser.KW_SESSION: + case MySqlParser.KW_SHARE: + case MySqlParser.KW_SHARED: + case MySqlParser.KW_SIGNED: + case MySqlParser.KW_SIMPLE: + case MySqlParser.KW_SLAVE: + case MySqlParser.KW_SLOW: + case MySqlParser.KW_SNAPSHOT: + case MySqlParser.KW_SOCKET: + case MySqlParser.KW_SOME: + case MySqlParser.KW_SONAME: + case MySqlParser.KW_SOUNDS: + case MySqlParser.KW_SOURCE: + case MySqlParser.KW_SQL_AFTER_GTIDS: + case MySqlParser.KW_SQL_AFTER_MTS_GAPS: + case MySqlParser.KW_SQL_BEFORE_GTIDS: + case MySqlParser.KW_SQL_BUFFER_RESULT: + case MySqlParser.KW_SQL_CACHE: + case MySqlParser.KW_SQL_NO_CACHE: + case MySqlParser.KW_SQL_THREAD: + case MySqlParser.KW_START: + case MySqlParser.KW_STARTS: + case MySqlParser.KW_STATS_AUTO_RECALC: + case MySqlParser.KW_STATS_PERSISTENT: + case MySqlParser.KW_STATS_SAMPLE_PAGES: + case MySqlParser.KW_STATUS: + case MySqlParser.KW_STOP: + case MySqlParser.KW_STORAGE: + case MySqlParser.KW_STRING: + case MySqlParser.KW_SUBCLASS_ORIGIN: + case MySqlParser.KW_SUBJECT: + case MySqlParser.KW_SUBPARTITION: + case MySqlParser.KW_SUBPARTITIONS: + case MySqlParser.KW_SUSPEND: + case MySqlParser.KW_SWAPS: + case MySqlParser.KW_SWITCHES: + case MySqlParser.KW_TABLE_NAME: + case MySqlParser.KW_TABLESPACE: + case MySqlParser.KW_TABLE_TYPE: + case MySqlParser.KW_TEMPORARY: + case MySqlParser.KW_TEMPTABLE: + case MySqlParser.KW_THAN: + case MySqlParser.KW_TRADITIONAL: + case MySqlParser.KW_TRANSACTION: + case MySqlParser.KW_TRANSACTIONAL: + case MySqlParser.KW_TRIGGERS: + case MySqlParser.KW_TRUNCATE: + case MySqlParser.KW_UNBOUNDED: + case MySqlParser.KW_UNDEFINED: + case MySqlParser.KW_UNDOFILE: + case MySqlParser.KW_UNDO_BUFFER_SIZE: + case MySqlParser.KW_UNINSTALL: + case MySqlParser.KW_UNKNOWN: + case MySqlParser.KW_UNTIL: + case MySqlParser.KW_UPGRADE: + case MySqlParser.KW_USER: + case MySqlParser.KW_USE_FRM: + case MySqlParser.KW_USER_RESOURCES: + case MySqlParser.KW_VALIDATION: + case MySqlParser.KW_VALUE: + case MySqlParser.KW_VARIABLES: + case MySqlParser.KW_VIEW: + case MySqlParser.KW_VIRTUAL: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_WAIT: + case MySqlParser.KW_WARNINGS: + case MySqlParser.KW_WITHOUT: + case MySqlParser.KW_WORK: + case MySqlParser.KW_WRAPPER: + case MySqlParser.KW_X509: + case MySqlParser.KW_XA: + case MySqlParser.KW_XML: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_ADMIN: + case MySqlParser.KW_AUDIT_ABORT_EXEMPT: + case MySqlParser.KW_AUDIT_ADMIN: + case MySqlParser.KW_AUTHENTICATION_POLICY_ADMIN: + case MySqlParser.KW_BACKUP_ADMIN: + case MySqlParser.KW_BINLOG_ADMIN: + case MySqlParser.KW_BINLOG_ENCRYPTION_ADMIN: + case MySqlParser.KW_CLONE_ADMIN: + case MySqlParser.KW_CONNECTION_ADMIN: + case MySqlParser.KW_ENCRYPTION_KEY_ADMIN: + case MySqlParser.KW_EXECUTE: + case MySqlParser.KW_FILE: + case MySqlParser.KW_FIREWALL_ADMIN: + case MySqlParser.KW_FIREWALL_EXEMPT: + case MySqlParser.KW_FIREWALL_USER: + case MySqlParser.KW_GROUP_REPLICATION_ADMIN: + case MySqlParser.KW_INNODB_REDO_LOG_ARCHIVE: + case MySqlParser.KW_INVOKE: + case MySqlParser.KW_LAMBDA: + case MySqlParser.KW_NDB_STORED_USER: + case MySqlParser.KW_PASSWORDLESS_USER_ADMIN: + case MySqlParser.KW_PERSIST_RO_VARIABLES_ADMIN: + case MySqlParser.KW_PRIVILEGES: + case MySqlParser.KW_PROCESS: + case MySqlParser.KW_RELOAD: + case MySqlParser.KW_REPLICATION_APPLIER: + case MySqlParser.KW_REPLICATION_SLAVE_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_ADMIN: + case MySqlParser.KW_RESOURCE_GROUP_USER: + case MySqlParser.KW_ROLE_ADMIN: + case MySqlParser.KW_ROUTINE: + case MySqlParser.KW_S3: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_SET_USER_ID: + case MySqlParser.KW_SHOW_ROUTINE: + case MySqlParser.KW_SHUTDOWN: + case MySqlParser.KW_SUPER: + case MySqlParser.KW_SYSTEM_VARIABLES_ADMIN: + case MySqlParser.KW_TABLES: + case MySqlParser.KW_TABLE_ENCRYPTION_ADMIN: + case MySqlParser.KW_VERSION_TOKEN_ADMIN: + case MySqlParser.KW_XA_RECOVER_ADMIN: + case MySqlParser.KW_ARMSCII8: + case MySqlParser.KW_ASCII: + case MySqlParser.KW_BIG5: + case MySqlParser.KW_CP1250: + case MySqlParser.KW_CP1251: + case MySqlParser.KW_CP1256: + case MySqlParser.KW_CP1257: + case MySqlParser.KW_CP850: + case MySqlParser.KW_CP852: + case MySqlParser.KW_CP866: + case MySqlParser.KW_CP932: + case MySqlParser.KW_DEC8: + case MySqlParser.KW_EUCJPMS: + case MySqlParser.KW_EUCKR: + case MySqlParser.KW_GB18030: + case MySqlParser.KW_GB2312: + case MySqlParser.KW_GBK: + case MySqlParser.KW_GEOSTD8: + case MySqlParser.KW_GREEK: + case MySqlParser.KW_HEBREW: + case MySqlParser.KW_HP8: + case MySqlParser.KW_KEYBCS2: + case MySqlParser.KW_KOI8R: + case MySqlParser.KW_KOI8U: + case MySqlParser.KW_LATIN1: + case MySqlParser.KW_LATIN2: + case MySqlParser.KW_LATIN5: + case MySqlParser.KW_LATIN7: + case MySqlParser.KW_MACCE: + case MySqlParser.KW_MACROMAN: + case MySqlParser.KW_SJIS: + case MySqlParser.KW_SWE7: + case MySqlParser.KW_TIS620: + case MySqlParser.KW_UCS2: + case MySqlParser.KW_UJIS: + case MySqlParser.KW_UTF16: + case MySqlParser.KW_UTF16LE: + case MySqlParser.KW_UTF32: + case MySqlParser.KW_UTF8: + case MySqlParser.KW_UTF8MB3: + case MySqlParser.KW_UTF8MB4: + case MySqlParser.KW_ARCHIVE: + case MySqlParser.KW_BLACKHOLE: + case MySqlParser.KW_CSV: + case MySqlParser.KW_FEDERATED: + case MySqlParser.KW_INNODB: + case MySqlParser.KW_MEMORY: + case MySqlParser.KW_MRG_MYISAM: + case MySqlParser.KW_MYISAM: + case MySqlParser.KW_NDB: + case MySqlParser.KW_NDBCLUSTER: + case MySqlParser.KW_PERFORMANCE_SCHEMA: + case MySqlParser.KW_TOKUDB: + case MySqlParser.KW_REPEATABLE: + case MySqlParser.KW_COMMITTED: + case MySqlParser.KW_UNCOMMITTED: + case MySqlParser.KW_SERIALIZABLE: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CATALOG_NAME: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_ENGINE_ATTRIBUTE: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SCHEMA_NAME: + case MySqlParser.KW_SECONDARY_ENGINE_ATTRIBUTE: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_TP_CONNECTION_ADMIN: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + case MySqlParser.CHARSET_REVERSE_QOUTE_STRING: + case MySqlParser.STRING_LITERAL: + case MySqlParser.ID: + { + this.state = 7704; + this.windowName(); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + windowSpec() { + let localContext = new WindowSpecContext(this.context, this.state); + this.enterRule(localContext, 776, MySqlParser.RULE_windowSpec); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7708; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1122, this.context)) { + case 1: + { + this.state = 7707; + this.windowName(); + } + break; + } + this.state = 7711; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 130) { + { + this.state = 7710; + this.partitionClause(); + } + } + this.state = 7714; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 125) { + { + this.state = 7713; + this.orderByClause(); + } + } + this.state = 7717; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 134 || _la === 587) { + { + this.state = 7716; + this.frameClause(); + } + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + windowName() { + let localContext = new WindowNameContext(this.context, this.state); + this.enterRule(localContext, 778, MySqlParser.RULE_windowName); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7719; + this.uid(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameClause() { + let localContext = new FrameClauseContext(this.context, this.state); + this.enterRule(localContext, 780, MySqlParser.RULE_frameClause); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7721; + this.frameUnits(); + this.state = 7722; + this.frameExtent(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameUnits() { + let localContext = new FrameUnitsContext(this.context, this.state); + this.enterRule(localContext, 782, MySqlParser.RULE_frameUnits); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7724; + _la = this.tokenStream.LA(1); + if (!(_la === 134 || _la === 587)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameExtent() { + let localContext = new FrameExtentContext(this.context, this.state); + this.enterRule(localContext, 784, MySqlParser.RULE_frameExtent); + try { + this.state = 7728; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1126, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7726; + this.frameRange(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7727; + this.frameBetween(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameBetween() { + let localContext = new FrameBetweenContext(this.context, this.state); + this.enterRule(localContext, 786, MySqlParser.RULE_frameBetween); + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7730; + this.match(MySqlParser.KW_BETWEEN); + this.state = 7731; + this.frameRange(); + this.state = 7732; + this.match(MySqlParser.KW_AND); + this.state = 7733; + this.frameRange(); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + frameRange() { + let localContext = new FrameRangeContext(this.context, this.state); + this.enterRule(localContext, 788, MySqlParser.RULE_frameRange); + let _la; + try { + this.state = 7742; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1127, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7735; + this.match(MySqlParser.KW_CURRENT); + this.state = 7736; + this.match(MySqlParser.KW_ROW); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7737; + this.match(MySqlParser.KW_UNBOUNDED); + this.state = 7738; + _la = this.tokenStream.LA(1); + if (!(_la === 405 || _la === 539)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7739; + this.expression(0); + this.state = 7740; + _la = this.tokenStream.LA(1); + if (!(_la === 405 || _la === 539)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + partitionClause() { + let localContext = new PartitionClauseContext(this.context, this.state); + this.enterRule(localContext, 790, MySqlParser.RULE_partitionClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7744; + this.match(MySqlParser.KW_PARTITION); + this.state = 7745; + this.match(MySqlParser.KW_BY); + this.state = 7746; + this.expression(0); + this.state = 7751; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7747; + this.match(MySqlParser.COMMA); + this.state = 7748; + this.expression(0); + } + } + this.state = 7753; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + scalarFunctionName() { + let localContext = new ScalarFunctionNameContext(this.context, this.state); + this.enterRule(localContext, 792, MySqlParser.RULE_scalarFunctionName); + try { + this.state = 7778; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_DATABASE: + case MySqlParser.KW_LEFT: + case MySqlParser.KW_RIGHT: + case MySqlParser.KW_SCHEMA: + case MySqlParser.KW_DATE: + case MySqlParser.KW_TIME: + case MySqlParser.KW_TIMESTAMP: + case MySqlParser.KW_YEAR: + case MySqlParser.KW_JSON_TABLE: + case MySqlParser.KW_JSON_VALUE: + case MySqlParser.KW_COUNT: + case MySqlParser.KW_CUME_DIST: + case MySqlParser.KW_DENSE_RANK: + case MySqlParser.KW_FIRST_VALUE: + case MySqlParser.KW_LAG: + case MySqlParser.KW_LAST_VALUE: + case MySqlParser.KW_LEAD: + case MySqlParser.KW_NTILE: + case MySqlParser.KW_NTH_VALUE: + case MySqlParser.KW_PERCENT_RANK: + case MySqlParser.KW_RANK: + case MySqlParser.KW_ROW_NUMBER: + case MySqlParser.KW_POSITION: + case MySqlParser.KW_INVISIBLE: + case MySqlParser.KW_VISIBLE: + case MySqlParser.KW_QUARTER: + case MySqlParser.KW_MONTH: + case MySqlParser.KW_DAY: + case MySqlParser.KW_HOUR: + case MySqlParser.KW_MINUTE: + case MySqlParser.KW_WEEK: + case MySqlParser.KW_SECOND: + case MySqlParser.KW_MICROSECOND: + case MySqlParser.KW_SESSION_VARIABLES_ADMIN: + case MySqlParser.KW_GEOMETRYCOLLECTION: + case MySqlParser.KW_LINESTRING: + case MySqlParser.KW_MULTILINESTRING: + case MySqlParser.KW_MULTIPOINT: + case MySqlParser.KW_MULTIPOLYGON: + case MySqlParser.KW_POINT: + case MySqlParser.KW_POLYGON: + case MySqlParser.KW_CHARSET: + case MySqlParser.KW_COLLATION: + case MySqlParser.KW_FORMAT: + case MySqlParser.KW_GET_FORMAT: + case MySqlParser.KW_RANDOM: + case MySqlParser.KW_REVERSE: + case MySqlParser.KW_ROW_COUNT: + case MySqlParser.KW_SRID: + case MySqlParser.KW_SYSTEM_USER: + case MySqlParser.KW_WEIGHT_STRING: + case MySqlParser.MOD: + this.enterOuterAlt(localContext, 1); + { + this.state = 7754; + this.functionNameBase(); + } + break; + case MySqlParser.KW_ASCII: + this.enterOuterAlt(localContext, 2); + { + this.state = 7755; + this.match(MySqlParser.KW_ASCII); + } + break; + case MySqlParser.KW_CURDATE: + this.enterOuterAlt(localContext, 3); + { + this.state = 7756; + this.match(MySqlParser.KW_CURDATE); + } + break; + case MySqlParser.KW_CURRENT_DATE: + this.enterOuterAlt(localContext, 4); + { + this.state = 7757; + this.match(MySqlParser.KW_CURRENT_DATE); + } + break; + case MySqlParser.KW_CURRENT_TIME: + this.enterOuterAlt(localContext, 5); + { + this.state = 7758; + this.match(MySqlParser.KW_CURRENT_TIME); + } + break; + case MySqlParser.KW_CURRENT_TIMESTAMP: + this.enterOuterAlt(localContext, 6); + { + this.state = 7759; + this.match(MySqlParser.KW_CURRENT_TIMESTAMP); + } + break; + case MySqlParser.KW_CURTIME: + this.enterOuterAlt(localContext, 7); + { + this.state = 7760; + this.match(MySqlParser.KW_CURTIME); + } + break; + case MySqlParser.KW_DATE_ADD: + this.enterOuterAlt(localContext, 8); + { + this.state = 7761; + this.match(MySqlParser.KW_DATE_ADD); + } + break; + case MySqlParser.KW_DATE_SUB: + this.enterOuterAlt(localContext, 9); + { + this.state = 7762; + this.match(MySqlParser.KW_DATE_SUB); + } + break; + case MySqlParser.KW_IF: + this.enterOuterAlt(localContext, 10); + { + this.state = 7763; + this.match(MySqlParser.KW_IF); + } + break; + case MySqlParser.KW_INSERT: + this.enterOuterAlt(localContext, 11); + { + this.state = 7764; + this.match(MySqlParser.KW_INSERT); + } + break; + case MySqlParser.KW_LOCALTIME: + this.enterOuterAlt(localContext, 12); + { + this.state = 7765; + this.match(MySqlParser.KW_LOCALTIME); + } + break; + case MySqlParser.KW_LOCALTIMESTAMP: + this.enterOuterAlt(localContext, 13); + { + this.state = 7766; + this.match(MySqlParser.KW_LOCALTIMESTAMP); + } + break; + case MySqlParser.KW_MID: + this.enterOuterAlt(localContext, 14); + { + this.state = 7767; + this.match(MySqlParser.KW_MID); + } + break; + case MySqlParser.KW_NOW: + this.enterOuterAlt(localContext, 15); + { + this.state = 7768; + this.match(MySqlParser.KW_NOW); + } + break; + case MySqlParser.KW_REPEAT: + this.enterOuterAlt(localContext, 16); + { + this.state = 7769; + this.match(MySqlParser.KW_REPEAT); + } + break; + case MySqlParser.KW_REPLACE: + this.enterOuterAlt(localContext, 17); + { + this.state = 7770; + this.match(MySqlParser.KW_REPLACE); + } + break; + case MySqlParser.KW_SUBSTR: + this.enterOuterAlt(localContext, 18); + { + this.state = 7771; + this.match(MySqlParser.KW_SUBSTR); + } + break; + case MySqlParser.KW_SUBSTRING: + this.enterOuterAlt(localContext, 19); + { + this.state = 7772; + this.match(MySqlParser.KW_SUBSTRING); + } + break; + case MySqlParser.KW_SYSDATE: + this.enterOuterAlt(localContext, 20); + { + this.state = 7773; + this.match(MySqlParser.KW_SYSDATE); + } + break; + case MySqlParser.KW_TRIM: + this.enterOuterAlt(localContext, 21); + { + this.state = 7774; + this.match(MySqlParser.KW_TRIM); + } + break; + case MySqlParser.KW_UTC_DATE: + this.enterOuterAlt(localContext, 22); + { + this.state = 7775; + this.match(MySqlParser.KW_UTC_DATE); + } + break; + case MySqlParser.KW_UTC_TIME: + this.enterOuterAlt(localContext, 23); + { + this.state = 7776; + this.match(MySqlParser.KW_UTC_TIME); + } + break; + case MySqlParser.KW_UTC_TIMESTAMP: + this.enterOuterAlt(localContext, 24); + { + this.state = 7777; + this.match(MySqlParser.KW_UTC_TIMESTAMP); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + passwordFunctionClause() { + let localContext = new PasswordFunctionClauseContext(this.context, this.state); + this.enterRule(localContext, 794, MySqlParser.RULE_passwordFunctionClause); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7780; + _la = this.tokenStream.LA(1); + if (!(_la === 512 || _la === 529)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7781; + this.match(MySqlParser.LR_BRACKET); + this.state = 7782; + this.functionArg(); + this.state = 7783; + this.match(MySqlParser.RR_BRACKET); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionArgs() { + let localContext = new FunctionArgsContext(this.context, this.state); + this.enterRule(localContext, 796, MySqlParser.RULE_functionArgs); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7785; + this.functionArg(); + this.state = 7790; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7786; + this.match(MySqlParser.COMMA); + this.state = 7787; + this.functionArg(); + } + } + this.state = 7792; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionArg() { + let localContext = new FunctionArgContext(this.context, this.state); + this.enterRule(localContext, 798, MySqlParser.RULE_functionArg); + try { + this.state = 7796; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1131, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7793; + this.constant(); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7794; + this.functionCall(); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7795; + this.expression(0); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + expression(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new ExpressionContext(this.context, parentState); + let previousContext = localContext; + let _startState = 800; + this.enterRecursionRule(localContext, 800, MySqlParser.RULE_expression, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 7809; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1133, this.context)) { + case 1: + { + localContext = new NotExpressionContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7799; + localContext._notOperator = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 114 || _la === 860)) { + localContext._notOperator = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7800; + this.expression(4); + } + break; + case 2: + { + localContext = new IsExpressionContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7801; + this.predicate(0); + this.state = 7802; + this.match(MySqlParser.KW_IS); + this.state = 7804; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7803; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7806; + localContext._testValue = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 63 || _la === 179 || _la === 674)) { + localContext._testValue = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + break; + case 3: + { + localContext = new PredicateExpressionContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7808; + this.predicate(0); + } + break; + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 7817; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1134, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + { + localContext = new LogicalExpressionContext(new ExpressionContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expression); + this.state = 7811; + if (!(this.precpred(this.context, 3))) { + throw this.createFailedPredicateException("this.precpred(this.context, 3)"); + } + this.state = 7812; + this.logicalOperator(); + this.state = 7813; + this.expression(4); + } + } + } + this.state = 7819; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1134, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + predicate(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new PredicateContext(this.context, parentState); + let previousContext = localContext; + let _startState = 802; + this.enterRecursionRule(localContext, 802, MySqlParser.RULE_predicate, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + { + localContext = new ExpressionAtomPredicateContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7821; + this.expressionAtom(0); + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 7886; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1143, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + this.state = 7884; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1142, this.context)) { + case 1: + { + localContext = new BetweenPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7823; + if (!(this.precpred(this.context, 6))) { + throw this.createFailedPredicateException("this.precpred(this.context, 6)"); + } + this.state = 7825; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7824; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7827; + this.match(MySqlParser.KW_BETWEEN); + this.state = 7828; + this.predicate(0); + this.state = 7829; + this.match(MySqlParser.KW_AND); + this.state = 7830; + this.predicate(7); + } + break; + case 2: + { + localContext = new SoundsLikePredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7832; + if (!(this.precpred(this.context, 5))) { + throw this.createFailedPredicateException("this.precpred(this.context, 5)"); + } + this.state = 7833; + this.match(MySqlParser.KW_SOUNDS); + this.state = 7834; + this.match(MySqlParser.KW_LIKE); + this.state = 7835; + this.predicate(6); + } + break; + case 3: + { + localContext = new RegexpPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7836; + if (!(this.precpred(this.context, 3))) { + throw this.createFailedPredicateException("this.precpred(this.context, 3)"); + } + this.state = 7838; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7837; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7840; + localContext._regex = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 139 || _la === 151)) { + localContext._regex = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7841; + this.predicate(4); + } + break; + case 4: + { + localContext = new InPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7842; + if (!(this.precpred(this.context, 9))) { + throw this.createFailedPredicateException("this.precpred(this.context, 9)"); + } + this.state = 7844; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7843; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7846; + this.match(MySqlParser.KW_IN); + this.state = 7847; + this.match(MySqlParser.LR_BRACKET); + this.state = 7850; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1138, this.context)) { + case 1: + { + this.state = 7848; + this.selectStatement(); + } + break; + case 2: + { + this.state = 7849; + this.expressions(); + } + break; + } + this.state = 7852; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 5: + { + localContext = new IsNullPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7854; + if (!(this.precpred(this.context, 8))) { + throw this.createFailedPredicateException("this.precpred(this.context, 8)"); + } + this.state = 7855; + this.match(MySqlParser.KW_IS); + this.state = 7856; + this.nullNotnull(); + } + break; + case 6: + { + localContext = new BinaryComparisonPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7857; + if (!(this.precpred(this.context, 7))) { + throw this.createFailedPredicateException("this.precpred(this.context, 7)"); + } + this.state = 7858; + this.comparisonOperator(); + this.state = 7865; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1139, this.context)) { + case 1: + { + this.state = 7859; + localContext._quantifier = this.tokenStream.LT(1); + _la = this.tokenStream.LA(1); + if (!(_la === 7 || _la === 309 || _la === 602)) { + localContext._quantifier = this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + this.state = 7860; + this.match(MySqlParser.LR_BRACKET); + this.state = 7861; + localContext._subQuery = this.selectStatement(); + this.state = 7862; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 2: + { + this.state = 7864; + localContext._right = this.predicate(0); + } + break; + } + } + break; + case 7: + { + localContext = new LikePredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7867; + if (!(this.precpred(this.context, 4))) { + throw this.createFailedPredicateException("this.precpred(this.context, 4)"); + } + this.state = 7869; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + if (_la === 114) { + { + this.state = 7868; + this.match(MySqlParser.KW_NOT); + } + } + this.state = 7871; + this.match(MySqlParser.KW_LIKE); + this.state = 7872; + this.predicate(0); + this.state = 7875; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1141, this.context)) { + case 1: + { + this.state = 7873; + this.match(MySqlParser.KW_ESCAPE); + this.state = 7874; + this.match(MySqlParser.STRING_LITERAL); + } + break; + } + } + break; + case 8: + { + localContext = new JsonMemberOfPredicateContext(new PredicateContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_predicate); + this.state = 7877; + if (!(this.precpred(this.context, 2))) { + throw this.createFailedPredicateException("this.precpred(this.context, 2)"); + } + this.state = 7878; + this.match(MySqlParser.KW_MEMBER); + this.state = 7879; + this.match(MySqlParser.KW_OF); + this.state = 7880; + this.match(MySqlParser.LR_BRACKET); + this.state = 7881; + this.predicate(0); + this.state = 7882; + this.match(MySqlParser.RR_BRACKET); + } + break; + } + } + } + this.state = 7888; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1143, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + expressionAtom(_p) { + if (_p === undefined) { + _p = 0; + } + let parentContext = this.context; + let parentState = this.state; + let localContext = new ExpressionAtomContext(this.context, parentState); + let previousContext = localContext; + let _startState = 804; + this.enterRecursionRule(localContext, 804, MySqlParser.RULE_expressionAtom, _p); + let _la; + try { + let alternative; + this.enterOuterAlt(localContext, 1); + { + this.state = 7937; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1146, this.context)) { + case 1: + { + localContext = new ConstantExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7890; + this.constant(); + } + break; + case 2: + { + localContext = new FunctionCallExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7891; + this.functionCall(); + } + break; + case 3: + { + localContext = new MysqlVariableExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7892; + this.mysqlVariable(); + } + break; + case 4: + { + localContext = new UnaryExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7893; + this.unaryOperator(); + this.state = 7894; + this.expressionAtom(12); + } + break; + case 5: + { + localContext = new BinaryExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7896; + this.match(MySqlParser.KW_BINARY); + this.state = 7897; + this.expressionAtom(11); + } + break; + case 6: + { + localContext = new VariableAssignExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7898; + this.match(MySqlParser.LOCAL_ID); + this.state = 7899; + this.match(MySqlParser.VAR_ASSIGN); + this.state = 7900; + this.expressionAtom(10); + } + break; + case 7: + { + localContext = new NestedExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7901; + this.match(MySqlParser.LR_BRACKET); + this.state = 7902; + this.expression(0); + this.state = 7907; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + while (_la === 868) { + { + { + this.state = 7903; + this.match(MySqlParser.COMMA); + this.state = 7904; + this.expression(0); + } + } + this.state = 7909; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } + this.state = 7910; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 8: + { + localContext = new NestedRowExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7912; + this.match(MySqlParser.KW_ROW); + this.state = 7913; + this.match(MySqlParser.LR_BRACKET); + this.state = 7914; + this.expression(0); + this.state = 7917; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + do { + { + { + this.state = 7915; + this.match(MySqlParser.COMMA); + this.state = 7916; + this.expression(0); + } + } + this.state = 7919; + this.errorHandler.sync(this); + _la = this.tokenStream.LA(1); + } while (_la === 868); + this.state = 7921; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 9: + { + localContext = new ExistsExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7923; + this.match(MySqlParser.KW_EXISTS); + this.state = 7924; + this.match(MySqlParser.LR_BRACKET); + this.state = 7925; + this.selectStatement(); + this.state = 7926; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 10: + { + localContext = new SubqueryExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7928; + this.match(MySqlParser.LR_BRACKET); + this.state = 7929; + this.selectStatement(); + this.state = 7930; + this.match(MySqlParser.RR_BRACKET); + } + break; + case 11: + { + localContext = new IntervalExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7932; + this.match(MySqlParser.KW_INTERVAL); + this.state = 7933; + this.expression(0); + this.state = 7934; + this.intervalType(); + } + break; + case 12: + { + localContext = new ColumnNameExpressionAtomContext(localContext); + this.context = localContext; + previousContext = localContext; + this.state = 7936; + this.columnName(); + } + break; + } + this.context.stop = this.tokenStream.LT(-1); + this.state = 7956; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1148, this.context); + while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER) { + if (alternative === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + previousContext = localContext; + { + this.state = 7954; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1147, this.context)) { + case 1: + { + localContext = new JsonExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + localContext._left = previousContext; + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7939; + if (!(this.precpred(this.context, 4))) { + throw this.createFailedPredicateException("this.precpred(this.context, 4)"); + } + this.state = 7940; + this.jsonOperator(); + this.state = 7941; + localContext._right = this.expressionAtom(5); + } + break; + case 2: + { + localContext = new BitExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + localContext._left = previousContext; + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7943; + if (!(this.precpred(this.context, 3))) { + throw this.createFailedPredicateException("this.precpred(this.context, 3)"); + } + this.state = 7944; + this.bitOperator(); + this.state = 7945; + localContext._right = this.expressionAtom(4); + } + break; + case 3: + { + localContext = new MathExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + localContext._left = previousContext; + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7947; + if (!(this.precpred(this.context, 2))) { + throw this.createFailedPredicateException("this.precpred(this.context, 2)"); + } + this.state = 7948; + this.mathOperator(); + this.state = 7949; + localContext._right = this.expressionAtom(3); + } + break; + case 4: + { + localContext = new CollateExpressionAtomContext(new ExpressionAtomContext(parentContext, parentState)); + this.pushNewRecursionContext(localContext, _startState, MySqlParser.RULE_expressionAtom); + this.state = 7951; + if (!(this.precpred(this.context, 14))) { + throw this.createFailedPredicateException("this.precpred(this.context, 14)"); + } + this.state = 7952; + this.match(MySqlParser.KW_COLLATE); + this.state = 7953; + this.collationName(); + } + break; + } + } + } + this.state = 7958; + this.errorHandler.sync(this); + alternative = this.interpreter.adaptivePredict(this.tokenStream, 1148, this.context); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.unrollRecursionContexts(parentContext); + } + return localContext; + } + unaryOperator() { + let localContext = new UnaryOperatorContext(this.context, this.state); + this.enterRule(localContext, 806, MySqlParser.RULE_unaryOperator); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7959; + _la = this.tokenStream.LA(1); + if (!(_la === 114 || ((((_la - 853)) & ~0x1F) === 0 && ((1 << (_la - 853)) & 387) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + comparisonOperator() { + let localContext = new ComparisonOperatorContext(this.context, this.state); + this.enterRule(localContext, 808, MySqlParser.RULE_comparisonOperator); + try { + this.state = 7969; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1149, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7961; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7962; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7963; + this.match(MySqlParser.EXCLAMATION_SYMBOL); + this.state = 7964; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7965; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7966; + this.match(MySqlParser.EQUAL_SYMBOL); + this.state = 7967; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7968; + this.comparisonBase(); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + comparisonBase() { + let localContext = new ComparisonBaseContext(this.context, this.state); + this.enterRule(localContext, 810, MySqlParser.RULE_comparisonBase); + try { + this.state = 7978; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1150, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 7971; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7972; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 7973; + this.match(MySqlParser.GREATER_SYMBOL); + this.state = 7974; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 3: + this.enterOuterAlt(localContext, 3); + { + this.state = 7975; + this.match(MySqlParser.EQUAL_SYMBOL); + } + break; + case 4: + this.enterOuterAlt(localContext, 4); + { + this.state = 7976; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 5: + this.enterOuterAlt(localContext, 5); + { + this.state = 7977; + this.match(MySqlParser.LESS_SYMBOL); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + logicalOperator() { + let localContext = new LogicalOperatorContext(this.context, this.state); + this.enterRule(localContext, 812, MySqlParser.RULE_logicalOperator); + try { + this.state = 7987; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.KW_AND: + this.enterOuterAlt(localContext, 1); + { + this.state = 7980; + this.match(MySqlParser.KW_AND); + } + break; + case MySqlParser.BIT_AND_OP: + this.enterOuterAlt(localContext, 2); + { + this.state = 7981; + this.match(MySqlParser.BIT_AND_OP); + this.state = 7982; + this.match(MySqlParser.BIT_AND_OP); + } + break; + case MySqlParser.KW_XOR: + this.enterOuterAlt(localContext, 3); + { + this.state = 7983; + this.match(MySqlParser.KW_XOR); + } + break; + case MySqlParser.KW_OR: + this.enterOuterAlt(localContext, 4); + { + this.state = 7984; + this.match(MySqlParser.KW_OR); + } + break; + case MySqlParser.BIT_OR_OP: + this.enterOuterAlt(localContext, 5); + { + this.state = 7985; + this.match(MySqlParser.BIT_OR_OP); + this.state = 7986; + this.match(MySqlParser.BIT_OR_OP); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + bitOperator() { + let localContext = new BitOperatorContext(this.context, this.state); + this.enterRule(localContext, 814, MySqlParser.RULE_bitOperator); + try { + this.state = 7996; + this.errorHandler.sync(this); + switch (this.tokenStream.LA(1)) { + case MySqlParser.LESS_SYMBOL: + this.enterOuterAlt(localContext, 1); + { + this.state = 7989; + this.match(MySqlParser.LESS_SYMBOL); + this.state = 7990; + this.match(MySqlParser.LESS_SYMBOL); + } + break; + case MySqlParser.GREATER_SYMBOL: + this.enterOuterAlt(localContext, 2); + { + this.state = 7991; + this.match(MySqlParser.GREATER_SYMBOL); + this.state = 7992; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case MySqlParser.BIT_AND_OP: + this.enterOuterAlt(localContext, 3); + { + this.state = 7993; + this.match(MySqlParser.BIT_AND_OP); + } + break; + case MySqlParser.BIT_XOR_OP: + this.enterOuterAlt(localContext, 4); + { + this.state = 7994; + this.match(MySqlParser.BIT_XOR_OP); + } + break; + case MySqlParser.BIT_OR_OP: + this.enterOuterAlt(localContext, 5); + { + this.state = 7995; + this.match(MySqlParser.BIT_OR_OP); + } + break; + default: + throw new antlr.NoViableAltException(this); + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + mathOperator() { + let localContext = new MathOperatorContext(this.context, this.state); + this.enterRule(localContext, 816, MySqlParser.RULE_mathOperator); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 7998; + _la = this.tokenStream.LA(1); + if (!(((((_la - 850)) & ~0x1F) === 0 && ((1 << (_la - 850)) & 127) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + jsonOperator() { + let localContext = new JsonOperatorContext(this.context, this.state); + this.enterRule(localContext, 818, MySqlParser.RULE_jsonOperator); + try { + this.state = 8005; + this.errorHandler.sync(this); + switch (this.interpreter.adaptivePredict(this.tokenStream, 1153, this.context)) { + case 1: + this.enterOuterAlt(localContext, 1); + { + this.state = 8000; + this.match(MySqlParser.MINUS); + this.state = 8001; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + case 2: + this.enterOuterAlt(localContext, 2); + { + this.state = 8002; + this.match(MySqlParser.MINUS); + this.state = 8003; + this.match(MySqlParser.GREATER_SYMBOL); + this.state = 8004; + this.match(MySqlParser.GREATER_SYMBOL); + } + break; + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + charsetNameBase() { + let localContext = new CharsetNameBaseContext(this.context, this.state); + this.enterRule(localContext, 820, MySqlParser.RULE_charsetNameBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8007; + _la = this.tokenStream.LA(1); + if (!(_la === 228 || ((((_la - 756)) & ~0x1F) === 0 && ((1 << (_la - 756)) & 4294967295) !== 0) || ((((_la - 788)) & ~0x1F) === 0 && ((1 << (_la - 788)) & 511) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + transactionLevelBase() { + let localContext = new TransactionLevelBaseContext(this.context, this.state); + this.enterRule(localContext, 822, MySqlParser.RULE_transactionLevelBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8009; + _la = this.tokenStream.LA(1); + if (!(((((_la - 809)) & ~0x1F) === 0 && ((1 << (_la - 809)) & 15) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + privilegesBase() { + let localContext = new PrivilegesBaseContext(this.context, this.state); + this.enterRule(localContext, 824, MySqlParser.RULE_privilegesBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8011; + _la = this.tokenStream.LA(1); + if (!(((((_la - 717)) & ~0x1F) === 0 && ((1 << (_la - 717)) & 68026371) !== 0) || ((((_la - 749)) & ~0x1F) === 0 && ((1 << (_la - 749)) & 11) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + intervalTypeBase() { + let localContext = new IntervalTypeBaseContext(this.context, this.state); + this.enterRule(localContext, 826, MySqlParser.RULE_intervalTypeBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8013; + _la = this.tokenStream.LA(1); + if (!(((((_la - 696)) & ~0x1F) === 0 && ((1 << (_la - 696)) & 255) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + dataTypeBase() { + let localContext = new DataTypeBaseContext(this.context, this.state); + this.enterRule(localContext, 828, MySqlParser.RULE_dataTypeBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8015; + _la = this.tokenStream.LA(1); + if (!(((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 1179679) !== 0))) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + keywordsCanBeId() { + let localContext = new KeywordsCanBeIdContext(this.context, this.state); + this.enterRule(localContext, 830, MySqlParser.RULE_keywordsCanBeId); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8017; + _la = this.tokenStream.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & 1074302976) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & 11014211) !== 0) || _la === 74 || _la === 95 || ((((_la - 117)) & ~0x1F) === 0 && ((1 << (_la - 117)) & 16673) !== 0) || _la === 160 || _la === 170 || ((((_la - 241)) & ~0x1F) === 0 && ((1 << (_la - 241)) & 1648345089) !== 0) || ((((_la - 277)) & ~0x1F) === 0 && ((1 << (_la - 277)) & 4160749823) !== 0) || ((((_la - 309)) & ~0x1F) === 0 && ((1 << (_la - 309)) & 4292870141) !== 0) || ((((_la - 341)) & ~0x1F) === 0 && ((1 << (_la - 341)) & 4294967287) !== 0) || ((((_la - 373)) & ~0x1F) === 0 && ((1 << (_la - 373)) & 4024434671) !== 0) || ((((_la - 406)) & ~0x1F) === 0 && ((1 << (_la - 406)) & 3747609503) !== 0) || ((((_la - 438)) & ~0x1F) === 0 && ((1 << (_la - 438)) & 4227727359) !== 0) || ((((_la - 470)) & ~0x1F) === 0 && ((1 << (_la - 470)) & 3758096239) !== 0) || ((((_la - 502)) & ~0x1F) === 0 && ((1 << (_la - 502)) & 2678062559) !== 0) || ((((_la - 534)) & ~0x1F) === 0 && ((1 << (_la - 534)) & 2682256863) !== 0) || ((((_la - 566)) & ~0x1F) === 0 && ((1 << (_la - 566)) & 4294957695) !== 0) || ((((_la - 598)) & ~0x1F) === 0 && ((1 << (_la - 598)) & 255) !== 0) || ((((_la - 633)) & ~0x1F) === 0 && ((1 << (_la - 633)) & 4294934527) !== 0) || ((((_la - 665)) & ~0x1F) === 0 && ((1 << (_la - 665)) & 2128608253) !== 0) || ((((_la - 704)) & ~0x1F) === 0 && ((1 << (_la - 704)) & 1053007341) !== 0) || ((((_la - 737)) & ~0x1F) === 0 && ((1 << (_la - 737)) & 478907) !== 0) || ((((_la - 802)) & ~0x1F) === 0 && ((1 << (_la - 802)) & 3230662657) !== 0) || _la === 838)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + functionNameBase() { + let localContext = new FunctionNameBaseContext(this.context, this.state); + this.enterRule(localContext, 832, MySqlParser.RULE_functionNameBase); + let _la; + try { + this.enterOuterAlt(localContext, 1); + { + this.state = 8019; + _la = this.tokenStream.LA(1); + if (!(_la === 39 || _la === 98 || _la === 150 || _la === 152 || ((((_la - 219)) & ~0x1F) === 0 && ((1 << (_la - 219)) & 23) !== 0) || ((((_la - 253)) & ~0x1F) === 0 && ((1 << (_la - 253)) & 16375299) !== 0) || _la === 296 || _la === 435 || ((((_la - 686)) & ~0x1F) === 0 && ((1 << (_la - 686)) & 261121) !== 0) || _la === 746 || ((((_la - 813)) & ~0x1F) === 0 && ((1 << (_la - 813)) & 145190393) !== 0) || _la === 856)) { + this.errorHandler.recoverInline(this); + } + else { + this.errorHandler.reportMatch(this); + this.consume(); + } + } + } + catch (re) { + if (re instanceof antlr.RecognitionException) { + localContext.exception = re; + this.errorHandler.reportError(this, re); + this.errorHandler.recover(this, re); + } + else { + throw re; + } + } + finally { + this.exitRule(); + } + return localContext; + } + sempred(localContext, ruleIndex, predIndex) { + switch (ruleIndex) { + case 104: + return this.queryExpressionBody_sempred(localContext, predIndex); + case 105: + return this.queryItem_sempred(localContext, predIndex); + case 329: + return this.columnName_sempred(localContext, predIndex); + case 400: + return this.expression_sempred(localContext, predIndex); + case 401: + return this.predicate_sempred(localContext, predIndex); + case 402: + return this.expressionAtom_sempred(localContext, predIndex); + } + return true; + } + queryExpressionBody_sempred(localContext, predIndex) { + switch (predIndex) { + case 0: + return this.precpred(this.context, 2); + case 1: + return this.precpred(this.context, 1); + } + return true; + } + queryItem_sempred(localContext, predIndex) { + switch (predIndex) { + case 2: + return this.precpred(this.context, 1); + } + return true; + } + columnName_sempred(localContext, predIndex) { + switch (predIndex) { + case 3: + return this.shouldMatchEmpty(); + } + return true; + } + expression_sempred(localContext, predIndex) { + switch (predIndex) { + case 4: + return this.precpred(this.context, 3); + } + return true; + } + predicate_sempred(localContext, predIndex) { + switch (predIndex) { + case 5: + return this.precpred(this.context, 6); + case 6: + return this.precpred(this.context, 5); + case 7: + return this.precpred(this.context, 3); + case 8: + return this.precpred(this.context, 9); + case 9: + return this.precpred(this.context, 8); + case 10: + return this.precpred(this.context, 7); + case 11: + return this.precpred(this.context, 4); + case 12: + return this.precpred(this.context, 2); + } + return true; + } + expressionAtom_sempred(localContext, predIndex) { + switch (predIndex) { + case 13: + return this.precpred(this.context, 4); + case 14: + return this.precpred(this.context, 3); + case 15: + return this.precpred(this.context, 2); + case 16: + return this.precpred(this.context, 14); + } + return true; + } + static get _ATN() { + if (!MySqlParser.__ATN) { + MySqlParser.__ATN = new antlr.ATNDeserializer().deserialize(MySqlParser._serializedATN); + } + return MySqlParser.__ATN; + } + get vocabulary() { + return MySqlParser.vocabulary; + } +} + +export { MySqlParser }; \ No newline at end of file diff --git a/test/form/samples/optional-chaining-namespace/_expected.js b/test/form/samples/optional-chaining-namespace/_expected.js index fcffb6f8f..3a638fc2e 100644 --- a/test/form/samples/optional-chaining-namespace/_expected.js +++ b/test/form/samples/optional-chaining-namespace/_expected.js @@ -1,4 +1,4 @@ -const foo = { nullVal: null }; +const foo = { }; foo?.x.x; // retained diff --git a/test/form/samples/pure-comment-scenarios-complex/_expected.js b/test/form/samples/pure-comment-scenarios-complex/_expected.js index 56e6ef40c..c0b4e0e09 100644 --- a/test/form/samples/pure-comment-scenarios-complex/_expected.js +++ b/test/form/samples/pure-comment-scenarios-complex/_expected.js @@ -18,5 +18,5 @@ bar(); /* @__PURE__ */(function(){})() + "foo" ? bar() : baz(); "foo" + /* @__PURE__ */(function(){})() ? bar() : baz(); /* @__PURE__ */(function(){})() ? foo() : foo(); -foo() ; -baz(); +[/* @__PURE__ */(function(){})()] ? foo() : bar(); +!{ } ? bar() : baz(); diff --git a/test/form/samples/recursive-destructuring/_config.js b/test/form/samples/recursive-destructuring/_config.js new file mode 100644 index 000000000..36b2eac78 --- /dev/null +++ b/test/form/samples/recursive-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'does not fail for recursive variables declarations with destructuring' +}); diff --git a/test/form/samples/recursive-destructuring/_expected.js b/test/form/samples/recursive-destructuring/_expected.js new file mode 100644 index 000000000..5e79f768e --- /dev/null +++ b/test/form/samples/recursive-destructuring/_expected.js @@ -0,0 +1 @@ +var { x } = x; // retained as this should throw diff --git a/test/form/samples/recursive-destructuring/main.js b/test/form/samples/recursive-destructuring/main.js new file mode 100644 index 000000000..5e79f768e --- /dev/null +++ b/test/form/samples/recursive-destructuring/main.js @@ -0,0 +1 @@ +var { x } = x; // retained as this should throw diff --git a/test/form/samples/side-effect-default-reexport/_expected.js b/test/form/samples/side-effect-default-reexport/_expected.js index 6593edd35..4d9a62053 100644 --- a/test/form/samples/side-effect-default-reexport/_expected.js +++ b/test/form/samples/side-effect-default-reexport/_expected.js @@ -1,6 +1,5 @@ var Menu$1 = { - name: 'menu' -}; + }; var Item$2 = { name: 'item' @@ -13,8 +12,7 @@ Menu$1.Item1 = Item$2; Menu$1.Item2 = Item$2; var NamedExport = { - name: 'menu' -}; + }; var Item$1 = { name: 'item' diff --git a/test/form/samples/side-effects-logical-expressions/_expected/amd.js b/test/form/samples/side-effects-logical-expressions/_expected/amd.js index 5cd0363fa..fc94706a8 100644 --- a/test/form/samples/side-effects-logical-expressions/_expected/amd.js +++ b/test/form/samples/side-effects-logical-expressions/_expected/amd.js @@ -9,9 +9,7 @@ define((function () { 'use strict'; const foo = { get effect () { console.log( 'effect' ); - }, - get noEffect () {} - }; + }}; // effect (foo).effect; diff --git a/test/form/samples/side-effects-logical-expressions/_expected/cjs.js b/test/form/samples/side-effects-logical-expressions/_expected/cjs.js index 2efd87aac..a607ca44b 100644 --- a/test/form/samples/side-effects-logical-expressions/_expected/cjs.js +++ b/test/form/samples/side-effects-logical-expressions/_expected/cjs.js @@ -9,9 +9,7 @@ console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); - }, - get noEffect () {} -}; + }}; // effect (foo).effect; diff --git a/test/form/samples/side-effects-logical-expressions/_expected/es.js b/test/form/samples/side-effects-logical-expressions/_expected/es.js index 0814df63c..cb958dd28 100644 --- a/test/form/samples/side-effects-logical-expressions/_expected/es.js +++ b/test/form/samples/side-effects-logical-expressions/_expected/es.js @@ -7,9 +7,7 @@ console.log( 'effect' ) && {}; const foo = { get effect () { console.log( 'effect' ); - }, - get noEffect () {} -}; + }}; // effect (foo).effect; diff --git a/test/form/samples/side-effects-logical-expressions/_expected/iife.js b/test/form/samples/side-effects-logical-expressions/_expected/iife.js index fb4bea51a..173c1f306 100644 --- a/test/form/samples/side-effects-logical-expressions/_expected/iife.js +++ b/test/form/samples/side-effects-logical-expressions/_expected/iife.js @@ -10,9 +10,7 @@ const foo = { get effect () { console.log( 'effect' ); - }, - get noEffect () {} - }; + }}; // effect (foo).effect; diff --git a/test/form/samples/side-effects-logical-expressions/_expected/system.js b/test/form/samples/side-effects-logical-expressions/_expected/system.js index 8853d5df6..c4b22d8ac 100644 --- a/test/form/samples/side-effects-logical-expressions/_expected/system.js +++ b/test/form/samples/side-effects-logical-expressions/_expected/system.js @@ -12,9 +12,7 @@ System.register([], (function () { const foo = { get effect () { console.log( 'effect' ); - }, - get noEffect () {} - }; + }}; // effect (foo).effect; diff --git a/test/form/samples/side-effects-logical-expressions/_expected/umd.js b/test/form/samples/side-effects-logical-expressions/_expected/umd.js index 6ff0de937..b9ceed374 100644 --- a/test/form/samples/side-effects-logical-expressions/_expected/umd.js +++ b/test/form/samples/side-effects-logical-expressions/_expected/umd.js @@ -12,9 +12,7 @@ const foo = { get effect () { console.log( 'effect' ); - }, - get noEffect () {} - }; + }}; // effect (foo).effect; diff --git a/test/form/samples/side-effects-object-literal-mutation/_expected.js b/test/form/samples/side-effects-object-literal-mutation/_expected.js index f42a72e8a..f2e8bbcc0 100644 --- a/test/form/samples/side-effects-object-literal-mutation/_expected.js +++ b/test/form/samples/side-effects-object-literal-mutation/_expected.js @@ -2,7 +2,7 @@ const retained1 = { x: {} }; retained1.y = 1; retained1.x.y = 2; -const retained2 = { x: {} }; +const retained2 = { }; retained2.y.z = 1; const retained3 = { x: {} }; diff --git a/test/form/samples/side-effects-pattern-assignment/_expected.js b/test/form/samples/side-effects-pattern-assignment/_expected.js index 16c6cefd9..a86b21530 100644 --- a/test/form/samples/side-effects-pattern-assignment/_expected.js +++ b/test/form/samples/side-effects-pattern-assignment/_expected.js @@ -1,3 +1,13 @@ +var a = {}; +({x: a} = globalThis.unknown); + +var b = {}; +({b} = globalThis.unknown); + +var {x: c} = globalThis.unknown; + +var {d} = globalThis.unknown; + var e = {}; ({x: e} = globalThis.unknown); e.foo = 1; @@ -12,6 +22,16 @@ g.foo = 1; var {h} = globalThis.unknown; h.foo = 1; +var i = {}; +[i] = globalThis.unknown; + +var [j] = globalThis.unknown; + +var k = {}; +[,...k] = globalThis.unknown; + +var [,...l] = globalThis.unknown; + var m = {}; [m] = globalThis.unknown; m.foo = 1; diff --git a/test/form/samples/side-effects-prototype-assignments/_expected/es.js b/test/form/samples/side-effects-prototype-assignments/_expected.js similarity index 100% rename from test/form/samples/side-effects-prototype-assignments/_expected/es.js rename to test/form/samples/side-effects-prototype-assignments/_expected.js diff --git a/test/form/samples/side-effects-prototype-assignments/_expected/amd.js b/test/form/samples/side-effects-prototype-assignments/_expected/amd.js deleted file mode 100644 index 143e94218..000000000 --- a/test/form/samples/side-effects-prototype-assignments/_expected/amd.js +++ /dev/null @@ -1,14 +0,0 @@ -define((function () { 'use strict'; - - function V8Engine () {} - - V8Engine.prototype.toString = function () { return 'V8'; }; - - function V6Engine () {} - - V6Engine.prototype = V8Engine.prototype; - V6Engine.prototype.toString = function () { return 'V6'; }; - - console.log( new V8Engine().toString() ); - -})); diff --git a/test/form/samples/side-effects-prototype-assignments/_expected/cjs.js b/test/form/samples/side-effects-prototype-assignments/_expected/cjs.js deleted file mode 100644 index 47c19ab9d..000000000 --- a/test/form/samples/side-effects-prototype-assignments/_expected/cjs.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -function V8Engine () {} - -V8Engine.prototype.toString = function () { return 'V8'; }; - -function V6Engine () {} - -V6Engine.prototype = V8Engine.prototype; -V6Engine.prototype.toString = function () { return 'V6'; }; - -console.log( new V8Engine().toString() ); diff --git a/test/form/samples/side-effects-prototype-assignments/_expected/iife.js b/test/form/samples/side-effects-prototype-assignments/_expected/iife.js deleted file mode 100644 index 41af21f3b..000000000 --- a/test/form/samples/side-effects-prototype-assignments/_expected/iife.js +++ /dev/null @@ -1,15 +0,0 @@ -(function () { - 'use strict'; - - function V8Engine () {} - - V8Engine.prototype.toString = function () { return 'V8'; }; - - function V6Engine () {} - - V6Engine.prototype = V8Engine.prototype; - V6Engine.prototype.toString = function () { return 'V6'; }; - - console.log( new V8Engine().toString() ); - -})(); diff --git a/test/form/samples/side-effects-prototype-assignments/_expected/system.js b/test/form/samples/side-effects-prototype-assignments/_expected/system.js deleted file mode 100644 index aaa286412..000000000 --- a/test/form/samples/side-effects-prototype-assignments/_expected/system.js +++ /dev/null @@ -1,19 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - function V8Engine () {} - - V8Engine.prototype.toString = function () { return 'V8'; }; - - function V6Engine () {} - - V6Engine.prototype = V8Engine.prototype; - V6Engine.prototype.toString = function () { return 'V6'; }; - - console.log( new V8Engine().toString() ); - - }) - }; -})); diff --git a/test/form/samples/side-effects-prototype-assignments/_expected/umd.js b/test/form/samples/side-effects-prototype-assignments/_expected/umd.js deleted file mode 100644 index 26eb88fc9..000000000 --- a/test/form/samples/side-effects-prototype-assignments/_expected/umd.js +++ /dev/null @@ -1,17 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - function V8Engine () {} - - V8Engine.prototype.toString = function () { return 'V8'; }; - - function V6Engine () {} - - V6Engine.prototype = V8Engine.prototype; - V6Engine.prototype.toString = function () { return 'V6'; }; - - console.log( new V8Engine().toString() ); - -})); diff --git a/test/form/samples/side-effects-prototype-assignments/main.js b/test/form/samples/side-effects-prototype-assignments/main.js index 39142a71c..f7dcc5162 100644 --- a/test/form/samples/side-effects-prototype-assignments/main.js +++ b/test/form/samples/side-effects-prototype-assignments/main.js @@ -10,6 +10,5 @@ V6Engine.prototype.toString = function () { return 'V6'; }; function IgnoredEngine () {} IgnoredEngine.prototype.toString = function () { return 'IGNORED'; }; -IgnoredEngine.prototype[ 'to' + 'String' ] = function () { return 'IGNORED'; }; console.log( new V8Engine().toString() ); diff --git a/test/form/samples/system-export-declarations/_expected.js b/test/form/samples/system-export-declarations/_expected.js index 81f189c97..80e548b6c 100644 --- a/test/form/samples/system-export-declarations/_expected.js +++ b/test/form/samples/system-export-declarations/_expected.js @@ -23,7 +23,7 @@ System.register([], (function (exports) { console.log(e1, e2, e3); // destructuring declaration - let {f1, f2} = globalThis.obj; exports("f2", f2); + let {f1, f2} = globalThis.obj, {f3} = globalThis.obj; exports("f2", f2); }) }; diff --git a/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js b/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js index 8a69e51d0..c7115bf3b 100644 --- a/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js +++ b/test/form/samples/treeshake-deterministic-dynamic-import/_expected.js @@ -18,15 +18,15 @@ function _mergeNamespaces(n, m) { async function entry() { // simple const { foo1: foo } = await Promise.resolve().then(function () { return sub1; }); - await Promise.resolve().then(function () { return sub1; }); + const { doesNotExists } = await Promise.resolve().then(function () { return sub1; }); (await Promise.resolve().then(function () { return sub2; })).bar2(); - await Promise.resolve().then(function () { return sub2; }); - await Promise.resolve().then(function () { return sub2; }); + const { foo2 } = await Promise.resolve().then(function () { return sub2; }); + const { foo3 } = await Promise.resolve().then(function () { return sub2; }); Promise.resolve().then(function () { return sub2; }).then(({ baz2 }) => baz2); Promise.resolve().then(function () { return sub2; }).then(function({ reexported }) { }); // external with unknown namespace - await Promise.resolve().then(function () { return sub4; }); + const { foo4, x } = await Promise.resolve().then(function () { return sub4; }); // side-effect only Promise.resolve().then(function () { return effect1; }); @@ -37,10 +37,10 @@ async function entry() { Promise.resolve().then(function () { return effect6; }).finally(() => {}); // bail out - await Promise.resolve().then(function () { return bail1$1; }); + const { named1 } = await Promise.resolve().then(function () { return bail1$1; }); Promise.resolve().then(function () { return bail1$1; }); // this make it bail out - await Promise.resolve().then(function () { return bail2$1; }) + const { ...named2 } = await Promise.resolve().then(function () { return bail2$1; }) (await Promise.resolve().then(function () { return bail3$1; }))[foo]; @@ -55,9 +55,13 @@ async function entry() { Promise.resolve().then(function () { return bail8$1; }), ]; - await Promise.resolve().then(function () { return bail9$1; }); + const { [foo]: bar } = await Promise.resolve().then(function () { return bail9$1; }); Promise.resolve().then(function () { return bail10$1; }).then(({ [foo]: bar }) => {}); + + { + const [name11] = await Promise.resolve().then(function () { return bail11$1; }); + } } function foo1() { @@ -236,4 +240,13 @@ var bail10$1 = /*#__PURE__*/Object.freeze({ named10: named10 }); +var bail11 = '@included-bail-11'; +const named11 = 'bail11'; + +var bail11$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + default: bail11, + named11: named11 +}); + export { entry }; diff --git a/test/form/samples/treeshake-deterministic-dynamic-import/main.js b/test/form/samples/treeshake-deterministic-dynamic-import/main.js index 48bd026a6..45bdcf41d 100644 --- a/test/form/samples/treeshake-deterministic-dynamic-import/main.js +++ b/test/form/samples/treeshake-deterministic-dynamic-import/main.js @@ -43,4 +43,8 @@ export async function entry() { const { [foo]: bar } = await import('./bail-9.js') import('./bail-10.js').then(({ [foo]: bar }) => {}) + + { + const [name11] = await import('./bail-11.js'); + } } diff --git a/test/function/samples/deoptimize-nested-function-arg/_config.js b/test/function/samples/deoptimize-nested-function-arg/_config.js new file mode 100644 index 000000000..c35dc775c --- /dev/null +++ b/test/function/samples/deoptimize-nested-function-arg/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'deoptimizes call arguments to functions nested in function properties' +}); diff --git a/test/function/samples/deoptimize-nested-function-arg/main.js b/test/function/samples/deoptimize-nested-function-arg/main.js new file mode 100644 index 000000000..ce66ae745 --- /dev/null +++ b/test/function/samples/deoptimize-nested-function-arg/main.js @@ -0,0 +1,8 @@ +function test() {} + +test.mutate = a => (a.mutated = true); + +const obj = { mutated: false }; +test.mutate(obj); + +assert.strictEqual(obj.mutated ? 'OK' : 'FAIL', 'OK'); diff --git a/test/function/samples/deoptimize-via-arguments/main.js b/test/function/samples/deoptimize-via-arguments/main.js index 1b9072bb0..9bebcde68 100644 --- a/test/function/samples/deoptimize-via-arguments/main.js +++ b/test/function/samples/deoptimize-via-arguments/main.js @@ -13,5 +13,5 @@ var obj2 = { mutate(obj1, obj2); -assert.ok(obj1.x ? true : false); -assert.ok(obj2.x ? true : false); +assert.ok(obj1.x ? true : false, 'obj1'); +assert.ok(obj2.x ? true : false, 'obj2'); diff --git a/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/_config.js b/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/_config.js new file mode 100644 index 000000000..575f09159 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'makes sure to deconflict variables that are destructured for side effects only' +}); diff --git a/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/dep.js b/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/dep.js new file mode 100644 index 000000000..9bcefbb31 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/dep.js @@ -0,0 +1,2 @@ +const Foo = { ok: true }; +export { Foo as default }; diff --git a/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/main.js b/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/main.js new file mode 100644 index 000000000..29c4a2fc5 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deconflict-destructured-for-side-effects/main.js @@ -0,0 +1,9 @@ +import bar from './dep.js'; +let mutated = false; +const { Foo } = { + get Foo() { + mutated = true; + } +}; +assert.ok(mutated); +assert.deepStrictEqual(bar, { ok: true }); diff --git a/test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/_config.js b/test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/_config.js new file mode 100644 index 000000000..44ddb5912 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'deoptimizes arguments of calls to destructured functions' +}); diff --git a/test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/main.js b/test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/main.js new file mode 100644 index 000000000..95a2287a8 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deoptimize-arguments-via-destructuring/main.js @@ -0,0 +1,13 @@ +var { a } = { + a: { + b(x) { + x.mutated = true; + } + }, + b() {} +}; + +var obj = { mutated: false }; +a.b(obj); + +assert.strictEqual(obj.mutated ? 'OK' : 'FAILED', 'OK'); diff --git a/test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/_config.js b/test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/_config.js new file mode 100644 index 000000000..d7e2cced9 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'deoptimizes the object if a mutating getter is destructured' +}); diff --git a/test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/main.js b/test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/main.js new file mode 100644 index 000000000..60b29d3d5 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deoptimize-object-via-destructured-getter/main.js @@ -0,0 +1,9 @@ +const { a, b } = { + get a() { + // We cannot remove a as destructuring will trigger this getter + this.b = true; + }, + b: false +}; + +assert.strictEqual(b ? 'OK' : 'FAILED', 'OK'); diff --git a/test/function/samples/object-expression-treeshaking/deoptimized-argument-value/_config.js b/test/function/samples/object-expression-treeshaking/deoptimized-argument-value/_config.js new file mode 100644 index 000000000..1f04fcd06 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deoptimized-argument-value/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: + 'does not fail if an argument is deoptimized where the value of a nested property is used in a condition' +}); diff --git a/test/function/samples/object-expression-treeshaking/deoptimized-argument-value/main.js b/test/function/samples/object-expression-treeshaking/deoptimized-argument-value/main.js new file mode 100644 index 000000000..dca3d53ec --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/deoptimized-argument-value/main.js @@ -0,0 +1,9 @@ +function test(x) { + if (x?.y.z) { + return true; + } + return false; +} + +assert.ok(test({ y: { z: true } })); +assert.ok(!test({ y: { z: false } })); diff --git a/test/function/samples/object-expression-treeshaking/do-not-destructure-unused/_config.js b/test/function/samples/object-expression-treeshaking/do-not-destructure-unused/_config.js new file mode 100644 index 000000000..394122326 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/do-not-destructure-unused/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'ensures that unused properties that are potentially removed are not destructure' +}); diff --git a/test/function/samples/object-expression-treeshaking/do-not-destructure-unused/main.js b/test/function/samples/object-expression-treeshaking/do-not-destructure-unused/main.js new file mode 100644 index 000000000..8ccfd46e6 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/do-not-destructure-unused/main.js @@ -0,0 +1,17 @@ +const { + x: { + y: { z } + }, + a +} = { x: { y: { z: true } }, a: true }; +assert.ok(a); + +function test({ + x: { + y: { z } + }, + a +}) { + return a; +} +assert.ok(test({ x: { y: { z: true } }, a: true })); diff --git a/test/function/samples/object-expression-treeshaking/exports/_config.js b/test/function/samples/object-expression-treeshaking/exports/_config.js new file mode 100644 index 000000000..9c660cbb7 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/exports/_config.js @@ -0,0 +1,13 @@ +const assert = require('node:assert'); + +module.exports = defineTest({ + description: 'includes all paths of exported objects', + exports(exports) { + assert.deepStrictEqual(exports, { + foo: { + a: 1, + b: { c: 2 } + } + }); + } +}); diff --git a/test/function/samples/object-expression-treeshaking/exports/main.js b/test/function/samples/object-expression-treeshaking/exports/main.js new file mode 100644 index 000000000..f905aa8f9 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/exports/main.js @@ -0,0 +1,4 @@ +export const foo = { + a: 1, + b: { c: 2 } +}; diff --git a/test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/_config.js b/test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/_config.js new file mode 100644 index 000000000..283d1dc57 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'retrieves literal values from destructured variables' +}); diff --git a/test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/main.js b/test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/main.js new file mode 100644 index 000000000..fea5611f9 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/get-literal-value-via-destructuring/main.js @@ -0,0 +1,6 @@ +var { a } = { + a: { b: true }, + b: false +}; + +assert.strictEqual(a.b ? 'OK' : 'FAILED', 'OK'); diff --git a/test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/_config.js b/test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/_config.js new file mode 100644 index 000000000..573a3cd45 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'retrieves return expressions from destructured variables' +}); diff --git a/test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/main.js b/test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/main.js new file mode 100644 index 000000000..0f800d083 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/get-return-expression-via-destructuring/main.js @@ -0,0 +1,6 @@ +var { a } = { + a: { b: () => true }, + b: () => false +}; + +assert.strictEqual(a.b() ? 'OK' : 'FAILED', 'OK'); diff --git a/test/function/samples/object-expression-treeshaking/handle-try-catch/_config.js b/test/function/samples/object-expression-treeshaking/handle-try-catch/_config.js new file mode 100644 index 000000000..ab0519c65 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/handle-try-catch/_config.js @@ -0,0 +1,11 @@ +const assert = require('node:assert'); + +module.exports = defineTest({ + description: 'include properties through try-catch calls', + exports({ getBuilder }) { + const builder = getBuilder(); + assert.deepStrictEqual(builder.buildCall(), 3n); + assert.deepStrictEqual(builder.buildEvent(), 2n); + assert.deepStrictEqual(builder.buildError(), 1n); + } +}); diff --git a/test/function/samples/object-expression-treeshaking/handle-try-catch/main.js b/test/function/samples/object-expression-treeshaking/handle-try-catch/main.js new file mode 100644 index 000000000..6b01e4485 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/handle-try-catch/main.js @@ -0,0 +1,21 @@ +export const getBuilder = () => { + const variantShapeId = { + errors: 1n, + events: 2n, + calls: 3n + }; + + const buildVariant = variantType => () => { + try { + return variantShapeId[variantType]; + } catch { + return null; + } + }; + + return { + buildCall: buildVariant('calls'), + buildEvent: buildVariant('events'), + buildError: buildVariant('errors') + }; +}; diff --git a/test/function/samples/object-expression-treeshaking/in-operator/_config.js b/test/function/samples/object-expression-treeshaking/in-operator/_config.js new file mode 100644 index 000000000..d926de806 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/in-operator/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'includes properties referenced by the "in" operator' +}); diff --git a/test/function/samples/object-expression-treeshaking/in-operator/main.js b/test/function/samples/object-expression-treeshaking/in-operator/main.js new file mode 100644 index 000000000..75b3f1af9 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/in-operator/main.js @@ -0,0 +1 @@ +assert.ok('foo' in { foo: true, bar: true }); diff --git a/test/function/samples/object-expression-treeshaking/include-call-arguments-path/_config.js b/test/function/samples/object-expression-treeshaking/include-call-arguments-path/_config.js new file mode 100644 index 000000000..3021ca724 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-call-arguments-path/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'uses the correct path when including call arguments' +}); diff --git a/test/function/samples/object-expression-treeshaking/include-call-arguments-path/main.js b/test/function/samples/object-expression-treeshaking/include-call-arguments-path/main.js new file mode 100644 index 000000000..57709cc1a --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-call-arguments-path/main.js @@ -0,0 +1,9 @@ +let result = null; + +function test() {} +test.a = value => (result = value); + +const { a } = test; +a(1); + +assert.strictEqual(result, 1); diff --git a/test/function/samples/object-expression-treeshaking/include-destructuring-rest/_config.js b/test/function/samples/object-expression-treeshaking/include-destructuring-rest/_config.js new file mode 100644 index 000000000..a3e2d8dd3 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-destructuring-rest/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'includes rest properties in destructuring declarations' +}); diff --git a/test/function/samples/object-expression-treeshaking/include-destructuring-rest/main.js b/test/function/samples/object-expression-treeshaking/include-destructuring-rest/main.js new file mode 100644 index 000000000..1909f73bb --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-destructuring-rest/main.js @@ -0,0 +1,15 @@ +const { + a: { e: e1, ...rest1 } +} = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; +assert.deepStrictEqual(rest1, { b: { c: 1, d: 1 } }); + +const { ...rest2 } = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; +assert.deepStrictEqual(rest2, { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }); + +const { + a: { e: e3, ...rest3 }, + f +} = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; +assert.strictEqual(e3, 1); +assert.strictEqual(f, 1); +assert.deepStrictEqual(rest3, { b: { c: 1, d: 1 } }); diff --git a/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/_config.js b/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/_config.js new file mode 100644 index 000000000..8b1109d88 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/_config.js @@ -0,0 +1,6 @@ +module.exports = defineTest({ + description: 'includes used dynamic import properties with await', + async exports({ assertImport }) { + await assertImport(); + } +}); diff --git a/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/dep.js b/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/dep.js new file mode 100644 index 000000000..5fb7ac565 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/dep.js @@ -0,0 +1 @@ +export const foo = { bar: { baz: 42 } }; diff --git a/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/main.js b/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/main.js new file mode 100644 index 000000000..089c744b1 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-dynamic-import-properties-await/main.js @@ -0,0 +1,4 @@ +export async function assertImport() { + const { foo } = await import('./dep.js'); + assert.strictEqual(foo.bar.baz, 42); +} diff --git a/test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/_config.js b/test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/_config.js new file mode 100644 index 000000000..6fde0ab66 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'includes redeclared destructured variable paths' +}); diff --git a/test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/main.js b/test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/main.js new file mode 100644 index 000000000..7959bf5e3 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-redeclared-destructured-variable-paths/main.js @@ -0,0 +1,5 @@ +var { a } = { a: { b: 1 } }; +assert.strictEqual(a.b, 1); + +var { a } = { a: { b: 2 } }; +assert.strictEqual(a.b, 2); diff --git a/test/function/samples/object-expression-treeshaking/include-this-unknown-function/_config.js b/test/function/samples/object-expression-treeshaking/include-this-unknown-function/_config.js new file mode 100644 index 000000000..5d6a6ecac --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-this-unknown-function/_config.js @@ -0,0 +1,8 @@ +module.exports = defineTest({ + description: 'includes all context properties if the handler is unknown', + context: { + external() { + this.bar(); + } + } +}); diff --git a/test/function/samples/object-expression-treeshaking/include-this-unknown-function/main.js b/test/function/samples/object-expression-treeshaking/include-this-unknown-function/main.js new file mode 100644 index 000000000..f25e812ab --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-this-unknown-function/main.js @@ -0,0 +1,11 @@ +let mutated = false; + +const obj = { + foo: external, + bar() { + mutated = true; + } +}; + +obj.foo(); +assert.ok(mutated ? true : false); diff --git a/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/_config.js b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/_config.js new file mode 100644 index 000000000..7669a3d47 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'destructures unused properties with getter side effects in assignments' +}); diff --git a/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/main.js b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/main.js new file mode 100644 index 000000000..3049bcb52 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-assignment/main.js @@ -0,0 +1,36 @@ +const effects1 = []; +let x1; +({ x1 } = { + get x1() { + effects1.push('x1'); + }, + get y1() { + effects1.push('y1'); + } +}); +assert.deepStrictEqual(effects1, ['x1'], 'effects1'); + +const effects2 = []; +let y2; +({ + x2: { y2 } +} = { + x2: { + get y2() { + effects2.push('y2'); + } + } +}); +assert.deepStrictEqual(effects2, ['y2'], 'effects2'); + +const effects3 = []; +let x3, rest3; +({ x3, ...rest3 } = { + get x3() { + effects3.push('x3'); + }, + get y3() { + effects3.push('y3'); + } +}); +assert.deepStrictEqual(effects3, ['x3', 'y3'], 'effects3'); diff --git a/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/_config.js b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/_config.js new file mode 100644 index 000000000..7368c76c3 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'destructures unused properties with getter side effects in calls' +}); diff --git a/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/main.js b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/main.js new file mode 100644 index 000000000..8597d0263 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters-in-calls/main.js @@ -0,0 +1,34 @@ +const effects1 = []; +function test1({ x1 }) {} +test1({ + get x1() { + effects1.push('x1'); + }, + get y1() { + effects1.push('y1'); + } +}); +assert.deepStrictEqual(effects1, ['x1'], 'effects1'); + +const effects2 = []; +function test2({ x2: { y2 } }) {} +test2({ + x2: { + get y2() { + effects2.push('y2'); + } + } +}); +assert.deepStrictEqual(effects2, ['y2'], 'effects2'); + +const effects3 = []; +function test3( { x3, ...rest3 }){} +test3({ + get x3() { + effects3.push('x3'); + }, + get y3() { + effects3.push('y3'); + } +}); +assert.deepStrictEqual(effects3, ['x3', 'y3'], 'effects3'); diff --git a/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/_config.js b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/_config.js new file mode 100644 index 000000000..1f855971b --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'destructures unused properties with getter side effects' +}); diff --git a/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/main.js b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/main.js new file mode 100644 index 000000000..9750d2228 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/include-unused-destructured-getters/main.js @@ -0,0 +1,33 @@ +const effects1 = []; +const { x1 } = { + get x1() { + effects1.push('x1'); + }, + get y1() { + effects1.push('y1'); + } +}; +assert.deepStrictEqual(effects1, ['x1'], 'effects1'); + +const effects2 = []; +const { + x2: { y2 } +} = { + x2: { + get y2() { + effects2.push('y2'); + } + } +}; +assert.deepStrictEqual(effects2, ['y2'], 'effects2'); + +const effects3 = []; +const { x3, ...rest3 } = { + get x3() { + effects3.push('x3'); + }, + get y3() { + effects3.push('y3'); + } +}; +assert.deepStrictEqual(effects3, ['x3', 'y3'], 'effects3'); diff --git a/test/function/samples/object-expression-treeshaking/object-side-effects/_config.js b/test/function/samples/object-expression-treeshaking/object-side-effects/_config.js new file mode 100644 index 000000000..dfb161d6e --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/object-side-effects/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'considers side effects in unused property declarations' +}); diff --git a/test/function/samples/object-expression-treeshaking/object-side-effects/main.js b/test/function/samples/object-expression-treeshaking/object-side-effects/main.js new file mode 100644 index 000000000..d32c4546a --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/object-side-effects/main.js @@ -0,0 +1,22 @@ +let modified1 = false; +let modified2 = false; + +function effect1() { + modified1 = true; + return 'keyEffect'; +} + +function effect2() { + modified2 = true; + return 4; +} + +const obj = { + used: 1, + unused: 2, + [effect1()]: 3, + valueEffect: effect2() +}; +assert.strictEqual(obj.used, 1); +assert.ok(modified1, 'first'); +assert.ok(modified2, 'second'); diff --git a/test/function/samples/object-expression-treeshaking/retain-property-definition-paths/_config.js b/test/function/samples/object-expression-treeshaking/retain-property-definition-paths/_config.js new file mode 100644 index 000000000..b9af1759f --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/retain-property-definition-paths/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'ensures that paths of property definitions are retained' +}); diff --git a/test/function/samples/object-expression-treeshaking/retain-property-definition-paths/main.js b/test/function/samples/object-expression-treeshaking/retain-property-definition-paths/main.js new file mode 100644 index 000000000..7110c9874 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/retain-property-definition-paths/main.js @@ -0,0 +1,5 @@ +class Test { + foo = { x: 1 }; +} + +assert.strictEqual(new Test().foo.x, 1); diff --git a/test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/_config.js b/test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/_config.js new file mode 100644 index 000000000..07cdb40b8 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'tracks property access side effects for destructured variables' +}); diff --git a/test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/main.js b/test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/main.js new file mode 100644 index 000000000..eff4d3124 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-access-side-effect-via-destructuring/main.js @@ -0,0 +1,14 @@ +let mutated = false; + +var { a } = { + a: { + get b() { + mutated = true; + return {}; + } + }, + b: {} +}; + +a.b; +assert.ok(mutated); diff --git a/test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/_config.js b/test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/_config.js new file mode 100644 index 000000000..5f3148007 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'tracks property assignment side effects for destructured variables' +}); diff --git a/test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/main.js b/test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/main.js new file mode 100644 index 000000000..1fae33053 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-assignment-side-effect-via-destructuring/main.js @@ -0,0 +1,13 @@ +let mutated = false; + +var { a } = { + a: { + set b(value) { + mutated = value; + } + }, + b: {} +}; + +a.b = true; +assert.ok(mutated); diff --git a/test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/_config.js b/test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/_config.js new file mode 100644 index 000000000..993182b77 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'tracks call side effects for destructured variables' +}); diff --git a/test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/main.js b/test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/main.js new file mode 100644 index 000000000..09711eded --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-call-side-effect-via-destructuring/main.js @@ -0,0 +1,13 @@ +let mutated = false; + +var { a } = { + a: { + b() { + mutated = true; + } + }, + b() {} +}; + +a.b(); +assert.ok(mutated); diff --git a/test/function/samples/object-expression-treeshaking/track-destructured-setter/_config.js b/test/function/samples/object-expression-treeshaking/track-destructured-setter/_config.js new file mode 100644 index 000000000..6268facf7 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-destructured-setter/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'tracks side effects from setters in destructuring assignments' +}); diff --git a/test/function/samples/object-expression-treeshaking/track-destructured-setter/main.js b/test/function/samples/object-expression-treeshaking/track-destructured-setter/main.js new file mode 100644 index 000000000..58d231674 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/track-destructured-setter/main.js @@ -0,0 +1,8 @@ +let effect = false; +const obj = { + set foo(value) { + effect = value; + } +}; +({ foo: obj.foo } = { foo: 'value' }); +assert.strictEqual(effect, 'value'); diff --git a/test/function/samples/object-expression-treeshaking/try-statement-arguments/_config.js b/test/function/samples/object-expression-treeshaking/try-statement-arguments/_config.js new file mode 100644 index 000000000..4b50df22d --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/try-statement-arguments/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'includes referenced call arguments to functions called from try statements' +}); diff --git a/test/function/samples/object-expression-treeshaking/try-statement-arguments/main.js b/test/function/samples/object-expression-treeshaking/try-statement-arguments/main.js new file mode 100644 index 000000000..f699e9fb7 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/try-statement-arguments/main.js @@ -0,0 +1,14 @@ +const safeCall = call => { + call() + try { + return call(); + } catch {} +}; + +const identity = x => x; + +const opts = { foo: 1 }; +assert.deepStrictEqual( + safeCall(() => identity(opts)), + { foo: 1 } +); diff --git a/test/function/samples/object-tree-shaking-for-global-assignment/_config.js b/test/function/samples/object-tree-shaking-for-global-assignment/_config.js new file mode 100644 index 000000000..342682dfe --- /dev/null +++ b/test/function/samples/object-tree-shaking-for-global-assignment/_config.js @@ -0,0 +1,6 @@ +module.exports = defineTest({ + description: 'preserve the object on the right side of the global assignment', + context: { + b: {} + } +}); diff --git a/test/function/samples/object-tree-shaking-for-global-assignment/main.js b/test/function/samples/object-tree-shaking-for-global-assignment/main.js new file mode 100644 index 000000000..2b3e70c2b --- /dev/null +++ b/test/function/samples/object-tree-shaking-for-global-assignment/main.js @@ -0,0 +1,6 @@ +function foo() { + const a = (b.c = { e: 1 }); +} +foo(); + +assert.deepEqual(b.c.e, 1); diff --git a/test/function/samples/object-tree-shaking-for-parameter/_config.js b/test/function/samples/object-tree-shaking-for-parameter/_config.js new file mode 100644 index 000000000..78d27f625 --- /dev/null +++ b/test/function/samples/object-tree-shaking-for-parameter/_config.js @@ -0,0 +1,8 @@ +module.exports = defineTest({ + description: 'preserve the object argument', + context: { + externalFunc(input) { + return input; + } + } +}); diff --git a/test/function/samples/object-tree-shaking-for-parameter/main.js b/test/function/samples/object-tree-shaking-for-parameter/main.js new file mode 100644 index 000000000..0d18beb54 --- /dev/null +++ b/test/function/samples/object-tree-shaking-for-parameter/main.js @@ -0,0 +1,15 @@ +function foo() { + function bar(input2) { + return input2; + } + + function Baz(input) { + this.value = bar(input); + } + + externalFunc(Baz); + + return new Baz({ next: 2 }); +} + +assert.deepEqual(foo().value.next, 2); diff --git a/test/function/samples/object-tree-shaking-in-function-self-call/_config.js b/test/function/samples/object-tree-shaking-in-function-self-call/_config.js new file mode 100644 index 000000000..0148514e6 --- /dev/null +++ b/test/function/samples/object-tree-shaking-in-function-self-call/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'avoid maximum call stack size exceeded' +}); diff --git a/test/function/samples/object-tree-shaking-in-function-self-call/main.js b/test/function/samples/object-tree-shaking-in-function-self-call/main.js new file mode 100644 index 000000000..bb5d1b013 --- /dev/null +++ b/test/function/samples/object-tree-shaking-in-function-self-call/main.js @@ -0,0 +1,7 @@ +function foo(v) { + if (v.a) { + foo(v.b); + foo(v.c); + } +} +foo({ b: 1 }); diff --git a/test/function/samples/object-tree-shaking-with-destructed-export/_config.js b/test/function/samples/object-tree-shaking-with-destructed-export/_config.js new file mode 100644 index 000000000..7fc0d9a35 --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-destructed-export/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'export the full object which in the ObjectPattern' +}); diff --git a/test/function/samples/object-tree-shaking-with-destructed-export/main.js b/test/function/samples/object-tree-shaking-with-destructed-export/main.js new file mode 100644 index 000000000..7d821e50c --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-destructed-export/main.js @@ -0,0 +1,3 @@ +import { bar } from './module'; + +assert(bar.baz, 1); diff --git a/test/function/samples/object-tree-shaking-with-destructed-export/module.js b/test/function/samples/object-tree-shaking-with-destructed-export/module.js new file mode 100644 index 000000000..b60c753a2 --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-destructed-export/module.js @@ -0,0 +1,2 @@ +const foo = { bar: { baz: 1 } }; +export const { bar } = foo; diff --git a/test/function/samples/object-tree-shaking-with-duplicated-function-call/_config.js b/test/function/samples/object-tree-shaking-with-duplicated-function-call/_config.js new file mode 100644 index 000000000..19f844a1e --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-duplicated-function-call/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'get the full object which as a parameter passed to duplicated function call' +}); diff --git a/test/function/samples/object-tree-shaking-with-duplicated-function-call/main.js b/test/function/samples/object-tree-shaking-with-duplicated-function-call/main.js new file mode 100644 index 000000000..4a920f168 --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-duplicated-function-call/main.js @@ -0,0 +1,6 @@ +function foo(c) { + assert.ok(c.a); +} + +foo({ a: 1 }); +foo({ a: 1 }); diff --git a/test/function/samples/preserve-exported-object-in-namespace/_config.js b/test/function/samples/preserve-exported-object-in-namespace/_config.js new file mode 100644 index 000000000..c87382ae0 --- /dev/null +++ b/test/function/samples/preserve-exported-object-in-namespace/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'preserve the exported object that imported by namespace' +}); diff --git a/test/function/samples/preserve-exported-object-in-namespace/main.js b/test/function/samples/preserve-exported-object-in-namespace/main.js new file mode 100644 index 000000000..596387027 --- /dev/null +++ b/test/function/samples/preserve-exported-object-in-namespace/main.js @@ -0,0 +1,2 @@ +import * as module from './module'; +assert.deepEqual(module.foo.bar, 1); diff --git a/test/function/samples/preserve-exported-object-in-namespace/module.js b/test/function/samples/preserve-exported-object-in-namespace/module.js new file mode 100644 index 000000000..1399af4bb --- /dev/null +++ b/test/function/samples/preserve-exported-object-in-namespace/module.js @@ -0,0 +1 @@ +export const foo = { bar: 1 }; diff --git a/test/function/samples/preserve-var-declaration/_config.js b/test/function/samples/preserve-var-declaration/_config.js new file mode 100644 index 000000000..5281c9eb6 --- /dev/null +++ b/test/function/samples/preserve-var-declaration/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'preserve the variableDeclaration that declared by var' +}); diff --git a/test/function/samples/preserve-var-declaration/main.js b/test/function/samples/preserve-var-declaration/main.js new file mode 100644 index 000000000..92df84abc --- /dev/null +++ b/test/function/samples/preserve-var-declaration/main.js @@ -0,0 +1,5 @@ +{ + var a = { c: 1 }; + var b = { a }; + assert.deepEqual(b.a.c, 1); +} diff --git a/test/function/samples/recursive-calls-without-treeshake/_config.js b/test/function/samples/recursive-calls-without-treeshake/_config.js new file mode 100644 index 000000000..9e859a0ff --- /dev/null +++ b/test/function/samples/recursive-calls-without-treeshake/_config.js @@ -0,0 +1,6 @@ +module.exports = defineTest({ + description: 'Avoid maximum call stack error with recursive calls when treeshake is disabled', + options: { + treeshake: false + } +}); diff --git a/test/function/samples/recursive-calls-without-treeshake/main.js b/test/function/samples/recursive-calls-without-treeshake/main.js new file mode 100644 index 000000000..df7cfe3f7 --- /dev/null +++ b/test/function/samples/recursive-calls-without-treeshake/main.js @@ -0,0 +1,10 @@ +function test(callback, index) { + if (index > 0) { + test(callback, index - 1); + } + callback(); +} + +let count = 0; +test(() => count++, 3); +assert.strictEqual(count, 4); diff --git a/test/function/samples/recursive-property-access/_config.js b/test/function/samples/recursive-property-access/_config.js new file mode 100644 index 000000000..f9baf190c --- /dev/null +++ b/test/function/samples/recursive-property-access/_config.js @@ -0,0 +1,8 @@ +const assert = require('assert'); + +module.exports = defineTest({ + description: 'handles accessing different properties in recursive calls with good performance', + exports(exports) { + assert.strictEqual(exports.test({ u: { s: { w: 42 } } }), 42); + } +}); diff --git a/test/function/samples/recursive-property-access/main.js b/test/function/samples/recursive-property-access/main.js new file mode 100644 index 000000000..6409ae14d --- /dev/null +++ b/test/function/samples/recursive-property-access/main.js @@ -0,0 +1,29 @@ +export function test(arg) { + if (arg.a) return test(arg.a); + if (arg.b) return test(arg.b); + if (arg.c) return test(arg.c); + if (arg.d) return test(arg.d); + if (arg.e) return test(arg.e); + if (arg.f) return test(arg.f); + if (arg.g) return test(arg.g); + if (arg.h) return test(arg.h); + if (arg.i) return test(arg.i); + if (arg.j) return test(arg.j); + if (arg.k) return test(arg.k); + if (arg.l) return test(arg.l); + if (arg.m) return test(arg.m); + if (arg.n) return test(arg.n); + if (arg.o) return test(arg.o); + if (arg.p) return test(arg.p); + if (arg.q) return test(arg.q); + if (arg.r) return test(arg.r); + if (arg.s) return test(arg.s); + if (arg.t) return test(arg.t); + if (arg.u) return test(arg.u); + if (arg.v) return test(arg.v); + if (arg.w) return test(arg.w); + if (arg.x) return test(arg.x); + if (arg.y) return test(arg.y); + if (arg.z) return test(arg.z); + return arg; +} diff --git a/test/function/samples/track-rest-parameter-value/_config.js b/test/function/samples/track-rest-parameter-value/_config.js new file mode 100644 index 000000000..58ae41ab0 --- /dev/null +++ b/test/function/samples/track-rest-parameter-value/_config.js @@ -0,0 +1,4 @@ +module.exports = defineTest({ + description: + 'determines the correct value of rest parameters when a function is called multiple times' +}); diff --git a/test/function/samples/track-rest-parameter-value/main.js b/test/function/samples/track-rest-parameter-value/main.js new file mode 100644 index 000000000..e8c5e9cf3 --- /dev/null +++ b/test/function/samples/track-rest-parameter-value/main.js @@ -0,0 +1,9 @@ +const getArgsInfo = (...args) => { + if (args.length === 0) { + return 'no args'; + } + return 'has args'; +}; + +assert.strictEqual(getArgsInfo(), 'no args'); +assert.strictEqual(getArgsInfo(1), 'has args'); diff --git a/test/function/samples/typescript-enum-no-module-side-effects/_config.js b/test/function/samples/typescript-enum-no-module-side-effects/_config.js new file mode 100644 index 000000000..d766d8840 --- /dev/null +++ b/test/function/samples/typescript-enum-no-module-side-effects/_config.js @@ -0,0 +1,8 @@ +module.exports = defineTest({ + description: 'bundles enums when using moduleSideEffects: false', + options: { + treeshake: { + moduleSideEffects: false + } + } +}); diff --git a/test/function/samples/typescript-enum-no-module-side-effects/dep.js b/test/function/samples/typescript-enum-no-module-side-effects/dep.js new file mode 100644 index 000000000..c47995c9e --- /dev/null +++ b/test/function/samples/typescript-enum-no-module-side-effects/dep.js @@ -0,0 +1,12 @@ +// The problem is that with moduleSideEffects: false, the TDZ detection logic +// fails here and assumes that InjectFlags is truthy in its initializer. While +// this construct is questionable, the correct solution should be to detect +// this case even in modules without side effects. For now, the simpler solution +// is to turn off handling the return value of the IIFE as truthy. +var InjectFlags = /* @__PURE__ */ (function (InjectFlags2) { + InjectFlags2[(InjectFlags2['Default'] = 0)] = 'Default'; + return InjectFlags2; +})(InjectFlags || {}); + +export const value = InjectFlags.Default; + diff --git a/test/function/samples/typescript-enum-no-module-side-effects/main.js b/test/function/samples/typescript-enum-no-module-side-effects/main.js new file mode 100644 index 000000000..e77f08c15 --- /dev/null +++ b/test/function/samples/typescript-enum-no-module-side-effects/main.js @@ -0,0 +1,3 @@ +import { value } from './dep.js'; + +assert.strictEqual(value, 0); diff --git a/test/function/samples/wrap-empty-object-with-double-brackets/_config.js b/test/function/samples/wrap-empty-object-with-double-brackets/_config.js new file mode 100644 index 000000000..51d3a0c6c --- /dev/null +++ b/test/function/samples/wrap-empty-object-with-double-brackets/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'wrap double brackets to empty object' +}); diff --git a/test/function/samples/wrap-empty-object-with-double-brackets/main.js b/test/function/samples/wrap-empty-object-with-double-brackets/main.js new file mode 100644 index 000000000..de9628c93 --- /dev/null +++ b/test/function/samples/wrap-empty-object-with-double-brackets/main.js @@ -0,0 +1,2 @@ +Object.prototype.customize_fn = () => {}; +const c = {}.customize_fn(); From 979d62888dbe75f92e50fdd64246c737c52f5f1f Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 1 Feb 2025 09:19:50 +0100 Subject: [PATCH 13/21] 4.34.0 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14cab86cf..b1f0ce750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.34.0 + +_2025-02-01_ + +### Features + +- Tree-shake unused properties in object literals (re-implements #5420) (#5737) + +### Pull Requests + +- [#5737](https://github.com/rollup/rollup/pull/5737): Reapply object tree-shaking (@lukastaegert, @TrickyPi) + ## 4.33.0 _2025-02-01_ diff --git a/browser/package.json b/browser/package.json index a64a072c1..d55ebc67d 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.33.0", + "version": "4.34.0", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index c5d187e10..303f5363c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.33.0", + "version": "4.34.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.33.0", + "version": "4.34.0", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index eea6458ac..d218bc50e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.33.0", + "version": "4.34.0", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 32504b34e6583e47adbf2bb838e23a82dc6ec10c Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Mon, 3 Feb 2025 07:16:39 +0100 Subject: [PATCH 14/21] Ensure that all properties of throw statements are included (#5825) --- src/ast/nodes/ThrowStatement.ts | 17 +++++++++-------- .../throw-object/_config.js | 12 ++++++++++++ .../throw-object/main.js | 3 +++ 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 test/function/samples/object-expression-treeshaking/throw-object/_config.js create mode 100644 test/function/samples/object-expression-treeshaking/throw-object/main.js diff --git a/src/ast/nodes/ThrowStatement.ts b/src/ast/nodes/ThrowStatement.ts index 6b42c7ac4..fab4b3e3f 100644 --- a/src/ast/nodes/ThrowStatement.ts +++ b/src/ast/nodes/ThrowStatement.ts @@ -1,13 +1,9 @@ import type MagicString from 'magic-string'; import type { RenderOptions } from '../../utils/renderHelpers'; import { type InclusionContext } from '../ExecutionContext'; +import { UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; -import { - type ExpressionNode, - type IncludeChildren, - onlyIncludeSelf, - StatementBase -} from './shared/Node'; +import { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node'; export default class ThrowStatement extends StatementBase { declare argument: ExpressionNode; @@ -23,6 +19,13 @@ export default class ThrowStatement extends StatementBase { context.brokenFlow = true; } + includeNode(context: InclusionContext) { + if (!this.included) { + this.included = true; + this.argument.includePath(UNKNOWN_PATH, context); + } + } + render(code: MagicString, options: RenderOptions): void { this.argument.render(code, options, { preventASI: true }); if (this.argument.start === this.start + 5 /* 'throw'.length */) { @@ -30,5 +33,3 @@ export default class ThrowStatement extends StatementBase { } } } - -ThrowStatement.prototype.includeNode = onlyIncludeSelf; diff --git a/test/function/samples/object-expression-treeshaking/throw-object/_config.js b/test/function/samples/object-expression-treeshaking/throw-object/_config.js new file mode 100644 index 000000000..348d86287 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/throw-object/_config.js @@ -0,0 +1,12 @@ +const assert = require('assert'); + +module.exports = defineTest({ + description: 'allows to throw object expressions with all properties', + exports({ test }) { + try { + test(); + } catch (error) { + assert.deepStrictEqual(error, { my: 'info' }); + } + } +}); diff --git a/test/function/samples/object-expression-treeshaking/throw-object/main.js b/test/function/samples/object-expression-treeshaking/throw-object/main.js new file mode 100644 index 000000000..9a2087127 --- /dev/null +++ b/test/function/samples/object-expression-treeshaking/throw-object/main.js @@ -0,0 +1,3 @@ +export function test() { + throw { my: 'info' }; +} From 0f20524ad9ecd166a900d43af93f05a3405d2a45 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Mon, 3 Feb 2025 07:17:44 +0100 Subject: [PATCH 15/21] 4.34.1 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1f0ce750..b07f4253c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.34.1 + +_2025-02-03_ + +### Bug Fixes + +- Ensure throwing objects includes the entire object (#5825) + +### Pull Requests + +- [#5825](https://github.com/rollup/rollup/pull/5825): Ensure that all properties of throw statements are included (@lukastaegert) + ## 4.34.0 _2025-02-01_ diff --git a/browser/package.json b/browser/package.json index d55ebc67d..e2e764387 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.34.0", + "version": "4.34.1", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 303f5363c..e51c6e27a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.34.0", + "version": "4.34.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.34.0", + "version": "4.34.1", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index d218bc50e..11085dbfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.34.0", + "version": "4.34.1", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 17346a91388291209dee8e6a9012aede8a73101e Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 4 Feb 2025 07:24:46 +0100 Subject: [PATCH 16/21] Ensure that functions provided to a constructor are properly deoptimized (#5827) * Ensure that functions provided to a constructor are properly deoptimized * Make argument inclusion more symmetric (resolves #5823) --- src/ast/nodes/shared/Expression.ts | 6 ++++-- src/ast/nodes/shared/IdentifierBase.ts | 1 + src/ast/scopes/ParameterScope.ts | 2 +- .../parameters-promise-constructor/_config.js | 8 ++++++++ .../samples/parameters-promise-constructor/main.js | 12 ++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 test/function/samples/parameters-promise-constructor/_config.js create mode 100644 test/function/samples/parameters-promise-constructor/main.js diff --git a/src/ast/nodes/shared/Expression.ts b/src/ast/nodes/shared/Expression.ts index 7cd16f32f..ddb2c97eb 100644 --- a/src/ast/nodes/shared/Expression.ts +++ b/src/ast/nodes/shared/Expression.ts @@ -99,8 +99,10 @@ export class ExpressionEntity implements WritableEntity { includeCallArguments(context: InclusionContext, interaction: NodeInteractionCalled): void { for (const argument of interaction.args) { - argument?.includePath(UNKNOWN_PATH, context); - argument?.include(context, false); + if (argument) { + argument.includePath(UNKNOWN_PATH, context); + argument.include(context, false); + } } } diff --git a/src/ast/nodes/shared/IdentifierBase.ts b/src/ast/nodes/shared/IdentifierBase.ts index 9e151755d..ede8b90c7 100644 --- a/src/ast/nodes/shared/IdentifierBase.ts +++ b/src/ast/nodes/shared/IdentifierBase.ts @@ -142,6 +142,7 @@ export default class IdentifierBase extends NodeBase { includePath(path: ObjectPath, context: InclusionContext): void { if (!this.included) { this.included = true; + if (!this.deoptimized) this.applyDeoptimizations(); if (this.variable !== null) { this.scope.context.includeVariableInModule(this.variable, path, context); } diff --git a/src/ast/scopes/ParameterScope.ts b/src/ast/scopes/ParameterScope.ts index 25914d86c..79f26c2ed 100644 --- a/src/ast/scopes/ParameterScope.ts +++ b/src/ast/scopes/ParameterScope.ts @@ -97,7 +97,7 @@ export default class ParameterScope extends ChildScope { } } } - if (!argument.included && (argumentIncluded || argument.shouldBeIncluded(context))) { + if (argumentIncluded || argument.shouldBeIncluded(context)) { argumentIncluded = true; argument.include(context, calledFromTryStatement); } diff --git a/test/function/samples/parameters-promise-constructor/_config.js b/test/function/samples/parameters-promise-constructor/_config.js new file mode 100644 index 000000000..735f6d348 --- /dev/null +++ b/test/function/samples/parameters-promise-constructor/_config.js @@ -0,0 +1,8 @@ +const assert = require('assert'); + +module.exports = defineTest({ + description: 'correctly handles parameters of promise constructor', + async exports({ result }) { + assert.strictEqual(await result, 42); + } +}); diff --git a/test/function/samples/parameters-promise-constructor/main.js b/test/function/samples/parameters-promise-constructor/main.js new file mode 100644 index 000000000..6e8a38ba8 --- /dev/null +++ b/test/function/samples/parameters-promise-constructor/main.js @@ -0,0 +1,12 @@ +const value = 42; + +export function test(callback) { + return callback ? execute(undefined, callback) : new Promise(execute); + + function execute(resolve) { + if (resolve) resolve(value); + else resolve('FAIL'); + } +} + +export const result = test().then(r => r); From 615efa045779fae70c4fd5fe64fdb08a039c0442 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 4 Feb 2025 07:25:50 +0100 Subject: [PATCH 17/21] 4.34.2 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b07f4253c..37e3827cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.34.2 + +_2025-02-04_ + +### Bug Fixes + +- Fix an issue where not all usages of a function were properly detected (#5827) + +### Pull Requests + +- [#5827](https://github.com/rollup/rollup/pull/5827): Ensure that functions provided to a constructor are properly deoptimized (@lukastaegert) + ## 4.34.1 _2025-02-03_ diff --git a/browser/package.json b/browser/package.json index e2e764387..a98fd9d43 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.34.1", + "version": "4.34.2", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index e51c6e27a..a3cbbfca7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.34.1", + "version": "4.34.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.34.1", + "version": "4.34.2", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index 11085dbfb..5938fbb12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.34.1", + "version": "4.34.2", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From 7d553db5978eee77ba764e0ea0dab9f2444ad519 Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Wed, 5 Feb 2025 15:56:09 +0800 Subject: [PATCH 18/21] include the properties that accessed by this (#5831) --- src/ast/nodes/ThisExpression.ts | 23 +++++++++++++++++++ src/ast/nodes/shared/FunctionNode.ts | 2 +- src/ast/scopes/FunctionScope.ts | 6 ++++- .../object-tree-shaking-with-this/_config.js | 3 +++ .../_expected.js | 15 ++++++++++++ .../object-tree-shaking-with-this/main.js | 13 +++++++++++ 6 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 test/form/samples/object-tree-shaking-with-this/_config.js create mode 100644 test/form/samples/object-tree-shaking-with-this/_expected.js create mode 100644 test/form/samples/object-tree-shaking-with-this/main.js diff --git a/src/ast/nodes/ThisExpression.ts b/src/ast/nodes/ThisExpression.ts index 643a12f87..f9e5e7954 100644 --- a/src/ast/nodes/ThisExpression.ts +++ b/src/ast/nodes/ThisExpression.ts @@ -4,11 +4,16 @@ import { logThisIsUndefined } from '../../utils/logs'; import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_ACCESSED } from '../NodeInteractions'; +import ChildScope from '../scopes/ChildScope'; +import FunctionScope from '../scopes/FunctionScope'; import ModuleScope from '../scopes/ModuleScope'; +import type Scope from '../scopes/Scope'; import type { EntityPathTracker, ObjectPath } from '../utils/PathTracker'; import { EMPTY_PATH } from '../utils/PathTracker'; import type Variable from '../variables/Variable'; import type * as NodeType from './NodeType'; +import ObjectExpression from './ObjectExpression'; +import Property from './Property'; import { NodeBase } from './shared/Node'; export default class ThisExpression extends NodeBase { @@ -60,6 +65,14 @@ export default class ThisExpression extends NodeBase { } else if (path.length > 0) { this.variable.includePath(path, context); } + const functionScope = findFunctionScope(this.scope, this.variable); + if ( + functionScope && + functionScope.functionNode.parent instanceof Property && + functionScope.functionNode.parent.parent instanceof ObjectExpression + ) { + functionScope.functionNode.parent.parent.includePath(path, context); + } } initialise(): void { @@ -82,3 +95,13 @@ export default class ThisExpression extends NodeBase { } } } + +function findFunctionScope(scope: Scope | ChildScope, thisVariable: Variable) { + while (!(scope instanceof FunctionScope && scope.thisVariable === thisVariable)) { + if (!(scope instanceof ChildScope)) { + return null; + } + scope = scope.parent; + } + return scope; +} diff --git a/src/ast/nodes/shared/FunctionNode.ts b/src/ast/nodes/shared/FunctionNode.ts index 8a64ba5b6..afc4cf1a7 100644 --- a/src/ast/nodes/shared/FunctionNode.ts +++ b/src/ast/nodes/shared/FunctionNode.ts @@ -28,7 +28,7 @@ export default class FunctionNode extends FunctionBase { declare private constructedEntity: ObjectEntity; createScope(parentScope: ChildScope): void { - this.scope = new FunctionScope(parentScope); + this.scope = new FunctionScope(parentScope, this); this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE); // This makes sure that all deoptimizations of "this" are applied to the // constructed entity. diff --git a/src/ast/scopes/FunctionScope.ts b/src/ast/scopes/FunctionScope.ts index 2898841f4..65f8788bd 100644 --- a/src/ast/scopes/FunctionScope.ts +++ b/src/ast/scopes/FunctionScope.ts @@ -1,6 +1,7 @@ import type { InclusionContext } from '../ExecutionContext'; import type { NodeInteractionCalled } from '../NodeInteractions'; import type { ExpressionEntity } from '../nodes/shared/Expression'; +import type { NodeBase } from '../nodes/shared/Node'; import { UNKNOWN_PATH } from '../utils/PathTracker'; import ArgumentsVariable from '../variables/ArgumentsVariable'; import ThisVariable from '../variables/ThisVariable'; @@ -11,7 +12,10 @@ export default class FunctionScope extends ReturnValueScope { readonly argumentsVariable: ArgumentsVariable; readonly thisVariable: ThisVariable; - constructor(parent: ChildScope) { + constructor( + parent: ChildScope, + readonly functionNode: NodeBase + ) { super(parent, false); const { context } = parent; this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context))); diff --git a/test/form/samples/object-tree-shaking-with-this/_config.js b/test/form/samples/object-tree-shaking-with-this/_config.js new file mode 100644 index 000000000..e1fe03646 --- /dev/null +++ b/test/form/samples/object-tree-shaking-with-this/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'include the properties that accessed by this' +}); diff --git a/test/form/samples/object-tree-shaking-with-this/_expected.js b/test/form/samples/object-tree-shaking-with-this/_expected.js new file mode 100644 index 000000000..e15dd4147 --- /dev/null +++ b/test/form/samples/object-tree-shaking-with-this/_expected.js @@ -0,0 +1,15 @@ +const config = { + recipients: { ALL: 'all'}, + + get recipientsList() { + return [ + { + value: this.recipients.ALL + } + ]; + } +}; + +var main = config.recipientsList; + +export { main as default }; diff --git a/test/form/samples/object-tree-shaking-with-this/main.js b/test/form/samples/object-tree-shaking-with-this/main.js new file mode 100644 index 000000000..407f1c673 --- /dev/null +++ b/test/form/samples/object-tree-shaking-with-this/main.js @@ -0,0 +1,13 @@ +const config = { + recipients: { ALL: 'all', TEAM: 'team' }, + + get recipientsList() { + return [ + { + value: this.recipients.ALL + } + ]; + } +}; + +export default config.recipientsList; From ac8b06a2b5406f694c38c416912cc2b18ba13355 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 5 Feb 2025 09:59:54 +0100 Subject: [PATCH 19/21] 4.34.3 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37e3827cd..8dc9b1702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.34.3 + +_2025-02-05_ + +### Bug Fixes + +- Ensure properties of "this" are included in getters (#5831) + +### Pull Requests + +- [#5831](https://github.com/rollup/rollup/pull/5831): include the properties that accessed by this (@TrickyPi) + ## 4.34.2 _2025-02-04_ diff --git a/browser/package.json b/browser/package.json index a98fd9d43..e03a5285f 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.34.2", + "version": "4.34.3", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index a3cbbfca7..17007f175 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.34.2", + "version": "4.34.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.34.2", + "version": "4.34.3", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index 5938fbb12..7c97a271b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.34.2", + "version": "4.34.3", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js", From cf54603ec174de6c2c567debe739db6d0842f056 Mon Sep 17 00:00:00 2001 From: XiaoPi <530257315@qq.com> Date: Thu, 6 Feb 2025 05:09:04 +0800 Subject: [PATCH 20/21] include all properties if a rest element is destructed (#5833) * include all properties if a rest element is destructed * improve test coverage --- src/ast/nodes/ObjectPattern.ts | 17 +++++++++++++++-- .../remove-props-via-destructuring/main.js | 3 +++ .../_config.js | 3 +++ .../main.js | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 test/function/samples/object-tree-shaking-with-rest-element-destructed/_config.js create mode 100644 test/function/samples/object-tree-shaking-with-rest-element-destructed/main.js diff --git a/src/ast/nodes/ObjectPattern.ts b/src/ast/nodes/ObjectPattern.ts index 6a1beedcd..20a9d1372 100644 --- a/src/ast/nodes/ObjectPattern.ts +++ b/src/ast/nodes/ObjectPattern.ts @@ -87,8 +87,21 @@ export default class ObjectPattern extends NodeBase implements DeclarationPatter destructuredInitPath: ObjectPath, init: ExpressionEntity ): boolean { - let included = false; - for (const property of this.properties) { + if (!this.properties.length) return false; + + const lastProperty = this.properties.at(-1)!; + const lastPropertyIncluded = lastProperty.includeDestructuredIfNecessary( + context, + destructuredInitPath, + init + ); + const lastPropertyIsRestElement = lastProperty.type === NodeType.RestElement; + + let included = lastPropertyIsRestElement ? lastPropertyIncluded : false; + for (const property of this.properties.slice(0, -1)) { + if (lastPropertyIsRestElement && lastPropertyIncluded) { + property.includeNode(context); + } included = property.includeDestructuredIfNecessary(context, destructuredInitPath, init) || included; } diff --git a/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js index be4bfe8b7..5c07932ed 100644 --- a/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js +++ b/test/form/samples/object-expression-treeshaking/remove-props-via-destructuring/main.js @@ -7,3 +7,6 @@ const { a: { ...rest } } = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; console.log(rest); + +// for improving test coverage +const {} = { a: { b: { c: 1, d: 1 }, e: 1 }, f: 1 }; diff --git a/test/function/samples/object-tree-shaking-with-rest-element-destructed/_config.js b/test/function/samples/object-tree-shaking-with-rest-element-destructed/_config.js new file mode 100644 index 000000000..a5de162cb --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-rest-element-destructed/_config.js @@ -0,0 +1,3 @@ +module.exports = defineTest({ + description: 'include all properties if a rest element is destructed' +}); diff --git a/test/function/samples/object-tree-shaking-with-rest-element-destructed/main.js b/test/function/samples/object-tree-shaking-with-rest-element-destructed/main.js new file mode 100644 index 000000000..f4eb3aaee --- /dev/null +++ b/test/function/samples/object-tree-shaking-with-rest-element-destructed/main.js @@ -0,0 +1,3 @@ +const obj = { a: 1, b: 2 }; +const { a: _, ...rest } = obj; +assert.deepStrictEqual(rest, { b: 2 }); From 19312a762c3cda56a0f6dc80a0887a4499db2257 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 5 Feb 2025 22:10:36 +0100 Subject: [PATCH 21/21] 4.34.4 --- CHANGELOG.md | 12 ++++++++++++ browser/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc9b1702..9363a4953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # rollup changelog +## 4.34.4 + +_2025-02-05_ + +### Bug Fixes + +- Do not tree-shake properties if a rest element is used in destructuring (#5833) + +### Pull Requests + +- [#5833](https://github.com/rollup/rollup/pull/5833): include all properties if a rest element is destructed (@TrickyPi) + ## 4.34.3 _2025-02-05_ diff --git a/browser/package.json b/browser/package.json index e03a5285f..33e955438 100644 --- a/browser/package.json +++ b/browser/package.json @@ -1,6 +1,6 @@ { "name": "@rollup/browser", - "version": "4.34.3", + "version": "4.34.4", "description": "Next-generation ES module bundler browser build", "main": "dist/rollup.browser.js", "module": "dist/es/rollup.browser.js", diff --git a/package-lock.json b/package-lock.json index 17007f175..1e3531d11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rollup", - "version": "4.34.3", + "version": "4.34.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rollup", - "version": "4.34.3", + "version": "4.34.4", "license": "MIT", "dependencies": { "@types/estree": "1.0.6" diff --git a/package.json b/package.json index 7c97a271b..ba2daef79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rollup", - "version": "4.34.3", + "version": "4.34.4", "description": "Next-generation ES module bundler", "main": "dist/rollup.js", "module": "dist/es/rollup.js",