From 47ed7208c0c8d7a500abf69d51f86a1783d553ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 23 Oct 2026 21:28:14 +0200 Subject: [PATCH] Remove the Rust parser extension and its documentation --- .github/workflows/phpunit-tests.yml | 86 +- .../publish-wasm-extension-artifact.yml | 291 - .github/workflows/wasm-spike.yml | 192 - ...wp-tests-phpunit-native-extension-setup.sh | 211 - .github/workflows/wp-tests-phpunit-run.js | 23 - .github/workflows/wp-tests-phpunit.yml | 34 - .gitignore | 1 - README.md | 9 - packages/mysql-on-sqlite/src/load.php | 22 +- .../src/mysql/native/class-wp-mysql-lexer.php | 8 - .../class-wp-mysql-native-parser-node.php | 181 - .../mysql/native/class-wp-mysql-parser.php | 16 - .../src/mysql/native/mysql-rust-bridge.php | 24 - .../trait-wp-mysql-native-parser-impl.php | 57 - .../src/parser/class-wp-parser-grammar.php | 1 - .../src/sqlite/class-wp-mysql-on-sqlite.php | 16 +- packages/mysql-on-sqlite/tests/bootstrap.php | 4 - .../WP_MySQL_Parser_Instanceof_Tests.php | 31 + ...P_MySQL_Native_Parser_Node_Cycle_Tests.php | 267 - ...ySQL_Native_Parser_Node_Identity_Tests.php | 142 - .../WP_MySQL_Parser_Instanceof_Tests.php | 39 - .../tests/tools/run-lexer-benchmark.php | 53 +- .../tools/run-native-extension-benchmark.php | 113 - .../tests/tools/run-parser-benchmark.php | 26 +- .../tools/verify-native-parser-extension.php | 103 - packages/php-ext-wp-mysql-parser/.gitignore | 1 - packages/php-ext-wp-mysql-parser/Cargo.lock | 1689 ------ packages/php-ext-wp-mysql-parser/Cargo.toml | 17 - packages/php-ext-wp-mysql-parser/README.md | 104 - .../src/lexer_constants.rs | 5279 ----------------- packages/php-ext-wp-mysql-parser/src/lib.rs | 2110 ------- .../tools/generate-lexer-constants.php | 229 - .../wasm-spike/.gitignore | 2 - .../wasm-spike/Dockerfile.rust | 81 - .../wasm-spike/RESULT.md | 138 - .../wasm-spike/build-in-docker-rust.sh | 330 -- .../check-playground-web-compat.mjs | 105 - .../wasm-spike/probe-host-cargo-wasm.sh | 26 - .../wasm-spike/run-spike.mjs | 103 - .../wasm-spike/shim/config.m4 | 21 - .../wasm-spike/shim/wp_mysql_parser_shim.c | 16 - .../wasm-spike/write-extension-manifest.mjs | 61 - 42 files changed, 79 insertions(+), 12183 deletions(-) delete mode 100644 .github/workflows/publish-wasm-extension-artifact.yml delete mode 100644 .github/workflows/wasm-spike.yml delete mode 100644 .github/workflows/wp-tests-phpunit-native-extension-setup.sh delete mode 100644 packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-lexer.php delete mode 100644 packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-native-parser-node.php delete mode 100644 packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-parser.php delete mode 100644 packages/mysql-on-sqlite/src/mysql/native/mysql-rust-bridge.php delete mode 100644 packages/mysql-on-sqlite/src/mysql/native/trait-wp-mysql-native-parser-impl.php create mode 100644 packages/mysql-on-sqlite/tests/mysql/WP_MySQL_Parser_Instanceof_Tests.php delete mode 100644 packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Cycle_Tests.php delete mode 100644 packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Identity_Tests.php delete mode 100644 packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Parser_Instanceof_Tests.php delete mode 100644 packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php delete mode 100644 packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php delete mode 100644 packages/php-ext-wp-mysql-parser/.gitignore delete mode 100644 packages/php-ext-wp-mysql-parser/Cargo.lock delete mode 100644 packages/php-ext-wp-mysql-parser/Cargo.toml delete mode 100644 packages/php-ext-wp-mysql-parser/README.md delete mode 100644 packages/php-ext-wp-mysql-parser/src/lexer_constants.rs delete mode 100644 packages/php-ext-wp-mysql-parser/src/lib.rs delete mode 100644 packages/php-ext-wp-mysql-parser/tools/generate-lexer-constants.php delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/.gitignore delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/Dockerfile.rust delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md delete mode 100755 packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh delete mode 100755 packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs delete mode 100755 packages/php-ext-wp-mysql-parser/wasm-spike/probe-host-cargo-wasm.sh delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/shim/config.m4 delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/shim/wp_mysql_parser_shim.c delete mode 100644 packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index da87f9f1e..74daffa4b 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -7,14 +7,12 @@ on: paths: - '.github/workflows/phpunit-tests.yml' - 'packages/mysql-on-sqlite/**' - - 'packages/php-ext-wp-mysql-parser/**' - 'composer.json' - 'composer.lock' pull_request: paths: - '.github/workflows/phpunit-tests.yml' - 'packages/mysql-on-sqlite/**' - - 'packages/php-ext-wp-mysql-parser/**' - 'composer.json' - 'composer.lock' workflow_dispatch: @@ -29,10 +27,7 @@ permissions: {} jobs: test: - # The pure-PHP parser is exercised across the full PHP/SQLite range; the - # native Rust parser extension is exercised on PHP 8.0+ (its minimum). Both - # run the same mysql-on-sqlite suite, just with a different parser engine. - name: PHP ${{ matrix.php }}${{ matrix.extension && ' + ext-wp-mysql-parser' || '' }} / SQLite ${{ matrix.sqlite }} + name: PHP ${{ matrix.php }} / SQLite ${{ matrix.sqlite }} runs-on: ubuntu-latest timeout-minutes: 30 permissions: @@ -43,22 +38,15 @@ jobs: include: # Pure-PHP parser, across the supported PHP versions, each pinned to a # representative SQLite version spanning the supported range. - - { php: '7.2', sqlite: '3.27.0', extension: false } # minimum with WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS - - { php: '7.3', sqlite: '3.31.1', extension: false } # Ubuntu 20.04 LTS - - { php: '7.4', sqlite: '3.34.1', extension: false } # Debian 11 (Bullseye) - - { php: '8.0', sqlite: '3.37.0', extension: false } # minimum supported version (STRICT tables) - - { php: '8.1', sqlite: '3.40.1', extension: false } # Debian 12 (Bookworm) - - { php: '8.2', sqlite: '3.45.1', extension: false } # Ubuntu 24.04 LTS - - { php: '8.3', sqlite: '3.46.1', extension: false } # Debian 13 (Trixie) - - { php: '8.4', sqlite: '3.51.2', extension: false } # First 2026 release - - { php: '8.5', sqlite: 'latest', extension: false } - # Native Rust parser extension (requires PHP 8.0+). - - { php: '8.0', sqlite: '3.37.0', extension: true } - - { php: '8.1', sqlite: '3.40.1', extension: true } - - { php: '8.2', sqlite: '3.45.1', extension: true } - - { php: '8.3', sqlite: '3.46.1', extension: true } - - { php: '8.4', sqlite: '3.51.2', extension: true } - - { php: '8.5', sqlite: 'latest', extension: true } + - { php: '7.2', sqlite: '3.27.0' } # minimum with WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS + - { php: '7.3', sqlite: '3.31.1' } # Ubuntu 20.04 LTS + - { php: '7.4', sqlite: '3.34.1' } # Debian 11 (Bullseye) + - { php: '8.0', sqlite: '3.37.0' } # minimum supported version (STRICT tables) + - { php: '8.1', sqlite: '3.40.1' } # Debian 12 (Bookworm) + - { php: '8.2', sqlite: '3.45.1' } # Ubuntu 24.04 LTS + - { php: '8.3', sqlite: '3.46.1' } # Debian 13 (Trixie) + - { php: '8.4', sqlite: '3.51.2' } # First 2026 release + - { php: '8.5', sqlite: 'latest' } steps: - name: Checkout repository @@ -124,29 +112,6 @@ jobs: exit 1 fi - - name: Set up Rust - if: matrix.extension - uses: dtolnay/rust-toolchain@stable - - - name: Cache Rust build - if: matrix.extension - uses: Swatinem/rust-cache@v2 - with: - workspaces: packages/php-ext-wp-mysql-parser - # Segregate by PHP version: the extension links against the PHP headers - # of the matrix's php-config, so a build cached for one PHP version is - # ABI-incompatible with another (Zend module API mismatch on load). - key: php-${{ matrix.php }} - - - name: Install native build dependencies - if: matrix.extension - run: | - sudo apt-get update - sudo apt-get install -y libclang-dev - echo "PHP_CONFIG=$(command -v php-config)" >> "$GITHUB_ENV" - LIBCLANG_SO="$(find /usr/lib -name 'libclang.so*' | head -n 1)" - echo "LIBCLANG_PATH=$(dirname "$LIBCLANG_SO")" >> "$GITHUB_ENV" - - name: Install Composer dependencies (root) uses: ramsey/composer-install@v3 with: @@ -160,37 +125,6 @@ jobs: ignore-cache: "yes" composer-options: "--optimize-autoloader" - - name: Check Rust formatting - if: ${{ matrix.extension && matrix.php == '8.2' }} - run: cargo fmt --check - working-directory: packages/php-ext-wp-mysql-parser - - - name: Build parser extension - if: matrix.extension - run: cargo build --release - working-directory: packages/php-ext-wp-mysql-parser - - # Load the extension via an INI file, so that it also applies to child - # processes, such as PHPUnit tests that run in a separate process. - - name: Enable parser extension - if: matrix.extension - run: | - echo "extension=$GITHUB_WORKSPACE/packages/php-ext-wp-mysql-parser/target/release/libwp_mysql_parser.so" \ - | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/wp-mysql-parser.ini" - - - name: Verify native parser extension - if: matrix.extension - run: php tests/tools/verify-native-parser-extension.php - working-directory: packages/mysql-on-sqlite - - - name: Run PHPUnit suite with parser extension - if: matrix.extension - env: - WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION: '1' - run: php ./vendor/bin/phpunit -c ./phpunit.xml.dist - working-directory: packages/mysql-on-sqlite - - name: Run PHPUnit suite - if: ${{ ! matrix.extension }} run: php ./vendor/bin/phpunit -c ./phpunit.xml.dist working-directory: packages/mysql-on-sqlite diff --git a/.github/workflows/publish-wasm-extension-artifact.yml b/.github/workflows/publish-wasm-extension-artifact.yml deleted file mode 100644 index 75f655c1e..000000000 --- a/.github/workflows/publish-wasm-extension-artifact.yml +++ /dev/null @@ -1,291 +0,0 @@ -name: Publish WASM extension artifact - -on: - push: - branches: - - trunk - paths: - - 'packages/php-ext-wp-mysql-parser/**' - - '.github/workflows/publish-wasm-extension-artifact.yml' - workflow_dispatch: - inputs: - playground-ref: - description: 'wordpress-playground branch/tag/SHA to build against' - required: false - default: 'trunk' - retention-days: - description: 'Actions artifact retention in days' - required: false - default: '30' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - base-image: - name: Build shared Playground base image - runs-on: ubuntu-latest - timeout-minutes: 20 - permissions: - contents: read # Required to clone the wordpress-playground repo. - - steps: - - name: Check out wordpress-playground - uses: actions/checkout@v4 - with: - repository: WordPress/wordpress-playground - ref: ${{ github.event.inputs.playground-ref || 'trunk' }} - path: wordpress-playground - sparse-checkout: | - packages/php-wasm/compile/base-image - - - name: Build Playground base image - run: | - docker build \ - -f wordpress-playground/packages/php-wasm/compile/base-image/Dockerfile \ - --tag playground-php-wasm:base \ - wordpress-playground/packages/php-wasm/compile/base-image - - - name: Save Playground base image - run: docker save --output "${RUNNER_TEMP}/playground-php-wasm-base.tar" playground-php-wasm:base - - - name: Upload Playground base image - uses: actions/upload-artifact@v4 - with: - name: playground-php-wasm-base-image - path: ${{ runner.temp }}/playground-php-wasm-base.tar - if-no-files-found: error - retention-days: 1 - - build: - name: Build wp_mysql_parser.so (PHP ${{ matrix.php }}) - needs: base-image - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: read # Required to clone the repo. - strategy: - fail-fast: false - max-parallel: 6 - matrix: - # The Rust WASM path uses ext-php-rs 0.15, which depends on PHP 8 - # Zend APIs. PHP 7.4 cannot be added here by extending the matrix. - php: ['8.5', '8.4', '8.3', '8.2', '8.1', '8.0'] - - steps: - - name: Check out sqlite-database-integration - uses: actions/checkout@v4 - with: - path: sqlite-database-integration - - - name: Check out wordpress-playground - uses: actions/checkout@v4 - with: - repository: WordPress/wordpress-playground - ref: ${{ github.event.inputs.playground-ref || 'trunk' }} - path: wordpress-playground - sparse-checkout-cone-mode: false - sparse-checkout: | - /package.json - /package-lock.json - /nx.json - /tsconfig.base.json - /packages/meta/ - /packages/nx-extensions/ - /packages/php-wasm/cli-util/ - /packages/php-wasm/compile-extension/ - /packages/php-wasm/compile/ - /packages/php-wasm/fs-journal/ - /packages/php-wasm/logger/ - /packages/php-wasm/node/ - /packages/php-wasm/node-builds/8-0/ - /packages/php-wasm/node-builds/8-1/ - /packages/php-wasm/node-builds/8-2/ - /packages/php-wasm/node-builds/8-3/ - /packages/php-wasm/node-builds/8-4/ - /packages/php-wasm/node-builds/8-5/ - /packages/php-wasm/web-builds/8-0/ - /packages/php-wasm/web-builds/8-1/ - /packages/php-wasm/web-builds/8-2/ - /packages/php-wasm/web-builds/8-3/ - /packages/php-wasm/web-builds/8-4/ - /packages/php-wasm/web-builds/8-5/ - /packages/php-wasm/progress/ - /packages/php-wasm/scopes/ - /packages/php-wasm/stream-compression/ - /packages/php-wasm/universal/ - /packages/php-wasm/util/ - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: '24' - cache: 'npm' - cache-dependency-path: wordpress-playground/package-lock.json - - - name: Download Playground base image - uses: actions/download-artifact@v4 - with: - name: playground-php-wasm-base-image - path: ${{ runner.temp }}/playground-base-image - - - name: Load Playground base image - run: docker load --input "${RUNNER_TEMP}/playground-base-image/playground-php-wasm-base.tar" - - - name: Install Playground deps - working-directory: wordpress-playground - run: npm ci --ignore-scripts - - - name: Build wp_mysql_parser side module - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - env: - PHP_VERSION: ${{ matrix.php }} - ASYNC_MODE: jspi - COMPILE_EXTENSION_PACKAGE: '@php-wasm/compile-extension@3.1.27' - PLAYGROUND_REPO: ${{ github.workspace }}/wordpress-playground - SKIP_BASE_IMAGE_BUILD: '1' - run: bash build-in-docker-rust.sh - - - name: Verify side module exists - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - run: | - test -f dist/wp_mysql_parser-php${{ matrix.php }}-jspi.so - ls -lh dist/wp_mysql_parser-php${{ matrix.php }}-jspi.so - - - name: Check Playground browser runtime compatibility - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - env: - PLAYGROUND_REPO: ${{ github.workspace }}/wordpress-playground - PHP_VERSION: ${{ matrix.php }} - ASYNC_MODE: jspi - run: node check-playground-web-compat.mjs - - - name: Upload side module - uses: actions/upload-artifact@v4 - with: - name: wp_mysql_parser-php${{ matrix.php }}-jspi-so - path: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike/dist/wp_mysql_parser-php${{ matrix.php }}-jspi.so - if-no-files-found: error - retention-days: ${{ github.event.inputs.retention-days || '30' }} - - package: - name: Package extension manifest - runs-on: ubuntu-latest - needs: build - timeout-minutes: 10 - permissions: - contents: write # Required to push the built extension to the gh-pages branch. - - steps: - - name: Check out sqlite-database-integration - uses: actions/checkout@v4 - - - name: Download side modules - uses: actions/download-artifact@v4 - with: - pattern: wp_mysql_parser-php*-jspi-so - path: build/wp_mysql_parser-wasm-extension - merge-multiple: true - - - name: Write Playground extension manifest - env: - ASYNC_MODE: jspi - EXTENSION_VERSION: ${{ github.sha }} - run: | - node packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs \ - build/wp_mysql_parser-wasm-extension \ - 8.5 8.4 8.3 8.2 8.1 8.0 - - - name: Verify published manifest shape - run: | - node <<'NODE' - const fs = require('node:fs'); - const path = require('node:path'); - - const root = 'build/wp_mysql_parser-wasm-extension'; - const manifest = JSON.parse(fs.readFileSync(path.join(root, 'manifest.json'), 'utf8')); - if (manifest.name !== 'wp_mysql_parser') { - throw new Error(`Unexpected extension name: ${manifest.name}`); - } - if (manifest.mode !== 'php-extension') { - throw new Error(`Unexpected manifest mode: ${manifest.mode}`); - } - if (!Array.isArray(manifest.artifacts) || manifest.artifacts.length !== 6) { - throw new Error('Expected six PHP 8.x artifacts.'); - } - for (const artifact of manifest.artifacts) { - if (!artifact.phpVersion || !artifact.sourcePath) { - throw new Error(`Invalid artifact entry: ${JSON.stringify(artifact)}`); - } - if ('file' in artifact || 'sha256' in artifact) { - throw new Error(`Manifest uses the retired pre-PR-3580 fields: ${JSON.stringify(artifact)}`); - } - const artifactPath = path.join(root, artifact.sourcePath); - if (!fs.existsSync(artifactPath)) { - throw new Error(`Manifest references missing artifact: ${artifactPath}`); - } - } - NODE - - - name: Write checksums - working-directory: build/wp_mysql_parser-wasm-extension - run: sha256sum *.so > SHA256SUMS - - - name: Upload packaged extension - uses: actions/upload-artifact@v4 - with: - name: wp_mysql_parser-wasm-extension - path: build/wp_mysql_parser-wasm-extension/ - if-no-files-found: error - retention-days: ${{ github.event.inputs.retention-days || '30' }} - - - name: Publish static extension bundle to gh-pages - env: - BUNDLE_DIR: build/wp_mysql_parser-wasm-extension - EXTENSION_PATH: wp_mysql_parser-wasm-extension - GITHUB_TOKEN: ${{ github.token }} - SITE_BRANCH: gh-pages - VERSION_PATH: ${{ github.sha }} - run: | - set -euo pipefail - - pages_dir="$(mktemp -d)" - git init "$pages_dir" - git -C "$pages_dir" remote add origin "https://github.com/${GITHUB_REPOSITORY}.git" - auth_header="$(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 -w 0)" - git -C "$pages_dir" config http.https://github.com/.extraheader "AUTHORIZATION: basic ${auth_header}" - git -C "$pages_dir" config user.name "github-actions[bot]" - git -C "$pages_dir" config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - if git -C "$pages_dir" ls-remote --exit-code --heads origin "$SITE_BRANCH" >/dev/null 2>&1; then - git -C "$pages_dir" fetch --depth=1 origin "$SITE_BRANCH" - git -C "$pages_dir" checkout -B "$SITE_BRANCH" FETCH_HEAD - else - git -C "$pages_dir" checkout --orphan "$SITE_BRANCH" - fi - - mkdir -p "$pages_dir/$EXTENSION_PATH" - rm -rf "$pages_dir/$EXTENSION_PATH/$VERSION_PATH" "$pages_dir/$EXTENSION_PATH/latest" - mkdir -p "$pages_dir/$EXTENSION_PATH/$VERSION_PATH" "$pages_dir/$EXTENSION_PATH/latest" - cp -R "$BUNDLE_DIR"/. "$pages_dir/$EXTENSION_PATH/$VERSION_PATH/" - cp -R "$BUNDLE_DIR"/. "$pages_dir/$EXTENSION_PATH/latest/" - touch "$pages_dir/.nojekyll" - - git -C "$pages_dir" add .nojekyll "$EXTENSION_PATH" - if git -C "$pages_dir" diff --cached --quiet; then - echo "No gh-pages changes to publish." - exit 0 - fi - - git -C "$pages_dir" commit -m "Publish wp_mysql_parser WASM extension ${VERSION_PATH}" - git -C "$pages_dir" push origin "HEAD:$SITE_BRANCH" - - owner="${GITHUB_REPOSITORY_OWNER,,}" - repo="${GITHUB_REPOSITORY#*/}" - echo "Published latest manifest: https://${owner}.github.io/${repo}/${EXTENSION_PATH}/latest/manifest.json" - echo "Published immutable manifest: https://${owner}.github.io/${repo}/${EXTENSION_PATH}/${VERSION_PATH}/manifest.json" diff --git a/.github/workflows/wasm-spike.yml b/.github/workflows/wasm-spike.yml deleted file mode 100644 index 2e9065814..000000000 --- a/.github/workflows/wasm-spike.yml +++ /dev/null @@ -1,192 +0,0 @@ -name: WASM extension build - -on: - push: - branches: - - trunk - paths: - - 'packages/php-ext-wp-mysql-parser/**' - - '.github/workflows/wasm-spike.yml' - pull_request: - paths: - - 'packages/php-ext-wp-mysql-parser/**' - - '.github/workflows/wasm-spike.yml' - workflow_dispatch: - inputs: - playground-ref: - description: 'wordpress-playground branch/tag/SHA to build against' - required: false - default: 'trunk' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - base-image: - name: Build shared Playground base image - runs-on: ubuntu-latest - timeout-minutes: 20 - permissions: - contents: read # Required to clone the wordpress-playground repo. - - steps: - - name: Check out wordpress-playground - uses: actions/checkout@v4 - with: - repository: WordPress/wordpress-playground - ref: ${{ github.event.inputs.playground-ref || 'trunk' }} - path: wordpress-playground - sparse-checkout: | - packages/php-wasm/compile/base-image - - - name: Build Playground base image - run: | - docker build \ - -f wordpress-playground/packages/php-wasm/compile/base-image/Dockerfile \ - --tag playground-php-wasm:base \ - wordpress-playground/packages/php-wasm/compile/base-image - - - name: Save Playground base image - run: docker save --output "${RUNNER_TEMP}/playground-php-wasm-base.tar" playground-php-wasm:base - - - name: Upload Playground base image - uses: actions/upload-artifact@v4 - with: - name: playground-php-wasm-base-image - path: ${{ runner.temp }}/playground-php-wasm-base.tar - if-no-files-found: error - retention-days: 1 - - build-and-load: - name: Build wp_mysql_parser.so and load it in Playground (PHP ${{ matrix.php }}) - needs: base-image - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: read # Required to clone the repo. - strategy: - fail-fast: false - max-parallel: 6 - matrix: - # The Rust WASM path uses ext-php-rs 0.15, which depends on PHP 8 - # Zend APIs. PHP 7.4 cannot be added here by extending the matrix. - php: ['8.5', '8.4', '8.3', '8.2', '8.1', '8.0'] - async-mode: ['jspi'] - - steps: - - name: Check out sqlite-database-integration - uses: actions/checkout@v4 - with: - path: sqlite-database-integration - - - name: Check out wordpress-playground - uses: actions/checkout@v4 - with: - repository: WordPress/wordpress-playground - ref: ${{ github.event.inputs.playground-ref || 'trunk' }} - path: wordpress-playground - sparse-checkout-cone-mode: false - sparse-checkout: | - /package.json - /package-lock.json - /nx.json - /tsconfig.base.json - /packages/meta/ - /packages/nx-extensions/ - /packages/php-wasm/cli-util/ - /packages/php-wasm/compile-extension/ - /packages/php-wasm/compile/ - /packages/php-wasm/fs-journal/ - /packages/php-wasm/logger/ - /packages/php-wasm/node/ - /packages/php-wasm/node-builds/8-0/ - /packages/php-wasm/node-builds/8-1/ - /packages/php-wasm/node-builds/8-2/ - /packages/php-wasm/node-builds/8-3/ - /packages/php-wasm/node-builds/8-4/ - /packages/php-wasm/node-builds/8-5/ - /packages/php-wasm/web-builds/8-0/ - /packages/php-wasm/web-builds/8-1/ - /packages/php-wasm/web-builds/8-2/ - /packages/php-wasm/web-builds/8-3/ - /packages/php-wasm/web-builds/8-4/ - /packages/php-wasm/web-builds/8-5/ - /packages/php-wasm/progress/ - /packages/php-wasm/scopes/ - /packages/php-wasm/stream-compression/ - /packages/php-wasm/universal/ - /packages/php-wasm/util/ - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: '24' - cache: 'npm' - cache-dependency-path: wordpress-playground/package-lock.json - - - name: Download Playground base image - uses: actions/download-artifact@v4 - with: - name: playground-php-wasm-base-image - path: ${{ runner.temp }}/playground-base-image - - - name: Load Playground base image - run: docker load --input "${RUNNER_TEMP}/playground-base-image/playground-php-wasm-base.tar" - - - name: Install Playground deps - working-directory: wordpress-playground - run: npm ci --ignore-scripts - - - name: Build wp_mysql_parser side module - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - env: - PHP_VERSION: ${{ matrix.php }} - ASYNC_MODE: ${{ matrix.async-mode }} - COMPILE_EXTENSION_PACKAGE: '@php-wasm/compile-extension@3.1.27' - PLAYGROUND_REPO: ${{ github.workspace }}/wordpress-playground - SKIP_BASE_IMAGE_BUILD: '1' - run: bash build-in-docker-rust.sh - - - name: Verify build artifacts exist - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - run: | - test -f dist/wp_mysql_parser-php${{ matrix.php }}-${{ matrix.async-mode }}.so - test -f dist/manifest.json - test -f dist/libwp_mysql_parser.a - ls -lh dist/ - - - name: Verify manifest references the built side module - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - run: | - SOURCE_PATH=$(node -e "console.log(require('./dist/manifest.json').artifacts[0].sourcePath)") - EXPECTED="wp_mysql_parser-php${{ matrix.php }}-${{ matrix.async-mode }}.so" - echo "manifest sourcePath: $SOURCE_PATH" - echo "expected artifact: $EXPECTED" - test "$SOURCE_PATH" = "$EXPECTED" - test -f "dist/$SOURCE_PATH" - node -e "const artifact = require('./dist/manifest.json').artifacts[0]; if ('file' in artifact || 'sha256' in artifact) { throw new Error('manifest uses retired artifact fields'); }" - - - name: Check Playground browser runtime compatibility - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - env: - PLAYGROUND_REPO: ${{ github.workspace }}/wordpress-playground - PHP_VERSION: ${{ matrix.php }} - ASYNC_MODE: ${{ matrix.async-mode }} - run: node check-playground-web-compat.mjs - - - name: Load the extension in Playground and parse a query - working-directory: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike - env: - PLAYGROUND_REPO: ${{ github.workspace }}/wordpress-playground - PHP_VERSION: ${{ matrix.php }} - run: node run-spike.mjs - - - name: Upload artifacts on success - if: success() - uses: actions/upload-artifact@v4 - with: - name: wp_mysql_parser-php${{ matrix.php }}-${{ matrix.async-mode }} - path: sqlite-database-integration/packages/php-ext-wp-mysql-parser/wasm-spike/dist/ - if-no-files-found: error - retention-days: 14 diff --git a/.github/workflows/wp-tests-phpunit-native-extension-setup.sh b/.github/workflows/wp-tests-phpunit-native-extension-setup.sh deleted file mode 100644 index 956c60737..000000000 --- a/.github/workflows/wp-tests-phpunit-native-extension-setup.sh +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" -WP_DIR="$ROOT_DIR/wordpress" -COMPOSE_OVERRIDE="$WP_DIR/docker-compose.override.yml" -RUNTIME_DIR="$ROOT_DIR/tmp-native-extension" -EXTENSION_SOURCE_VOLUME=" - ../packages/php-ext-wp-mysql-parser:/var/native-parser-extension-src" -EXTENSION_RUNTIME_VOLUME=" - ../tmp-native-extension:/var/native-parser-extension:ro" -EXTENSION_INI_VOLUME=" - ../tmp-native-extension/wp-mysql-parser.ini:/usr/local/etc/php/conf.d/wp-mysql-parser.ini:ro" - -if [ ! -f "$COMPOSE_OVERRIDE" ]; then - echo "Missing $COMPOSE_OVERRIDE. Run composer run wp-setup first." >&2 - exit 1 -fi - -add_volume_to_service() { - local service="$1" - local volume="$2" - - node - "$COMPOSE_OVERRIDE" "$service" "$volume" <<'NODE' -const fs = require( 'fs' ); - -const file = process.argv[2]; -const service = process.argv[3]; -const volume = process.argv[4]; -const lines = fs.readFileSync( file, 'utf8' ).split( '\n' ); - -const serviceIndex = lines.findIndex( line => line === ` ${ service }:` ); -if ( serviceIndex === -1 ) { - throw new Error( `Service ${ service } not found in ${ file }.` ); -} - -let serviceEnd = lines.length; -for ( let i = serviceIndex + 1; i < lines.length; i++ ) { - if ( /^ [A-Za-z0-9_-]+:/.test( lines[i] ) ) { - serviceEnd = i; - break; - } -} - -if ( lines.slice( serviceIndex, serviceEnd ).some( line => line.trim() === volume.trim() ) ) { - process.exit( 0 ); -} - -let volumesIndex = -1; -for ( let i = serviceIndex + 1; i < serviceEnd; i++ ) { - if ( lines[i].trim() === 'volumes:' ) { - volumesIndex = i; - break; - } -} - -if ( volumesIndex === -1 ) { - throw new Error( `Service ${ service } has no volumes list in ${ file }.` ); -} - -let insertAt = volumesIndex + 1; -while ( insertAt < serviceEnd && /^\s{6}- /.test( lines[insertAt] ) ) { - insertAt++; -} - -lines.splice( insertAt, 0, volume ); -fs.writeFileSync( file, lines.join( '\n' ) ); -NODE -} - -add_volume_to_service php "$EXTENSION_SOURCE_VOLUME" -add_volume_to_service cli "$EXTENSION_SOURCE_VOLUME" - -cat > "$WP_DIR/native-build-extension.sh" <<'EOF' -#!/bin/sh -set -eu - -apt-get update -apt-get install -y --no-install-recommends ca-certificates curl build-essential clang libclang-dev pkg-config - -if [ ! -x "$HOME/.cargo/bin/cargo" ]; then - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable -fi - -. "$HOME/.cargo/env" - -PHP_CONFIG="$(command -v php-config)" -export PHP_CONFIG - -LIBCLANG_SO="$(find /usr/lib /usr/local/lib -name 'libclang.so*' 2>/dev/null | head -n 1)" -if [ -z "$LIBCLANG_SO" ]; then - echo "Unable to locate libclang.so after installing libclang-dev." >&2 - exit 1 -fi - -LIBCLANG_PATH="$(dirname "$LIBCLANG_SO")" -export LIBCLANG_PATH - -cd /var/native-parser-extension-src -cargo build --release -EOF - -chmod +x "$WP_DIR/native-build-extension.sh" - -cd "$WP_DIR" -node tools/local-env/scripts/docker.js run --rm php sh /var/www/native-build-extension.sh - -mkdir -p "$RUNTIME_DIR" -cp "$ROOT_DIR/packages/php-ext-wp-mysql-parser/target/release/libwp_mysql_parser.so" "$RUNTIME_DIR/libwp_mysql_parser.so" -printf '%s\n' 'extension=/var/native-parser-extension/libwp_mysql_parser.so' > "$RUNTIME_DIR/wp-mysql-parser.ini" - -add_volume_to_service php "$EXTENSION_RUNTIME_VOLUME" -add_volume_to_service cli "$EXTENSION_RUNTIME_VOLUME" -add_volume_to_service php "$EXTENSION_INI_VOLUME" -add_volume_to_service cli "$EXTENSION_INI_VOLUME" - -cat > "$WP_DIR/native-verify-extension.php" <<'EOF' -hasProperty( 'native' ) ) { - wp_sqlite_native_parser_verification_fail( $message ); - } - - $native_property = $parser_reflection->getProperty( 'native' ); - $native_property->setAccessible( true ); - if ( ! ( $native_property->getValue( $parser ) instanceof WP_MySQL_Native_Parser ) ) { - wp_sqlite_native_parser_verification_fail( $message ); - } -} - -$lexer = new WP_MySQL_Lexer( 'SELECT 1' ); -if ( ! ( $lexer instanceof WP_MySQL_Native_Lexer ) ) { - wp_sqlite_native_parser_verification_fail( 'Native lexer is not available in the WordPress PHP test container.' ); -} - -$tokens = $lexer->native_token_stream(); -$rules = include '/var/www/src/wp-content/plugins/sqlite-database-integration/wp-includes/database/mysql/mysql-grammar.php'; -$grammar = new WP_Parser_Grammar( $rules ); -$parser = new WP_MySQL_Parser( $grammar, $tokens ); -wp_sqlite_assert_native_parser_delegate( $parser, 'WordPress PHP test container did not select the native parser delegate.' ); - -$parser_ast = $parser->parse(); -if ( ! ( $parser_ast instanceof WP_MySQL_Native_Parser_Node ) ) { - wp_sqlite_native_parser_verification_fail( 'Native parser did not produce a native-backed AST in the WordPress PHP test container.' ); -} - -$driver = new WP_MySQL_On_SQLite( 'mysql-on-sqlite:path=:memory:;dbname=wp;' ); -$parser = $driver->create_parser( 'SELECT 1' ); -wp_sqlite_assert_native_parser_delegate( $parser, 'WordPress PHP test container SQLite driver did not create a native parser delegate.' ); -$parser->next_query(); -$ast = $parser->get_query_ast(); - -if ( ! ( $ast instanceof WP_MySQL_Native_Parser_Node ) ) { - wp_sqlite_native_parser_verification_fail( 'WordPress PHP test container did not select the native-backed AST.' ); -} - -$reflection = new ReflectionObject( $ast ); -if ( $reflection->hasProperty( 'native_ast' ) || $reflection->hasProperty( 'native_node_index' ) ) { - wp_sqlite_native_parser_verification_fail( 'Native wrapper still stores Rust AST handle properties.' ); -} - -$first = $ast->get_first_child_node(); -if ( ! ( $first instanceof WP_MySQL_Native_Parser_Node ) ) { - wp_sqlite_native_parser_verification_fail( 'Native wrapper did not return a native-backed child node.' ); -} - -if ( $first !== $ast->get_first_child_node() ) { - wp_sqlite_native_parser_verification_fail( 'Native wrapper identity is not stable across reads.' ); -} - -$synthetic = new WP_Parser_Node( 0, 'synthetic' ); -$first->append_child( $synthetic ); -$same_first = $ast->get_first_child_node(); -if ( $same_first !== $first || ! in_array( $synthetic, $same_first->get_children(), true ) ) { - wp_sqlite_native_parser_verification_fail( 'Materialized native wrapper was lost from the parent cache.' ); -} -EOF - -node - "$WP_DIR/tests/phpunit/includes/bootstrap.php" <<'NODE' -const fs = require( 'fs' ); - -const file = process.argv[2]; -const marker = "require_once ABSPATH . 'wp-settings.php';"; -const guard = [ - '/*', - ' * Native parser extension guard. This file is generated by the SQLite integration workflow.', - ' */', - "require_once dirname( __DIR__, 3 ) . '/native-verify-extension.php';", -].join( '\n' ); - -let contents = fs.readFileSync( file, 'utf8' ); - -if ( contents.includes( guard ) ) { - process.exit( 0 ); -} - -if ( ! contents.includes( marker ) ) { - throw new Error( `Unable to find WordPress bootstrap marker in ${ file }.` ); -} - -contents = contents.replace( marker, `${ marker }\n\n${ guard }` ); -fs.writeFileSync( file, contents ); -NODE - -node tools/local-env/scripts/docker.js run --rm php php -m | grep -qx 'wp_mysql_parser' -node tools/local-env/scripts/docker.js run --rm php php /var/www/native-verify-extension.php diff --git a/.github/workflows/wp-tests-phpunit-run.js b/.github/workflows/wp-tests-phpunit-run.js index 78f9d5c16..0d098022a 100644 --- a/.github/workflows/wp-tests-phpunit-run.js +++ b/.github/workflows/wp-tests-phpunit-run.js @@ -9,8 +9,6 @@ const { execSync } = require( 'child_process' ); const fs = require( 'fs' ); const path = require( 'path' ); -const requiresNativeParserExtension = process.env.WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION === '1'; - const expectedErrors = [ 'Tests_DB_Charset::test_set_charset_changes_the_connection_collation', ]; @@ -53,31 +51,10 @@ const expectedFailures = [ ]; console.log( 'Running WordPress PHPUnit tests with expected failures tracking...' ); -if ( requiresNativeParserExtension ) { - console.log( 'Native parser extension is required for this PHPUnit run.' ); -} console.log( 'Expected errors:', expectedErrors ); console.log( 'Expected failures:', expectedFailures ); -function verifyNativeParserExtension() { - const verifier = path.join( __dirname, '..', '..', 'wordpress', 'native-verify-extension.php' ); - if ( ! fs.existsSync( verifier ) ) { - console.error( `Error: Native parser verifier not found at ${ verifier }.` ); - process.exit( 1 ); - } - - execSync( 'composer run wp-test-ensure-env', { stdio: 'inherit' } ); - execSync( - 'cd wordpress && node tools/local-env/scripts/docker.js run --rm php php /var/www/native-verify-extension.php', - { stdio: 'inherit' } - ); -} - try { - if ( requiresNativeParserExtension ) { - verifyNativeParserExtension(); - } - try { execSync( `composer run wp-test-php -- --log-junit=phpunit-results.xml --verbose`, diff --git a/.github/workflows/wp-tests-phpunit.yml b/.github/workflows/wp-tests-phpunit.yml index 91f7d44e2..1b791045f 100644 --- a/.github/workflows/wp-tests-phpunit.yml +++ b/.github/workflows/wp-tests-phpunit.yml @@ -36,37 +36,3 @@ jobs: - name: Stop Docker containers if: always() run: composer run wp-test-clean - - native-parser-test: - name: WordPress PHPUnit Tests / Rust extension - runs-on: ubuntu-latest - timeout-minutes: 40 - permissions: - contents: read # Required to clone the repo. - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Set UID and GID for PHP in WordPress images - run: | - echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV - echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV - - - name: Set up WordPress test environment - run: composer run wp-setup - - - name: Build and load parser extension in WordPress PHP containers - run: bash .github/workflows/wp-tests-phpunit-native-extension-setup.sh - - - name: Run WordPress PHPUnit tests with parser extension - env: - WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION: '1' - run: node .github/workflows/wp-tests-phpunit-run.js - - - name: Stop Docker containers - if: always() - run: composer run wp-test-clean diff --git a/.gitignore b/.gitignore index b75ec524b..82cfb6090 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ composer.lock /wordpress /.claude/settings.local.json /.adversarial-loop/ -/packages/php-ext-wp-mysql-parser/target/ diff --git a/README.md b/README.md index 2541944a8..2683d73ee 100644 --- a/README.md +++ b/README.md @@ -59,15 +59,6 @@ composer run wp-test-e2e # Run WordPress E2E tests (Playwright) composer run wp-test-clean # Clean up WordPress environment (Docker and DB) ``` -## Optional: Native MySQL Parser Extension - -The default code path is pure PHP. For environments that can load PHP extensions, the optional `wp_mysql_parser` extension accelerates the MySQL lexer/parser used by MySQL on SQLite. - -- [Published WASM release list, manifest links, Playground links, and native extension overview](https://wordpress.github.io/sqlite-database-integration/) -- [Build, load, and benchmark docs](packages/php-ext-wp-mysql-parser/README.md) - -Latest local measurement (Apple Silicon macOS, PHP 8.4.5 CLI, 2026-05-26): the native lexer path processed the MySQL test corpus at ~343k QPS versus ~72k QPS for pure PHP (~4.80x), and the native parser path processed it at ~108k QPS versus ~7k QPS for pure PHP (~15.45x). - ## Release workflow Release is streamlined with a local preparation script and GitHub Actions: diff --git a/packages/mysql-on-sqlite/src/load.php b/packages/mysql-on-sqlite/src/load.php index cf3be9b22..93e6b4f09 100644 --- a/packages/mysql-on-sqlite/src/load.php +++ b/packages/mysql-on-sqlite/src/load.php @@ -17,26 +17,8 @@ require_once __DIR__ . '/parser/class-wp-parser-token.php'; require_once __DIR__ . '/mysql/class-wp-mysql-token.php'; -/* - * The MySQL lexer and parser have an optional native (e.g. Rust) implementation. - * When the native extension is loaded, it pre-declares WP_MySQL_Native_Lexer / - * WP_MySQL_Native_Parser; otherwise we fall back to the pure-PHP classes shipped - * here. WP_MySQL_Lexer / WP_MySQL_Parser is the public entrypoint either way. - */ -if ( class_exists( 'WP_MySQL_Native_Lexer', false ) ) { - require_once __DIR__ . '/mysql/native/class-wp-mysql-lexer.php'; -} else { - require_once __DIR__ . '/mysql/class-wp-mysql-lexer.php'; -} - -if ( class_exists( 'WP_MySQL_Native_Parser', false ) ) { - require_once __DIR__ . '/mysql/native/mysql-rust-bridge.php'; - require_once __DIR__ . '/mysql/native/class-wp-mysql-native-parser-node.php'; - require_once __DIR__ . '/mysql/native/trait-wp-mysql-native-parser-impl.php'; - require_once __DIR__ . '/mysql/native/class-wp-mysql-parser.php'; -} else { - require_once __DIR__ . '/mysql/class-wp-mysql-parser.php'; -} +require_once __DIR__ . '/mysql/class-wp-mysql-lexer.php'; +require_once __DIR__ . '/mysql/class-wp-mysql-parser.php'; require_once __DIR__ . '/sqlite/class-wp-sqlite-connection.php'; require_once __DIR__ . '/sqlite/class-wp-sqlite-configurator.php'; require_once __DIR__ . '/sqlite/class-wp-sqlite-driver.php'; diff --git a/packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-lexer.php b/packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-lexer.php deleted file mode 100644 index 1a645ab52..000000000 --- a/packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-lexer.php +++ /dev/null @@ -1,8 +0,0 @@ -materialize_native_children(); - parent::append_child( $node ); - } - - /** @inheritDoc */ - public function merge_fragment( $node ) { - $this->materialize_native_children(); - if ( $node instanceof self ) { - $node->materialize_native_children(); - } - parent::merge_fragment( $node ); - } - - /** @inheritDoc */ - public function has_child(): bool { - if ( $this->was_mutated ) { - return parent::has_child(); - } - return wp_sqlite_mysql_native_ast_has_child( $this ); - } - - /** @inheritDoc */ - public function has_child_node( ?string $rule_name = null ): bool { - if ( $this->was_mutated ) { - return parent::has_child_node( $rule_name ); - } - return wp_sqlite_mysql_native_ast_has_child_node( $this, $rule_name ); - } - - /** @inheritDoc */ - public function has_child_token( ?int $token_id = null ): bool { - if ( $this->was_mutated ) { - return parent::has_child_token( $token_id ); - } - return wp_sqlite_mysql_native_ast_has_child_token( $this, $token_id ); - } - - /** @inheritDoc */ - public function get_first_child() { - if ( $this->was_mutated ) { - return parent::get_first_child(); - } - return wp_sqlite_mysql_native_ast_get_first_child( $this ); - } - - /** @inheritDoc */ - public function get_first_child_node( ?string $rule_name = null ): ?WP_Parser_Node { - if ( $this->was_mutated ) { - return parent::get_first_child_node( $rule_name ); - } - return wp_sqlite_mysql_native_ast_get_first_child_node( $this, $rule_name ); - } - - /** @inheritDoc */ - public function get_first_child_token( ?int $token_id = null ): ?WP_Parser_Token { - if ( $this->was_mutated ) { - return parent::get_first_child_token( $token_id ); - } - return wp_sqlite_mysql_native_ast_get_first_child_token( $this, $token_id ); - } - - /** @inheritDoc */ - public function get_first_descendant_node( ?string $rule_name = null ): ?WP_Parser_Node { - if ( $this->was_mutated ) { - return parent::get_first_descendant_node( $rule_name ); - } - return wp_sqlite_mysql_native_ast_get_first_descendant_node( $this, $rule_name ); - } - - /** @inheritDoc */ - public function get_first_descendant_token( ?int $token_id = null ): ?WP_Parser_Token { - if ( $this->was_mutated ) { - return parent::get_first_descendant_token( $token_id ); - } - return wp_sqlite_mysql_native_ast_get_first_descendant_token( $this, $token_id ); - } - - /** @inheritDoc */ - public function get_children(): array { - if ( $this->was_mutated ) { - return parent::get_children(); - } - return wp_sqlite_mysql_native_ast_get_children( $this ); - } - - /** @inheritDoc */ - public function get_child_nodes( ?string $rule_name = null ): array { - if ( $this->was_mutated ) { - return parent::get_child_nodes( $rule_name ); - } - return wp_sqlite_mysql_native_ast_get_child_nodes( $this, $rule_name ); - } - - /** @inheritDoc */ - public function get_child_tokens( ?int $token_id = null ): array { - if ( $this->was_mutated ) { - return parent::get_child_tokens( $token_id ); - } - return wp_sqlite_mysql_native_ast_get_child_tokens( $this, $token_id ); - } - - /** @inheritDoc */ - public function get_descendants(): array { - if ( $this->was_mutated ) { - return parent::get_descendants(); - } - return wp_sqlite_mysql_native_ast_get_descendants( $this ); - } - - /** @inheritDoc */ - public function get_descendant_nodes( ?string $rule_name = null ): array { - if ( $this->was_mutated ) { - return parent::get_descendant_nodes( $rule_name ); - } - return wp_sqlite_mysql_native_ast_get_descendant_nodes( $this, $rule_name ); - } - - /** @inheritDoc */ - public function get_descendant_tokens( ?int $token_id = null ): array { - if ( $this->was_mutated ) { - return parent::get_descendant_tokens( $token_id ); - } - return wp_sqlite_mysql_native_ast_get_descendant_tokens( $this, $token_id ); - } - - /** @inheritDoc */ - public function get_start(): int { - if ( $this->was_mutated ) { - return parent::get_start(); - } - return wp_sqlite_mysql_native_ast_get_start( $this ); - } - - /** @inheritDoc */ - public function get_length(): int { - if ( $this->was_mutated ) { - return parent::get_length(); - } - return wp_sqlite_mysql_native_ast_get_length( $this ); - } - - private function materialize_native_children(): void { - if ( $this->was_mutated ) { - return; - } - - $this->children = wp_sqlite_mysql_native_ast_get_children( $this ); - $this->was_mutated = true; - if ( function_exists( 'wp_sqlite_mysql_native_ast_materialize_wrapper' ) ) { - wp_sqlite_mysql_native_ast_materialize_wrapper( $this ); - } - } -} diff --git a/packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-parser.php b/packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-parser.php deleted file mode 100644 index ddb3f50e9..000000000 --- a/packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-parser.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -function wp_sqlite_mysql_native_export_grammar( WP_Parser_Grammar $grammar ): array { - return array( - 'highest_terminal_id' => $grammar->highest_terminal_id, - 'rules' => $grammar->rules, - 'lookahead_is_match_possible' => $grammar->lookahead_is_match_possible, - 'rule_names' => $grammar->rule_names, - 'fragment_ids' => $grammar->fragment_ids, - ); -} diff --git a/packages/mysql-on-sqlite/src/mysql/native/trait-wp-mysql-native-parser-impl.php b/packages/mysql-on-sqlite/src/mysql/native/trait-wp-mysql-native-parser-impl.php deleted file mode 100644 index 52628831a..000000000 --- a/packages/mysql-on-sqlite/src/mysql/native/trait-wp-mysql-native-parser-impl.php +++ /dev/null @@ -1,57 +0,0 @@ -native`. `WP_Parser`'s state (`$grammar`, `$tokens`, - * `$position`) stays inert in native mode — the trait's overrides - * never read it. - * - * Adding a public method here is enough to plumb a new public method - * through to the native parser; the using class does not need touching. - * - * @access private - */ -trait WP_MySQL_Native_Parser_Impl { - /** - * @var WP_MySQL_Native_Parser - */ - private $native; - - /** - * @param WP_Parser_Grammar $grammar - * @param array|WP_MySQL_Native_Token_Stream $tokens - */ - public function __construct( WP_Parser_Grammar $grammar, $tokens ) { - // WP_Parser's `array $tokens` constructor signature can't accept - // the native token stream object; its `$this->tokens` / - // `$this->position` state is inert in native mode anyway, so we - // pass an empty array to satisfy the parent contract and keep - // the actual tokens on the native parser. - parent::__construct( $grammar, array() ); - $this->native = new WP_MySQL_Native_Parser( $grammar, $tokens ); - } - - /** - * @param array|WP_MySQL_Native_Token_Stream $tokens - */ - public function reset_tokens( $tokens ): void { - $this->native->reset_tokens( $tokens ); - } - - public function next_query(): bool { - return $this->native->next_query(); - } - - public function get_query_ast(): ?WP_Parser_Node { - return $this->native->get_query_ast(); - } - - public function parse() { - return $this->native->parse(); - } -} diff --git a/packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php b/packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php index 5e9222112..0c96aa882 100644 --- a/packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php +++ b/packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php @@ -34,7 +34,6 @@ class WP_Parser_Grammar { public $lookahead_is_match_possible = array(); public $lowest_non_terminal_id; public $highest_terminal_id; - public $native_grammar; public function __construct( array $rules ) { $this->inflate( $rules ); diff --git a/packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php b/packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php index eee3f050b..2a4122386 100644 --- a/packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php +++ b/packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php @@ -1612,20 +1612,10 @@ public function create_parser( string $query ): WP_MySQL_Parser { $this->mysql_version, $this->get_active_sql_mode_names() ); - $tokens = $lexer instanceof WP_MySQL_Native_Lexer - ? $lexer->native_token_stream() - : $lexer->remaining_tokens(); - return $this->reset_or_create_parser( $tokens ); - } + $tokens = $lexer->remaining_tokens(); - /** - * Reset the reusable parser with new tokens or create it on first use. - * - * @param array|object $tokens Parser tokens. - * @return WP_MySQL_Parser A parser initialized for the token stream. - */ - private function reset_or_create_parser( $tokens ): WP_MySQL_Parser { - if ( null === $this->mysql_parser || ! method_exists( $this->mysql_parser, 'reset_tokens' ) ) { + // Reset the reusable parser with new tokens or create it on first use. + if ( null === $this->mysql_parser ) { $this->mysql_parser = new WP_MySQL_Parser( self::$mysql_grammar, $tokens ); } else { $this->mysql_parser->reset_tokens( $tokens ); diff --git a/packages/mysql-on-sqlite/tests/bootstrap.php b/packages/mysql-on-sqlite/tests/bootstrap.php index 49adca752..78a8df267 100644 --- a/packages/mysql-on-sqlite/tests/bootstrap.php +++ b/packages/mysql-on-sqlite/tests/bootstrap.php @@ -9,10 +9,6 @@ define( 'WP_SQLITE_UNSAFE_ENABLE_UNSUPPORTED_VERSIONS', true ); } -if ( '1' === getenv( 'WP_SQLITE_REQUIRE_NATIVE_PARSER_EXTENSION' ) ) { - require_once __DIR__ . '/tools/verify-native-parser-extension.php'; -} - // Configure the test environment. error_reporting( E_ALL ); define( 'FQDB', ':memory:' ); diff --git a/packages/mysql-on-sqlite/tests/mysql/WP_MySQL_Parser_Instanceof_Tests.php b/packages/mysql-on-sqlite/tests/mysql/WP_MySQL_Parser_Instanceof_Tests.php new file mode 100644 index 000000000..cd795433a --- /dev/null +++ b/packages/mysql-on-sqlite/tests/mysql/WP_MySQL_Parser_Instanceof_Tests.php @@ -0,0 +1,31 @@ +remaining_tokens(); + $parser = new WP_MySQL_Parser( $grammar, $tokens ); + + $this->assertInstanceOf( WP_Parser::class, $parser ); + $this->assertInstanceOf( WP_MySQL_Parser::class, $parser ); + } + + public function test_parser_returns_an_ast(): void { + $grammar = new WP_Parser_Grammar( include __DIR__ . '/../../src/mysql/mysql-grammar.php' ); + $lexer = new WP_MySQL_Lexer( 'SELECT 1 + 2' ); + $tokens = $lexer->remaining_tokens(); + $parser = new WP_MySQL_Parser( $grammar, $tokens ); + + $ast = $parser->parse(); + $this->assertNotNull( $ast ); + $this->assertInstanceOf( WP_Parser_Node::class, $ast ); + } +} diff --git a/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Cycle_Tests.php b/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Cycle_Tests.php deleted file mode 100644 index 576721620..000000000 --- a/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Cycle_Tests.php +++ /dev/null @@ -1,267 +0,0 @@ -markTestSkipped( 'Native MySQL parser extension is not loaded.' ); - } - // Force a clean slate before each test — ASTs from earlier tests - // must not pollute the memory measurements below. - gc_collect_cycles(); - } - - private function parse( string $sql ): WP_Parser_Node { - static $grammar = null; - if ( null === $grammar ) { - $grammar = new WP_Parser_Grammar( include __DIR__ . '/../../../src/mysql/mysql-grammar.php' ); - } - $lexer = new WP_MySQL_Lexer( $sql ); - $tokens = $lexer instanceof WP_MySQL_Native_Lexer - ? $lexer->native_token_stream() - : $lexer->remaining_tokens(); - $parser = new WP_MySQL_Parser( $grammar, $tokens ); - $tree = $parser->parse(); - $this->assertNotNull( $tree, 'Failed to parse SQL: ' . $sql ); - return $tree; - } - - /** - * Hostile loop: parse and walk many ASTs in a tight loop, only - * `gc_collect_cycles()` between iterations. Memory must plateau. - * - * If wrapper registry entries or cache pointers are not released, peak - * memory grows linearly with iteration count. With cleanup in place, the - * working set stays bounded. - */ - public function test_repeated_parse_walk_drop_does_not_leak(): void { - $sql = 'SELECT a, b, c FROM t WHERE a + b * c IN (1, 2, 3) AND d = 4'; - - // Warm-up: do enough work that allocator overhead is amortized - // before we sample the floor. - for ( $i = 0; $i < 20; $i++ ) { - $ast = $this->parse( $sql ); - $ast->get_descendants(); - $ast = null; - gc_collect_cycles(); - } - $baseline = memory_get_usage(); - - // Now run substantially more iterations and assert the working - // set stays within a small multiple of the warm-up floor. - for ( $i = 0; $i < 500; $i++ ) { - $ast = $this->parse( $sql ); - $ast->get_descendants(); - $ast = null; - gc_collect_cycles(); - } - $after = memory_get_usage(); - - // 4 MB headroom — generous, but a leaking cache adds tens of MB - // across 500 iterations on this query. - $delta = $after - $baseline; - $this->assertLessThan( - 4 * 1024 * 1024, - $delta, - sprintf( - 'Memory grew %.1f MB across 500 parse-walk-drop cycles; the per-AST cache is not being collected.', - $delta / 1024 / 1024 - ) - ); - } - - /** - * After dropping the AST and triggering GC, the entire wrapper - * graph must be reclaimable. We hand out one descendant, drop the - * root, then drop the descendant — the next gc cycle must reclaim - * the rest of the cached wrappers. - */ - public function test_drop_then_gc_reclaims_cached_wrappers(): void { - $sql = 'SELECT a, b, c FROM t WHERE a + b * c IN (1, 2, 3) AND d = 4'; - - // Establish a memory floor with no AST live. - gc_collect_cycles(); - $floor = memory_get_usage(); - - $ast = $this->parse( $sql ); - $descendant = $ast->get_first_descendant_node(); - $this->assertNotNull( $descendant ); - $ast = null; - $descendant = null; - gc_collect_cycles(); - - $after = memory_get_usage(); - $delta = $after - $floor; - // Generous bound — but tens of MB of leaked wrappers would blow it. - $this->assertLessThan( - 1 * 1024 * 1024, - $delta, - sprintf( - 'After dropping the AST and the descendant and running gc, %.1f MB of cached wrappers remain.', - $delta / 1024 / 1024 - ) - ); - } - - /** - * Holding a child wrapper *outlives* the variable holding the root. - * The child's registry entry must keep the AST alive (no UAF when the - * bridge is called on the orphaned child). Once the child is also dropped, - * the registry entry must be released. - */ - public function test_orphaned_child_keeps_ast_alive_then_collects(): void { - $sql = 'SELECT a, b, c FROM t WHERE a + b * c IN (1, 2, 3)'; - $child = ( function () use ( $sql ) { - $ast = $this->parse( $sql ); - return $ast->get_first_descendant_node(); - } )(); - - // Root variable is gone; only the child reference remains, but the - // registry entry still pins the AST. The child must still be - // functional — accessing it must not crash. - $this->assertNotNull( $child ); - $this->assertIsString( $child->rule_name ); - // The child's own children should also resolve without UAF. - $grand = $child->get_first_child(); - $this->assertNotNull( $grand ); - - // Now drop the child too; the AST + cache should be reclaimable. - $child = null; - $grand = null; - gc_collect_cycles(); - // If the registry entry was released, this assertion always passes; - // the real signal is the absence of a segfault during teardown. - $this->addToAssertionCount( 1 ); - } - - /** - * Mutating a cached wrapper through `append_child` before dropping - * the AST must not block collection. The mutated wrapper's - * `$children` array now contains a non-cached node; that must not keep - * stale registry/cache entries alive. - */ - public function test_mutation_before_drop_does_not_block_collection(): void { - $sql = 'SELECT 1 + 2'; - - gc_collect_cycles(); - $floor = memory_get_usage(); - - for ( $i = 0; $i < 200; $i++ ) { - $ast = $this->parse( $sql ); - $child = $ast->get_first_child_node(); - $injected = new WP_Parser_Node( 0, 'synthetic-' . $i ); - $ast->append_child( $injected ); - // Touch the cache after mutation to keep wrappers live. - $ast->get_descendants(); - $ast = null; - $child = null; - $injected = null; - gc_collect_cycles(); - } - $after = memory_get_usage(); - $delta = $after - $floor; - $this->assertLessThan( - 4 * 1024 * 1024, - $delta, - sprintf( - 'Memory grew %.1f MB across 200 mutate-then-drop cycles.', - $delta / 1024 / 1024 - ) - ); - } - - /** - * Two ASTs alive simultaneously, then dropped in interleaved order. - * Dropping AST A must not affect AST B's cached wrappers; both must - * eventually collect once unreferenced. - */ - public function test_overlapping_asts_do_not_corrupt_each_other(): void { - $ast_a = $this->parse( 'SELECT a FROM ta WHERE a > 1' ); - $ast_b = $this->parse( 'SELECT b FROM tb WHERE b < 9' ); - - $child_a = $ast_a->get_first_descendant_node(); - $child_b = $ast_b->get_first_descendant_node(); - - // Drop A first and run gc; B must remain fully functional. - $ast_a = null; - $child_a = null; - gc_collect_cycles(); - - $this->assertNotNull( $child_b ); - $walk = $ast_b->get_descendants(); - $this->assertNotEmpty( $walk ); - - // Drop B too; walk one of its still-held descendants — the cache - // is still alive because $child_b pins it. - $ast_b = null; - $this->assertIsString( $child_b->rule_name ); - - $child_b = null; - $walk = null; - gc_collect_cycles(); - $this->addToAssertionCount( 1 ); - } - - /** - * Re-walk + drop + collect across many iterations. This is the - * "translator pass on each query" shape of real workloads. The wrapper - * registry and cache must not create a memory cliff under repeated walks. - */ - public function test_rewalk_loop_stays_bounded(): void { - $sql = 'SELECT a, b, c, d, e FROM t WHERE (a + b) * (c - d) > e AND f IN (1,2,3,4,5)'; - - gc_collect_cycles(); - // Warm-up. - for ( $i = 0; $i < 10; $i++ ) { - $ast = $this->parse( $sql ); - for ( $r = 0; $r < 10; $r++ ) { - $ast->get_descendants(); - } - $ast = null; - gc_collect_cycles(); - } - $floor = memory_get_usage(); - - for ( $i = 0; $i < 200; $i++ ) { - $ast = $this->parse( $sql ); - for ( $r = 0; $r < 10; $r++ ) { - $ast->get_descendants(); - } - $ast = null; - gc_collect_cycles(); - } - $after = memory_get_usage(); - $delta = $after - $floor; - $this->assertLessThan( - 4 * 1024 * 1024, - $delta, - sprintf( - 'Rewalk loop grew memory by %.1f MB; cache likely uncollectable.', - $delta / 1024 / 1024 - ) - ); - } -} diff --git a/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Identity_Tests.php b/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Identity_Tests.php deleted file mode 100644 index 066fd38d4..000000000 --- a/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Identity_Tests.php +++ /dev/null @@ -1,142 +0,0 @@ -markTestSkipped( 'Native MySQL parser extension is not loaded.' ); - } - } - - private function parse( string $sql ): WP_Parser_Node { - static $grammar = null; - if ( null === $grammar ) { - $grammar = new WP_Parser_Grammar( include __DIR__ . '/../../../src/mysql/mysql-grammar.php' ); - } - $lexer = new WP_MySQL_Lexer( $sql ); - $tokens = $lexer instanceof WP_MySQL_Native_Lexer - ? $lexer->native_token_stream() - : $lexer->remaining_tokens(); - $parser = new WP_MySQL_Parser( $grammar, $tokens ); - $tree = $parser->parse(); - $this->assertNotNull( $tree, 'Failed to parse SQL: ' . $sql ); - return $tree; - } - - public function test_get_first_child_node_returns_same_instance(): void { - $tree = $this->parse( 'SELECT 1 + 2' ); - - $first = $tree->get_first_child_node(); - $second = $tree->get_first_child_node(); - - $this->assertNotNull( $first ); - $this->assertSame( $first, $second ); - } - - public function test_native_wrapper_does_not_store_native_ast_handle(): void { - $tree = $this->parse( 'SELECT 1 + 2' ); - - $reflection = new ReflectionObject( $tree ); - - $this->assertFalse( $reflection->hasProperty( 'native_ast' ) ); - $this->assertFalse( $reflection->hasProperty( 'native_node_index' ) ); - } - - public function test_get_children_returns_same_instances_across_calls(): void { - $tree = $this->parse( 'SELECT 1, 2, 3' ); - - $first_pass = $tree->get_children(); - $second_pass = $tree->get_children(); - - $this->assertSameSize( $first_pass, $second_pass ); - foreach ( $first_pass as $i => $child ) { - if ( $child instanceof WP_Parser_Node ) { - $this->assertSame( $child, $second_pass[ $i ] ); - } - } - } - - public function test_descendant_lookup_shares_identity_with_child_lookup(): void { - $tree = $this->parse( 'SELECT 1 + 2' ); - - $descendant = $tree->get_first_descendant_node(); - $this->assertNotNull( $descendant ); - - // Walk down to the same node via direct children. We don't know the - // exact depth, so we descend until we hit the descendant we found. - $cursor = $tree; - while ( null !== $cursor && $cursor !== $descendant ) { - $next = $cursor->get_first_child_node(); - if ( $next === $cursor ) { - break; - } - $cursor = $next; - } - - $this->assertSame( $descendant, $cursor, 'Descendant and child lookups must return the same wrapper instance.' ); - } - - public function test_mutation_on_child_survives_re_read(): void { - $tree = $this->parse( 'SELECT 1 + 2' ); - - $child = $tree->get_first_child_node(); - $this->assertNotNull( $child ); - - // Mutate via the public WP_Parser_Node API. This catches regressions - // where accessors hand back fresh wrappers and lose state written - // through a previously returned child. - $child->rule_name = 'mutated-rule'; - - $same_child = $tree->get_first_child_node(); - $this->assertSame( $child, $same_child ); - $this->assertSame( 'mutated-rule', $same_child->rule_name ); - } - - public function test_materialized_child_survives_re_read_from_native_parent(): void { - $tree = $this->parse( 'SELECT 1 + 2' ); - - $child = $tree->get_first_child_node(); - $this->assertNotNull( $child ); - - $synthetic = new WP_Parser_Node( 0, 'synthetic' ); - $child->append_child( $synthetic ); - - $same_child = $tree->get_first_child_node(); - $this->assertSame( $child, $same_child ); - $this->assertTrue( - in_array( $synthetic, $same_child->get_children(), true ), - 'Materialized live child wrappers must stay discoverable through the parent native cache.' - ); - } - - public function test_mutation_survives_parent_materialization(): void { - $tree = $this->parse( 'SELECT 1 + 2' ); - - $child = $tree->get_first_child_node(); - $this->assertNotNull( $child ); - $child->rule_name = 'before-materialize'; - - // Force the parent to materialize its native children by appending - // a sibling. After this, the parent walks $this->children directly. - $sibling = new WP_Parser_Node( 0, 'synthetic' ); - $tree->append_child( $sibling ); - - $children = $tree->get_children(); - $this->assertContains( $child, $children, 'Materialized children must include the previously-mutated wrapper.' ); - $this->assertSame( 'before-materialize', $child->rule_name ); - } -} diff --git a/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Parser_Instanceof_Tests.php b/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Parser_Instanceof_Tests.php deleted file mode 100644 index d308d5585..000000000 --- a/packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Parser_Instanceof_Tests.php +++ /dev/null @@ -1,39 +0,0 @@ -native_token_stream() - : $lexer->remaining_tokens(); - $parser = new WP_MySQL_Parser( $grammar, $tokens ); - - $this->assertInstanceOf( WP_Parser::class, $parser ); - $this->assertInstanceOf( WP_MySQL_Parser::class, $parser ); - } - - public function test_parser_returns_an_ast(): void { - $grammar = new WP_Parser_Grammar( include __DIR__ . '/../../../src/mysql/mysql-grammar.php' ); - $lexer = new WP_MySQL_Lexer( 'SELECT 1 + 2' ); - $tokens = $lexer instanceof WP_MySQL_Native_Lexer - ? $lexer->native_token_stream() - : $lexer->remaining_tokens(); - $parser = new WP_MySQL_Parser( $grammar, $tokens ); - - $ast = $parser->parse(); - $this->assertNotNull( $ast ); - $this->assertInstanceOf( WP_Parser_Node::class, $ast ); - } -} diff --git a/packages/mysql-on-sqlite/tests/tools/run-lexer-benchmark.php b/packages/mysql-on-sqlite/tests/tools/run-lexer-benchmark.php index 23ecd1b43..276312f58 100644 --- a/packages/mysql-on-sqlite/tests/tools/run-lexer-benchmark.php +++ b/packages/mysql-on-sqlite/tests/tools/run-lexer-benchmark.php @@ -4,9 +4,8 @@ * Benchmark the MySQL lexer over the checked-in MySQL server test corpus and * report its tokenization throughput (queries lexed per second). * - * Mirrors run-parser-benchmark.php: it loads through src/load.php, so when the - * native wp_mysql_parser extension is loaded the benchmark runs the native - * lexer through the same public WP_MySQL_Lexer wrapper that the driver uses. + * Mirrors run-parser-benchmark.php: it loads through src/load.php and uses + * the same WP_MySQL_Lexer class that the driver uses. * * JIT / opcache are start-up ini settings, so this script does not toggle them; * it reports the active configuration so every run is self-describing. Run it @@ -56,8 +55,7 @@ function ( $severity, $message, $file, $line ) { } } -// Use the integration loader so an already-loaded native extension selects -// the same public lexer class that runtime code uses. +// Use the integration loader so the benchmark uses the runtime lexer class. require_once __DIR__ . '/../../src/load.php'; // Load the bounded checked-in corpus before timing so file IO is excluded @@ -76,17 +74,12 @@ function ( $severity, $message, $file, $line ) { } $query_count = count( $queries ); -// Lex the whole corpus once. Calling native_token_stream() vs remaining_tokens() -// mirrors how the driver consumes the chosen lexer. -$native = class_exists( 'WP_MySQL_Native_Lexer', false ); -$lex_corpus = function () use ( $queries, $native ) { +// Lex the whole corpus once, consuming tokens the same way as the driver. +$lex_corpus = function () use ( $queries ) { foreach ( $queries as $query ) { $lexer = new WP_MySQL_Lexer( $query ); - $tokens = $native && $lexer instanceof WP_MySQL_Native_Lexer - ? $lexer->native_token_stream() - : $lexer->remaining_tokens(); - $count = is_array( $tokens ) ? count( $tokens ) : $tokens->count(); - if ( 0 === $count ) { + $tokens = $lexer->remaining_tokens(); + if ( 0 === count( $tokens ) ) { throw new Exception( 'Failed to tokenize query: ' . $query ); } } @@ -120,26 +113,24 @@ function ( $severity, $message, $file, $line ) { $opcache_status = function_exists( 'opcache_get_status' ) ? opcache_get_status( false ) : false; $opcache_on = is_array( $opcache_status ); $jit_on = $opcache_on && ! empty( $opcache_status['jit']['on'] ); -$implementation = ( extension_loaded( 'wp_mysql_parser' ) && $native ) ? 'native-extension' : 'php'; if ( $json ) { echo json_encode( array( - 'benchmark' => 'mysql-lexer', - 'implementation' => $implementation, - 'extension_loaded' => extension_loaded( 'wp_mysql_parser' ), - 'opcache' => $opcache_on, - 'jit' => $jit_on, - 'queries' => $query_count, - 'warmup' => $warmup, - 'iterations' => $iterations, - 'qps' => $best, // Headline (best pass); kept as "qps" for compatibility. - 'qps_best' => $best, - 'qps_median' => $median, - 'qps_mean' => $mean, - 'qps_worst' => $worst, - 'spread' => $spread, - 'php_version' => PHP_VERSION, + 'benchmark' => 'mysql-lexer', + 'implementation' => 'php', + 'opcache' => $opcache_on, + 'jit' => $jit_on, + 'queries' => $query_count, + 'warmup' => $warmup, + 'iterations' => $iterations, + 'qps' => $best, // Headline (best pass); kept as "qps" for compatibility. + 'qps_best' => $best, + 'qps_median' => $median, + 'qps_mean' => $mean, + 'qps_worst' => $worst, + 'spread' => $spread, + 'php_version' => PHP_VERSION, ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ), "\n"; @@ -147,7 +138,7 @@ function ( $severity, $message, $file, $line ) { } $config = $jit_on ? 'opcache + tracing JIT' : ( $opcache_on ? 'opcache, no JIT' : 'no opcache' ); -printf( "MySQL lexer (%s implementation) — %s\n", $implementation, $config ); +printf( "MySQL lexer (php implementation) — %s\n", $config ); $jit_requested = ! in_array( strtolower( (string) ini_get( 'opcache.jit' ) ), array( '', '0', 'off', 'disable' ), true ); if ( $jit_requested && ! $jit_on ) { printf( " warning: opcache.jit is set but the JIT is NOT active here — check that opcache is enabled and jit_buffer_size > 0.\n" ); diff --git a/packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php b/packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php deleted file mode 100644 index e4e304a9a..000000000 --- a/packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php +++ /dev/null @@ -1,113 +0,0 @@ -= $limit ) { - break; - } -} - -function benchmark_php_mysql_lexer( $queries ) { - $start = microtime( true ); - foreach ( $queries as $query ) { - $lexer = new WP_MySQL_Lexer( $query ); - $tokens = $lexer->remaining_tokens(); - if ( count( $tokens ) === 0 ) { - throw new Exception( 'Failed to tokenize query: ' . $query ); - } - } - $duration = microtime( true ) - $start; - return array( - 'available' => true, - 'duration' => $duration, - 'qps' => count( $queries ) / $duration, - ); -} - -function benchmark_native_mysql_lexer( $queries ) { - if ( ! class_exists( 'WP_MySQL_Native_Lexer', false ) ) { - return array( - 'available' => false, - 'reason' => 'The wp_mysql_parser extension is not loaded.', - ); - } - - $start = microtime( true ); - foreach ( $queries as $query ) { - $lexer = new WP_MySQL_Native_Lexer( $query ); - $tokens = $lexer->native_token_stream(); - if ( 0 === $tokens->count() ) { - throw new Exception( 'Failed to tokenize query with native lexer: ' . $query ); - } - } - $duration = microtime( true ) - $start; - return array( - 'available' => true, - 'duration' => $duration, - 'qps' => count( $queries ) / $duration, - ); -} - -$php = benchmark_php_mysql_lexer( $queries ); -$native = benchmark_native_mysql_lexer( $queries ); - -$result = array( - 'benchmark' => 'mysql-lexer-native-extension', - 'queries' => count( $queries ), - 'php_version' => PHP_VERSION, - 'extension_loaded' => extension_loaded( 'wp_mysql_parser' ), - 'pure_php' => $php, - 'native_extension' => $native, -); - -if ( ! empty( $native['available'] ) ) { - $result['speedup'] = $native['qps'] / $php['qps']; -} - -if ( $json ) { - echo json_encode( $result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ), "\n"; - exit; -} - -printf( "Benchmarked %d MySQL queries on PHP %s.\n", $result['queries'], PHP_VERSION ); -printf( "Pure PHP lexer: %.5fs @ %d QPS\n", $php['duration'], $php['qps'] ); -if ( empty( $native['available'] ) ) { - printf( "Native extension: unavailable (%s)\n", $native['reason'] ); - exit; -} -printf( "Native extension: %.5fs @ %d QPS\n", $native['duration'], $native['qps'] ); -printf( "Speedup: %.2fx\n", $result['speedup'] ); diff --git a/packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php b/packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php index 6b77ea899..8568e94b8 100644 --- a/packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php +++ b/packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php @@ -25,8 +25,7 @@ function ( $severity, $message, $file, $line ) { } } -// Use the integration loader so an already-loaded native extension selects -// the same public lexer/parser classes that runtime code uses. +// Use the integration loader so the benchmark uses the runtime lexer/parser classes. require_once __DIR__ . '/../../src/load.php'; function get_stats( $total, $failures, $exceptions ) { @@ -68,10 +67,8 @@ function get_stats( $total, $failures, $exceptions ) { foreach ( $queries as $query ) { try { $lexer = new WP_MySQL_Lexer( $query ); - $tokens = $lexer instanceof WP_MySQL_Native_Lexer - ? $lexer->native_token_stream() - : $lexer->remaining_tokens(); - if ( ( is_array( $tokens ) ? count( $tokens ) : $tokens->count() ) === 0 ) { + $tokens = $lexer->remaining_tokens(); + if ( count( $tokens ) === 0 ) { throw new Exception( 'Failed to tokenize query: ' . $query ); } @@ -95,15 +92,14 @@ function get_stats( $total, $failures, $exceptions ) { if ( $json ) { echo json_encode( array( - 'benchmark' => 'mysql-parser', - 'implementation' => class_exists( 'WP_MySQL_Native_Parser', false ) ? 'native-extension' : 'php', - 'extension_loaded' => extension_loaded( 'wp_mysql_parser' ), - 'queries' => $processed, - 'duration' => $duration, - 'qps' => $qps, - 'failures' => count( $failures ), - 'exceptions' => count( $exceptions ), - 'php_version' => PHP_VERSION, + 'benchmark' => 'mysql-parser', + 'implementation' => 'php', + 'queries' => $processed, + 'duration' => $duration, + 'qps' => $qps, + 'failures' => count( $failures ), + 'exceptions' => count( $exceptions ), + 'php_version' => PHP_VERSION, ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ), "\n"; diff --git a/packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php b/packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php deleted file mode 100644 index 499fc5b9e..000000000 --- a/packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php +++ /dev/null @@ -1,103 +0,0 @@ -hasProperty( 'native' ) ) { - wp_sqlite_native_parser_verification_fail( $context ); - } - - $native_property = $reflection->getProperty( 'native' ); - if ( PHP_VERSION_ID < 80100 ) { - $native_property->setAccessible( true ); - } - if ( ! ( $native_property->getValue( $parser ) instanceof WP_MySQL_Native_Parser ) ) { - wp_sqlite_native_parser_verification_fail( $context ); - } -} - -/** - * Run the native parser verification. - */ -function wp_sqlite_verify_native_parser_extension(): void { - if ( ! class_exists( 'WP_MySQL_Native_Lexer', false ) || ! class_exists( 'WP_MySQL_Native_Parser', false ) ) { - wp_sqlite_native_parser_verification_fail( 'Native MySQL parser extension is not loaded.' ); - } - - $lexer = new WP_MySQL_Lexer( 'SELECT ID, post_title FROM wp_posts WHERE ID IN (1, 2, 3)' ); - if ( ! ( $lexer instanceof WP_MySQL_Native_Lexer ) ) { - wp_sqlite_native_parser_verification_fail( 'WP_MySQL_Lexer did not resolve to the native implementation.' ); - } - - $tokens = $lexer->native_token_stream(); - $rules = include __DIR__ . '/../../src/mysql/mysql-grammar.php'; - $grammar = new WP_Parser_Grammar( $rules ); - $parser = new WP_MySQL_Parser( $grammar, $tokens ); - wp_sqlite_assert_native_parser_delegate( - $parser, - 'WP_MySQL_Parser did not create a native parser delegate.' - ); - - $parser_ast = $parser->parse(); - if ( ! ( $parser_ast instanceof WP_MySQL_Native_Parser_Node ) || 'query' !== $parser_ast->rule_name ) { - wp_sqlite_native_parser_verification_fail( 'Native parser did not produce the expected query AST.' ); - } - - $driver = new WP_MySQL_On_SQLite( 'mysql-on-sqlite:path=:memory:;dbname=wp;' ); - $parser = $driver->create_parser( 'SELECT 1' ); - wp_sqlite_assert_native_parser_delegate( - $parser, - 'WP_MySQL_On_SQLite did not create a native parser delegate.' - ); - - $parser->next_query(); - $ast = $parser->get_query_ast(); - if ( ! ( $ast instanceof WP_MySQL_Native_Parser_Node ) ) { - wp_sqlite_native_parser_verification_fail( 'WP_MySQL_On_SQLite did not produce a native-backed AST.' ); - } - - $reflection = new ReflectionObject( $ast ); - if ( $reflection->hasProperty( 'native_ast' ) || $reflection->hasProperty( 'native_node_index' ) ) { - wp_sqlite_native_parser_verification_fail( 'Native wrapper still stores Rust AST handle properties.' ); - } - - $first = $ast->get_first_child_node(); - if ( ! ( $first instanceof WP_MySQL_Native_Parser_Node ) ) { - wp_sqlite_native_parser_verification_fail( 'Native wrapper did not return a native-backed child node.' ); - } - - if ( $first !== $ast->get_first_child_node() ) { - wp_sqlite_native_parser_verification_fail( 'Native wrapper identity is not stable across reads.' ); - } - - $synthetic = new WP_Parser_Node( 0, 'synthetic' ); - $first->append_child( $synthetic ); - $same_first = $ast->get_first_child_node(); - if ( $same_first !== $first || ! in_array( $synthetic, $same_first->get_children(), true ) ) { - wp_sqlite_native_parser_verification_fail( 'Materialized native wrapper was lost from the parent cache.' ); - } -} - -wp_sqlite_verify_native_parser_extension(); diff --git a/packages/php-ext-wp-mysql-parser/.gitignore b/packages/php-ext-wp-mysql-parser/.gitignore deleted file mode 100644 index b83d22266..000000000 --- a/packages/php-ext-wp-mysql-parser/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/packages/php-ext-wp-mysql-parser/Cargo.lock b/packages/php-ext-wp-mysql-parser/Cargo.lock deleted file mode 100644 index baf9d8490..000000000 --- a/packages/php-ext-wp-mysql-parser/Cargo.lock +++ /dev/null @@ -1,1689 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aes" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66bd29a732b644c0431c6140f370d097879203d79b80c94a6747ba0872adaef8" -dependencies = [ - "cipher", - "cpubits", - "cpufeatures 0.3.0", -] - -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - -[[package]] -name = "ar_archive_writer" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb93bbb63b9c227414f6eb3a0adfddca591a8ce1e9b60661bb08969b87e340b" -dependencies = [ - "object", -] - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" - -[[package]] -name = "bitflags" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdd35008169921d80bc60d3d0ab416eecb028c4cd653352907921d95084790be" -dependencies = [ - "hybrid-array", - "zeroize", -] - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - -[[package]] -name = "bytecount" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" - -[[package]] -name = "bytes" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" - -[[package]] -name = "bzip2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c" -dependencies = [ - "libbz2-rs-sys", -] - -[[package]] -name = "camino" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" -dependencies = [ - "serde_core", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - -[[package]] -name = "cc" -version = "1.2.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" -dependencies = [ - "find-msvc-tools", - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "cipher" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34d8227fe1ba289043aeb13792056ff80fd6de1a9f49137a5f499de8e8c78ea" -dependencies = [ - "crypto-common 0.2.1", - "inout", -] - -[[package]] -name = "cmov" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f88a43d011fc4a6876cb7344703e297c71dda42494fee094d5f7c76bf13f746" - -[[package]] -name = "const-oid" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" - -[[package]] -name = "constant_time_eq" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" - -[[package]] -name = "convert_case" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpubits" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef0c543070d296ea414df2dd7625d1b24866ce206709d8a4a424f28377f5861" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "cpufeatures" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-common" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710" -dependencies = [ - "hybrid-array", -] - -[[package]] -name = "ctutils" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" -dependencies = [ - "cmov", -] - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "deflate64" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6b926516df9c60bfa16e107b21086399f8285a44ca9711344b9e553c5146e2" - -[[package]] -name = "der" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" -dependencies = [ - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common 0.1.7", -] - -[[package]] -name = "digest" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4850db49bf08e663084f7fb5c87d202ef91a3907271aff24a94eb97ff039153c" -dependencies = [ - "block-buffer 0.12.0", - "const-oid", - "crypto-common 0.2.1", - "ctutils", - "zeroize", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", -] - -[[package]] -name = "ext-php-rs" -version = "0.15.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0525834a3e26fdf0a60a8e7c27ec9521a35808eba8e41a15e135c22f670bc937" -dependencies = [ - "anyhow", - "bitflags", - "cc", - "cfg-if", - "ext-php-rs-bindgen", - "ext-php-rs-build", - "ext-php-rs-derive", - "inventory", - "native-tls", - "once_cell", - "parking_lot", - "skeptic", - "ureq", - "zip", -] - -[[package]] -name = "ext-php-rs-bindgen" -version = "0.72.1-extphprs.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4795dd0976bd7d7d321c49e88e836f8e5b5b2b481e089067e303f2945617458a" -dependencies = [ - "bitflags", - "cexpr", - "ext-php-rs-clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] - -[[package]] -name = "ext-php-rs-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561bce8a6312a6182c078cd987d8d9cb6bf9292a35817cfd009ea0bffa794f5f" -dependencies = [ - "anyhow", -] - -[[package]] -name = "ext-php-rs-clang-sys" -version = "1.8.1-extphprs.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa1ad6e482017d457d57d73691f8bed148a8a6198babe90830310c3308480a61" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "ext-php-rs-derive" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6cb94d5f4c1e9758b6b936ad306dea36a034c125334d9a438fe966a5d596a85" -dependencies = [ - "convert_case", - "darling", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fastrand" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", - "zlib-rs", -] - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi 5.3.0", - "wasip2", -] - -[[package]] -name = "getrandom" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "r-efi 6.0.0", - "wasip2", - "wasip3", - "wasm-bindgen", -] - -[[package]] -name = "glob" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash", -] - -[[package]] -name = "hashbrown" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hmac" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" -dependencies = [ - "digest 0.11.2", -] - -[[package]] -name = "http" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "hybrid-array" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d46837a0ed51fe95bd3b05de33cd64a1ee88fc797477ca48446872504507c5" -dependencies = [ - "typenum", -] - -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.0", - "serde", - "serde_core", -] - -[[package]] -name = "inout" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4250ce6452e92010fdf7268ccc5d14faa80bb12fc741938534c58f16804e03c7" -dependencies = [ - "hybrid-array", -] - -[[package]] -name = "inventory" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" -dependencies = [ - "rustversion", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "jobserver" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" -dependencies = [ - "getrandom 0.3.4", - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] -name = "libbz2-rs-sys" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a6a8c165077efc8f3a971534c50ea6a1a18b329ef4a66e897a7e3a1494565f" - -[[package]] -name = "libc" -version = "0.2.186" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" - -[[package]] -name = "libloading" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" -dependencies = [ - "cfg-if", - "windows-link", -] - -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "lzma-rust2" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47bb1e988e6fb779cf720ad431242d3f03167c1b3f2b1aae7f1a94b2495b36ae" -dependencies = [ - "sha2", -] - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "native-tls" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-conv" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - -[[package]] -name = "openssl" -version = "0.10.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38c4372413cdaaf3cc79dd92d29d7d9f5ab09b51b10dded508fb90bb70b9222" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - -[[package]] -name = "openssl-sys" -version = "0.9.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ce1245cd07fcc4cfdb438f7507b0c7e4f3849a69fd84d52374c66d83741bb6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link", -] - -[[package]] -name = "pbkdf2" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112d82ceb8c5bf524d9af484d4e4970c9fd5a0cc15ba14ad93dccd28873b0629" -dependencies = [ - "digest 0.11.2", - "hmac", -] - -[[package]] -name = "pem-rfc7468" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "pkg-config" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppmd-rust" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efca4c95a19a79d1c98f791f10aebd5c1363b473244630bb7dbde1dc98455a24" - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "psm" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645dbe486e346d9b5de3ef16ede18c26e6c70ad97418f4874b8b1889d6e761ea" -dependencies = [ - "ar_archive_writer", - "cc", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags", - "memchr", - "unicase", -] - -[[package]] -name = "quote" -version = "1.0.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" - -[[package]] -name = "rustc-hash" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" - -[[package]] -name = "rustix" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustls-pki-types" -version = "1.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" -dependencies = [ - "zeroize", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "security-framework" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" -dependencies = [ - "serde", - "serde_core", -] - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "sha1" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" -dependencies = [ - "cfg-if", - "cpufeatures 0.3.0", - "digest 0.11.2", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "simd-adler32" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" - -[[package]] -name = "skeptic" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" -dependencies = [ - "bytecount", - "cargo_metadata", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", -] - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "stacker" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "640c8cdd92b6b12f5bcb1803ca3bbf5ab96e5e6b6b96b9ab77dabe9e880b3190" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "windows-sys", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.2", - "once_cell", - "rustix", - "windows-sys", -] - -[[package]] -name = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "js-sys", - "num-conv", - "powerfmt", - "serde_core", - "time-core", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "typed-path" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e" - -[[package]] -name = "typenum" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" - -[[package]] -name = "unicase" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-segmentation" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "ureq" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" -dependencies = [ - "base64", - "der", - "flate2", - "log", - "native-tls", - "percent-encoding", - "rustls-pki-types", - "ureq-proto", - "utf8-zero", - "webpki-root-certs", -] - -[[package]] -name = "ureq-proto" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" -dependencies = [ - "base64", - "http", - "httparse", - "log", -] - -[[package]] -name = "utf8-zero" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasip2" -version = "1.0.3+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" -dependencies = [ - "wit-bindgen 0.57.1", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen 0.51.0", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - -[[package]] -name = "webpki-root-certs" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - -[[package]] -name = "wp_mysql_parser" -version = "0.1.0" -dependencies = [ - "ext-php-rs", - "libc", - "stacker", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" - -[[package]] -name = "zip" -version = "8.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b" -dependencies = [ - "aes", - "bzip2", - "constant_time_eq", - "crc32fast", - "deflate64", - "flate2", - "getrandom 0.4.2", - "hmac", - "indexmap", - "lzma-rust2", - "memchr", - "pbkdf2", - "ppmd-rust", - "sha1", - "time", - "typed-path", - "zeroize", - "zopfli", - "zstd", -] - -[[package]] -name = "zlib-rs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be3d40e40a133f9c916ee3f9f4fa2d9d63435b5fbe1bfc6d9dae0aa0ada1513" - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" - -[[package]] -name = "zopfli" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" -dependencies = [ - "bumpalo", - "crc32fast", - "log", - "simd-adler32", -] - -[[package]] -name = "zstd" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/packages/php-ext-wp-mysql-parser/Cargo.toml b/packages/php-ext-wp-mysql-parser/Cargo.toml deleted file mode 100644 index 6646c110d..000000000 --- a/packages/php-ext-wp-mysql-parser/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "wp_mysql_parser" -version = "0.1.0" -edition = "2021" -license = "GPL-2.0-or-later" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -ext-php-rs = { version = "0.15.12", default-features = false, features = ["runtime"] } -libc = "0.2" -stacker = "0.1" - -[profile.release] -lto = "thin" -codegen-units = 1 diff --git a/packages/php-ext-wp-mysql-parser/README.md b/packages/php-ext-wp-mysql-parser/README.md deleted file mode 100644 index 2df0b54c4..000000000 --- a/packages/php-ext-wp-mysql-parser/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# WP MySQL Parser PHP Extension - -`wp_mysql_parser` is an optional native PHP extension for the SQLite Database Integration project. It provides native implementations of the MySQL lexer/parser path used by the SQLite driver while keeping the pure-PHP implementation as the portable fallback. - -When the extension is loaded before `packages/mysql-on-sqlite/src/load.php`, it registers native base classes used by the public `WP_MySQL_Lexer` and `WP_MySQL_Parser` wrappers. Without the extension, those public wrappers extend the pure-PHP implementations instead. - -## Published WASM build for Playground - -Published WASM builds are listed on this repository's GitHub Pages site, with manifest links and a “Run in Playground” link for each release: - - - -The current build is also available directly: - -- Manifest: -- Supported PHP versions: 8.0, 8.1, 8.2, 8.3, 8.4, and 8.5. - -Use this Playground URL to load the extension and open the demo/benchmark page. -The published manifest contains PHP 8.0 through 8.5 side modules, and CI checks -that every side module imports only symbols exported by the matching Playground -browser runtime. - - - -## Build the native extension locally - -Requirements: - -- Rust toolchain. -- PHP development headers and `php-config`. -- libclang, with `LIBCLANG_PATH` pointing at the directory containing the libclang shared library when auto-detection is not enough. - -```bash -( - cd packages/php-ext-wp-mysql-parser - PHP_CONFIG="$(command -v php-config)" \ - LIBCLANG_PATH=/path/to/libclang \ - cargo build --release -) -``` - -On macOS, if the linker reports unresolved Zend/PHP symbols, add dynamic lookup linker flags: - -```bash -( - cd packages/php-ext-wp-mysql-parser - RUSTFLAGS='-C link-arg=-undefined -C link-arg=dynamic_lookup' \ - PHP_CONFIG="$(command -v php-config)" \ - LIBCLANG_PATH=/path/to/libclang \ - cargo build --release -) -``` - -The resulting shared object is written under `target/release/` as `libwp_mysql_parser.so` on Linux or `libwp_mysql_parser.dylib` on macOS. - -From the repository root, load it for local verification or benchmarks: - -```bash -php -d extension=/absolute/path/to/libwp_mysql_parser.so -m | grep wp_mysql_parser -php -d extension=/absolute/path/to/libwp_mysql_parser.so packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php -``` - -## Benchmarks - -Run the pure-PHP lexer/parser benchmarks: - -```bash -php packages/mysql-on-sqlite/tests/tools/run-lexer-benchmark.php --json -php packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php --json -``` - -Run the same parser benchmark with the native extension loaded: - -```bash -php -d extension=/absolute/path/to/libwp_mysql_parser.so packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php --json -``` - -Compare the pure-PHP lexer with the native extension lexer in one process: - -```bash -php -d extension=/absolute/path/to/libwp_mysql_parser.so packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php -php -d extension=/absolute/path/to/libwp_mysql_parser.so packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php --json -``` - -The GitHub Pages demo reads published benchmark data from: - - - -Latest local measurement (Apple Silicon macOS, PHP 8.4.5 CLI, 2026-05-26): - -| Benchmark | Implementation | Queries | QPS | Speedup | -| --- | --- | ---: | ---: | ---: | -| MySQL lexer | Pure PHP | 69,577 | 71,553 | — | -| MySQL lexer | Native extension | 69,577 | 343,124 | 4.80x | -| MySQL parser | Pure PHP | 69,577 | 7,015 | — | -| MySQL parser | Native extension | 69,577 | 108,354 | 15.45x | - -That file should be updated whenever a new extension build or benchmark environment is published. - -## PHP.wasm side-module build - -The experimental PHP.wasm side-module build lives in `wasm-spike/` and is verified in CI for PHP `8.0` through `8.5`. - -PHP `7.4` is not supported by this Rust WASM path. The build uses `ext-php-rs` `0.15`, which depends on PHP 8 Zend APIs and does not compile against PHP `7.4` headers. diff --git a/packages/php-ext-wp-mysql-parser/src/lexer_constants.rs b/packages/php-ext-wp-mysql-parser/src/lexer_constants.rs deleted file mode 100644 index d207179fe..000000000 --- a/packages/php-ext-wp-mysql-parser/src/lexer_constants.rs +++ /dev/null @@ -1,5279 +0,0 @@ -#![allow(dead_code)] - -use std::mem; -use std::ptr; - -use ext_php_rs::boxed::ZBox; -use ext_php_rs::builders::ClassBuilder; -use ext_php_rs::ffi::{zval, HashTable}; -use ext_php_rs::types::ZendHashTable; - -type DtorFunc = Option; -const GC_IMMUTABLE: u32 = 1 << 6; - -extern "C" { - fn _zend_hash_init(ht: *mut HashTable, nSize: u32, pDestructor: DtorFunc, persistent: bool); -} - -fn persistent_array(capacity: usize) -> ZBox { - unsafe { - let pointer = libc::malloc(mem::size_of::()) as *mut ZendHashTable; - if pointer.is_null() { - panic!("Failed to allocate persistent Zend array"); - } - ptr::write_bytes(pointer, 0, 1); - _zend_hash_init(pointer, capacity as u32, None, true); - ZBox::from_raw(pointer) - } -} - -fn freeze_array(array: &mut ZendHashTable) { - unsafe { - array.gc.u.type_info |= GC_IMMUTABLE; - } -} -fn array_tokens() -> ZBox { - let mut array = persistent_array(800); - array.insert("ACCESSIBLE", 1i64).unwrap(); - array.insert("ACCOUNT", 2i64).unwrap(); - array.insert("ACTION", 3i64).unwrap(); - array.insert("ADD", 4i64).unwrap(); - array.insert("ADDDATE", 5i64).unwrap(); - array.insert("AFTER", 6i64).unwrap(); - array.insert("AGAINST", 7i64).unwrap(); - array.insert("AGGREGATE", 8i64).unwrap(); - array.insert("ALGORITHM", 9i64).unwrap(); - array.insert("ALL", 10i64).unwrap(); - array.insert("ALTER", 11i64).unwrap(); - array.insert("ALWAYS", 12i64).unwrap(); - array.insert("ANALYSE", 13i64).unwrap(); - array.insert("ANALYZE", 14i64).unwrap(); - array.insert("AND", 15i64).unwrap(); - array.insert("ANY", 16i64).unwrap(); - array.insert("AS", 17i64).unwrap(); - array.insert("ASC", 18i64).unwrap(); - array.insert("ASCII", 19i64).unwrap(); - array.insert("ASENSITIVE", 20i64).unwrap(); - array.insert("AT", 21i64).unwrap(); - array.insert("ATTRIBUTE", 812i64).unwrap(); - array.insert("AUTHORS", 22i64).unwrap(); - array.insert("AUTO_INCREMENT", 24i64).unwrap(); - array.insert("AUTOEXTEND_SIZE", 23i64).unwrap(); - array.insert("AVG", 26i64).unwrap(); - array.insert("AVG_ROW_LENGTH", 25i64).unwrap(); - array.insert("BACKUP", 27i64).unwrap(); - array.insert("BEFORE", 28i64).unwrap(); - array.insert("BEGIN", 29i64).unwrap(); - array.insert("BETWEEN", 30i64).unwrap(); - array.insert("BIGINT", 31i64).unwrap(); - array.insert("BIN_NUM", 34i64).unwrap(); - array.insert("BINARY", 32i64).unwrap(); - array.insert("BINLOG", 33i64).unwrap(); - array.insert("BIT", 37i64).unwrap(); - array.insert("BIT_AND", 35i64).unwrap(); - array.insert("BIT_OR", 36i64).unwrap(); - array.insert("BIT_XOR", 38i64).unwrap(); - array.insert("BLOB", 39i64).unwrap(); - array.insert("BLOCK", 40i64).unwrap(); - array.insert("BOOL", 42i64).unwrap(); - array.insert("BOOLEAN", 41i64).unwrap(); - array.insert("BOTH", 43i64).unwrap(); - array.insert("BTREE", 44i64).unwrap(); - array.insert("BY", 45i64).unwrap(); - array.insert("BYTE", 46i64).unwrap(); - array.insert("CACHE", 47i64).unwrap(); - array.insert("CALL", 48i64).unwrap(); - array.insert("CASCADE", 49i64).unwrap(); - array.insert("CASCADED", 50i64).unwrap(); - array.insert("CASE", 51i64).unwrap(); - array.insert("CAST", 52i64).unwrap(); - array.insert("CATALOG_NAME", 53i64).unwrap(); - array.insert("CHAIN", 54i64).unwrap(); - array.insert("CHANGE", 55i64).unwrap(); - array.insert("CHANGED", 56i64).unwrap(); - array.insert("CHANNEL", 57i64).unwrap(); - array.insert("CHAR", 60i64).unwrap(); - array.insert("CHARACTER", 59i64).unwrap(); - array.insert("CHARSET", 58i64).unwrap(); - array.insert("CHECK", 62i64).unwrap(); - array.insert("CHECKSUM", 61i64).unwrap(); - array.insert("CIPHER", 63i64).unwrap(); - array.insert("CLASS_ORIGIN", 64i64).unwrap(); - array.insert("CLIENT", 65i64).unwrap(); - array.insert("CLOSE", 66i64).unwrap(); - array.insert("COALESCE", 67i64).unwrap(); - array.insert("CODE", 68i64).unwrap(); - array.insert("COLLATE", 69i64).unwrap(); - array.insert("COLLATION", 70i64).unwrap(); - array.insert("COLUMN", 72i64).unwrap(); - array.insert("COLUMN_FORMAT", 74i64).unwrap(); - array.insert("COLUMN_NAME", 73i64).unwrap(); - array.insert("COLUMNS", 71i64).unwrap(); - array.insert("COMMENT", 75i64).unwrap(); - array.insert("COMMIT", 77i64).unwrap(); - array.insert("COMMITTED", 76i64).unwrap(); - array.insert("COMPACT", 78i64).unwrap(); - array.insert("COMPLETION", 79i64).unwrap(); - array.insert("COMPRESSED", 80i64).unwrap(); - array.insert("COMPRESSION", 81i64).unwrap(); - array.insert("CONCURRENT", 82i64).unwrap(); - array.insert("CONDITION", 83i64).unwrap(); - array.insert("CONNECTION", 84i64).unwrap(); - array.insert("CONSISTENT", 85i64).unwrap(); - array.insert("CONSTRAINT", 86i64).unwrap(); - array.insert("CONSTRAINT_CATALOG", 87i64).unwrap(); - array.insert("CONSTRAINT_NAME", 88i64).unwrap(); - array.insert("CONSTRAINT_SCHEMA", 89i64).unwrap(); - array.insert("CONTAINS", 90i64).unwrap(); - array.insert("CONTEXT", 91i64).unwrap(); - array.insert("CONTINUE", 92i64).unwrap(); - array.insert("CONTRIBUTORS", 93i64).unwrap(); - array.insert("CONVERT", 94i64).unwrap(); - array.insert("COUNT", 95i64).unwrap(); - array.insert("CPU", 96i64).unwrap(); - array.insert("CREATE", 97i64).unwrap(); - array.insert("CROSS", 98i64).unwrap(); - array.insert("CUBE", 99i64).unwrap(); - array.insert("CURDATE", 100i64).unwrap(); - array.insert("CURRENT", 101i64).unwrap(); - array.insert("CURRENT_DATE", 102i64).unwrap(); - array.insert("CURRENT_TIME", 103i64).unwrap(); - array.insert("CURRENT_TIMESTAMP", 104i64).unwrap(); - array.insert("CURRENT_USER", 105i64).unwrap(); - array.insert("CURSOR", 106i64).unwrap(); - array.insert("CURSOR_NAME", 107i64).unwrap(); - array.insert("CURTIME", 108i64).unwrap(); - array.insert("DATA", 112i64).unwrap(); - array.insert("DATABASE", 109i64).unwrap(); - array.insert("DATABASES", 110i64).unwrap(); - array.insert("DATAFILE", 111i64).unwrap(); - array.insert("DATE", 116i64).unwrap(); - array.insert("DATE_ADD", 114i64).unwrap(); - array.insert("DATE_SUB", 115i64).unwrap(); - array.insert("DATETIME", 113i64).unwrap(); - array.insert("DAY", 122i64).unwrap(); - array.insert("DAY_HOUR", 118i64).unwrap(); - array.insert("DAY_MICROSECOND", 119i64).unwrap(); - array.insert("DAY_MINUTE", 120i64).unwrap(); - array.insert("DAY_SECOND", 121i64).unwrap(); - array.insert("DAYOFMONTH", 117i64).unwrap(); - array.insert("DEALLOCATE", 123i64).unwrap(); - array.insert("DEC", 124i64).unwrap(); - array.insert("DECIMAL", 126i64).unwrap(); - array.insert("DECIMAL_NUM", 125i64).unwrap(); - array.insert("DECLARE", 127i64).unwrap(); - array.insert("DEFAULT", 128i64).unwrap(); - array.insert("DEFAULT_AUTH", 129i64).unwrap(); - array.insert("DEFINER", 130i64).unwrap(); - array.insert("DELAY_KEY_WRITE", 132i64).unwrap(); - array.insert("DELAYED", 131i64).unwrap(); - array.insert("DELETE", 133i64).unwrap(); - array.insert("DES_KEY_FILE", 136i64).unwrap(); - array.insert("DESC", 134i64).unwrap(); - array.insert("DESCRIBE", 135i64).unwrap(); - array.insert("DETERMINISTIC", 137i64).unwrap(); - array.insert("DIAGNOSTICS", 138i64).unwrap(); - array.insert("DIRECTORY", 139i64).unwrap(); - array.insert("DISABLE", 140i64).unwrap(); - array.insert("DISCARD", 141i64).unwrap(); - array.insert("DISK", 142i64).unwrap(); - array.insert("DISTINCT", 143i64).unwrap(); - array.insert("DISTINCTROW", 144i64).unwrap(); - array.insert("DIV", 145i64).unwrap(); - array.insert("DO", 147i64).unwrap(); - array.insert("DOUBLE", 146i64).unwrap(); - array.insert("DROP", 148i64).unwrap(); - array.insert("DUAL", 149i64).unwrap(); - array.insert("DUMPFILE", 150i64).unwrap(); - array.insert("DUPLICATE", 151i64).unwrap(); - array.insert("DYNAMIC", 152i64).unwrap(); - array.insert("EACH", 153i64).unwrap(); - array.insert("ELSE", 154i64).unwrap(); - array.insert("ELSEIF", 155i64).unwrap(); - array.insert("ENABLE", 156i64).unwrap(); - array.insert("ENCLOSED", 157i64).unwrap(); - array.insert("ENCRYPTION", 158i64).unwrap(); - array.insert("END", 159i64).unwrap(); - array.insert("END_OF_INPUT", -1i64).unwrap(); - array.insert("ENDS", 160i64).unwrap(); - array.insert("ENGINE", 163i64).unwrap(); - array.insert("ENGINES", 162i64).unwrap(); - array.insert("ENUM", 164i64).unwrap(); - array.insert("ERROR", 165i64).unwrap(); - array.insert("ERRORS", 166i64).unwrap(); - array.insert("ESCAPE", 168i64).unwrap(); - array.insert("ESCAPED", 167i64).unwrap(); - array.insert("EVENT", 170i64).unwrap(); - array.insert("EVENTS", 169i64).unwrap(); - array.insert("EVERY", 171i64).unwrap(); - array.insert("EXCHANGE", 172i64).unwrap(); - array.insert("EXECUTE", 173i64).unwrap(); - array.insert("EXISTS", 174i64).unwrap(); - array.insert("EXIT", 175i64).unwrap(); - array.insert("EXPANSION", 176i64).unwrap(); - array.insert("EXPIRE", 177i64).unwrap(); - array.insert("EXPLAIN", 178i64).unwrap(); - array.insert("EXPORT", 179i64).unwrap(); - array.insert("EXTENDED", 180i64).unwrap(); - array.insert("EXTENT_SIZE", 181i64).unwrap(); - array.insert("EXTRACT", 182i64).unwrap(); - array.insert("FALSE", 183i64).unwrap(); - array.insert("FAST", 184i64).unwrap(); - array.insert("FAULTS", 185i64).unwrap(); - array.insert("FETCH", 186i64).unwrap(); - array.insert("FIELDS", 187i64).unwrap(); - array.insert("FILE", 188i64).unwrap(); - array.insert("FILE_BLOCK_SIZE", 189i64).unwrap(); - array.insert("FILTER", 190i64).unwrap(); - array.insert("FIRST", 191i64).unwrap(); - array.insert("FIXED", 192i64).unwrap(); - array.insert("FLOAT", 195i64).unwrap(); - array.insert("FLOAT4", 193i64).unwrap(); - array.insert("FLOAT8", 194i64).unwrap(); - array.insert("FLUSH", 196i64).unwrap(); - array.insert("FOLLOWS", 197i64).unwrap(); - array.insert("FOR", 200i64).unwrap(); - array.insert("FORCE", 198i64).unwrap(); - array.insert("FOREIGN", 199i64).unwrap(); - array.insert("FORMAT", 201i64).unwrap(); - array.insert("FOUND", 202i64).unwrap(); - array.insert("FROM", 203i64).unwrap(); - array.insert("FULL", 204i64).unwrap(); - array.insert("FULLTEXT", 205i64).unwrap(); - array.insert("FUNCTION", 206i64).unwrap(); - array.insert("GENERAL", 208i64).unwrap(); - array.insert("GENERATED", 209i64).unwrap(); - array.insert("GEOMCOLLECTION", 852i64).unwrap(); - array.insert("GEOMETRY", 212i64).unwrap(); - array.insert("GEOMETRYCOLLECTION", 211i64).unwrap(); - array.insert("GET", 207i64).unwrap(); - array.insert("GET_FORMAT", 213i64).unwrap(); - array.insert("GLOBAL", 214i64).unwrap(); - array.insert("GRANT", 215i64).unwrap(); - array.insert("GRANTS", 216i64).unwrap(); - array.insert("GROUP", 217i64).unwrap(); - array.insert("GROUP_CONCAT", 218i64).unwrap(); - array.insert("GROUP_REPLICATION", 210i64).unwrap(); - array.insert("HANDLER", 219i64).unwrap(); - array.insert("HASH", 220i64).unwrap(); - array.insert("HAVING", 221i64).unwrap(); - array.insert("HELP", 222i64).unwrap(); - array.insert("HIGH_PRIORITY", 223i64).unwrap(); - array.insert("HOST", 224i64).unwrap(); - array.insert("HOSTS", 225i64).unwrap(); - array.insert("HOUR", 229i64).unwrap(); - array.insert("HOUR_MICROSECOND", 226i64).unwrap(); - array.insert("HOUR_MINUTE", 227i64).unwrap(); - array.insert("HOUR_SECOND", 228i64).unwrap(); - array.insert("IDENTIFIED", 230i64).unwrap(); - array.insert("IF", 231i64).unwrap(); - array.insert("IGNORE", 232i64).unwrap(); - array.insert("IGNORE_SERVER_IDS", 233i64).unwrap(); - array.insert("IMPORT", 234i64).unwrap(); - array.insert("IN", 251i64).unwrap(); - array.insert("INDEX", 236i64).unwrap(); - array.insert("INDEXES", 235i64).unwrap(); - array.insert("INFILE", 237i64).unwrap(); - array.insert("INITIAL_SIZE", 238i64).unwrap(); - array.insert("INNER", 239i64).unwrap(); - array.insert("INNODB", 844i64).unwrap(); - array.insert("INOUT", 240i64).unwrap(); - array.insert("INSENSITIVE", 241i64).unwrap(); - array.insert("INSERT", 242i64).unwrap(); - array.insert("INSERT_METHOD", 243i64).unwrap(); - array.insert("INSTALL", 245i64).unwrap(); - array.insert("INSTANCE", 244i64).unwrap(); - array.insert("INT", 249i64).unwrap(); - array.insert("INT1", 795i64).unwrap(); - array.insert("INT2", 796i64).unwrap(); - array.insert("INT3", 797i64).unwrap(); - array.insert("INT4", 798i64).unwrap(); - array.insert("INT8", 799i64).unwrap(); - array.insert("INTEGER", 246i64).unwrap(); - array.insert("INTERVAL", 247i64).unwrap(); - array.insert("INTO", 248i64).unwrap(); - array.insert("INVOKER", 250i64).unwrap(); - array.insert("IO", 255i64).unwrap(); - array.insert("IO_AFTER_GTIDS", 252i64).unwrap(); - array.insert("IO_BEFORE_GTIDS", 253i64).unwrap(); - array.insert("IO_THREAD", 254i64).unwrap(); - array.insert("IPC", 256i64).unwrap(); - array.insert("IS", 257i64).unwrap(); - array.insert("ISOLATION", 258i64).unwrap(); - array.insert("ISSUER", 259i64).unwrap(); - array.insert("ITERATE", 260i64).unwrap(); - array.insert("JOIN", 261i64).unwrap(); - array.insert("JSON", 262i64).unwrap(); - array.insert("KEY", 265i64).unwrap(); - array.insert("KEY_BLOCK_SIZE", 264i64).unwrap(); - array.insert("KEYS", 263i64).unwrap(); - array.insert("KILL", 266i64).unwrap(); - array.insert("LANGUAGE", 267i64).unwrap(); - array.insert("LAST", 268i64).unwrap(); - array.insert("LEADING", 269i64).unwrap(); - array.insert("LEAVE", 271i64).unwrap(); - array.insert("LEAVES", 270i64).unwrap(); - array.insert("LEFT", 272i64).unwrap(); - array.insert("LESS", 273i64).unwrap(); - array.insert("LEVEL", 274i64).unwrap(); - array.insert("LIKE", 275i64).unwrap(); - array.insert("LIMIT", 276i64).unwrap(); - array.insert("LINEAR", 277i64).unwrap(); - array.insert("LINES", 278i64).unwrap(); - array.insert("LINESTRING", 279i64).unwrap(); - array.insert("LIST", 280i64).unwrap(); - array.insert("LOAD", 281i64).unwrap(); - array.insert("LOCAL", 284i64).unwrap(); - array.insert("LOCALTIME", 282i64).unwrap(); - array.insert("LOCALTIMESTAMP", 283i64).unwrap(); - array.insert("LOCATOR", 285i64).unwrap(); - array.insert("LOCK", 287i64).unwrap(); - array.insert("LOCKS", 286i64).unwrap(); - array.insert("LOGFILE", 288i64).unwrap(); - array.insert("LOGS", 289i64).unwrap(); - array.insert("LONG", 293i64).unwrap(); - array.insert("LONG_NUM", 292i64).unwrap(); - array.insert("LONGBLOB", 290i64).unwrap(); - array.insert("LONGTEXT", 291i64).unwrap(); - array.insert("LOOP", 294i64).unwrap(); - array.insert("LOW_PRIORITY", 295i64).unwrap(); - array.insert("MASTER", 316i64).unwrap(); - array.insert("MASTER_AUTO_POSITION", 296i64).unwrap(); - array.insert("MASTER_BIND", 297i64).unwrap(); - array.insert("MASTER_CONNECT_RETRY", 298i64).unwrap(); - array.insert("MASTER_DELAY", 299i64).unwrap(); - array.insert("MASTER_HEARTBEAT_PERIOD", 319i64).unwrap(); - array.insert("MASTER_HOST", 300i64).unwrap(); - array.insert("MASTER_LOG_FILE", 301i64).unwrap(); - array.insert("MASTER_LOG_POS", 302i64).unwrap(); - array.insert("MASTER_PASSWORD", 303i64).unwrap(); - array.insert("MASTER_PORT", 304i64).unwrap(); - array.insert("MASTER_RETRY_COUNT", 305i64).unwrap(); - array.insert("MASTER_SERVER_ID", 306i64).unwrap(); - array.insert("MASTER_SSL", 314i64).unwrap(); - array.insert("MASTER_SSL_CA", 308i64).unwrap(); - array.insert("MASTER_SSL_CAPATH", 307i64).unwrap(); - array.insert("MASTER_SSL_CERT", 309i64).unwrap(); - array.insert("MASTER_SSL_CIPHER", 310i64).unwrap(); - array.insert("MASTER_SSL_CRL", 311i64).unwrap(); - array.insert("MASTER_SSL_CRLPATH", 312i64).unwrap(); - array.insert("MASTER_SSL_KEY", 313i64).unwrap(); - array - .insert("MASTER_SSL_VERIFY_SERVER_CERT", 315i64) - .unwrap(); - array.insert("MASTER_TLS_VERSION", 317i64).unwrap(); - array.insert("MASTER_USER", 318i64).unwrap(); - array.insert("MATCH", 320i64).unwrap(); - array.insert("MAX", 326i64).unwrap(); - array.insert("MAX_CONNECTIONS_PER_HOUR", 321i64).unwrap(); - array.insert("MAX_QUERIES_PER_HOUR", 322i64).unwrap(); - array.insert("MAX_ROWS", 323i64).unwrap(); - array.insert("MAX_SIZE", 324i64).unwrap(); - array.insert("MAX_STATEMENT_TIME", 325i64).unwrap(); - array.insert("MAX_UPDATES_PER_HOUR", 327i64).unwrap(); - array.insert("MAX_USER_CONNECTIONS", 328i64).unwrap(); - array.insert("MAXVALUE", 329i64).unwrap(); - array.insert("MEDIUM", 333i64).unwrap(); - array.insert("MEDIUMBLOB", 330i64).unwrap(); - array.insert("MEDIUMINT", 331i64).unwrap(); - array.insert("MEDIUMTEXT", 332i64).unwrap(); - array.insert("MEMORY", 334i64).unwrap(); - array.insert("MERGE", 335i64).unwrap(); - array.insert("MESSAGE_TEXT", 336i64).unwrap(); - array.insert("MICROSECOND", 337i64).unwrap(); - array.insert("MID", 338i64).unwrap(); - array.insert("MIDDLEINT", 339i64).unwrap(); - array.insert("MIGRATE", 340i64).unwrap(); - array.insert("MIN", 345i64).unwrap(); - array.insert("MIN_ROWS", 344i64).unwrap(); - array.insert("MINUTE", 343i64).unwrap(); - array.insert("MINUTE_MICROSECOND", 341i64).unwrap(); - array.insert("MINUTE_SECOND", 342i64).unwrap(); - array.insert("MOD", 349i64).unwrap(); - array.insert("MODE", 346i64).unwrap(); - array.insert("MODIFIES", 347i64).unwrap(); - array.insert("MODIFY", 348i64).unwrap(); - array.insert("MONTH", 350i64).unwrap(); - array.insert("MULTILINESTRING", 351i64).unwrap(); - array.insert("MULTIPOINT", 352i64).unwrap(); - array.insert("MULTIPOLYGON", 353i64).unwrap(); - array.insert("MUTEX", 354i64).unwrap(); - array.insert("MYSQL_ERRNO", 355i64).unwrap(); - array.insert("NAME", 357i64).unwrap(); - array.insert("NAMES", 356i64).unwrap(); - array.insert("NATIONAL", 358i64).unwrap(); - array.insert("NATURAL", 359i64).unwrap(); - array.insert("NCHAR", 361i64).unwrap(); - array.insert("NCHAR_STRING", 360i64).unwrap(); - array.insert("NDB", 362i64).unwrap(); - array.insert("NDBCLUSTER", 363i64).unwrap(); - array.insert("NEG", 364i64).unwrap(); - array.insert("NEVER", 365i64).unwrap(); - array.insert("NEW", 366i64).unwrap(); - array.insert("NEXT", 367i64).unwrap(); - array.insert("NO", 373i64).unwrap(); - array.insert("NO_WAIT", 374i64).unwrap(); - array.insert("NO_WRITE_TO_BINLOG", 375i64).unwrap(); - array.insert("NODEGROUP", 368i64).unwrap(); - array.insert("NONBLOCKING", 370i64).unwrap(); - array.insert("NONE", 369i64).unwrap(); - array.insert("NOT", 371i64).unwrap(); - array.insert("NOW", 372i64).unwrap(); - array.insert("NULL", 376i64).unwrap(); - array.insert("NUMBER", 377i64).unwrap(); - array.insert("NUMERIC", 378i64).unwrap(); - array.insert("NVARCHAR", 379i64).unwrap(); - array.insert("OFFLINE", 380i64).unwrap(); - array.insert("OFFSET", 381i64).unwrap(); - array.insert("OLD_PASSWORD", 382i64).unwrap(); - array.insert("ON", 383i64).unwrap(); - array.insert("ONE", 384i64).unwrap(); - array.insert("ONLINE", 385i64).unwrap(); - array.insert("ONLY", 386i64).unwrap(); - array.insert("OPEN", 387i64).unwrap(); - array.insert("OPTIMIZE", 388i64).unwrap(); - array.insert("OPTIMIZER_COSTS", 389i64).unwrap(); - array.insert("OPTION", 391i64).unwrap(); - array.insert("OPTIONALLY", 392i64).unwrap(); - array.insert("OPTIONS", 390i64).unwrap(); - array.insert("OR", 394i64).unwrap(); - array.insert("ORDER", 393i64).unwrap(); - array.insert("OUT", 397i64).unwrap(); - array.insert("OUTER", 395i64).unwrap(); - array.insert("OUTFILE", 396i64).unwrap(); - array.insert("OWNER", 398i64).unwrap(); - array.insert("PACK_KEYS", 399i64).unwrap(); - array.insert("PAGE", 400i64).unwrap(); - array.insert("PARSER", 401i64).unwrap(); - array.insert("PARTIAL", 402i64).unwrap(); - array.insert("PARTITION", 405i64).unwrap(); - array.insert("PARTITIONING", 403i64).unwrap(); - array.insert("PARTITIONS", 404i64).unwrap(); - array.insert("PASSWORD", 406i64).unwrap(); - array.insert("PHASE", 407i64).unwrap(); - array.insert("PLUGIN", 410i64).unwrap(); - array.insert("PLUGIN_DIR", 409i64).unwrap(); - array.insert("PLUGINS", 408i64).unwrap(); - array.insert("POINT", 411i64).unwrap(); - array.insert("POLYGON", 412i64).unwrap(); - array.insert("PORT", 413i64).unwrap(); - array.insert("POSITION", 414i64).unwrap(); - array.insert("PRECEDES", 415i64).unwrap(); - array.insert("PRECISION", 416i64).unwrap(); - array.insert("PREPARE", 417i64).unwrap(); - array.insert("PRESERVE", 418i64).unwrap(); - array.insert("PREV", 419i64).unwrap(); - array.insert("PRIMARY", 420i64).unwrap(); - array.insert("PRIVILEGES", 421i64).unwrap(); - array.insert("PROCEDURE", 422i64).unwrap(); - array.insert("PROCESS", 423i64).unwrap(); - array.insert("PROCESSLIST", 424i64).unwrap(); - array.insert("PROFILE", 425i64).unwrap(); - array.insert("PROFILES", 426i64).unwrap(); - array.insert("PROXY", 427i64).unwrap(); - array.insert("PURGE", 428i64).unwrap(); - array.insert("QUARTER", 429i64).unwrap(); - array.insert("QUERY", 430i64).unwrap(); - array.insert("QUICK", 431i64).unwrap(); - array.insert("RANGE", 432i64).unwrap(); - array.insert("READ", 435i64).unwrap(); - array.insert("READ_ONLY", 434i64).unwrap(); - array.insert("READ_WRITE", 436i64).unwrap(); - array.insert("READS", 433i64).unwrap(); - array.insert("REAL", 437i64).unwrap(); - array.insert("REBUILD", 438i64).unwrap(); - array.insert("RECOVER", 439i64).unwrap(); - array.insert("REDO_BUFFER_SIZE", 441i64).unwrap(); - array.insert("REDOFILE", 440i64).unwrap(); - array.insert("REDUNDANT", 442i64).unwrap(); - array.insert("REFERENCES", 443i64).unwrap(); - array.insert("REGEXP", 444i64).unwrap(); - array.insert("RELAY", 445i64).unwrap(); - array.insert("RELAY_LOG_FILE", 447i64).unwrap(); - array.insert("RELAY_LOG_POS", 448i64).unwrap(); - array.insert("RELAY_THREAD", 449i64).unwrap(); - array.insert("RELAYLOG", 446i64).unwrap(); - array.insert("RELEASE", 450i64).unwrap(); - array.insert("RELOAD", 451i64).unwrap(); - array.insert("REMOVE", 452i64).unwrap(); - array.insert("RENAME", 453i64).unwrap(); - array.insert("REORGANIZE", 454i64).unwrap(); - array.insert("REPAIR", 455i64).unwrap(); - array.insert("REPEAT", 457i64).unwrap(); - array.insert("REPEATABLE", 456i64).unwrap(); - array.insert("REPLACE", 458i64).unwrap(); - array.insert("REPLICATE_DO_DB", 460i64).unwrap(); - array.insert("REPLICATE_DO_TABLE", 462i64).unwrap(); - array.insert("REPLICATE_IGNORE_DB", 461i64).unwrap(); - array.insert("REPLICATE_IGNORE_TABLE", 463i64).unwrap(); - array.insert("REPLICATE_REWRITE_DB", 466i64).unwrap(); - array.insert("REPLICATE_WILD_DO_TABLE", 464i64).unwrap(); - array.insert("REPLICATE_WILD_IGNORE_TABLE", 465i64).unwrap(); - array.insert("REPLICATION", 459i64).unwrap(); - array.insert("REQUIRE", 467i64).unwrap(); - array.insert("RESET", 468i64).unwrap(); - array.insert("RESIGNAL", 469i64).unwrap(); - array.insert("RESTORE", 470i64).unwrap(); - array.insert("RESTRICT", 471i64).unwrap(); - array.insert("RESUME", 472i64).unwrap(); - array.insert("RETURN", 475i64).unwrap(); - array.insert("RETURNED_SQLSTATE", 473i64).unwrap(); - array.insert("RETURNS", 474i64).unwrap(); - array.insert("REVERSE", 476i64).unwrap(); - array.insert("REVOKE", 477i64).unwrap(); - array.insert("RIGHT", 478i64).unwrap(); - array.insert("RLIKE", 479i64).unwrap(); - array.insert("ROLLBACK", 480i64).unwrap(); - array.insert("ROLLUP", 481i64).unwrap(); - array.insert("ROTATE", 482i64).unwrap(); - array.insert("ROUTINE", 483i64).unwrap(); - array.insert("ROW", 487i64).unwrap(); - array.insert("ROW_COUNT", 485i64).unwrap(); - array.insert("ROW_FORMAT", 486i64).unwrap(); - array.insert("ROWS", 484i64).unwrap(); - array.insert("RTREE", 488i64).unwrap(); - array.insert("SAVEPOINT", 489i64).unwrap(); - array.insert("SCHEDULE", 490i64).unwrap(); - array.insert("SCHEMA", 491i64).unwrap(); - array.insert("SCHEMA_NAME", 492i64).unwrap(); - array.insert("SCHEMAS", 493i64).unwrap(); - array.insert("SECOND", 495i64).unwrap(); - array.insert("SECOND_MICROSECOND", 494i64).unwrap(); - array.insert("SECURITY", 496i64).unwrap(); - array.insert("SELECT", 497i64).unwrap(); - array.insert("SENSITIVE", 498i64).unwrap(); - array.insert("SEPARATOR", 499i64).unwrap(); - array.insert("SERIAL", 501i64).unwrap(); - array.insert("SERIALIZABLE", 500i64).unwrap(); - array.insert("SERVER", 503i64).unwrap(); - array.insert("SERVER_OPTIONS", 504i64).unwrap(); - array.insert("SESSION", 502i64).unwrap(); - array.insert("SESSION_USER", 505i64).unwrap(); - array.insert("SET", 506i64).unwrap(); - array.insert("SET_VAR", 507i64).unwrap(); - array.insert("SHARE", 508i64).unwrap(); - array.insert("SHOW", 509i64).unwrap(); - array.insert("SHUTDOWN", 510i64).unwrap(); - array.insert("SIGNAL", 511i64).unwrap(); - array.insert("SIGNED", 512i64).unwrap(); - array.insert("SIMPLE", 513i64).unwrap(); - array.insert("SLAVE", 514i64).unwrap(); - array.insert("SLOW", 515i64).unwrap(); - array.insert("SMALLINT", 516i64).unwrap(); - array.insert("SNAPSHOT", 517i64).unwrap(); - array.insert("SOCKET", 519i64).unwrap(); - array.insert("SOME", 518i64).unwrap(); - array.insert("SONAME", 520i64).unwrap(); - array.insert("SOUNDS", 521i64).unwrap(); - array.insert("SOURCE", 522i64).unwrap(); - array.insert("SPATIAL", 523i64).unwrap(); - array.insert("SPECIFIC", 524i64).unwrap(); - array.insert("SQL", 537i64).unwrap(); - array.insert("SQL_AFTER_GTIDS", 528i64).unwrap(); - array.insert("SQL_AFTER_MTS_GAPS", 529i64).unwrap(); - array.insert("SQL_BEFORE_GTIDS", 530i64).unwrap(); - array.insert("SQL_BIG_RESULT", 531i64).unwrap(); - array.insert("SQL_BUFFER_RESULT", 532i64).unwrap(); - array.insert("SQL_CACHE", 533i64).unwrap(); - array.insert("SQL_CALC_FOUND_ROWS", 534i64).unwrap(); - array.insert("SQL_NO_CACHE", 535i64).unwrap(); - array.insert("SQL_SMALL_RESULT", 536i64).unwrap(); - array.insert("SQL_THREAD", 538i64).unwrap(); - array.insert("SQL_TSI_DAY", 802i64).unwrap(); - array.insert("SQL_TSI_HOUR", 803i64).unwrap(); - array.insert("SQL_TSI_MICROSECOND", 804i64).unwrap(); - array.insert("SQL_TSI_MINUTE", 805i64).unwrap(); - array.insert("SQL_TSI_MONTH", 806i64).unwrap(); - array.insert("SQL_TSI_QUARTER", 807i64).unwrap(); - array.insert("SQL_TSI_SECOND", 808i64).unwrap(); - array.insert("SQL_TSI_WEEK", 809i64).unwrap(); - array.insert("SQL_TSI_YEAR", 810i64).unwrap(); - array.insert("SQLEXCEPTION", 525i64).unwrap(); - array.insert("SQLSTATE", 526i64).unwrap(); - array.insert("SQLWARNING", 527i64).unwrap(); - array.insert("SSL", 539i64).unwrap(); - array.insert("STACKED", 540i64).unwrap(); - array.insert("START", 543i64).unwrap(); - array.insert("STARTING", 541i64).unwrap(); - array.insert("STARTS", 542i64).unwrap(); - array.insert("STATS_AUTO_RECALC", 544i64).unwrap(); - array.insert("STATS_PERSISTENT", 545i64).unwrap(); - array.insert("STATS_SAMPLE_PAGES", 546i64).unwrap(); - array.insert("STATUS", 547i64).unwrap(); - array.insert("STD", 551i64).unwrap(); - array.insert("STDDEV", 549i64).unwrap(); - array.insert("STDDEV_POP", 550i64).unwrap(); - array.insert("STDDEV_SAMP", 548i64).unwrap(); - array.insert("STOP", 552i64).unwrap(); - array.insert("STORAGE", 553i64).unwrap(); - array.insert("STORED", 554i64).unwrap(); - array.insert("STRAIGHT_JOIN", 555i64).unwrap(); - array.insert("STRING", 556i64).unwrap(); - array.insert("SUBCLASS_ORIGIN", 557i64).unwrap(); - array.insert("SUBDATE", 558i64).unwrap(); - array.insert("SUBJECT", 559i64).unwrap(); - array.insert("SUBPARTITION", 561i64).unwrap(); - array.insert("SUBPARTITIONS", 560i64).unwrap(); - array.insert("SUBSTR", 562i64).unwrap(); - array.insert("SUBSTRING", 563i64).unwrap(); - array.insert("SUM", 564i64).unwrap(); - array.insert("SUPER", 565i64).unwrap(); - array.insert("SUSPEND", 566i64).unwrap(); - array.insert("SWAPS", 567i64).unwrap(); - array.insert("SWITCHES", 568i64).unwrap(); - array.insert("SYSDATE", 569i64).unwrap(); - array.insert("SYSTEM_USER", 570i64).unwrap(); - array.insert("TABLE", 574i64).unwrap(); - array.insert("TABLE_CHECKSUM", 575i64).unwrap(); - array.insert("TABLE_NAME", 576i64).unwrap(); - array.insert("TABLE_REF_PRIORITY", 573i64).unwrap(); - array.insert("TABLES", 571i64).unwrap(); - array.insert("TABLESPACE", 572i64).unwrap(); - array.insert("TEMPORARY", 577i64).unwrap(); - array.insert("TEMPTABLE", 578i64).unwrap(); - array.insert("TERMINATED", 579i64).unwrap(); - array.insert("TEXT", 580i64).unwrap(); - array.insert("THAN", 581i64).unwrap(); - array.insert("THEN", 582i64).unwrap(); - array.insert("TIME", 586i64).unwrap(); - array.insert("TIMESTAMP", 583i64).unwrap(); - array.insert("TIMESTAMP_ADD", 584i64).unwrap(); - array.insert("TIMESTAMP_DIFF", 585i64).unwrap(); - array.insert("TINYBLOB", 587i64).unwrap(); - array.insert("TINYINT", 588i64).unwrap(); - array.insert("TINYTEXT", 589i64).unwrap(); - array.insert("TO", 590i64).unwrap(); - array.insert("TRAILING", 591i64).unwrap(); - array.insert("TRANSACTION", 592i64).unwrap(); - array.insert("TRIGGER", 594i64).unwrap(); - array.insert("TRIGGERS", 593i64).unwrap(); - array.insert("TRIM", 595i64).unwrap(); - array.insert("TRUE", 596i64).unwrap(); - array.insert("TRUNCATE", 597i64).unwrap(); - array.insert("TYPE", 599i64).unwrap(); - array.insert("TYPES", 598i64).unwrap(); - array.insert("UDF_RETURNS", 600i64).unwrap(); - array.insert("UNCOMMITTED", 601i64).unwrap(); - array.insert("UNDEFINED", 602i64).unwrap(); - array.insert("UNDO", 605i64).unwrap(); - array.insert("UNDO_BUFFER_SIZE", 604i64).unwrap(); - array.insert("UNDOFILE", 603i64).unwrap(); - array.insert("UNICODE", 606i64).unwrap(); - array.insert("UNINSTALL", 607i64).unwrap(); - array.insert("UNION", 608i64).unwrap(); - array.insert("UNIQUE", 609i64).unwrap(); - array.insert("UNKNOWN", 610i64).unwrap(); - array.insert("UNLOCK", 611i64).unwrap(); - array.insert("UNSIGNED", 612i64).unwrap(); - array.insert("UNTIL", 613i64).unwrap(); - array.insert("UPDATE", 614i64).unwrap(); - array.insert("UPGRADE", 615i64).unwrap(); - array.insert("USAGE", 616i64).unwrap(); - array.insert("USE", 620i64).unwrap(); - array.insert("USE_FRM", 619i64).unwrap(); - array.insert("USER", 618i64).unwrap(); - array.insert("USER_RESOURCES", 617i64).unwrap(); - array.insert("USING", 621i64).unwrap(); - array.insert("UTC_DATE", 622i64).unwrap(); - array.insert("UTC_TIME", 624i64).unwrap(); - array.insert("UTC_TIMESTAMP", 623i64).unwrap(); - array.insert("VALIDATION", 625i64).unwrap(); - array.insert("VALUE", 627i64).unwrap(); - array.insert("VALUES", 626i64).unwrap(); - array.insert("VAR_POP", 634i64).unwrap(); - array.insert("VAR_SAMP", 635i64).unwrap(); - array.insert("VARBINARY", 628i64).unwrap(); - array.insert("VARCHAR", 629i64).unwrap(); - array.insert("VARCHARACTER", 630i64).unwrap(); - array.insert("VARIABLES", 631i64).unwrap(); - array.insert("VARIANCE", 632i64).unwrap(); - array.insert("VARYING", 633i64).unwrap(); - array.insert("VIEW", 636i64).unwrap(); - array.insert("VIRTUAL", 637i64).unwrap(); - array.insert("WAIT", 638i64).unwrap(); - array.insert("WARNINGS", 639i64).unwrap(); - array.insert("WEEK", 640i64).unwrap(); - array.insert("WEIGHT_STRING", 641i64).unwrap(); - array.insert("WHEN", 642i64).unwrap(); - array.insert("WHERE", 643i64).unwrap(); - array.insert("WHILE", 644i64).unwrap(); - array.insert("WITH", 645i64).unwrap(); - array.insert("WITHOUT", 646i64).unwrap(); - array.insert("WORK", 647i64).unwrap(); - array.insert("WRAPPER", 648i64).unwrap(); - array.insert("WRITE", 649i64).unwrap(); - array.insert("X509", 650i64).unwrap(); - array.insert("XA", 651i64).unwrap(); - array.insert("XID", 652i64).unwrap(); - array.insert("XML", 653i64).unwrap(); - array.insert("XOR", 654i64).unwrap(); - array.insert("YEAR", 656i64).unwrap(); - array.insert("YEAR_MONTH", 655i64).unwrap(); - array.insert("ZEROFILL", 657i64).unwrap(); - array.insert("ACTIVE", 724i64).unwrap(); - array.insert("ADMIN", 660i64).unwrap(); - array.insert("ARRAY", 731i64).unwrap(); - array - .insert("ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS", 842i64) - .unwrap(); - array.insert("BUCKETS", 675i64).unwrap(); - array.insert("CLONE", 677i64).unwrap(); - array.insert("COMPONENT", 664i64).unwrap(); - array.insert("CUME_DIST", 678i64).unwrap(); - array.insert("DEFINITION", 715i64).unwrap(); - array.insert("DENSE_RANK", 679i64).unwrap(); - array.insert("DESCRIPTION", 716i64).unwrap(); - array.insert("EMPTY", 700i64).unwrap(); - array.insert("ENFORCED", 730i64).unwrap(); - array.insert("ENGINE_ATTRIBUTE", 848i64).unwrap(); - array.insert("EXCEPT", 663i64).unwrap(); - array.insert("EXCLUDE", 680i64).unwrap(); - array.insert("FAILED_LOGIN_ATTEMPTS", 741i64).unwrap(); - array.insert("FIRST_VALUE", 681i64).unwrap(); - array.insert("FOLLOWING", 682i64).unwrap(); - array.insert("GET_MASTER_PUBLIC_KEY_SYM", 713i64).unwrap(); - array.insert("GET_SOURCE_PUBLIC_KEY", 840i64).unwrap(); - array.insert("GROUPING", 672i64).unwrap(); - array.insert("GROUPS", 683i64).unwrap(); - array.insert("GTID_ONLY", 841i64).unwrap(); - array.insert("HISTOGRAM", 674i64).unwrap(); - array.insert("HISTORY", 705i64).unwrap(); - array.insert("INACTIVE", 725i64).unwrap(); - array.insert("INTERSECT", 811i64).unwrap(); - array.insert("INVISIBLE", 661i64).unwrap(); - array.insert("JSON_ARRAYAGG", 667i64).unwrap(); - array.insert("JSON_OBJECTAGG", 666i64).unwrap(); - array.insert("JSON_TABLE", 701i64).unwrap(); - array.insert("JSON_VALUE", 850i64).unwrap(); - array.insert("KEYRING", 847i64).unwrap(); - array.insert("LAG", 684i64).unwrap(); - array.insert("LAST_VALUE", 685i64).unwrap(); - array.insert("LATERAL", 726i64).unwrap(); - array.insert("LEAD", 686i64).unwrap(); - array.insert("LOCKED", 670i64).unwrap(); - array - .insert("MASTER_COMPRESSION_ALGORITHM", 735i64) - .unwrap(); - array.insert("MASTER_PUBLIC_KEY_PATH", 712i64).unwrap(); - array.insert("MASTER_TLS_CIPHERSUITES", 738i64).unwrap(); - array - .insert("MASTER_ZSTD_COMPRESSION_LEVEL", 736i64) - .unwrap(); - array.insert("MEMBER", 733i64).unwrap(); - array.insert("NESTED", 702i64).unwrap(); - array.insert("NETWORK_NAMESPACE", 729i64).unwrap(); - array.insert("NOWAIT", 671i64).unwrap(); - array.insert("NTH_VALUE", 687i64).unwrap(); - array.insert("NTILE", 688i64).unwrap(); - array.insert("NULLS", 689i64).unwrap(); - array.insert("OF", 668i64).unwrap(); - array.insert("OFF", 744i64).unwrap(); - array.insert("OJ", 732i64).unwrap(); - array.insert("OLD", 728i64).unwrap(); - array.insert("OPTIONAL", 719i64).unwrap(); - array.insert("ORDINALITY", 703i64).unwrap(); - array.insert("ORGANIZATION", 717i64).unwrap(); - array.insert("OTHERS", 690i64).unwrap(); - array.insert("OVER", 691i64).unwrap(); - array.insert("PASSWORD_LOCK_TIME", 740i64).unwrap(); - array.insert("PATH", 704i64).unwrap(); - array.insert("PERCENT_RANK", 692i64).unwrap(); - array.insert("PERSIST", 658i64).unwrap(); - array.insert("PERSIST_ONLY", 673i64).unwrap(); - array.insert("PRECEDING", 693i64).unwrap(); - array.insert("PRIVILEGE_CHECKS_USER", 737i64).unwrap(); - array.insert("RANDOM", 734i64).unwrap(); - array.insert("RANK", 694i64).unwrap(); - array.insert("RECURSIVE", 665i64).unwrap(); - array.insert("REDO_LOG", 846i64).unwrap(); - array.insert("REFERENCE", 718i64).unwrap(); - array.insert("REMOTE", 676i64).unwrap(); - array.insert("REQUIRE_ROW_FORMAT", 739i64).unwrap(); - array - .insert("REQUIRE_TABLE_PRIMARY_KEY_CHECK", 742i64) - .unwrap(); - array.insert("RESOURCE", 709i64).unwrap(); - array.insert("RESPECT", 695i64).unwrap(); - array.insert("RESTART", 714i64).unwrap(); - array.insert("RETAIN", 727i64).unwrap(); - array.insert("RETURNING", 851i64).unwrap(); - array.insert("REUSE", 706i64).unwrap(); - array.insert("ROLE", 659i64).unwrap(); - array.insert("ROW_NUMBER", 696i64).unwrap(); - array.insert("SECONDARY", 720i64).unwrap(); - array.insert("SECONDARY_ENGINE", 721i64).unwrap(); - array.insert("SECONDARY_ENGINE_ATTRIBUTE", 849i64).unwrap(); - array.insert("SECONDARY_LOAD", 722i64).unwrap(); - array.insert("SECONDARY_UNLOAD", 723i64).unwrap(); - array.insert("SKIP", 669i64).unwrap(); - array.insert("SOURCE_AUTO_POSITION", 813i64).unwrap(); - array.insert("SOURCE_BIND", 814i64).unwrap(); - array - .insert("SOURCE_COMPRESSION_ALGORITHM", 815i64) - .unwrap(); - array.insert("SOURCE_CONNECT_RETRY", 816i64).unwrap(); - array - .insert("SOURCE_CONNECTION_AUTO_FAILOVER", 817i64) - .unwrap(); - array.insert("SOURCE_DELAY", 818i64).unwrap(); - array.insert("SOURCE_HEARTBEAT_PERIOD", 819i64).unwrap(); - array.insert("SOURCE_HOST", 820i64).unwrap(); - array.insert("SOURCE_LOG_FILE", 821i64).unwrap(); - array.insert("SOURCE_LOG_POS", 822i64).unwrap(); - array.insert("SOURCE_PASSWORD", 823i64).unwrap(); - array.insert("SOURCE_PORT", 824i64).unwrap(); - array.insert("SOURCE_PUBLIC_KEY_PATH", 825i64).unwrap(); - array.insert("SOURCE_RETRY_COUNT", 826i64).unwrap(); - array.insert("SOURCE_SSL", 827i64).unwrap(); - array.insert("SOURCE_SSL_CA", 828i64).unwrap(); - array.insert("SOURCE_SSL_CAPATH", 829i64).unwrap(); - array.insert("SOURCE_SSL_CERT", 830i64).unwrap(); - array.insert("SOURCE_SSL_CIPHER", 831i64).unwrap(); - array.insert("SOURCE_SSL_CRL", 832i64).unwrap(); - array.insert("SOURCE_SSL_CRLPATH", 833i64).unwrap(); - array.insert("SOURCE_SSL_KEY", 834i64).unwrap(); - array - .insert("SOURCE_SSL_VERIFY_SERVER_CERT", 835i64) - .unwrap(); - array.insert("SOURCE_TLS_CIPHERSUITES", 836i64).unwrap(); - array.insert("SOURCE_TLS_VERSION", 837i64).unwrap(); - array.insert("SOURCE_USER", 838i64).unwrap(); - array - .insert("SOURCE_ZSTD_COMPRESSION_LEVEL", 839i64) - .unwrap(); - array.insert("SRID", 707i64).unwrap(); - array.insert("STREAM", 743i64).unwrap(); - array.insert("SYSTEM", 710i64).unwrap(); - array.insert("THREAD_PRIORITY", 708i64).unwrap(); - array.insert("TIES", 697i64).unwrap(); - array.insert("TLS", 845i64).unwrap(); - array.insert("UNBOUNDED", 698i64).unwrap(); - array.insert("VCPU", 711i64).unwrap(); - array.insert("VISIBLE", 662i64).unwrap(); - array.insert("WINDOW", 699i64).unwrap(); - array.insert("ZONE", 843i64).unwrap(); - freeze_array(&mut array); - array -} - -fn array_functions() -> ZBox { - let mut array = persistent_array(34); - array.insert_at_index(5i64, true).unwrap(); - array.insert_at_index(35i64, true).unwrap(); - array.insert_at_index(36i64, true).unwrap(); - array.insert_at_index(38i64, true).unwrap(); - array.insert_at_index(52i64, true).unwrap(); - array.insert_at_index(95i64, true).unwrap(); - array.insert_at_index(100i64, true).unwrap(); - array.insert_at_index(102i64, true).unwrap(); - array.insert_at_index(103i64, true).unwrap(); - array.insert_at_index(108i64, true).unwrap(); - array.insert_at_index(114i64, true).unwrap(); - array.insert_at_index(115i64, true).unwrap(); - array.insert_at_index(182i64, true).unwrap(); - array.insert_at_index(218i64, true).unwrap(); - array.insert_at_index(326i64, true).unwrap(); - array.insert_at_index(338i64, true).unwrap(); - array.insert_at_index(345i64, true).unwrap(); - array.insert_at_index(372i64, true).unwrap(); - array.insert_at_index(414i64, true).unwrap(); - array.insert_at_index(505i64, true).unwrap(); - array.insert_at_index(551i64, true).unwrap(); - array.insert_at_index(550i64, true).unwrap(); - array.insert_at_index(548i64, true).unwrap(); - array.insert_at_index(549i64, true).unwrap(); - array.insert_at_index(558i64, true).unwrap(); - array.insert_at_index(562i64, true).unwrap(); - array.insert_at_index(563i64, true).unwrap(); - array.insert_at_index(564i64, true).unwrap(); - array.insert_at_index(569i64, true).unwrap(); - array.insert_at_index(570i64, true).unwrap(); - array.insert_at_index(595i64, true).unwrap(); - array.insert_at_index(634i64, true).unwrap(); - array.insert_at_index(635i64, true).unwrap(); - array.insert_at_index(632i64, true).unwrap(); - freeze_array(&mut array); - array -} - -fn array_synonyms() -> ZBox { - let mut array = persistent_array(43); - array.insert_at_index(59i64, 60i64).unwrap(); - array.insert_at_index(102i64, 100i64).unwrap(); - array.insert_at_index(103i64, 108i64).unwrap(); - array.insert_at_index(104i64, 372i64).unwrap(); - array.insert_at_index(117i64, 122i64).unwrap(); - array.insert_at_index(124i64, 126i64).unwrap(); - array.insert_at_index(144i64, 143i64).unwrap(); - array.insert_at_index(187i64, 71i64).unwrap(); - array.insert_at_index(193i64, 195i64).unwrap(); - array.insert_at_index(194i64, 146i64).unwrap(); - array.insert_at_index(852i64, 211i64).unwrap(); - array.insert_at_index(795i64, 588i64).unwrap(); - array.insert_at_index(796i64, 516i64).unwrap(); - array.insert_at_index(797i64, 331i64).unwrap(); - array.insert_at_index(798i64, 249i64).unwrap(); - array.insert_at_index(799i64, 31i64).unwrap(); - array.insert_at_index(246i64, 249i64).unwrap(); - array.insert_at_index(254i64, 449i64).unwrap(); - array.insert_at_index(282i64, 372i64).unwrap(); - array.insert_at_index(283i64, 372i64).unwrap(); - array.insert_at_index(338i64, 563i64).unwrap(); - array.insert_at_index(339i64, 331i64).unwrap(); - array.insert_at_index(362i64, 363i64).unwrap(); - array.insert_at_index(479i64, 444i64).unwrap(); - array.insert_at_index(491i64, 109i64).unwrap(); - array.insert_at_index(493i64, 110i64).unwrap(); - array.insert_at_index(505i64, 618i64).unwrap(); - array.insert_at_index(518i64, 16i64).unwrap(); - array.insert_at_index(802i64, 122i64).unwrap(); - array.insert_at_index(803i64, 229i64).unwrap(); - array.insert_at_index(804i64, 337i64).unwrap(); - array.insert_at_index(805i64, 343i64).unwrap(); - array.insert_at_index(806i64, 350i64).unwrap(); - array.insert_at_index(807i64, 429i64).unwrap(); - array.insert_at_index(808i64, 495i64).unwrap(); - array.insert_at_index(809i64, 640i64).unwrap(); - array.insert_at_index(810i64, 656i64).unwrap(); - array.insert_at_index(550i64, 551i64).unwrap(); - array.insert_at_index(549i64, 551i64).unwrap(); - array.insert_at_index(562i64, 563i64).unwrap(); - array.insert_at_index(570i64, 618i64).unwrap(); - array.insert_at_index(634i64, 632i64).unwrap(); - array.insert_at_index(630i64, 629i64).unwrap(); - freeze_array(&mut array); - array -} - -fn array_versions() -> ZBox { - let mut array = persistent_array(179); - array.insert_at_index(2i64, 50707i64).unwrap(); - array.insert_at_index(12i64, 50707i64).unwrap(); - array.insert_at_index(13i64, -80000i64).unwrap(); - array.insert_at_index(22i64, -50700i64).unwrap(); - array.insert_at_index(57i64, 50706i64).unwrap(); - array.insert_at_index(81i64, 50707i64).unwrap(); - array.insert_at_index(93i64, -50700i64).unwrap(); - array.insert_at_index(101i64, 50604i64).unwrap(); - array.insert_at_index(129i64, 50604i64).unwrap(); - array.insert_at_index(136i64, -80003i64).unwrap(); - array.insert_at_index(158i64, 50711i64).unwrap(); - array.insert_at_index(177i64, 50606i64).unwrap(); - array.insert_at_index(179i64, 50606i64).unwrap(); - array.insert_at_index(189i64, 50707i64).unwrap(); - array.insert_at_index(190i64, 50700i64).unwrap(); - array.insert_at_index(197i64, 50700i64).unwrap(); - array.insert_at_index(209i64, 50707i64).unwrap(); - array.insert_at_index(207i64, 50604i64).unwrap(); - array.insert_at_index(210i64, 50707i64).unwrap(); - array.insert_at_index(844i64, 50711i64).unwrap(); - array.insert_at_index(244i64, 50713i64).unwrap(); - array.insert_at_index(262i64, 50708i64).unwrap(); - array.insert_at_index(296i64, 50605i64).unwrap(); - array.insert_at_index(297i64, 50602i64).unwrap(); - array.insert_at_index(305i64, 50601i64).unwrap(); - array.insert_at_index(311i64, 50603i64).unwrap(); - array.insert_at_index(312i64, 50603i64).unwrap(); - array.insert_at_index(317i64, 50713i64).unwrap(); - array.insert_at_index(365i64, 50704i64).unwrap(); - array.insert_at_index(377i64, 50606i64).unwrap(); - array.insert_at_index(382i64, -50706i64).unwrap(); - array.insert_at_index(386i64, 50605i64).unwrap(); - array.insert_at_index(389i64, 50706i64).unwrap(); - array.insert_at_index(409i64, 50604i64).unwrap(); - array.insert_at_index(415i64, 50700i64).unwrap(); - array.insert_at_index(440i64, -80000i64).unwrap(); - array.insert_at_index(460i64, 50700i64).unwrap(); - array.insert_at_index(462i64, 50700i64).unwrap(); - array.insert_at_index(461i64, 50700i64).unwrap(); - array.insert_at_index(463i64, 50700i64).unwrap(); - array.insert_at_index(466i64, 50700i64).unwrap(); - array.insert_at_index(464i64, 50700i64).unwrap(); - array.insert_at_index(465i64, 50700i64).unwrap(); - array.insert_at_index(482i64, 50713i64).unwrap(); - array.insert_at_index(529i64, 50606i64).unwrap(); - array.insert_at_index(533i64, -80000i64).unwrap(); - array.insert_at_index(540i64, 50700i64).unwrap(); - array.insert_at_index(554i64, 50707i64).unwrap(); - array.insert_at_index(573i64, -80000i64).unwrap(); - array.insert_at_index(625i64, 50706i64).unwrap(); - array.insert_at_index(637i64, 50707i64).unwrap(); - array.insert_at_index(652i64, 50704i64).unwrap(); - array.insert_at_index(724i64, 80014i64).unwrap(); - array.insert_at_index(660i64, 80000i64).unwrap(); - array.insert_at_index(731i64, 80017i64).unwrap(); - array.insert_at_index(842i64, 80000i64).unwrap(); - array.insert_at_index(812i64, 80021i64).unwrap(); - array.insert_at_index(675i64, 80000i64).unwrap(); - array.insert_at_index(677i64, 80000i64).unwrap(); - array.insert_at_index(664i64, 80000i64).unwrap(); - array.insert_at_index(678i64, 80000i64).unwrap(); - array.insert_at_index(715i64, 80011i64).unwrap(); - array.insert_at_index(679i64, 80000i64).unwrap(); - array.insert_at_index(716i64, 80011i64).unwrap(); - array.insert_at_index(700i64, 80000i64).unwrap(); - array.insert_at_index(730i64, 80017i64).unwrap(); - array.insert_at_index(848i64, 80021i64).unwrap(); - array.insert_at_index(663i64, 80000i64).unwrap(); - array.insert_at_index(680i64, 80000i64).unwrap(); - array.insert_at_index(741i64, 80019i64).unwrap(); - array.insert_at_index(681i64, 80000i64).unwrap(); - array.insert_at_index(682i64, 80000i64).unwrap(); - array.insert_at_index(852i64, 80000i64).unwrap(); - array.insert_at_index(713i64, 80000i64).unwrap(); - array.insert_at_index(840i64, 80000i64).unwrap(); - array.insert_at_index(672i64, 80000i64).unwrap(); - array.insert_at_index(683i64, 80000i64).unwrap(); - array.insert_at_index(841i64, 80000i64).unwrap(); - array.insert_at_index(674i64, 80000i64).unwrap(); - array.insert_at_index(705i64, 80000i64).unwrap(); - array.insert_at_index(725i64, 80014i64).unwrap(); - array.insert_at_index(811i64, 80031i64).unwrap(); - array.insert_at_index(661i64, 80000i64).unwrap(); - array.insert_at_index(667i64, 80000i64).unwrap(); - array.insert_at_index(666i64, 80000i64).unwrap(); - array.insert_at_index(701i64, 80000i64).unwrap(); - array.insert_at_index(850i64, 80021i64).unwrap(); - array.insert_at_index(847i64, 80024i64).unwrap(); - array.insert_at_index(684i64, 80000i64).unwrap(); - array.insert_at_index(685i64, 80000i64).unwrap(); - array.insert_at_index(726i64, 80014i64).unwrap(); - array.insert_at_index(686i64, 80000i64).unwrap(); - array.insert_at_index(670i64, 80000i64).unwrap(); - array.insert_at_index(735i64, 80018i64).unwrap(); - array.insert_at_index(712i64, 80000i64).unwrap(); - array.insert_at_index(738i64, 80018i64).unwrap(); - array.insert_at_index(736i64, 80018i64).unwrap(); - array.insert_at_index(733i64, 80017i64).unwrap(); - array.insert_at_index(702i64, 80000i64).unwrap(); - array.insert_at_index(729i64, 80017i64).unwrap(); - array.insert_at_index(671i64, 80000i64).unwrap(); - array.insert_at_index(687i64, 80000i64).unwrap(); - array.insert_at_index(688i64, 80000i64).unwrap(); - array.insert_at_index(689i64, 80000i64).unwrap(); - array.insert_at_index(668i64, 80000i64).unwrap(); - array.insert_at_index(744i64, 80019i64).unwrap(); - array.insert_at_index(732i64, 80017i64).unwrap(); - array.insert_at_index(728i64, 80014i64).unwrap(); - array.insert_at_index(719i64, 80013i64).unwrap(); - array.insert_at_index(703i64, 80000i64).unwrap(); - array.insert_at_index(717i64, 80011i64).unwrap(); - array.insert_at_index(690i64, 80000i64).unwrap(); - array.insert_at_index(691i64, 80000i64).unwrap(); - array.insert_at_index(740i64, 80019i64).unwrap(); - array.insert_at_index(704i64, 80000i64).unwrap(); - array.insert_at_index(692i64, 80000i64).unwrap(); - array.insert_at_index(673i64, 80000i64).unwrap(); - array.insert_at_index(658i64, 80000i64).unwrap(); - array.insert_at_index(693i64, 80000i64).unwrap(); - array.insert_at_index(737i64, 80018i64).unwrap(); - array.insert_at_index(734i64, 80018i64).unwrap(); - array.insert_at_index(694i64, 80000i64).unwrap(); - array.insert_at_index(665i64, 80000i64).unwrap(); - array.insert_at_index(846i64, 80021i64).unwrap(); - array.insert_at_index(718i64, 80011i64).unwrap(); - array.insert_at_index(739i64, 80019i64).unwrap(); - array.insert_at_index(742i64, 80019i64).unwrap(); - array.insert_at_index(709i64, 80000i64).unwrap(); - array.insert_at_index(695i64, 80000i64).unwrap(); - array.insert_at_index(714i64, 80011i64).unwrap(); - array.insert_at_index(727i64, 80014i64).unwrap(); - array.insert_at_index(706i64, 80000i64).unwrap(); - array.insert_at_index(851i64, 80021i64).unwrap(); - array.insert_at_index(659i64, 80000i64).unwrap(); - array.insert_at_index(696i64, 80000i64).unwrap(); - array.insert_at_index(849i64, 80021i64).unwrap(); - array.insert_at_index(721i64, 80013i64).unwrap(); - array.insert_at_index(722i64, 80013i64).unwrap(); - array.insert_at_index(720i64, 80013i64).unwrap(); - array.insert_at_index(723i64, 80013i64).unwrap(); - array.insert_at_index(669i64, 80000i64).unwrap(); - array.insert_at_index(813i64, 80000i64).unwrap(); - array.insert_at_index(814i64, 80000i64).unwrap(); - array.insert_at_index(815i64, 80000i64).unwrap(); - array.insert_at_index(816i64, 80000i64).unwrap(); - array.insert_at_index(817i64, 80000i64).unwrap(); - array.insert_at_index(818i64, 80000i64).unwrap(); - array.insert_at_index(819i64, 80000i64).unwrap(); - array.insert_at_index(820i64, 80000i64).unwrap(); - array.insert_at_index(821i64, 80000i64).unwrap(); - array.insert_at_index(822i64, 80000i64).unwrap(); - array.insert_at_index(823i64, 80000i64).unwrap(); - array.insert_at_index(824i64, 80000i64).unwrap(); - array.insert_at_index(825i64, 80000i64).unwrap(); - array.insert_at_index(826i64, 80000i64).unwrap(); - array.insert_at_index(828i64, 80000i64).unwrap(); - array.insert_at_index(829i64, 80000i64).unwrap(); - array.insert_at_index(830i64, 80000i64).unwrap(); - array.insert_at_index(831i64, 80000i64).unwrap(); - array.insert_at_index(832i64, 80000i64).unwrap(); - array.insert_at_index(833i64, 80000i64).unwrap(); - array.insert_at_index(834i64, 80000i64).unwrap(); - array.insert_at_index(827i64, 80000i64).unwrap(); - array.insert_at_index(835i64, 80000i64).unwrap(); - array.insert_at_index(836i64, 80000i64).unwrap(); - array.insert_at_index(837i64, 80000i64).unwrap(); - array.insert_at_index(838i64, 80000i64).unwrap(); - array.insert_at_index(839i64, 80000i64).unwrap(); - array.insert_at_index(707i64, 80000i64).unwrap(); - array.insert_at_index(743i64, 80019i64).unwrap(); - array.insert_at_index(710i64, 80000i64).unwrap(); - array.insert_at_index(708i64, 80000i64).unwrap(); - array.insert_at_index(697i64, 80000i64).unwrap(); - array.insert_at_index(845i64, 80016i64).unwrap(); - array.insert_at_index(698i64, 80000i64).unwrap(); - array.insert_at_index(711i64, 80000i64).unwrap(); - array.insert_at_index(662i64, 80000i64).unwrap(); - array.insert_at_index(699i64, 80000i64).unwrap(); - array.insert_at_index(843i64, 80022i64).unwrap(); - freeze_array(&mut array); - array -} - -fn array_underscore_charsets() -> ZBox { - let mut array = persistent_array(42); - array.insert("_armscii8", true).unwrap(); - array.insert("_ascii", true).unwrap(); - array.insert("_big5", true).unwrap(); - array.insert("_binary", true).unwrap(); - array.insert("_cp1250", true).unwrap(); - array.insert("_cp1251", true).unwrap(); - array.insert("_cp1256", true).unwrap(); - array.insert("_cp1257", true).unwrap(); - array.insert("_cp850", true).unwrap(); - array.insert("_cp852", true).unwrap(); - array.insert("_cp866", true).unwrap(); - array.insert("_cp932", true).unwrap(); - array.insert("_dec8", true).unwrap(); - array.insert("_eucjpms", true).unwrap(); - array.insert("_euckr", true).unwrap(); - array.insert("_gb18030", true).unwrap(); - array.insert("_gb2312", true).unwrap(); - array.insert("_gbk", true).unwrap(); - array.insert("_geostd8", true).unwrap(); - array.insert("_greek", true).unwrap(); - array.insert("_hebrew", true).unwrap(); - array.insert("_hp8", true).unwrap(); - array.insert("_keybcs2", true).unwrap(); - array.insert("_koi8r", true).unwrap(); - array.insert("_koi8u", true).unwrap(); - array.insert("_latin1", true).unwrap(); - array.insert("_latin2", true).unwrap(); - array.insert("_latin5", true).unwrap(); - array.insert("_latin7", true).unwrap(); - array.insert("_macce", true).unwrap(); - array.insert("_macroman", true).unwrap(); - array.insert("_sjis", true).unwrap(); - array.insert("_swe7", true).unwrap(); - array.insert("_tis620", true).unwrap(); - array.insert("_ucs2", true).unwrap(); - array.insert("_ujis", true).unwrap(); - array.insert("_utf16", true).unwrap(); - array.insert("_utf16le", true).unwrap(); - array.insert("_utf32", true).unwrap(); - array.insert("_utf8", true).unwrap(); - array.insert("_utf8mb3", true).unwrap(); - array.insert("_utf8mb4", true).unwrap(); - freeze_array(&mut array); - array -} - -pub const SCALAR_INT_CONSTANTS: &[(&str, i64)] = &[ - ("SQL_MODE_HIGH_NOT_PRECEDENCE", 1i64), - ("SQL_MODE_PIPES_AS_CONCAT", 2i64), - ("SQL_MODE_IGNORE_SPACE", 4i64), - ("SQL_MODE_NO_BACKSLASH_ESCAPES", 8i64), - ("SQL_MODE_ANSI_QUOTES", 16i64), - ("ACCESSIBLE_SYMBOL", 1i64), - ("ACCOUNT_SYMBOL", 2i64), - ("ACTION_SYMBOL", 3i64), - ("ADD_SYMBOL", 4i64), - ("ADDDATE_SYMBOL", 5i64), - ("AFTER_SYMBOL", 6i64), - ("AGAINST_SYMBOL", 7i64), - ("AGGREGATE_SYMBOL", 8i64), - ("ALGORITHM_SYMBOL", 9i64), - ("ALL_SYMBOL", 10i64), - ("ALTER_SYMBOL", 11i64), - ("ALWAYS_SYMBOL", 12i64), - ("ANALYSE_SYMBOL", 13i64), - ("ANALYZE_SYMBOL", 14i64), - ("AND_SYMBOL", 15i64), - ("ANY_SYMBOL", 16i64), - ("AS_SYMBOL", 17i64), - ("ASC_SYMBOL", 18i64), - ("ASCII_SYMBOL", 19i64), - ("ASENSITIVE_SYMBOL", 20i64), - ("AT_SYMBOL", 21i64), - ("AUTHORS_SYMBOL", 22i64), - ("AUTOEXTEND_SIZE_SYMBOL", 23i64), - ("AUTO_INCREMENT_SYMBOL", 24i64), - ("AVG_ROW_LENGTH_SYMBOL", 25i64), - ("AVG_SYMBOL", 26i64), - ("BACKUP_SYMBOL", 27i64), - ("BEFORE_SYMBOL", 28i64), - ("BEGIN_SYMBOL", 29i64), - ("BETWEEN_SYMBOL", 30i64), - ("BIGINT_SYMBOL", 31i64), - ("BINARY_SYMBOL", 32i64), - ("BINLOG_SYMBOL", 33i64), - ("BIN_NUM_SYMBOL", 34i64), - ("BIT_AND_SYMBOL", 35i64), - ("BIT_OR_SYMBOL", 36i64), - ("BIT_SYMBOL", 37i64), - ("BIT_XOR_SYMBOL", 38i64), - ("BLOB_SYMBOL", 39i64), - ("BLOCK_SYMBOL", 40i64), - ("BOOLEAN_SYMBOL", 41i64), - ("BOOL_SYMBOL", 42i64), - ("BOTH_SYMBOL", 43i64), - ("BTREE_SYMBOL", 44i64), - ("BY_SYMBOL", 45i64), - ("BYTE_SYMBOL", 46i64), - ("CACHE_SYMBOL", 47i64), - ("CALL_SYMBOL", 48i64), - ("CASCADE_SYMBOL", 49i64), - ("CASCADED_SYMBOL", 50i64), - ("CASE_SYMBOL", 51i64), - ("CAST_SYMBOL", 52i64), - ("CATALOG_NAME_SYMBOL", 53i64), - ("CHAIN_SYMBOL", 54i64), - ("CHANGE_SYMBOL", 55i64), - ("CHANGED_SYMBOL", 56i64), - ("CHANNEL_SYMBOL", 57i64), - ("CHARSET_SYMBOL", 58i64), - ("CHARACTER_SYMBOL", 59i64), - ("CHAR_SYMBOL", 60i64), - ("CHECKSUM_SYMBOL", 61i64), - ("CHECK_SYMBOL", 62i64), - ("CIPHER_SYMBOL", 63i64), - ("CLASS_ORIGIN_SYMBOL", 64i64), - ("CLIENT_SYMBOL", 65i64), - ("CLOSE_SYMBOL", 66i64), - ("COALESCE_SYMBOL", 67i64), - ("CODE_SYMBOL", 68i64), - ("COLLATE_SYMBOL", 69i64), - ("COLLATION_SYMBOL", 70i64), - ("COLUMNS_SYMBOL", 71i64), - ("COLUMN_SYMBOL", 72i64), - ("COLUMN_NAME_SYMBOL", 73i64), - ("COLUMN_FORMAT_SYMBOL", 74i64), - ("COMMENT_SYMBOL", 75i64), - ("COMMITTED_SYMBOL", 76i64), - ("COMMIT_SYMBOL", 77i64), - ("COMPACT_SYMBOL", 78i64), - ("COMPLETION_SYMBOL", 79i64), - ("COMPRESSED_SYMBOL", 80i64), - ("COMPRESSION_SYMBOL", 81i64), - ("CONCURRENT_SYMBOL", 82i64), - ("CONDITION_SYMBOL", 83i64), - ("CONNECTION_SYMBOL", 84i64), - ("CONSISTENT_SYMBOL", 85i64), - ("CONSTRAINT_SYMBOL", 86i64), - ("CONSTRAINT_CATALOG_SYMBOL", 87i64), - ("CONSTRAINT_NAME_SYMBOL", 88i64), - ("CONSTRAINT_SCHEMA_SYMBOL", 89i64), - ("CONTAINS_SYMBOL", 90i64), - ("CONTEXT_SYMBOL", 91i64), - ("CONTINUE_SYMBOL", 92i64), - ("CONTRIBUTORS_SYMBOL", 93i64), - ("CONVERT_SYMBOL", 94i64), - ("COUNT_SYMBOL", 95i64), - ("CPU_SYMBOL", 96i64), - ("CREATE_SYMBOL", 97i64), - ("CROSS_SYMBOL", 98i64), - ("CUBE_SYMBOL", 99i64), - ("CURDATE_SYMBOL", 100i64), - ("CURRENT_SYMBOL", 101i64), - ("CURRENT_DATE_SYMBOL", 102i64), - ("CURRENT_TIME_SYMBOL", 103i64), - ("CURRENT_TIMESTAMP_SYMBOL", 104i64), - ("CURRENT_USER_SYMBOL", 105i64), - ("CURSOR_SYMBOL", 106i64), - ("CURSOR_NAME_SYMBOL", 107i64), - ("CURTIME_SYMBOL", 108i64), - ("DATABASE_SYMBOL", 109i64), - ("DATABASES_SYMBOL", 110i64), - ("DATAFILE_SYMBOL", 111i64), - ("DATA_SYMBOL", 112i64), - ("DATETIME_SYMBOL", 113i64), - ("DATE_ADD_SYMBOL", 114i64), - ("DATE_SUB_SYMBOL", 115i64), - ("DATE_SYMBOL", 116i64), - ("DAYOFMONTH_SYMBOL", 117i64), - ("DAY_HOUR_SYMBOL", 118i64), - ("DAY_MICROSECOND_SYMBOL", 119i64), - ("DAY_MINUTE_SYMBOL", 120i64), - ("DAY_SECOND_SYMBOL", 121i64), - ("DAY_SYMBOL", 122i64), - ("DEALLOCATE_SYMBOL", 123i64), - ("DEC_SYMBOL", 124i64), - ("DECIMAL_NUM_SYMBOL", 125i64), - ("DECIMAL_SYMBOL", 126i64), - ("DECLARE_SYMBOL", 127i64), - ("DEFAULT_SYMBOL", 128i64), - ("DEFAULT_AUTH_SYMBOL", 129i64), - ("DEFINER_SYMBOL", 130i64), - ("DELAYED_SYMBOL", 131i64), - ("DELAY_KEY_WRITE_SYMBOL", 132i64), - ("DELETE_SYMBOL", 133i64), - ("DESC_SYMBOL", 134i64), - ("DESCRIBE_SYMBOL", 135i64), - ("DES_KEY_FILE_SYMBOL", 136i64), - ("DETERMINISTIC_SYMBOL", 137i64), - ("DIAGNOSTICS_SYMBOL", 138i64), - ("DIRECTORY_SYMBOL", 139i64), - ("DISABLE_SYMBOL", 140i64), - ("DISCARD_SYMBOL", 141i64), - ("DISK_SYMBOL", 142i64), - ("DISTINCT_SYMBOL", 143i64), - ("DISTINCTROW_SYMBOL", 144i64), - ("DIV_SYMBOL", 145i64), - ("DOUBLE_SYMBOL", 146i64), - ("DO_SYMBOL", 147i64), - ("DROP_SYMBOL", 148i64), - ("DUAL_SYMBOL", 149i64), - ("DUMPFILE_SYMBOL", 150i64), - ("DUPLICATE_SYMBOL", 151i64), - ("DYNAMIC_SYMBOL", 152i64), - ("EACH_SYMBOL", 153i64), - ("ELSE_SYMBOL", 154i64), - ("ELSEIF_SYMBOL", 155i64), - ("ENABLE_SYMBOL", 156i64), - ("ENCLOSED_SYMBOL", 157i64), - ("ENCRYPTION_SYMBOL", 158i64), - ("END_SYMBOL", 159i64), - ("ENDS_SYMBOL", 160i64), - ("END_OF_INPUT_SYMBOL", 161i64), - ("ENGINES_SYMBOL", 162i64), - ("ENGINE_SYMBOL", 163i64), - ("ENUM_SYMBOL", 164i64), - ("ERROR_SYMBOL", 165i64), - ("ERRORS_SYMBOL", 166i64), - ("ESCAPED_SYMBOL", 167i64), - ("ESCAPE_SYMBOL", 168i64), - ("EVENTS_SYMBOL", 169i64), - ("EVENT_SYMBOL", 170i64), - ("EVERY_SYMBOL", 171i64), - ("EXCHANGE_SYMBOL", 172i64), - ("EXECUTE_SYMBOL", 173i64), - ("EXISTS_SYMBOL", 174i64), - ("EXIT_SYMBOL", 175i64), - ("EXPANSION_SYMBOL", 176i64), - ("EXPIRE_SYMBOL", 177i64), - ("EXPLAIN_SYMBOL", 178i64), - ("EXPORT_SYMBOL", 179i64), - ("EXTENDED_SYMBOL", 180i64), - ("EXTENT_SIZE_SYMBOL", 181i64), - ("EXTRACT_SYMBOL", 182i64), - ("FALSE_SYMBOL", 183i64), - ("FAST_SYMBOL", 184i64), - ("FAULTS_SYMBOL", 185i64), - ("FETCH_SYMBOL", 186i64), - ("FIELDS_SYMBOL", 187i64), - ("FILE_SYMBOL", 188i64), - ("FILE_BLOCK_SIZE_SYMBOL", 189i64), - ("FILTER_SYMBOL", 190i64), - ("FIRST_SYMBOL", 191i64), - ("FIXED_SYMBOL", 192i64), - ("FLOAT4_SYMBOL", 193i64), - ("FLOAT8_SYMBOL", 194i64), - ("FLOAT_SYMBOL", 195i64), - ("FLUSH_SYMBOL", 196i64), - ("FOLLOWS_SYMBOL", 197i64), - ("FORCE_SYMBOL", 198i64), - ("FOREIGN_SYMBOL", 199i64), - ("FOR_SYMBOL", 200i64), - ("FORMAT_SYMBOL", 201i64), - ("FOUND_SYMBOL", 202i64), - ("FROM_SYMBOL", 203i64), - ("FULL_SYMBOL", 204i64), - ("FULLTEXT_SYMBOL", 205i64), - ("FUNCTION_SYMBOL", 206i64), - ("GET_SYMBOL", 207i64), - ("GENERAL_SYMBOL", 208i64), - ("GENERATED_SYMBOL", 209i64), - ("GROUP_REPLICATION_SYMBOL", 210i64), - ("GEOMETRYCOLLECTION_SYMBOL", 211i64), - ("GEOMETRY_SYMBOL", 212i64), - ("GET_FORMAT_SYMBOL", 213i64), - ("GLOBAL_SYMBOL", 214i64), - ("GRANT_SYMBOL", 215i64), - ("GRANTS_SYMBOL", 216i64), - ("GROUP_SYMBOL", 217i64), - ("GROUP_CONCAT_SYMBOL", 218i64), - ("HANDLER_SYMBOL", 219i64), - ("HASH_SYMBOL", 220i64), - ("HAVING_SYMBOL", 221i64), - ("HELP_SYMBOL", 222i64), - ("HIGH_PRIORITY_SYMBOL", 223i64), - ("HOST_SYMBOL", 224i64), - ("HOSTS_SYMBOL", 225i64), - ("HOUR_MICROSECOND_SYMBOL", 226i64), - ("HOUR_MINUTE_SYMBOL", 227i64), - ("HOUR_SECOND_SYMBOL", 228i64), - ("HOUR_SYMBOL", 229i64), - ("IDENTIFIED_SYMBOL", 230i64), - ("IF_SYMBOL", 231i64), - ("IGNORE_SYMBOL", 232i64), - ("IGNORE_SERVER_IDS_SYMBOL", 233i64), - ("IMPORT_SYMBOL", 234i64), - ("INDEXES_SYMBOL", 235i64), - ("INDEX_SYMBOL", 236i64), - ("INFILE_SYMBOL", 237i64), - ("INITIAL_SIZE_SYMBOL", 238i64), - ("INNER_SYMBOL", 239i64), - ("INOUT_SYMBOL", 240i64), - ("INSENSITIVE_SYMBOL", 241i64), - ("INSERT_SYMBOL", 242i64), - ("INSERT_METHOD_SYMBOL", 243i64), - ("INSTANCE_SYMBOL", 244i64), - ("INSTALL_SYMBOL", 245i64), - ("INTEGER_SYMBOL", 246i64), - ("INTERVAL_SYMBOL", 247i64), - ("INTO_SYMBOL", 248i64), - ("INT_SYMBOL", 249i64), - ("INVOKER_SYMBOL", 250i64), - ("IN_SYMBOL", 251i64), - ("IO_AFTER_GTIDS_SYMBOL", 252i64), - ("IO_BEFORE_GTIDS_SYMBOL", 253i64), - ("IO_THREAD_SYMBOL", 254i64), - ("IO_SYMBOL", 255i64), - ("IPC_SYMBOL", 256i64), - ("IS_SYMBOL", 257i64), - ("ISOLATION_SYMBOL", 258i64), - ("ISSUER_SYMBOL", 259i64), - ("ITERATE_SYMBOL", 260i64), - ("JOIN_SYMBOL", 261i64), - ("JSON_SYMBOL", 262i64), - ("KEYS_SYMBOL", 263i64), - ("KEY_BLOCK_SIZE_SYMBOL", 264i64), - ("KEY_SYMBOL", 265i64), - ("KILL_SYMBOL", 266i64), - ("LANGUAGE_SYMBOL", 267i64), - ("LAST_SYMBOL", 268i64), - ("LEADING_SYMBOL", 269i64), - ("LEAVES_SYMBOL", 270i64), - ("LEAVE_SYMBOL", 271i64), - ("LEFT_SYMBOL", 272i64), - ("LESS_SYMBOL", 273i64), - ("LEVEL_SYMBOL", 274i64), - ("LIKE_SYMBOL", 275i64), - ("LIMIT_SYMBOL", 276i64), - ("LINEAR_SYMBOL", 277i64), - ("LINES_SYMBOL", 278i64), - ("LINESTRING_SYMBOL", 279i64), - ("LIST_SYMBOL", 280i64), - ("LOAD_SYMBOL", 281i64), - ("LOCALTIME_SYMBOL", 282i64), - ("LOCALTIMESTAMP_SYMBOL", 283i64), - ("LOCAL_SYMBOL", 284i64), - ("LOCATOR_SYMBOL", 285i64), - ("LOCKS_SYMBOL", 286i64), - ("LOCK_SYMBOL", 287i64), - ("LOGFILE_SYMBOL", 288i64), - ("LOGS_SYMBOL", 289i64), - ("LONGBLOB_SYMBOL", 290i64), - ("LONGTEXT_SYMBOL", 291i64), - ("LONG_NUM_SYMBOL", 292i64), - ("LONG_SYMBOL", 293i64), - ("LOOP_SYMBOL", 294i64), - ("LOW_PRIORITY_SYMBOL", 295i64), - ("MASTER_AUTO_POSITION_SYMBOL", 296i64), - ("MASTER_BIND_SYMBOL", 297i64), - ("MASTER_CONNECT_RETRY_SYMBOL", 298i64), - ("MASTER_DELAY_SYMBOL", 299i64), - ("MASTER_HOST_SYMBOL", 300i64), - ("MASTER_LOG_FILE_SYMBOL", 301i64), - ("MASTER_LOG_POS_SYMBOL", 302i64), - ("MASTER_PASSWORD_SYMBOL", 303i64), - ("MASTER_PORT_SYMBOL", 304i64), - ("MASTER_RETRY_COUNT_SYMBOL", 305i64), - ("MASTER_SERVER_ID_SYMBOL", 306i64), - ("MASTER_SSL_CAPATH_SYMBOL", 307i64), - ("MASTER_SSL_CA_SYMBOL", 308i64), - ("MASTER_SSL_CERT_SYMBOL", 309i64), - ("MASTER_SSL_CIPHER_SYMBOL", 310i64), - ("MASTER_SSL_CRL_SYMBOL", 311i64), - ("MASTER_SSL_CRLPATH_SYMBOL", 312i64), - ("MASTER_SSL_KEY_SYMBOL", 313i64), - ("MASTER_SSL_SYMBOL", 314i64), - ("MASTER_SSL_VERIFY_SERVER_CERT_SYMBOL", 315i64), - ("MASTER_SYMBOL", 316i64), - ("MASTER_TLS_VERSION_SYMBOL", 317i64), - ("MASTER_USER_SYMBOL", 318i64), - ("MASTER_HEARTBEAT_PERIOD_SYMBOL", 319i64), - ("MATCH_SYMBOL", 320i64), - ("MAX_CONNECTIONS_PER_HOUR_SYMBOL", 321i64), - ("MAX_QUERIES_PER_HOUR_SYMBOL", 322i64), - ("MAX_ROWS_SYMBOL", 323i64), - ("MAX_SIZE_SYMBOL", 324i64), - ("MAX_STATEMENT_TIME_SYMBOL", 325i64), - ("MAX_SYMBOL", 326i64), - ("MAX_UPDATES_PER_HOUR_SYMBOL", 327i64), - ("MAX_USER_CONNECTIONS_SYMBOL", 328i64), - ("MAXVALUE_SYMBOL", 329i64), - ("MEDIUMBLOB_SYMBOL", 330i64), - ("MEDIUMINT_SYMBOL", 331i64), - ("MEDIUMTEXT_SYMBOL", 332i64), - ("MEDIUM_SYMBOL", 333i64), - ("MEMORY_SYMBOL", 334i64), - ("MERGE_SYMBOL", 335i64), - ("MESSAGE_TEXT_SYMBOL", 336i64), - ("MICROSECOND_SYMBOL", 337i64), - ("MID_SYMBOL", 338i64), - ("MIDDLEINT_SYMBOL", 339i64), - ("MIGRATE_SYMBOL", 340i64), - ("MINUTE_MICROSECOND_SYMBOL", 341i64), - ("MINUTE_SECOND_SYMBOL", 342i64), - ("MINUTE_SYMBOL", 343i64), - ("MIN_ROWS_SYMBOL", 344i64), - ("MIN_SYMBOL", 345i64), - ("MODE_SYMBOL", 346i64), - ("MODIFIES_SYMBOL", 347i64), - ("MODIFY_SYMBOL", 348i64), - ("MOD_SYMBOL", 349i64), - ("MONTH_SYMBOL", 350i64), - ("MULTILINESTRING_SYMBOL", 351i64), - ("MULTIPOINT_SYMBOL", 352i64), - ("MULTIPOLYGON_SYMBOL", 353i64), - ("MUTEX_SYMBOL", 354i64), - ("MYSQL_ERRNO_SYMBOL", 355i64), - ("NAMES_SYMBOL", 356i64), - ("NAME_SYMBOL", 357i64), - ("NATIONAL_SYMBOL", 358i64), - ("NATURAL_SYMBOL", 359i64), - ("NCHAR_STRING_SYMBOL", 360i64), - ("NCHAR_SYMBOL", 361i64), - ("NDB_SYMBOL", 362i64), - ("NDBCLUSTER_SYMBOL", 363i64), - ("NEG_SYMBOL", 364i64), - ("NEVER_SYMBOL", 365i64), - ("NEW_SYMBOL", 366i64), - ("NEXT_SYMBOL", 367i64), - ("NODEGROUP_SYMBOL", 368i64), - ("NONE_SYMBOL", 369i64), - ("NONBLOCKING_SYMBOL", 370i64), - ("NOT_SYMBOL", 371i64), - ("NOW_SYMBOL", 372i64), - ("NO_SYMBOL", 373i64), - ("NO_WAIT_SYMBOL", 374i64), - ("NO_WRITE_TO_BINLOG_SYMBOL", 375i64), - ("NULL_SYMBOL", 376i64), - ("NUMBER_SYMBOL", 377i64), - ("NUMERIC_SYMBOL", 378i64), - ("NVARCHAR_SYMBOL", 379i64), - ("OFFLINE_SYMBOL", 380i64), - ("OFFSET_SYMBOL", 381i64), - ("OLD_PASSWORD_SYMBOL", 382i64), - ("ON_SYMBOL", 383i64), - ("ONE_SYMBOL", 384i64), - ("ONLINE_SYMBOL", 385i64), - ("ONLY_SYMBOL", 386i64), - ("OPEN_SYMBOL", 387i64), - ("OPTIMIZE_SYMBOL", 388i64), - ("OPTIMIZER_COSTS_SYMBOL", 389i64), - ("OPTIONS_SYMBOL", 390i64), - ("OPTION_SYMBOL", 391i64), - ("OPTIONALLY_SYMBOL", 392i64), - ("ORDER_SYMBOL", 393i64), - ("OR_SYMBOL", 394i64), - ("OUTER_SYMBOL", 395i64), - ("OUTFILE_SYMBOL", 396i64), - ("OUT_SYMBOL", 397i64), - ("OWNER_SYMBOL", 398i64), - ("PACK_KEYS_SYMBOL", 399i64), - ("PAGE_SYMBOL", 400i64), - ("PARSER_SYMBOL", 401i64), - ("PARTIAL_SYMBOL", 402i64), - ("PARTITIONING_SYMBOL", 403i64), - ("PARTITIONS_SYMBOL", 404i64), - ("PARTITION_SYMBOL", 405i64), - ("PASSWORD_SYMBOL", 406i64), - ("PHASE_SYMBOL", 407i64), - ("PLUGINS_SYMBOL", 408i64), - ("PLUGIN_DIR_SYMBOL", 409i64), - ("PLUGIN_SYMBOL", 410i64), - ("POINT_SYMBOL", 411i64), - ("POLYGON_SYMBOL", 412i64), - ("PORT_SYMBOL", 413i64), - ("POSITION_SYMBOL", 414i64), - ("PRECEDES_SYMBOL", 415i64), - ("PRECISION_SYMBOL", 416i64), - ("PREPARE_SYMBOL", 417i64), - ("PRESERVE_SYMBOL", 418i64), - ("PREV_SYMBOL", 419i64), - ("PRIMARY_SYMBOL", 420i64), - ("PRIVILEGES_SYMBOL", 421i64), - ("PROCEDURE_SYMBOL", 422i64), - ("PROCESS_SYMBOL", 423i64), - ("PROCESSLIST_SYMBOL", 424i64), - ("PROFILE_SYMBOL", 425i64), - ("PROFILES_SYMBOL", 426i64), - ("PROXY_SYMBOL", 427i64), - ("PURGE_SYMBOL", 428i64), - ("QUARTER_SYMBOL", 429i64), - ("QUERY_SYMBOL", 430i64), - ("QUICK_SYMBOL", 431i64), - ("RANGE_SYMBOL", 432i64), - ("READS_SYMBOL", 433i64), - ("READ_ONLY_SYMBOL", 434i64), - ("READ_SYMBOL", 435i64), - ("READ_WRITE_SYMBOL", 436i64), - ("REAL_SYMBOL", 437i64), - ("REBUILD_SYMBOL", 438i64), - ("RECOVER_SYMBOL", 439i64), - ("REDOFILE_SYMBOL", 440i64), - ("REDO_BUFFER_SIZE_SYMBOL", 441i64), - ("REDUNDANT_SYMBOL", 442i64), - ("REFERENCES_SYMBOL", 443i64), - ("REGEXP_SYMBOL", 444i64), - ("RELAY_SYMBOL", 445i64), - ("RELAYLOG_SYMBOL", 446i64), - ("RELAY_LOG_FILE_SYMBOL", 447i64), - ("RELAY_LOG_POS_SYMBOL", 448i64), - ("RELAY_THREAD_SYMBOL", 449i64), - ("RELEASE_SYMBOL", 450i64), - ("RELOAD_SYMBOL", 451i64), - ("REMOVE_SYMBOL", 452i64), - ("RENAME_SYMBOL", 453i64), - ("REORGANIZE_SYMBOL", 454i64), - ("REPAIR_SYMBOL", 455i64), - ("REPEATABLE_SYMBOL", 456i64), - ("REPEAT_SYMBOL", 457i64), - ("REPLACE_SYMBOL", 458i64), - ("REPLICATION_SYMBOL", 459i64), - ("REPLICATE_DO_DB_SYMBOL", 460i64), - ("REPLICATE_IGNORE_DB_SYMBOL", 461i64), - ("REPLICATE_DO_TABLE_SYMBOL", 462i64), - ("REPLICATE_IGNORE_TABLE_SYMBOL", 463i64), - ("REPLICATE_WILD_DO_TABLE_SYMBOL", 464i64), - ("REPLICATE_WILD_IGNORE_TABLE_SYMBOL", 465i64), - ("REPLICATE_REWRITE_DB_SYMBOL", 466i64), - ("REQUIRE_SYMBOL", 467i64), - ("RESET_SYMBOL", 468i64), - ("RESIGNAL_SYMBOL", 469i64), - ("RESTORE_SYMBOL", 470i64), - ("RESTRICT_SYMBOL", 471i64), - ("RESUME_SYMBOL", 472i64), - ("RETURNED_SQLSTATE_SYMBOL", 473i64), - ("RETURNS_SYMBOL", 474i64), - ("RETURN_SYMBOL", 475i64), - ("REVERSE_SYMBOL", 476i64), - ("REVOKE_SYMBOL", 477i64), - ("RIGHT_SYMBOL", 478i64), - ("RLIKE_SYMBOL", 479i64), - ("ROLLBACK_SYMBOL", 480i64), - ("ROLLUP_SYMBOL", 481i64), - ("ROTATE_SYMBOL", 482i64), - ("ROUTINE_SYMBOL", 483i64), - ("ROWS_SYMBOL", 484i64), - ("ROW_COUNT_SYMBOL", 485i64), - ("ROW_FORMAT_SYMBOL", 486i64), - ("ROW_SYMBOL", 487i64), - ("RTREE_SYMBOL", 488i64), - ("SAVEPOINT_SYMBOL", 489i64), - ("SCHEDULE_SYMBOL", 490i64), - ("SCHEMA_SYMBOL", 491i64), - ("SCHEMA_NAME_SYMBOL", 492i64), - ("SCHEMAS_SYMBOL", 493i64), - ("SECOND_MICROSECOND_SYMBOL", 494i64), - ("SECOND_SYMBOL", 495i64), - ("SECURITY_SYMBOL", 496i64), - ("SELECT_SYMBOL", 497i64), - ("SENSITIVE_SYMBOL", 498i64), - ("SEPARATOR_SYMBOL", 499i64), - ("SERIALIZABLE_SYMBOL", 500i64), - ("SERIAL_SYMBOL", 501i64), - ("SESSION_SYMBOL", 502i64), - ("SERVER_SYMBOL", 503i64), - ("SERVER_OPTIONS_SYMBOL", 504i64), - ("SESSION_USER_SYMBOL", 505i64), - ("SET_SYMBOL", 506i64), - ("SET_VAR_SYMBOL", 507i64), - ("SHARE_SYMBOL", 508i64), - ("SHOW_SYMBOL", 509i64), - ("SHUTDOWN_SYMBOL", 510i64), - ("SIGNAL_SYMBOL", 511i64), - ("SIGNED_SYMBOL", 512i64), - ("SIMPLE_SYMBOL", 513i64), - ("SLAVE_SYMBOL", 514i64), - ("SLOW_SYMBOL", 515i64), - ("SMALLINT_SYMBOL", 516i64), - ("SNAPSHOT_SYMBOL", 517i64), - ("SOME_SYMBOL", 518i64), - ("SOCKET_SYMBOL", 519i64), - ("SONAME_SYMBOL", 520i64), - ("SOUNDS_SYMBOL", 521i64), - ("SOURCE_SYMBOL", 522i64), - ("SPATIAL_SYMBOL", 523i64), - ("SPECIFIC_SYMBOL", 524i64), - ("SQLEXCEPTION_SYMBOL", 525i64), - ("SQLSTATE_SYMBOL", 526i64), - ("SQLWARNING_SYMBOL", 527i64), - ("SQL_AFTER_GTIDS_SYMBOL", 528i64), - ("SQL_AFTER_MTS_GAPS_SYMBOL", 529i64), - ("SQL_BEFORE_GTIDS_SYMBOL", 530i64), - ("SQL_BIG_RESULT_SYMBOL", 531i64), - ("SQL_BUFFER_RESULT_SYMBOL", 532i64), - ("SQL_CACHE_SYMBOL", 533i64), - ("SQL_CALC_FOUND_ROWS_SYMBOL", 534i64), - ("SQL_NO_CACHE_SYMBOL", 535i64), - ("SQL_SMALL_RESULT_SYMBOL", 536i64), - ("SQL_SYMBOL", 537i64), - ("SQL_THREAD_SYMBOL", 538i64), - ("SSL_SYMBOL", 539i64), - ("STACKED_SYMBOL", 540i64), - ("STARTING_SYMBOL", 541i64), - ("STARTS_SYMBOL", 542i64), - ("START_SYMBOL", 543i64), - ("STATS_AUTO_RECALC_SYMBOL", 544i64), - ("STATS_PERSISTENT_SYMBOL", 545i64), - ("STATS_SAMPLE_PAGES_SYMBOL", 546i64), - ("STATUS_SYMBOL", 547i64), - ("STDDEV_SAMP_SYMBOL", 548i64), - ("STDDEV_SYMBOL", 549i64), - ("STDDEV_POP_SYMBOL", 550i64), - ("STD_SYMBOL", 551i64), - ("STOP_SYMBOL", 552i64), - ("STORAGE_SYMBOL", 553i64), - ("STORED_SYMBOL", 554i64), - ("STRAIGHT_JOIN_SYMBOL", 555i64), - ("STRING_SYMBOL", 556i64), - ("SUBCLASS_ORIGIN_SYMBOL", 557i64), - ("SUBDATE_SYMBOL", 558i64), - ("SUBJECT_SYMBOL", 559i64), - ("SUBPARTITIONS_SYMBOL", 560i64), - ("SUBPARTITION_SYMBOL", 561i64), - ("SUBSTR_SYMBOL", 562i64), - ("SUBSTRING_SYMBOL", 563i64), - ("SUM_SYMBOL", 564i64), - ("SUPER_SYMBOL", 565i64), - ("SUSPEND_SYMBOL", 566i64), - ("SWAPS_SYMBOL", 567i64), - ("SWITCHES_SYMBOL", 568i64), - ("SYSDATE_SYMBOL", 569i64), - ("SYSTEM_USER_SYMBOL", 570i64), - ("TABLES_SYMBOL", 571i64), - ("TABLESPACE_SYMBOL", 572i64), - ("TABLE_REF_PRIORITY_SYMBOL", 573i64), - ("TABLE_SYMBOL", 574i64), - ("TABLE_CHECKSUM_SYMBOL", 575i64), - ("TABLE_NAME_SYMBOL", 576i64), - ("TEMPORARY_SYMBOL", 577i64), - ("TEMPTABLE_SYMBOL", 578i64), - ("TERMINATED_SYMBOL", 579i64), - ("TEXT_SYMBOL", 580i64), - ("THAN_SYMBOL", 581i64), - ("THEN_SYMBOL", 582i64), - ("TIMESTAMP_SYMBOL", 583i64), - ("TIMESTAMP_ADD_SYMBOL", 584i64), - ("TIMESTAMP_DIFF_SYMBOL", 585i64), - ("TIME_SYMBOL", 586i64), - ("TINYBLOB_SYMBOL", 587i64), - ("TINYINT_SYMBOL", 588i64), - ("TINYTEXT_SYMBOL", 589i64), - ("TO_SYMBOL", 590i64), - ("TRAILING_SYMBOL", 591i64), - ("TRANSACTION_SYMBOL", 592i64), - ("TRIGGERS_SYMBOL", 593i64), - ("TRIGGER_SYMBOL", 594i64), - ("TRIM_SYMBOL", 595i64), - ("TRUE_SYMBOL", 596i64), - ("TRUNCATE_SYMBOL", 597i64), - ("TYPES_SYMBOL", 598i64), - ("TYPE_SYMBOL", 599i64), - ("UDF_RETURNS_SYMBOL", 600i64), - ("UNCOMMITTED_SYMBOL", 601i64), - ("UNDEFINED_SYMBOL", 602i64), - ("UNDOFILE_SYMBOL", 603i64), - ("UNDO_BUFFER_SIZE_SYMBOL", 604i64), - ("UNDO_SYMBOL", 605i64), - ("UNICODE_SYMBOL", 606i64), - ("UNINSTALL_SYMBOL", 607i64), - ("UNION_SYMBOL", 608i64), - ("UNIQUE_SYMBOL", 609i64), - ("UNKNOWN_SYMBOL", 610i64), - ("UNLOCK_SYMBOL", 611i64), - ("UNSIGNED_SYMBOL", 612i64), - ("UNTIL_SYMBOL", 613i64), - ("UPDATE_SYMBOL", 614i64), - ("UPGRADE_SYMBOL", 615i64), - ("USAGE_SYMBOL", 616i64), - ("USER_RESOURCES_SYMBOL", 617i64), - ("USER_SYMBOL", 618i64), - ("USE_FRM_SYMBOL", 619i64), - ("USE_SYMBOL", 620i64), - ("USING_SYMBOL", 621i64), - ("UTC_DATE_SYMBOL", 622i64), - ("UTC_TIMESTAMP_SYMBOL", 623i64), - ("UTC_TIME_SYMBOL", 624i64), - ("VALIDATION_SYMBOL", 625i64), - ("VALUES_SYMBOL", 626i64), - ("VALUE_SYMBOL", 627i64), - ("VARBINARY_SYMBOL", 628i64), - ("VARCHAR_SYMBOL", 629i64), - ("VARCHARACTER_SYMBOL", 630i64), - ("VARIABLES_SYMBOL", 631i64), - ("VARIANCE_SYMBOL", 632i64), - ("VARYING_SYMBOL", 633i64), - ("VAR_POP_SYMBOL", 634i64), - ("VAR_SAMP_SYMBOL", 635i64), - ("VIEW_SYMBOL", 636i64), - ("VIRTUAL_SYMBOL", 637i64), - ("WAIT_SYMBOL", 638i64), - ("WARNINGS_SYMBOL", 639i64), - ("WEEK_SYMBOL", 640i64), - ("WEIGHT_STRING_SYMBOL", 641i64), - ("WHEN_SYMBOL", 642i64), - ("WHERE_SYMBOL", 643i64), - ("WHILE_SYMBOL", 644i64), - ("WITH_SYMBOL", 645i64), - ("WITHOUT_SYMBOL", 646i64), - ("WORK_SYMBOL", 647i64), - ("WRAPPER_SYMBOL", 648i64), - ("WRITE_SYMBOL", 649i64), - ("X509_SYMBOL", 650i64), - ("XA_SYMBOL", 651i64), - ("XID_SYMBOL", 652i64), - ("XML_SYMBOL", 653i64), - ("XOR_SYMBOL", 654i64), - ("YEAR_MONTH_SYMBOL", 655i64), - ("YEAR_SYMBOL", 656i64), - ("ZEROFILL_SYMBOL", 657i64), - ("PERSIST_SYMBOL", 658i64), - ("ROLE_SYMBOL", 659i64), - ("ADMIN_SYMBOL", 660i64), - ("INVISIBLE_SYMBOL", 661i64), - ("VISIBLE_SYMBOL", 662i64), - ("EXCEPT_SYMBOL", 663i64), - ("COMPONENT_SYMBOL", 664i64), - ("RECURSIVE_SYMBOL", 665i64), - ("JSON_OBJECTAGG_SYMBOL", 666i64), - ("JSON_ARRAYAGG_SYMBOL", 667i64), - ("OF_SYMBOL", 668i64), - ("SKIP_SYMBOL", 669i64), - ("LOCKED_SYMBOL", 670i64), - ("NOWAIT_SYMBOL", 671i64), - ("GROUPING_SYMBOL", 672i64), - ("PERSIST_ONLY_SYMBOL", 673i64), - ("HISTOGRAM_SYMBOL", 674i64), - ("BUCKETS_SYMBOL", 675i64), - ("REMOTE_SYMBOL", 676i64), - ("CLONE_SYMBOL", 677i64), - ("CUME_DIST_SYMBOL", 678i64), - ("DENSE_RANK_SYMBOL", 679i64), - ("EXCLUDE_SYMBOL", 680i64), - ("FIRST_VALUE_SYMBOL", 681i64), - ("FOLLOWING_SYMBOL", 682i64), - ("GROUPS_SYMBOL", 683i64), - ("LAG_SYMBOL", 684i64), - ("LAST_VALUE_SYMBOL", 685i64), - ("LEAD_SYMBOL", 686i64), - ("NTH_VALUE_SYMBOL", 687i64), - ("NTILE_SYMBOL", 688i64), - ("NULLS_SYMBOL", 689i64), - ("OTHERS_SYMBOL", 690i64), - ("OVER_SYMBOL", 691i64), - ("PERCENT_RANK_SYMBOL", 692i64), - ("PRECEDING_SYMBOL", 693i64), - ("RANK_SYMBOL", 694i64), - ("RESPECT_SYMBOL", 695i64), - ("ROW_NUMBER_SYMBOL", 696i64), - ("TIES_SYMBOL", 697i64), - ("UNBOUNDED_SYMBOL", 698i64), - ("WINDOW_SYMBOL", 699i64), - ("EMPTY_SYMBOL", 700i64), - ("JSON_TABLE_SYMBOL", 701i64), - ("NESTED_SYMBOL", 702i64), - ("ORDINALITY_SYMBOL", 703i64), - ("PATH_SYMBOL", 704i64), - ("HISTORY_SYMBOL", 705i64), - ("REUSE_SYMBOL", 706i64), - ("SRID_SYMBOL", 707i64), - ("THREAD_PRIORITY_SYMBOL", 708i64), - ("RESOURCE_SYMBOL", 709i64), - ("SYSTEM_SYMBOL", 710i64), - ("VCPU_SYMBOL", 711i64), - ("MASTER_PUBLIC_KEY_PATH_SYMBOL", 712i64), - ("GET_MASTER_PUBLIC_KEY_SYMBOL", 713i64), - ("RESTART_SYMBOL", 714i64), - ("DEFINITION_SYMBOL", 715i64), - ("DESCRIPTION_SYMBOL", 716i64), - ("ORGANIZATION_SYMBOL", 717i64), - ("REFERENCE_SYMBOL", 718i64), - ("OPTIONAL_SYMBOL", 719i64), - ("SECONDARY_SYMBOL", 720i64), - ("SECONDARY_ENGINE_SYMBOL", 721i64), - ("SECONDARY_LOAD_SYMBOL", 722i64), - ("SECONDARY_UNLOAD_SYMBOL", 723i64), - ("ACTIVE_SYMBOL", 724i64), - ("INACTIVE_SYMBOL", 725i64), - ("LATERAL_SYMBOL", 726i64), - ("RETAIN_SYMBOL", 727i64), - ("OLD_SYMBOL", 728i64), - ("NETWORK_NAMESPACE_SYMBOL", 729i64), - ("ENFORCED_SYMBOL", 730i64), - ("ARRAY_SYMBOL", 731i64), - ("OJ_SYMBOL", 732i64), - ("MEMBER_SYMBOL", 733i64), - ("RANDOM_SYMBOL", 734i64), - ("MASTER_COMPRESSION_ALGORITHM_SYMBOL", 735i64), - ("MASTER_ZSTD_COMPRESSION_LEVEL_SYMBOL", 736i64), - ("PRIVILEGE_CHECKS_USER_SYMBOL", 737i64), - ("MASTER_TLS_CIPHERSUITES_SYMBOL", 738i64), - ("REQUIRE_ROW_FORMAT_SYMBOL", 739i64), - ("PASSWORD_LOCK_TIME_SYMBOL", 740i64), - ("FAILED_LOGIN_ATTEMPTS_SYMBOL", 741i64), - ("REQUIRE_TABLE_PRIMARY_KEY_CHECK_SYMBOL", 742i64), - ("STREAM_SYMBOL", 743i64), - ("OFF_SYMBOL", 744i64), - ("AT_AT_SIGN_SYMBOL", 745i64), - ("AT_SIGN_SYMBOL", 746i64), - ("CLOSE_CURLY_SYMBOL", 747i64), - ("CLOSE_PAR_SYMBOL", 748i64), - ("COLON_SYMBOL", 749i64), - ("COMMA_SYMBOL", 750i64), - ("DOT_SYMBOL", 751i64), - ("OPEN_CURLY_SYMBOL", 752i64), - ("OPEN_PAR_SYMBOL", 753i64), - ("PARAM_MARKER", 754i64), - ("SEMICOLON_SYMBOL", 755i64), - ("ASSIGN_OPERATOR", 756i64), - ("BITWISE_AND_OPERATOR", 757i64), - ("BITWISE_NOT_OPERATOR", 758i64), - ("BITWISE_OR_OPERATOR", 759i64), - ("BITWISE_XOR_OPERATOR", 760i64), - ("CONCAT_PIPES_SYMBOL", 761i64), - ("DIV_OPERATOR", 762i64), - ("EQUAL_OPERATOR", 763i64), - ("GREATER_OR_EQUAL_OPERATOR", 764i64), - ("GREATER_THAN_OPERATOR", 765i64), - ("JSON_SEPARATOR_SYMBOL", 766i64), - ("JSON_UNQUOTED_SEPARATOR_SYMBOL", 767i64), - ("LESS_OR_EQUAL_OPERATOR", 768i64), - ("LESS_THAN_OPERATOR", 769i64), - ("LOGICAL_AND_OPERATOR", 770i64), - ("LOGICAL_NOT_OPERATOR", 771i64), - ("LOGICAL_OR_OPERATOR", 772i64), - ("MINUS_OPERATOR", 773i64), - ("MOD_OPERATOR", 774i64), - ("MULT_OPERATOR", 775i64), - ("NOT_EQUAL_OPERATOR", 776i64), - ("NULL_SAFE_EQUAL_OPERATOR", 777i64), - ("PLUS_OPERATOR", 778i64), - ("SHIFT_LEFT_OPERATOR", 779i64), - ("SHIFT_RIGHT_OPERATOR", 780i64), - ("BACK_TICK_QUOTED_ID", 781i64), - ("BIN_NUMBER", 782i64), - ("DECIMAL_NUMBER", 783i64), - ("DOUBLE_QUOTED_TEXT", 784i64), - ("FLOAT_NUMBER", 785i64), - ("HEX_NUMBER", 786i64), - ("INT_NUMBER", 787i64), - ("LONG_NUMBER", 788i64), - ("NCHAR_TEXT", 789i64), - ("SINGLE_QUOTED_TEXT", 790i64), - ("ULONGLONG_NUMBER", 791i64), - ("AT_TEXT_SUFFIX", 792i64), - ("IDENTIFIER", 793i64), - ("UNDERSCORE_CHARSET", 794i64), - ("INT1_SYMBOL", 795i64), - ("INT2_SYMBOL", 796i64), - ("INT3_SYMBOL", 797i64), - ("INT4_SYMBOL", 798i64), - ("INT8_SYMBOL", 799i64), - ("NOT2_SYMBOL", 800i64), - ("NULL2_SYMBOL", 801i64), - ("SQL_TSI_DAY_SYMBOL", 802i64), - ("SQL_TSI_HOUR_SYMBOL", 803i64), - ("SQL_TSI_MICROSECOND_SYMBOL", 804i64), - ("SQL_TSI_MINUTE_SYMBOL", 805i64), - ("SQL_TSI_MONTH_SYMBOL", 806i64), - ("SQL_TSI_QUARTER_SYMBOL", 807i64), - ("SQL_TSI_SECOND_SYMBOL", 808i64), - ("SQL_TSI_WEEK_SYMBOL", 809i64), - ("SQL_TSI_YEAR_SYMBOL", 810i64), - ("INTERSECT_SYMBOL", 811i64), - ("ATTRIBUTE_SYMBOL", 812i64), - ("SOURCE_AUTO_POSITION_SYMBOL", 813i64), - ("SOURCE_BIND_SYMBOL", 814i64), - ("SOURCE_COMPRESSION_ALGORITHM_SYMBOL", 815i64), - ("SOURCE_CONNECT_RETRY_SYMBOL", 816i64), - ("SOURCE_CONNECTION_AUTO_FAILOVER_SYMBOL", 817i64), - ("SOURCE_DELAY_SYMBOL", 818i64), - ("SOURCE_HEARTBEAT_PERIOD_SYMBOL", 819i64), - ("SOURCE_HOST_SYMBOL", 820i64), - ("SOURCE_LOG_FILE_SYMBOL", 821i64), - ("SOURCE_LOG_POS_SYMBOL", 822i64), - ("SOURCE_PASSWORD_SYMBOL", 823i64), - ("SOURCE_PORT_SYMBOL", 824i64), - ("SOURCE_PUBLIC_KEY_PATH_SYMBOL", 825i64), - ("SOURCE_RETRY_COUNT_SYMBOL", 826i64), - ("SOURCE_SSL_SYMBOL", 827i64), - ("SOURCE_SSL_CA_SYMBOL", 828i64), - ("SOURCE_SSL_CAPATH_SYMBOL", 829i64), - ("SOURCE_SSL_CERT_SYMBOL", 830i64), - ("SOURCE_SSL_CIPHER_SYMBOL", 831i64), - ("SOURCE_SSL_CRL_SYMBOL", 832i64), - ("SOURCE_SSL_CRLPATH_SYMBOL", 833i64), - ("SOURCE_SSL_KEY_SYMBOL", 834i64), - ("SOURCE_SSL_VERIFY_SERVER_CERT_SYMBOL", 835i64), - ("SOURCE_TLS_CIPHERSUITES_SYMBOL", 836i64), - ("SOURCE_TLS_VERSION_SYMBOL", 837i64), - ("SOURCE_USER_SYMBOL", 838i64), - ("SOURCE_ZSTD_COMPRESSION_LEVEL_SYMBOL", 839i64), - ("GET_SOURCE_PUBLIC_KEY_SYMBOL", 840i64), - ("GTID_ONLY_SYMBOL", 841i64), - ("ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_SYMBOL", 842i64), - ("ZONE_SYMBOL", 843i64), - ("INNODB_SYMBOL", 844i64), - ("TLS_SYMBOL", 845i64), - ("REDO_LOG_SYMBOL", 846i64), - ("KEYRING_SYMBOL", 847i64), - ("ENGINE_ATTRIBUTE_SYMBOL", 848i64), - ("SECONDARY_ENGINE_ATTRIBUTE_SYMBOL", 849i64), - ("JSON_VALUE_SYMBOL", 850i64), - ("RETURNING_SYMBOL", 851i64), - ("GEOMCOLLECTION_SYMBOL", 852i64), - ("COMMENT", 900i64), - ("MYSQL_COMMENT_START", 901i64), - ("MYSQL_COMMENT_END", 902i64), - ("WHITESPACE", 0i64), - ("EOF", -1i64), -]; - -pub const SQL_MODE_HIGH_NOT_PRECEDENCE: i64 = 1i64; -pub const SQL_MODE_PIPES_AS_CONCAT: i64 = 2i64; -pub const SQL_MODE_IGNORE_SPACE: i64 = 4i64; -pub const SQL_MODE_NO_BACKSLASH_ESCAPES: i64 = 8i64; -pub const SQL_MODE_ANSI_QUOTES: i64 = 16i64; -pub const WHITESPACE_MASK: &str = " \t\n\r\x0c\x0b"; -pub const DIGIT_MASK: &str = "0123456789"; -pub const HEX_DIGIT_MASK: &str = "0123456789abcdefABCDEF"; -pub const ACCESSIBLE_SYMBOL: i64 = 1i64; -pub const ACCOUNT_SYMBOL: i64 = 2i64; -pub const ACTION_SYMBOL: i64 = 3i64; -pub const ADD_SYMBOL: i64 = 4i64; -pub const ADDDATE_SYMBOL: i64 = 5i64; -pub const AFTER_SYMBOL: i64 = 6i64; -pub const AGAINST_SYMBOL: i64 = 7i64; -pub const AGGREGATE_SYMBOL: i64 = 8i64; -pub const ALGORITHM_SYMBOL: i64 = 9i64; -pub const ALL_SYMBOL: i64 = 10i64; -pub const ALTER_SYMBOL: i64 = 11i64; -pub const ALWAYS_SYMBOL: i64 = 12i64; -pub const ANALYSE_SYMBOL: i64 = 13i64; -pub const ANALYZE_SYMBOL: i64 = 14i64; -pub const AND_SYMBOL: i64 = 15i64; -pub const ANY_SYMBOL: i64 = 16i64; -pub const AS_SYMBOL: i64 = 17i64; -pub const ASC_SYMBOL: i64 = 18i64; -pub const ASCII_SYMBOL: i64 = 19i64; -pub const ASENSITIVE_SYMBOL: i64 = 20i64; -pub const AT_SYMBOL: i64 = 21i64; -pub const AUTHORS_SYMBOL: i64 = 22i64; -pub const AUTOEXTEND_SIZE_SYMBOL: i64 = 23i64; -pub const AUTO_INCREMENT_SYMBOL: i64 = 24i64; -pub const AVG_ROW_LENGTH_SYMBOL: i64 = 25i64; -pub const AVG_SYMBOL: i64 = 26i64; -pub const BACKUP_SYMBOL: i64 = 27i64; -pub const BEFORE_SYMBOL: i64 = 28i64; -pub const BEGIN_SYMBOL: i64 = 29i64; -pub const BETWEEN_SYMBOL: i64 = 30i64; -pub const BIGINT_SYMBOL: i64 = 31i64; -pub const BINARY_SYMBOL: i64 = 32i64; -pub const BINLOG_SYMBOL: i64 = 33i64; -pub const BIN_NUM_SYMBOL: i64 = 34i64; -pub const BIT_AND_SYMBOL: i64 = 35i64; -pub const BIT_OR_SYMBOL: i64 = 36i64; -pub const BIT_SYMBOL: i64 = 37i64; -pub const BIT_XOR_SYMBOL: i64 = 38i64; -pub const BLOB_SYMBOL: i64 = 39i64; -pub const BLOCK_SYMBOL: i64 = 40i64; -pub const BOOLEAN_SYMBOL: i64 = 41i64; -pub const BOOL_SYMBOL: i64 = 42i64; -pub const BOTH_SYMBOL: i64 = 43i64; -pub const BTREE_SYMBOL: i64 = 44i64; -pub const BY_SYMBOL: i64 = 45i64; -pub const BYTE_SYMBOL: i64 = 46i64; -pub const CACHE_SYMBOL: i64 = 47i64; -pub const CALL_SYMBOL: i64 = 48i64; -pub const CASCADE_SYMBOL: i64 = 49i64; -pub const CASCADED_SYMBOL: i64 = 50i64; -pub const CASE_SYMBOL: i64 = 51i64; -pub const CAST_SYMBOL: i64 = 52i64; -pub const CATALOG_NAME_SYMBOL: i64 = 53i64; -pub const CHAIN_SYMBOL: i64 = 54i64; -pub const CHANGE_SYMBOL: i64 = 55i64; -pub const CHANGED_SYMBOL: i64 = 56i64; -pub const CHANNEL_SYMBOL: i64 = 57i64; -pub const CHARSET_SYMBOL: i64 = 58i64; -pub const CHARACTER_SYMBOL: i64 = 59i64; -pub const CHAR_SYMBOL: i64 = 60i64; -pub const CHECKSUM_SYMBOL: i64 = 61i64; -pub const CHECK_SYMBOL: i64 = 62i64; -pub const CIPHER_SYMBOL: i64 = 63i64; -pub const CLASS_ORIGIN_SYMBOL: i64 = 64i64; -pub const CLIENT_SYMBOL: i64 = 65i64; -pub const CLOSE_SYMBOL: i64 = 66i64; -pub const COALESCE_SYMBOL: i64 = 67i64; -pub const CODE_SYMBOL: i64 = 68i64; -pub const COLLATE_SYMBOL: i64 = 69i64; -pub const COLLATION_SYMBOL: i64 = 70i64; -pub const COLUMNS_SYMBOL: i64 = 71i64; -pub const COLUMN_SYMBOL: i64 = 72i64; -pub const COLUMN_NAME_SYMBOL: i64 = 73i64; -pub const COLUMN_FORMAT_SYMBOL: i64 = 74i64; -pub const COMMENT_SYMBOL: i64 = 75i64; -pub const COMMITTED_SYMBOL: i64 = 76i64; -pub const COMMIT_SYMBOL: i64 = 77i64; -pub const COMPACT_SYMBOL: i64 = 78i64; -pub const COMPLETION_SYMBOL: i64 = 79i64; -pub const COMPRESSED_SYMBOL: i64 = 80i64; -pub const COMPRESSION_SYMBOL: i64 = 81i64; -pub const CONCURRENT_SYMBOL: i64 = 82i64; -pub const CONDITION_SYMBOL: i64 = 83i64; -pub const CONNECTION_SYMBOL: i64 = 84i64; -pub const CONSISTENT_SYMBOL: i64 = 85i64; -pub const CONSTRAINT_SYMBOL: i64 = 86i64; -pub const CONSTRAINT_CATALOG_SYMBOL: i64 = 87i64; -pub const CONSTRAINT_NAME_SYMBOL: i64 = 88i64; -pub const CONSTRAINT_SCHEMA_SYMBOL: i64 = 89i64; -pub const CONTAINS_SYMBOL: i64 = 90i64; -pub const CONTEXT_SYMBOL: i64 = 91i64; -pub const CONTINUE_SYMBOL: i64 = 92i64; -pub const CONTRIBUTORS_SYMBOL: i64 = 93i64; -pub const CONVERT_SYMBOL: i64 = 94i64; -pub const COUNT_SYMBOL: i64 = 95i64; -pub const CPU_SYMBOL: i64 = 96i64; -pub const CREATE_SYMBOL: i64 = 97i64; -pub const CROSS_SYMBOL: i64 = 98i64; -pub const CUBE_SYMBOL: i64 = 99i64; -pub const CURDATE_SYMBOL: i64 = 100i64; -pub const CURRENT_SYMBOL: i64 = 101i64; -pub const CURRENT_DATE_SYMBOL: i64 = 102i64; -pub const CURRENT_TIME_SYMBOL: i64 = 103i64; -pub const CURRENT_TIMESTAMP_SYMBOL: i64 = 104i64; -pub const CURRENT_USER_SYMBOL: i64 = 105i64; -pub const CURSOR_SYMBOL: i64 = 106i64; -pub const CURSOR_NAME_SYMBOL: i64 = 107i64; -pub const CURTIME_SYMBOL: i64 = 108i64; -pub const DATABASE_SYMBOL: i64 = 109i64; -pub const DATABASES_SYMBOL: i64 = 110i64; -pub const DATAFILE_SYMBOL: i64 = 111i64; -pub const DATA_SYMBOL: i64 = 112i64; -pub const DATETIME_SYMBOL: i64 = 113i64; -pub const DATE_ADD_SYMBOL: i64 = 114i64; -pub const DATE_SUB_SYMBOL: i64 = 115i64; -pub const DATE_SYMBOL: i64 = 116i64; -pub const DAYOFMONTH_SYMBOL: i64 = 117i64; -pub const DAY_HOUR_SYMBOL: i64 = 118i64; -pub const DAY_MICROSECOND_SYMBOL: i64 = 119i64; -pub const DAY_MINUTE_SYMBOL: i64 = 120i64; -pub const DAY_SECOND_SYMBOL: i64 = 121i64; -pub const DAY_SYMBOL: i64 = 122i64; -pub const DEALLOCATE_SYMBOL: i64 = 123i64; -pub const DEC_SYMBOL: i64 = 124i64; -pub const DECIMAL_NUM_SYMBOL: i64 = 125i64; -pub const DECIMAL_SYMBOL: i64 = 126i64; -pub const DECLARE_SYMBOL: i64 = 127i64; -pub const DEFAULT_SYMBOL: i64 = 128i64; -pub const DEFAULT_AUTH_SYMBOL: i64 = 129i64; -pub const DEFINER_SYMBOL: i64 = 130i64; -pub const DELAYED_SYMBOL: i64 = 131i64; -pub const DELAY_KEY_WRITE_SYMBOL: i64 = 132i64; -pub const DELETE_SYMBOL: i64 = 133i64; -pub const DESC_SYMBOL: i64 = 134i64; -pub const DESCRIBE_SYMBOL: i64 = 135i64; -pub const DES_KEY_FILE_SYMBOL: i64 = 136i64; -pub const DETERMINISTIC_SYMBOL: i64 = 137i64; -pub const DIAGNOSTICS_SYMBOL: i64 = 138i64; -pub const DIRECTORY_SYMBOL: i64 = 139i64; -pub const DISABLE_SYMBOL: i64 = 140i64; -pub const DISCARD_SYMBOL: i64 = 141i64; -pub const DISK_SYMBOL: i64 = 142i64; -pub const DISTINCT_SYMBOL: i64 = 143i64; -pub const DISTINCTROW_SYMBOL: i64 = 144i64; -pub const DIV_SYMBOL: i64 = 145i64; -pub const DOUBLE_SYMBOL: i64 = 146i64; -pub const DO_SYMBOL: i64 = 147i64; -pub const DROP_SYMBOL: i64 = 148i64; -pub const DUAL_SYMBOL: i64 = 149i64; -pub const DUMPFILE_SYMBOL: i64 = 150i64; -pub const DUPLICATE_SYMBOL: i64 = 151i64; -pub const DYNAMIC_SYMBOL: i64 = 152i64; -pub const EACH_SYMBOL: i64 = 153i64; -pub const ELSE_SYMBOL: i64 = 154i64; -pub const ELSEIF_SYMBOL: i64 = 155i64; -pub const ENABLE_SYMBOL: i64 = 156i64; -pub const ENCLOSED_SYMBOL: i64 = 157i64; -pub const ENCRYPTION_SYMBOL: i64 = 158i64; -pub const END_SYMBOL: i64 = 159i64; -pub const ENDS_SYMBOL: i64 = 160i64; -pub const END_OF_INPUT_SYMBOL: i64 = 161i64; -pub const ENGINES_SYMBOL: i64 = 162i64; -pub const ENGINE_SYMBOL: i64 = 163i64; -pub const ENUM_SYMBOL: i64 = 164i64; -pub const ERROR_SYMBOL: i64 = 165i64; -pub const ERRORS_SYMBOL: i64 = 166i64; -pub const ESCAPED_SYMBOL: i64 = 167i64; -pub const ESCAPE_SYMBOL: i64 = 168i64; -pub const EVENTS_SYMBOL: i64 = 169i64; -pub const EVENT_SYMBOL: i64 = 170i64; -pub const EVERY_SYMBOL: i64 = 171i64; -pub const EXCHANGE_SYMBOL: i64 = 172i64; -pub const EXECUTE_SYMBOL: i64 = 173i64; -pub const EXISTS_SYMBOL: i64 = 174i64; -pub const EXIT_SYMBOL: i64 = 175i64; -pub const EXPANSION_SYMBOL: i64 = 176i64; -pub const EXPIRE_SYMBOL: i64 = 177i64; -pub const EXPLAIN_SYMBOL: i64 = 178i64; -pub const EXPORT_SYMBOL: i64 = 179i64; -pub const EXTENDED_SYMBOL: i64 = 180i64; -pub const EXTENT_SIZE_SYMBOL: i64 = 181i64; -pub const EXTRACT_SYMBOL: i64 = 182i64; -pub const FALSE_SYMBOL: i64 = 183i64; -pub const FAST_SYMBOL: i64 = 184i64; -pub const FAULTS_SYMBOL: i64 = 185i64; -pub const FETCH_SYMBOL: i64 = 186i64; -pub const FIELDS_SYMBOL: i64 = 187i64; -pub const FILE_SYMBOL: i64 = 188i64; -pub const FILE_BLOCK_SIZE_SYMBOL: i64 = 189i64; -pub const FILTER_SYMBOL: i64 = 190i64; -pub const FIRST_SYMBOL: i64 = 191i64; -pub const FIXED_SYMBOL: i64 = 192i64; -pub const FLOAT4_SYMBOL: i64 = 193i64; -pub const FLOAT8_SYMBOL: i64 = 194i64; -pub const FLOAT_SYMBOL: i64 = 195i64; -pub const FLUSH_SYMBOL: i64 = 196i64; -pub const FOLLOWS_SYMBOL: i64 = 197i64; -pub const FORCE_SYMBOL: i64 = 198i64; -pub const FOREIGN_SYMBOL: i64 = 199i64; -pub const FOR_SYMBOL: i64 = 200i64; -pub const FORMAT_SYMBOL: i64 = 201i64; -pub const FOUND_SYMBOL: i64 = 202i64; -pub const FROM_SYMBOL: i64 = 203i64; -pub const FULL_SYMBOL: i64 = 204i64; -pub const FULLTEXT_SYMBOL: i64 = 205i64; -pub const FUNCTION_SYMBOL: i64 = 206i64; -pub const GET_SYMBOL: i64 = 207i64; -pub const GENERAL_SYMBOL: i64 = 208i64; -pub const GENERATED_SYMBOL: i64 = 209i64; -pub const GROUP_REPLICATION_SYMBOL: i64 = 210i64; -pub const GEOMETRYCOLLECTION_SYMBOL: i64 = 211i64; -pub const GEOMETRY_SYMBOL: i64 = 212i64; -pub const GET_FORMAT_SYMBOL: i64 = 213i64; -pub const GLOBAL_SYMBOL: i64 = 214i64; -pub const GRANT_SYMBOL: i64 = 215i64; -pub const GRANTS_SYMBOL: i64 = 216i64; -pub const GROUP_SYMBOL: i64 = 217i64; -pub const GROUP_CONCAT_SYMBOL: i64 = 218i64; -pub const HANDLER_SYMBOL: i64 = 219i64; -pub const HASH_SYMBOL: i64 = 220i64; -pub const HAVING_SYMBOL: i64 = 221i64; -pub const HELP_SYMBOL: i64 = 222i64; -pub const HIGH_PRIORITY_SYMBOL: i64 = 223i64; -pub const HOST_SYMBOL: i64 = 224i64; -pub const HOSTS_SYMBOL: i64 = 225i64; -pub const HOUR_MICROSECOND_SYMBOL: i64 = 226i64; -pub const HOUR_MINUTE_SYMBOL: i64 = 227i64; -pub const HOUR_SECOND_SYMBOL: i64 = 228i64; -pub const HOUR_SYMBOL: i64 = 229i64; -pub const IDENTIFIED_SYMBOL: i64 = 230i64; -pub const IF_SYMBOL: i64 = 231i64; -pub const IGNORE_SYMBOL: i64 = 232i64; -pub const IGNORE_SERVER_IDS_SYMBOL: i64 = 233i64; -pub const IMPORT_SYMBOL: i64 = 234i64; -pub const INDEXES_SYMBOL: i64 = 235i64; -pub const INDEX_SYMBOL: i64 = 236i64; -pub const INFILE_SYMBOL: i64 = 237i64; -pub const INITIAL_SIZE_SYMBOL: i64 = 238i64; -pub const INNER_SYMBOL: i64 = 239i64; -pub const INOUT_SYMBOL: i64 = 240i64; -pub const INSENSITIVE_SYMBOL: i64 = 241i64; -pub const INSERT_SYMBOL: i64 = 242i64; -pub const INSERT_METHOD_SYMBOL: i64 = 243i64; -pub const INSTANCE_SYMBOL: i64 = 244i64; -pub const INSTALL_SYMBOL: i64 = 245i64; -pub const INTEGER_SYMBOL: i64 = 246i64; -pub const INTERVAL_SYMBOL: i64 = 247i64; -pub const INTO_SYMBOL: i64 = 248i64; -pub const INT_SYMBOL: i64 = 249i64; -pub const INVOKER_SYMBOL: i64 = 250i64; -pub const IN_SYMBOL: i64 = 251i64; -pub const IO_AFTER_GTIDS_SYMBOL: i64 = 252i64; -pub const IO_BEFORE_GTIDS_SYMBOL: i64 = 253i64; -pub const IO_THREAD_SYMBOL: i64 = 254i64; -pub const IO_SYMBOL: i64 = 255i64; -pub const IPC_SYMBOL: i64 = 256i64; -pub const IS_SYMBOL: i64 = 257i64; -pub const ISOLATION_SYMBOL: i64 = 258i64; -pub const ISSUER_SYMBOL: i64 = 259i64; -pub const ITERATE_SYMBOL: i64 = 260i64; -pub const JOIN_SYMBOL: i64 = 261i64; -pub const JSON_SYMBOL: i64 = 262i64; -pub const KEYS_SYMBOL: i64 = 263i64; -pub const KEY_BLOCK_SIZE_SYMBOL: i64 = 264i64; -pub const KEY_SYMBOL: i64 = 265i64; -pub const KILL_SYMBOL: i64 = 266i64; -pub const LANGUAGE_SYMBOL: i64 = 267i64; -pub const LAST_SYMBOL: i64 = 268i64; -pub const LEADING_SYMBOL: i64 = 269i64; -pub const LEAVES_SYMBOL: i64 = 270i64; -pub const LEAVE_SYMBOL: i64 = 271i64; -pub const LEFT_SYMBOL: i64 = 272i64; -pub const LESS_SYMBOL: i64 = 273i64; -pub const LEVEL_SYMBOL: i64 = 274i64; -pub const LIKE_SYMBOL: i64 = 275i64; -pub const LIMIT_SYMBOL: i64 = 276i64; -pub const LINEAR_SYMBOL: i64 = 277i64; -pub const LINES_SYMBOL: i64 = 278i64; -pub const LINESTRING_SYMBOL: i64 = 279i64; -pub const LIST_SYMBOL: i64 = 280i64; -pub const LOAD_SYMBOL: i64 = 281i64; -pub const LOCALTIME_SYMBOL: i64 = 282i64; -pub const LOCALTIMESTAMP_SYMBOL: i64 = 283i64; -pub const LOCAL_SYMBOL: i64 = 284i64; -pub const LOCATOR_SYMBOL: i64 = 285i64; -pub const LOCKS_SYMBOL: i64 = 286i64; -pub const LOCK_SYMBOL: i64 = 287i64; -pub const LOGFILE_SYMBOL: i64 = 288i64; -pub const LOGS_SYMBOL: i64 = 289i64; -pub const LONGBLOB_SYMBOL: i64 = 290i64; -pub const LONGTEXT_SYMBOL: i64 = 291i64; -pub const LONG_NUM_SYMBOL: i64 = 292i64; -pub const LONG_SYMBOL: i64 = 293i64; -pub const LOOP_SYMBOL: i64 = 294i64; -pub const LOW_PRIORITY_SYMBOL: i64 = 295i64; -pub const MASTER_AUTO_POSITION_SYMBOL: i64 = 296i64; -pub const MASTER_BIND_SYMBOL: i64 = 297i64; -pub const MASTER_CONNECT_RETRY_SYMBOL: i64 = 298i64; -pub const MASTER_DELAY_SYMBOL: i64 = 299i64; -pub const MASTER_HOST_SYMBOL: i64 = 300i64; -pub const MASTER_LOG_FILE_SYMBOL: i64 = 301i64; -pub const MASTER_LOG_POS_SYMBOL: i64 = 302i64; -pub const MASTER_PASSWORD_SYMBOL: i64 = 303i64; -pub const MASTER_PORT_SYMBOL: i64 = 304i64; -pub const MASTER_RETRY_COUNT_SYMBOL: i64 = 305i64; -pub const MASTER_SERVER_ID_SYMBOL: i64 = 306i64; -pub const MASTER_SSL_CAPATH_SYMBOL: i64 = 307i64; -pub const MASTER_SSL_CA_SYMBOL: i64 = 308i64; -pub const MASTER_SSL_CERT_SYMBOL: i64 = 309i64; -pub const MASTER_SSL_CIPHER_SYMBOL: i64 = 310i64; -pub const MASTER_SSL_CRL_SYMBOL: i64 = 311i64; -pub const MASTER_SSL_CRLPATH_SYMBOL: i64 = 312i64; -pub const MASTER_SSL_KEY_SYMBOL: i64 = 313i64; -pub const MASTER_SSL_SYMBOL: i64 = 314i64; -pub const MASTER_SSL_VERIFY_SERVER_CERT_SYMBOL: i64 = 315i64; -pub const MASTER_SYMBOL: i64 = 316i64; -pub const MASTER_TLS_VERSION_SYMBOL: i64 = 317i64; -pub const MASTER_USER_SYMBOL: i64 = 318i64; -pub const MASTER_HEARTBEAT_PERIOD_SYMBOL: i64 = 319i64; -pub const MATCH_SYMBOL: i64 = 320i64; -pub const MAX_CONNECTIONS_PER_HOUR_SYMBOL: i64 = 321i64; -pub const MAX_QUERIES_PER_HOUR_SYMBOL: i64 = 322i64; -pub const MAX_ROWS_SYMBOL: i64 = 323i64; -pub const MAX_SIZE_SYMBOL: i64 = 324i64; -pub const MAX_STATEMENT_TIME_SYMBOL: i64 = 325i64; -pub const MAX_SYMBOL: i64 = 326i64; -pub const MAX_UPDATES_PER_HOUR_SYMBOL: i64 = 327i64; -pub const MAX_USER_CONNECTIONS_SYMBOL: i64 = 328i64; -pub const MAXVALUE_SYMBOL: i64 = 329i64; -pub const MEDIUMBLOB_SYMBOL: i64 = 330i64; -pub const MEDIUMINT_SYMBOL: i64 = 331i64; -pub const MEDIUMTEXT_SYMBOL: i64 = 332i64; -pub const MEDIUM_SYMBOL: i64 = 333i64; -pub const MEMORY_SYMBOL: i64 = 334i64; -pub const MERGE_SYMBOL: i64 = 335i64; -pub const MESSAGE_TEXT_SYMBOL: i64 = 336i64; -pub const MICROSECOND_SYMBOL: i64 = 337i64; -pub const MID_SYMBOL: i64 = 338i64; -pub const MIDDLEINT_SYMBOL: i64 = 339i64; -pub const MIGRATE_SYMBOL: i64 = 340i64; -pub const MINUTE_MICROSECOND_SYMBOL: i64 = 341i64; -pub const MINUTE_SECOND_SYMBOL: i64 = 342i64; -pub const MINUTE_SYMBOL: i64 = 343i64; -pub const MIN_ROWS_SYMBOL: i64 = 344i64; -pub const MIN_SYMBOL: i64 = 345i64; -pub const MODE_SYMBOL: i64 = 346i64; -pub const MODIFIES_SYMBOL: i64 = 347i64; -pub const MODIFY_SYMBOL: i64 = 348i64; -pub const MOD_SYMBOL: i64 = 349i64; -pub const MONTH_SYMBOL: i64 = 350i64; -pub const MULTILINESTRING_SYMBOL: i64 = 351i64; -pub const MULTIPOINT_SYMBOL: i64 = 352i64; -pub const MULTIPOLYGON_SYMBOL: i64 = 353i64; -pub const MUTEX_SYMBOL: i64 = 354i64; -pub const MYSQL_ERRNO_SYMBOL: i64 = 355i64; -pub const NAMES_SYMBOL: i64 = 356i64; -pub const NAME_SYMBOL: i64 = 357i64; -pub const NATIONAL_SYMBOL: i64 = 358i64; -pub const NATURAL_SYMBOL: i64 = 359i64; -pub const NCHAR_STRING_SYMBOL: i64 = 360i64; -pub const NCHAR_SYMBOL: i64 = 361i64; -pub const NDB_SYMBOL: i64 = 362i64; -pub const NDBCLUSTER_SYMBOL: i64 = 363i64; -pub const NEG_SYMBOL: i64 = 364i64; -pub const NEVER_SYMBOL: i64 = 365i64; -pub const NEW_SYMBOL: i64 = 366i64; -pub const NEXT_SYMBOL: i64 = 367i64; -pub const NODEGROUP_SYMBOL: i64 = 368i64; -pub const NONE_SYMBOL: i64 = 369i64; -pub const NONBLOCKING_SYMBOL: i64 = 370i64; -pub const NOT_SYMBOL: i64 = 371i64; -pub const NOW_SYMBOL: i64 = 372i64; -pub const NO_SYMBOL: i64 = 373i64; -pub const NO_WAIT_SYMBOL: i64 = 374i64; -pub const NO_WRITE_TO_BINLOG_SYMBOL: i64 = 375i64; -pub const NULL_SYMBOL: i64 = 376i64; -pub const NUMBER_SYMBOL: i64 = 377i64; -pub const NUMERIC_SYMBOL: i64 = 378i64; -pub const NVARCHAR_SYMBOL: i64 = 379i64; -pub const OFFLINE_SYMBOL: i64 = 380i64; -pub const OFFSET_SYMBOL: i64 = 381i64; -pub const OLD_PASSWORD_SYMBOL: i64 = 382i64; -pub const ON_SYMBOL: i64 = 383i64; -pub const ONE_SYMBOL: i64 = 384i64; -pub const ONLINE_SYMBOL: i64 = 385i64; -pub const ONLY_SYMBOL: i64 = 386i64; -pub const OPEN_SYMBOL: i64 = 387i64; -pub const OPTIMIZE_SYMBOL: i64 = 388i64; -pub const OPTIMIZER_COSTS_SYMBOL: i64 = 389i64; -pub const OPTIONS_SYMBOL: i64 = 390i64; -pub const OPTION_SYMBOL: i64 = 391i64; -pub const OPTIONALLY_SYMBOL: i64 = 392i64; -pub const ORDER_SYMBOL: i64 = 393i64; -pub const OR_SYMBOL: i64 = 394i64; -pub const OUTER_SYMBOL: i64 = 395i64; -pub const OUTFILE_SYMBOL: i64 = 396i64; -pub const OUT_SYMBOL: i64 = 397i64; -pub const OWNER_SYMBOL: i64 = 398i64; -pub const PACK_KEYS_SYMBOL: i64 = 399i64; -pub const PAGE_SYMBOL: i64 = 400i64; -pub const PARSER_SYMBOL: i64 = 401i64; -pub const PARTIAL_SYMBOL: i64 = 402i64; -pub const PARTITIONING_SYMBOL: i64 = 403i64; -pub const PARTITIONS_SYMBOL: i64 = 404i64; -pub const PARTITION_SYMBOL: i64 = 405i64; -pub const PASSWORD_SYMBOL: i64 = 406i64; -pub const PHASE_SYMBOL: i64 = 407i64; -pub const PLUGINS_SYMBOL: i64 = 408i64; -pub const PLUGIN_DIR_SYMBOL: i64 = 409i64; -pub const PLUGIN_SYMBOL: i64 = 410i64; -pub const POINT_SYMBOL: i64 = 411i64; -pub const POLYGON_SYMBOL: i64 = 412i64; -pub const PORT_SYMBOL: i64 = 413i64; -pub const POSITION_SYMBOL: i64 = 414i64; -pub const PRECEDES_SYMBOL: i64 = 415i64; -pub const PRECISION_SYMBOL: i64 = 416i64; -pub const PREPARE_SYMBOL: i64 = 417i64; -pub const PRESERVE_SYMBOL: i64 = 418i64; -pub const PREV_SYMBOL: i64 = 419i64; -pub const PRIMARY_SYMBOL: i64 = 420i64; -pub const PRIVILEGES_SYMBOL: i64 = 421i64; -pub const PROCEDURE_SYMBOL: i64 = 422i64; -pub const PROCESS_SYMBOL: i64 = 423i64; -pub const PROCESSLIST_SYMBOL: i64 = 424i64; -pub const PROFILE_SYMBOL: i64 = 425i64; -pub const PROFILES_SYMBOL: i64 = 426i64; -pub const PROXY_SYMBOL: i64 = 427i64; -pub const PURGE_SYMBOL: i64 = 428i64; -pub const QUARTER_SYMBOL: i64 = 429i64; -pub const QUERY_SYMBOL: i64 = 430i64; -pub const QUICK_SYMBOL: i64 = 431i64; -pub const RANGE_SYMBOL: i64 = 432i64; -pub const READS_SYMBOL: i64 = 433i64; -pub const READ_ONLY_SYMBOL: i64 = 434i64; -pub const READ_SYMBOL: i64 = 435i64; -pub const READ_WRITE_SYMBOL: i64 = 436i64; -pub const REAL_SYMBOL: i64 = 437i64; -pub const REBUILD_SYMBOL: i64 = 438i64; -pub const RECOVER_SYMBOL: i64 = 439i64; -pub const REDOFILE_SYMBOL: i64 = 440i64; -pub const REDO_BUFFER_SIZE_SYMBOL: i64 = 441i64; -pub const REDUNDANT_SYMBOL: i64 = 442i64; -pub const REFERENCES_SYMBOL: i64 = 443i64; -pub const REGEXP_SYMBOL: i64 = 444i64; -pub const RELAY_SYMBOL: i64 = 445i64; -pub const RELAYLOG_SYMBOL: i64 = 446i64; -pub const RELAY_LOG_FILE_SYMBOL: i64 = 447i64; -pub const RELAY_LOG_POS_SYMBOL: i64 = 448i64; -pub const RELAY_THREAD_SYMBOL: i64 = 449i64; -pub const RELEASE_SYMBOL: i64 = 450i64; -pub const RELOAD_SYMBOL: i64 = 451i64; -pub const REMOVE_SYMBOL: i64 = 452i64; -pub const RENAME_SYMBOL: i64 = 453i64; -pub const REORGANIZE_SYMBOL: i64 = 454i64; -pub const REPAIR_SYMBOL: i64 = 455i64; -pub const REPEATABLE_SYMBOL: i64 = 456i64; -pub const REPEAT_SYMBOL: i64 = 457i64; -pub const REPLACE_SYMBOL: i64 = 458i64; -pub const REPLICATION_SYMBOL: i64 = 459i64; -pub const REPLICATE_DO_DB_SYMBOL: i64 = 460i64; -pub const REPLICATE_IGNORE_DB_SYMBOL: i64 = 461i64; -pub const REPLICATE_DO_TABLE_SYMBOL: i64 = 462i64; -pub const REPLICATE_IGNORE_TABLE_SYMBOL: i64 = 463i64; -pub const REPLICATE_WILD_DO_TABLE_SYMBOL: i64 = 464i64; -pub const REPLICATE_WILD_IGNORE_TABLE_SYMBOL: i64 = 465i64; -pub const REPLICATE_REWRITE_DB_SYMBOL: i64 = 466i64; -pub const REQUIRE_SYMBOL: i64 = 467i64; -pub const RESET_SYMBOL: i64 = 468i64; -pub const RESIGNAL_SYMBOL: i64 = 469i64; -pub const RESTORE_SYMBOL: i64 = 470i64; -pub const RESTRICT_SYMBOL: i64 = 471i64; -pub const RESUME_SYMBOL: i64 = 472i64; -pub const RETURNED_SQLSTATE_SYMBOL: i64 = 473i64; -pub const RETURNS_SYMBOL: i64 = 474i64; -pub const RETURN_SYMBOL: i64 = 475i64; -pub const REVERSE_SYMBOL: i64 = 476i64; -pub const REVOKE_SYMBOL: i64 = 477i64; -pub const RIGHT_SYMBOL: i64 = 478i64; -pub const RLIKE_SYMBOL: i64 = 479i64; -pub const ROLLBACK_SYMBOL: i64 = 480i64; -pub const ROLLUP_SYMBOL: i64 = 481i64; -pub const ROTATE_SYMBOL: i64 = 482i64; -pub const ROUTINE_SYMBOL: i64 = 483i64; -pub const ROWS_SYMBOL: i64 = 484i64; -pub const ROW_COUNT_SYMBOL: i64 = 485i64; -pub const ROW_FORMAT_SYMBOL: i64 = 486i64; -pub const ROW_SYMBOL: i64 = 487i64; -pub const RTREE_SYMBOL: i64 = 488i64; -pub const SAVEPOINT_SYMBOL: i64 = 489i64; -pub const SCHEDULE_SYMBOL: i64 = 490i64; -pub const SCHEMA_SYMBOL: i64 = 491i64; -pub const SCHEMA_NAME_SYMBOL: i64 = 492i64; -pub const SCHEMAS_SYMBOL: i64 = 493i64; -pub const SECOND_MICROSECOND_SYMBOL: i64 = 494i64; -pub const SECOND_SYMBOL: i64 = 495i64; -pub const SECURITY_SYMBOL: i64 = 496i64; -pub const SELECT_SYMBOL: i64 = 497i64; -pub const SENSITIVE_SYMBOL: i64 = 498i64; -pub const SEPARATOR_SYMBOL: i64 = 499i64; -pub const SERIALIZABLE_SYMBOL: i64 = 500i64; -pub const SERIAL_SYMBOL: i64 = 501i64; -pub const SESSION_SYMBOL: i64 = 502i64; -pub const SERVER_SYMBOL: i64 = 503i64; -pub const SERVER_OPTIONS_SYMBOL: i64 = 504i64; -pub const SESSION_USER_SYMBOL: i64 = 505i64; -pub const SET_SYMBOL: i64 = 506i64; -pub const SET_VAR_SYMBOL: i64 = 507i64; -pub const SHARE_SYMBOL: i64 = 508i64; -pub const SHOW_SYMBOL: i64 = 509i64; -pub const SHUTDOWN_SYMBOL: i64 = 510i64; -pub const SIGNAL_SYMBOL: i64 = 511i64; -pub const SIGNED_SYMBOL: i64 = 512i64; -pub const SIMPLE_SYMBOL: i64 = 513i64; -pub const SLAVE_SYMBOL: i64 = 514i64; -pub const SLOW_SYMBOL: i64 = 515i64; -pub const SMALLINT_SYMBOL: i64 = 516i64; -pub const SNAPSHOT_SYMBOL: i64 = 517i64; -pub const SOME_SYMBOL: i64 = 518i64; -pub const SOCKET_SYMBOL: i64 = 519i64; -pub const SONAME_SYMBOL: i64 = 520i64; -pub const SOUNDS_SYMBOL: i64 = 521i64; -pub const SOURCE_SYMBOL: i64 = 522i64; -pub const SPATIAL_SYMBOL: i64 = 523i64; -pub const SPECIFIC_SYMBOL: i64 = 524i64; -pub const SQLEXCEPTION_SYMBOL: i64 = 525i64; -pub const SQLSTATE_SYMBOL: i64 = 526i64; -pub const SQLWARNING_SYMBOL: i64 = 527i64; -pub const SQL_AFTER_GTIDS_SYMBOL: i64 = 528i64; -pub const SQL_AFTER_MTS_GAPS_SYMBOL: i64 = 529i64; -pub const SQL_BEFORE_GTIDS_SYMBOL: i64 = 530i64; -pub const SQL_BIG_RESULT_SYMBOL: i64 = 531i64; -pub const SQL_BUFFER_RESULT_SYMBOL: i64 = 532i64; -pub const SQL_CACHE_SYMBOL: i64 = 533i64; -pub const SQL_CALC_FOUND_ROWS_SYMBOL: i64 = 534i64; -pub const SQL_NO_CACHE_SYMBOL: i64 = 535i64; -pub const SQL_SMALL_RESULT_SYMBOL: i64 = 536i64; -pub const SQL_SYMBOL: i64 = 537i64; -pub const SQL_THREAD_SYMBOL: i64 = 538i64; -pub const SSL_SYMBOL: i64 = 539i64; -pub const STACKED_SYMBOL: i64 = 540i64; -pub const STARTING_SYMBOL: i64 = 541i64; -pub const STARTS_SYMBOL: i64 = 542i64; -pub const START_SYMBOL: i64 = 543i64; -pub const STATS_AUTO_RECALC_SYMBOL: i64 = 544i64; -pub const STATS_PERSISTENT_SYMBOL: i64 = 545i64; -pub const STATS_SAMPLE_PAGES_SYMBOL: i64 = 546i64; -pub const STATUS_SYMBOL: i64 = 547i64; -pub const STDDEV_SAMP_SYMBOL: i64 = 548i64; -pub const STDDEV_SYMBOL: i64 = 549i64; -pub const STDDEV_POP_SYMBOL: i64 = 550i64; -pub const STD_SYMBOL: i64 = 551i64; -pub const STOP_SYMBOL: i64 = 552i64; -pub const STORAGE_SYMBOL: i64 = 553i64; -pub const STORED_SYMBOL: i64 = 554i64; -pub const STRAIGHT_JOIN_SYMBOL: i64 = 555i64; -pub const STRING_SYMBOL: i64 = 556i64; -pub const SUBCLASS_ORIGIN_SYMBOL: i64 = 557i64; -pub const SUBDATE_SYMBOL: i64 = 558i64; -pub const SUBJECT_SYMBOL: i64 = 559i64; -pub const SUBPARTITIONS_SYMBOL: i64 = 560i64; -pub const SUBPARTITION_SYMBOL: i64 = 561i64; -pub const SUBSTR_SYMBOL: i64 = 562i64; -pub const SUBSTRING_SYMBOL: i64 = 563i64; -pub const SUM_SYMBOL: i64 = 564i64; -pub const SUPER_SYMBOL: i64 = 565i64; -pub const SUSPEND_SYMBOL: i64 = 566i64; -pub const SWAPS_SYMBOL: i64 = 567i64; -pub const SWITCHES_SYMBOL: i64 = 568i64; -pub const SYSDATE_SYMBOL: i64 = 569i64; -pub const SYSTEM_USER_SYMBOL: i64 = 570i64; -pub const TABLES_SYMBOL: i64 = 571i64; -pub const TABLESPACE_SYMBOL: i64 = 572i64; -pub const TABLE_REF_PRIORITY_SYMBOL: i64 = 573i64; -pub const TABLE_SYMBOL: i64 = 574i64; -pub const TABLE_CHECKSUM_SYMBOL: i64 = 575i64; -pub const TABLE_NAME_SYMBOL: i64 = 576i64; -pub const TEMPORARY_SYMBOL: i64 = 577i64; -pub const TEMPTABLE_SYMBOL: i64 = 578i64; -pub const TERMINATED_SYMBOL: i64 = 579i64; -pub const TEXT_SYMBOL: i64 = 580i64; -pub const THAN_SYMBOL: i64 = 581i64; -pub const THEN_SYMBOL: i64 = 582i64; -pub const TIMESTAMP_SYMBOL: i64 = 583i64; -pub const TIMESTAMP_ADD_SYMBOL: i64 = 584i64; -pub const TIMESTAMP_DIFF_SYMBOL: i64 = 585i64; -pub const TIME_SYMBOL: i64 = 586i64; -pub const TINYBLOB_SYMBOL: i64 = 587i64; -pub const TINYINT_SYMBOL: i64 = 588i64; -pub const TINYTEXT_SYMBOL: i64 = 589i64; -pub const TO_SYMBOL: i64 = 590i64; -pub const TRAILING_SYMBOL: i64 = 591i64; -pub const TRANSACTION_SYMBOL: i64 = 592i64; -pub const TRIGGERS_SYMBOL: i64 = 593i64; -pub const TRIGGER_SYMBOL: i64 = 594i64; -pub const TRIM_SYMBOL: i64 = 595i64; -pub const TRUE_SYMBOL: i64 = 596i64; -pub const TRUNCATE_SYMBOL: i64 = 597i64; -pub const TYPES_SYMBOL: i64 = 598i64; -pub const TYPE_SYMBOL: i64 = 599i64; -pub const UDF_RETURNS_SYMBOL: i64 = 600i64; -pub const UNCOMMITTED_SYMBOL: i64 = 601i64; -pub const UNDEFINED_SYMBOL: i64 = 602i64; -pub const UNDOFILE_SYMBOL: i64 = 603i64; -pub const UNDO_BUFFER_SIZE_SYMBOL: i64 = 604i64; -pub const UNDO_SYMBOL: i64 = 605i64; -pub const UNICODE_SYMBOL: i64 = 606i64; -pub const UNINSTALL_SYMBOL: i64 = 607i64; -pub const UNION_SYMBOL: i64 = 608i64; -pub const UNIQUE_SYMBOL: i64 = 609i64; -pub const UNKNOWN_SYMBOL: i64 = 610i64; -pub const UNLOCK_SYMBOL: i64 = 611i64; -pub const UNSIGNED_SYMBOL: i64 = 612i64; -pub const UNTIL_SYMBOL: i64 = 613i64; -pub const UPDATE_SYMBOL: i64 = 614i64; -pub const UPGRADE_SYMBOL: i64 = 615i64; -pub const USAGE_SYMBOL: i64 = 616i64; -pub const USER_RESOURCES_SYMBOL: i64 = 617i64; -pub const USER_SYMBOL: i64 = 618i64; -pub const USE_FRM_SYMBOL: i64 = 619i64; -pub const USE_SYMBOL: i64 = 620i64; -pub const USING_SYMBOL: i64 = 621i64; -pub const UTC_DATE_SYMBOL: i64 = 622i64; -pub const UTC_TIMESTAMP_SYMBOL: i64 = 623i64; -pub const UTC_TIME_SYMBOL: i64 = 624i64; -pub const VALIDATION_SYMBOL: i64 = 625i64; -pub const VALUES_SYMBOL: i64 = 626i64; -pub const VALUE_SYMBOL: i64 = 627i64; -pub const VARBINARY_SYMBOL: i64 = 628i64; -pub const VARCHAR_SYMBOL: i64 = 629i64; -pub const VARCHARACTER_SYMBOL: i64 = 630i64; -pub const VARIABLES_SYMBOL: i64 = 631i64; -pub const VARIANCE_SYMBOL: i64 = 632i64; -pub const VARYING_SYMBOL: i64 = 633i64; -pub const VAR_POP_SYMBOL: i64 = 634i64; -pub const VAR_SAMP_SYMBOL: i64 = 635i64; -pub const VIEW_SYMBOL: i64 = 636i64; -pub const VIRTUAL_SYMBOL: i64 = 637i64; -pub const WAIT_SYMBOL: i64 = 638i64; -pub const WARNINGS_SYMBOL: i64 = 639i64; -pub const WEEK_SYMBOL: i64 = 640i64; -pub const WEIGHT_STRING_SYMBOL: i64 = 641i64; -pub const WHEN_SYMBOL: i64 = 642i64; -pub const WHERE_SYMBOL: i64 = 643i64; -pub const WHILE_SYMBOL: i64 = 644i64; -pub const WITH_SYMBOL: i64 = 645i64; -pub const WITHOUT_SYMBOL: i64 = 646i64; -pub const WORK_SYMBOL: i64 = 647i64; -pub const WRAPPER_SYMBOL: i64 = 648i64; -pub const WRITE_SYMBOL: i64 = 649i64; -pub const X509_SYMBOL: i64 = 650i64; -pub const XA_SYMBOL: i64 = 651i64; -pub const XID_SYMBOL: i64 = 652i64; -pub const XML_SYMBOL: i64 = 653i64; -pub const XOR_SYMBOL: i64 = 654i64; -pub const YEAR_MONTH_SYMBOL: i64 = 655i64; -pub const YEAR_SYMBOL: i64 = 656i64; -pub const ZEROFILL_SYMBOL: i64 = 657i64; -pub const PERSIST_SYMBOL: i64 = 658i64; -pub const ROLE_SYMBOL: i64 = 659i64; -pub const ADMIN_SYMBOL: i64 = 660i64; -pub const INVISIBLE_SYMBOL: i64 = 661i64; -pub const VISIBLE_SYMBOL: i64 = 662i64; -pub const EXCEPT_SYMBOL: i64 = 663i64; -pub const COMPONENT_SYMBOL: i64 = 664i64; -pub const RECURSIVE_SYMBOL: i64 = 665i64; -pub const JSON_OBJECTAGG_SYMBOL: i64 = 666i64; -pub const JSON_ARRAYAGG_SYMBOL: i64 = 667i64; -pub const OF_SYMBOL: i64 = 668i64; -pub const SKIP_SYMBOL: i64 = 669i64; -pub const LOCKED_SYMBOL: i64 = 670i64; -pub const NOWAIT_SYMBOL: i64 = 671i64; -pub const GROUPING_SYMBOL: i64 = 672i64; -pub const PERSIST_ONLY_SYMBOL: i64 = 673i64; -pub const HISTOGRAM_SYMBOL: i64 = 674i64; -pub const BUCKETS_SYMBOL: i64 = 675i64; -pub const REMOTE_SYMBOL: i64 = 676i64; -pub const CLONE_SYMBOL: i64 = 677i64; -pub const CUME_DIST_SYMBOL: i64 = 678i64; -pub const DENSE_RANK_SYMBOL: i64 = 679i64; -pub const EXCLUDE_SYMBOL: i64 = 680i64; -pub const FIRST_VALUE_SYMBOL: i64 = 681i64; -pub const FOLLOWING_SYMBOL: i64 = 682i64; -pub const GROUPS_SYMBOL: i64 = 683i64; -pub const LAG_SYMBOL: i64 = 684i64; -pub const LAST_VALUE_SYMBOL: i64 = 685i64; -pub const LEAD_SYMBOL: i64 = 686i64; -pub const NTH_VALUE_SYMBOL: i64 = 687i64; -pub const NTILE_SYMBOL: i64 = 688i64; -pub const NULLS_SYMBOL: i64 = 689i64; -pub const OTHERS_SYMBOL: i64 = 690i64; -pub const OVER_SYMBOL: i64 = 691i64; -pub const PERCENT_RANK_SYMBOL: i64 = 692i64; -pub const PRECEDING_SYMBOL: i64 = 693i64; -pub const RANK_SYMBOL: i64 = 694i64; -pub const RESPECT_SYMBOL: i64 = 695i64; -pub const ROW_NUMBER_SYMBOL: i64 = 696i64; -pub const TIES_SYMBOL: i64 = 697i64; -pub const UNBOUNDED_SYMBOL: i64 = 698i64; -pub const WINDOW_SYMBOL: i64 = 699i64; -pub const EMPTY_SYMBOL: i64 = 700i64; -pub const JSON_TABLE_SYMBOL: i64 = 701i64; -pub const NESTED_SYMBOL: i64 = 702i64; -pub const ORDINALITY_SYMBOL: i64 = 703i64; -pub const PATH_SYMBOL: i64 = 704i64; -pub const HISTORY_SYMBOL: i64 = 705i64; -pub const REUSE_SYMBOL: i64 = 706i64; -pub const SRID_SYMBOL: i64 = 707i64; -pub const THREAD_PRIORITY_SYMBOL: i64 = 708i64; -pub const RESOURCE_SYMBOL: i64 = 709i64; -pub const SYSTEM_SYMBOL: i64 = 710i64; -pub const VCPU_SYMBOL: i64 = 711i64; -pub const MASTER_PUBLIC_KEY_PATH_SYMBOL: i64 = 712i64; -pub const GET_MASTER_PUBLIC_KEY_SYMBOL: i64 = 713i64; -pub const RESTART_SYMBOL: i64 = 714i64; -pub const DEFINITION_SYMBOL: i64 = 715i64; -pub const DESCRIPTION_SYMBOL: i64 = 716i64; -pub const ORGANIZATION_SYMBOL: i64 = 717i64; -pub const REFERENCE_SYMBOL: i64 = 718i64; -pub const OPTIONAL_SYMBOL: i64 = 719i64; -pub const SECONDARY_SYMBOL: i64 = 720i64; -pub const SECONDARY_ENGINE_SYMBOL: i64 = 721i64; -pub const SECONDARY_LOAD_SYMBOL: i64 = 722i64; -pub const SECONDARY_UNLOAD_SYMBOL: i64 = 723i64; -pub const ACTIVE_SYMBOL: i64 = 724i64; -pub const INACTIVE_SYMBOL: i64 = 725i64; -pub const LATERAL_SYMBOL: i64 = 726i64; -pub const RETAIN_SYMBOL: i64 = 727i64; -pub const OLD_SYMBOL: i64 = 728i64; -pub const NETWORK_NAMESPACE_SYMBOL: i64 = 729i64; -pub const ENFORCED_SYMBOL: i64 = 730i64; -pub const ARRAY_SYMBOL: i64 = 731i64; -pub const OJ_SYMBOL: i64 = 732i64; -pub const MEMBER_SYMBOL: i64 = 733i64; -pub const RANDOM_SYMBOL: i64 = 734i64; -pub const MASTER_COMPRESSION_ALGORITHM_SYMBOL: i64 = 735i64; -pub const MASTER_ZSTD_COMPRESSION_LEVEL_SYMBOL: i64 = 736i64; -pub const PRIVILEGE_CHECKS_USER_SYMBOL: i64 = 737i64; -pub const MASTER_TLS_CIPHERSUITES_SYMBOL: i64 = 738i64; -pub const REQUIRE_ROW_FORMAT_SYMBOL: i64 = 739i64; -pub const PASSWORD_LOCK_TIME_SYMBOL: i64 = 740i64; -pub const FAILED_LOGIN_ATTEMPTS_SYMBOL: i64 = 741i64; -pub const REQUIRE_TABLE_PRIMARY_KEY_CHECK_SYMBOL: i64 = 742i64; -pub const STREAM_SYMBOL: i64 = 743i64; -pub const OFF_SYMBOL: i64 = 744i64; -pub const AT_AT_SIGN_SYMBOL: i64 = 745i64; -pub const AT_SIGN_SYMBOL: i64 = 746i64; -pub const CLOSE_CURLY_SYMBOL: i64 = 747i64; -pub const CLOSE_PAR_SYMBOL: i64 = 748i64; -pub const COLON_SYMBOL: i64 = 749i64; -pub const COMMA_SYMBOL: i64 = 750i64; -pub const DOT_SYMBOL: i64 = 751i64; -pub const OPEN_CURLY_SYMBOL: i64 = 752i64; -pub const OPEN_PAR_SYMBOL: i64 = 753i64; -pub const PARAM_MARKER: i64 = 754i64; -pub const SEMICOLON_SYMBOL: i64 = 755i64; -pub const ASSIGN_OPERATOR: i64 = 756i64; -pub const BITWISE_AND_OPERATOR: i64 = 757i64; -pub const BITWISE_NOT_OPERATOR: i64 = 758i64; -pub const BITWISE_OR_OPERATOR: i64 = 759i64; -pub const BITWISE_XOR_OPERATOR: i64 = 760i64; -pub const CONCAT_PIPES_SYMBOL: i64 = 761i64; -pub const DIV_OPERATOR: i64 = 762i64; -pub const EQUAL_OPERATOR: i64 = 763i64; -pub const GREATER_OR_EQUAL_OPERATOR: i64 = 764i64; -pub const GREATER_THAN_OPERATOR: i64 = 765i64; -pub const JSON_SEPARATOR_SYMBOL: i64 = 766i64; -pub const JSON_UNQUOTED_SEPARATOR_SYMBOL: i64 = 767i64; -pub const LESS_OR_EQUAL_OPERATOR: i64 = 768i64; -pub const LESS_THAN_OPERATOR: i64 = 769i64; -pub const LOGICAL_AND_OPERATOR: i64 = 770i64; -pub const LOGICAL_NOT_OPERATOR: i64 = 771i64; -pub const LOGICAL_OR_OPERATOR: i64 = 772i64; -pub const MINUS_OPERATOR: i64 = 773i64; -pub const MOD_OPERATOR: i64 = 774i64; -pub const MULT_OPERATOR: i64 = 775i64; -pub const NOT_EQUAL_OPERATOR: i64 = 776i64; -pub const NULL_SAFE_EQUAL_OPERATOR: i64 = 777i64; -pub const PLUS_OPERATOR: i64 = 778i64; -pub const SHIFT_LEFT_OPERATOR: i64 = 779i64; -pub const SHIFT_RIGHT_OPERATOR: i64 = 780i64; -pub const BACK_TICK_QUOTED_ID: i64 = 781i64; -pub const BIN_NUMBER: i64 = 782i64; -pub const DECIMAL_NUMBER: i64 = 783i64; -pub const DOUBLE_QUOTED_TEXT: i64 = 784i64; -pub const FLOAT_NUMBER: i64 = 785i64; -pub const HEX_NUMBER: i64 = 786i64; -pub const INT_NUMBER: i64 = 787i64; -pub const LONG_NUMBER: i64 = 788i64; -pub const NCHAR_TEXT: i64 = 789i64; -pub const SINGLE_QUOTED_TEXT: i64 = 790i64; -pub const ULONGLONG_NUMBER: i64 = 791i64; -pub const AT_TEXT_SUFFIX: i64 = 792i64; -pub const IDENTIFIER: i64 = 793i64; -pub const UNDERSCORE_CHARSET: i64 = 794i64; -pub const INT1_SYMBOL: i64 = 795i64; -pub const INT2_SYMBOL: i64 = 796i64; -pub const INT3_SYMBOL: i64 = 797i64; -pub const INT4_SYMBOL: i64 = 798i64; -pub const INT8_SYMBOL: i64 = 799i64; -pub const NOT2_SYMBOL: i64 = 800i64; -pub const NULL2_SYMBOL: i64 = 801i64; -pub const SQL_TSI_DAY_SYMBOL: i64 = 802i64; -pub const SQL_TSI_HOUR_SYMBOL: i64 = 803i64; -pub const SQL_TSI_MICROSECOND_SYMBOL: i64 = 804i64; -pub const SQL_TSI_MINUTE_SYMBOL: i64 = 805i64; -pub const SQL_TSI_MONTH_SYMBOL: i64 = 806i64; -pub const SQL_TSI_QUARTER_SYMBOL: i64 = 807i64; -pub const SQL_TSI_SECOND_SYMBOL: i64 = 808i64; -pub const SQL_TSI_WEEK_SYMBOL: i64 = 809i64; -pub const SQL_TSI_YEAR_SYMBOL: i64 = 810i64; -pub const INTERSECT_SYMBOL: i64 = 811i64; -pub const ATTRIBUTE_SYMBOL: i64 = 812i64; -pub const SOURCE_AUTO_POSITION_SYMBOL: i64 = 813i64; -pub const SOURCE_BIND_SYMBOL: i64 = 814i64; -pub const SOURCE_COMPRESSION_ALGORITHM_SYMBOL: i64 = 815i64; -pub const SOURCE_CONNECT_RETRY_SYMBOL: i64 = 816i64; -pub const SOURCE_CONNECTION_AUTO_FAILOVER_SYMBOL: i64 = 817i64; -pub const SOURCE_DELAY_SYMBOL: i64 = 818i64; -pub const SOURCE_HEARTBEAT_PERIOD_SYMBOL: i64 = 819i64; -pub const SOURCE_HOST_SYMBOL: i64 = 820i64; -pub const SOURCE_LOG_FILE_SYMBOL: i64 = 821i64; -pub const SOURCE_LOG_POS_SYMBOL: i64 = 822i64; -pub const SOURCE_PASSWORD_SYMBOL: i64 = 823i64; -pub const SOURCE_PORT_SYMBOL: i64 = 824i64; -pub const SOURCE_PUBLIC_KEY_PATH_SYMBOL: i64 = 825i64; -pub const SOURCE_RETRY_COUNT_SYMBOL: i64 = 826i64; -pub const SOURCE_SSL_SYMBOL: i64 = 827i64; -pub const SOURCE_SSL_CA_SYMBOL: i64 = 828i64; -pub const SOURCE_SSL_CAPATH_SYMBOL: i64 = 829i64; -pub const SOURCE_SSL_CERT_SYMBOL: i64 = 830i64; -pub const SOURCE_SSL_CIPHER_SYMBOL: i64 = 831i64; -pub const SOURCE_SSL_CRL_SYMBOL: i64 = 832i64; -pub const SOURCE_SSL_CRLPATH_SYMBOL: i64 = 833i64; -pub const SOURCE_SSL_KEY_SYMBOL: i64 = 834i64; -pub const SOURCE_SSL_VERIFY_SERVER_CERT_SYMBOL: i64 = 835i64; -pub const SOURCE_TLS_CIPHERSUITES_SYMBOL: i64 = 836i64; -pub const SOURCE_TLS_VERSION_SYMBOL: i64 = 837i64; -pub const SOURCE_USER_SYMBOL: i64 = 838i64; -pub const SOURCE_ZSTD_COMPRESSION_LEVEL_SYMBOL: i64 = 839i64; -pub const GET_SOURCE_PUBLIC_KEY_SYMBOL: i64 = 840i64; -pub const GTID_ONLY_SYMBOL: i64 = 841i64; -pub const ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_SYMBOL: i64 = 842i64; -pub const ZONE_SYMBOL: i64 = 843i64; -pub const INNODB_SYMBOL: i64 = 844i64; -pub const TLS_SYMBOL: i64 = 845i64; -pub const REDO_LOG_SYMBOL: i64 = 846i64; -pub const KEYRING_SYMBOL: i64 = 847i64; -pub const ENGINE_ATTRIBUTE_SYMBOL: i64 = 848i64; -pub const SECONDARY_ENGINE_ATTRIBUTE_SYMBOL: i64 = 849i64; -pub const JSON_VALUE_SYMBOL: i64 = 850i64; -pub const RETURNING_SYMBOL: i64 = 851i64; -pub const GEOMCOLLECTION_SYMBOL: i64 = 852i64; -pub const COMMENT: i64 = 900i64; -pub const MYSQL_COMMENT_START: i64 = 901i64; -pub const MYSQL_COMMENT_END: i64 = 902i64; -pub const WHITESPACE: i64 = 0i64; -pub const EOF: i64 = -1i64; - -pub const KEYWORD_TOKENS: &[(&str, i64)] = &[ - ("ACCESSIBLE", 1i64), - ("ACCOUNT", 2i64), - ("ACTION", 3i64), - ("ADD", 4i64), - ("ADDDATE", 5i64), - ("AFTER", 6i64), - ("AGAINST", 7i64), - ("AGGREGATE", 8i64), - ("ALGORITHM", 9i64), - ("ALL", 10i64), - ("ALTER", 11i64), - ("ALWAYS", 12i64), - ("ANALYSE", 13i64), - ("ANALYZE", 14i64), - ("AND", 15i64), - ("ANY", 16i64), - ("AS", 17i64), - ("ASC", 18i64), - ("ASCII", 19i64), - ("ASENSITIVE", 20i64), - ("AT", 21i64), - ("ATTRIBUTE", 812i64), - ("AUTHORS", 22i64), - ("AUTO_INCREMENT", 24i64), - ("AUTOEXTEND_SIZE", 23i64), - ("AVG", 26i64), - ("AVG_ROW_LENGTH", 25i64), - ("BACKUP", 27i64), - ("BEFORE", 28i64), - ("BEGIN", 29i64), - ("BETWEEN", 30i64), - ("BIGINT", 31i64), - ("BIN_NUM", 34i64), - ("BINARY", 32i64), - ("BINLOG", 33i64), - ("BIT", 37i64), - ("BIT_AND", 35i64), - ("BIT_OR", 36i64), - ("BIT_XOR", 38i64), - ("BLOB", 39i64), - ("BLOCK", 40i64), - ("BOOL", 42i64), - ("BOOLEAN", 41i64), - ("BOTH", 43i64), - ("BTREE", 44i64), - ("BY", 45i64), - ("BYTE", 46i64), - ("CACHE", 47i64), - ("CALL", 48i64), - ("CASCADE", 49i64), - ("CASCADED", 50i64), - ("CASE", 51i64), - ("CAST", 52i64), - ("CATALOG_NAME", 53i64), - ("CHAIN", 54i64), - ("CHANGE", 55i64), - ("CHANGED", 56i64), - ("CHANNEL", 57i64), - ("CHAR", 60i64), - ("CHARACTER", 59i64), - ("CHARSET", 58i64), - ("CHECK", 62i64), - ("CHECKSUM", 61i64), - ("CIPHER", 63i64), - ("CLASS_ORIGIN", 64i64), - ("CLIENT", 65i64), - ("CLOSE", 66i64), - ("COALESCE", 67i64), - ("CODE", 68i64), - ("COLLATE", 69i64), - ("COLLATION", 70i64), - ("COLUMN", 72i64), - ("COLUMN_FORMAT", 74i64), - ("COLUMN_NAME", 73i64), - ("COLUMNS", 71i64), - ("COMMENT", 75i64), - ("COMMIT", 77i64), - ("COMMITTED", 76i64), - ("COMPACT", 78i64), - ("COMPLETION", 79i64), - ("COMPRESSED", 80i64), - ("COMPRESSION", 81i64), - ("CONCURRENT", 82i64), - ("CONDITION", 83i64), - ("CONNECTION", 84i64), - ("CONSISTENT", 85i64), - ("CONSTRAINT", 86i64), - ("CONSTRAINT_CATALOG", 87i64), - ("CONSTRAINT_NAME", 88i64), - ("CONSTRAINT_SCHEMA", 89i64), - ("CONTAINS", 90i64), - ("CONTEXT", 91i64), - ("CONTINUE", 92i64), - ("CONTRIBUTORS", 93i64), - ("CONVERT", 94i64), - ("COUNT", 95i64), - ("CPU", 96i64), - ("CREATE", 97i64), - ("CROSS", 98i64), - ("CUBE", 99i64), - ("CURDATE", 100i64), - ("CURRENT", 101i64), - ("CURRENT_DATE", 102i64), - ("CURRENT_TIME", 103i64), - ("CURRENT_TIMESTAMP", 104i64), - ("CURRENT_USER", 105i64), - ("CURSOR", 106i64), - ("CURSOR_NAME", 107i64), - ("CURTIME", 108i64), - ("DATA", 112i64), - ("DATABASE", 109i64), - ("DATABASES", 110i64), - ("DATAFILE", 111i64), - ("DATE", 116i64), - ("DATE_ADD", 114i64), - ("DATE_SUB", 115i64), - ("DATETIME", 113i64), - ("DAY", 122i64), - ("DAY_HOUR", 118i64), - ("DAY_MICROSECOND", 119i64), - ("DAY_MINUTE", 120i64), - ("DAY_SECOND", 121i64), - ("DAYOFMONTH", 117i64), - ("DEALLOCATE", 123i64), - ("DEC", 124i64), - ("DECIMAL", 126i64), - ("DECIMAL_NUM", 125i64), - ("DECLARE", 127i64), - ("DEFAULT", 128i64), - ("DEFAULT_AUTH", 129i64), - ("DEFINER", 130i64), - ("DELAY_KEY_WRITE", 132i64), - ("DELAYED", 131i64), - ("DELETE", 133i64), - ("DES_KEY_FILE", 136i64), - ("DESC", 134i64), - ("DESCRIBE", 135i64), - ("DETERMINISTIC", 137i64), - ("DIAGNOSTICS", 138i64), - ("DIRECTORY", 139i64), - ("DISABLE", 140i64), - ("DISCARD", 141i64), - ("DISK", 142i64), - ("DISTINCT", 143i64), - ("DISTINCTROW", 144i64), - ("DIV", 145i64), - ("DO", 147i64), - ("DOUBLE", 146i64), - ("DROP", 148i64), - ("DUAL", 149i64), - ("DUMPFILE", 150i64), - ("DUPLICATE", 151i64), - ("DYNAMIC", 152i64), - ("EACH", 153i64), - ("ELSE", 154i64), - ("ELSEIF", 155i64), - ("ENABLE", 156i64), - ("ENCLOSED", 157i64), - ("ENCRYPTION", 158i64), - ("END", 159i64), - ("END_OF_INPUT", -1i64), - ("ENDS", 160i64), - ("ENGINE", 163i64), - ("ENGINES", 162i64), - ("ENUM", 164i64), - ("ERROR", 165i64), - ("ERRORS", 166i64), - ("ESCAPE", 168i64), - ("ESCAPED", 167i64), - ("EVENT", 170i64), - ("EVENTS", 169i64), - ("EVERY", 171i64), - ("EXCHANGE", 172i64), - ("EXECUTE", 173i64), - ("EXISTS", 174i64), - ("EXIT", 175i64), - ("EXPANSION", 176i64), - ("EXPIRE", 177i64), - ("EXPLAIN", 178i64), - ("EXPORT", 179i64), - ("EXTENDED", 180i64), - ("EXTENT_SIZE", 181i64), - ("EXTRACT", 182i64), - ("FALSE", 183i64), - ("FAST", 184i64), - ("FAULTS", 185i64), - ("FETCH", 186i64), - ("FIELDS", 187i64), - ("FILE", 188i64), - ("FILE_BLOCK_SIZE", 189i64), - ("FILTER", 190i64), - ("FIRST", 191i64), - ("FIXED", 192i64), - ("FLOAT", 195i64), - ("FLOAT4", 193i64), - ("FLOAT8", 194i64), - ("FLUSH", 196i64), - ("FOLLOWS", 197i64), - ("FOR", 200i64), - ("FORCE", 198i64), - ("FOREIGN", 199i64), - ("FORMAT", 201i64), - ("FOUND", 202i64), - ("FROM", 203i64), - ("FULL", 204i64), - ("FULLTEXT", 205i64), - ("FUNCTION", 206i64), - ("GENERAL", 208i64), - ("GENERATED", 209i64), - ("GEOMCOLLECTION", 852i64), - ("GEOMETRY", 212i64), - ("GEOMETRYCOLLECTION", 211i64), - ("GET", 207i64), - ("GET_FORMAT", 213i64), - ("GLOBAL", 214i64), - ("GRANT", 215i64), - ("GRANTS", 216i64), - ("GROUP", 217i64), - ("GROUP_CONCAT", 218i64), - ("GROUP_REPLICATION", 210i64), - ("HANDLER", 219i64), - ("HASH", 220i64), - ("HAVING", 221i64), - ("HELP", 222i64), - ("HIGH_PRIORITY", 223i64), - ("HOST", 224i64), - ("HOSTS", 225i64), - ("HOUR", 229i64), - ("HOUR_MICROSECOND", 226i64), - ("HOUR_MINUTE", 227i64), - ("HOUR_SECOND", 228i64), - ("IDENTIFIED", 230i64), - ("IF", 231i64), - ("IGNORE", 232i64), - ("IGNORE_SERVER_IDS", 233i64), - ("IMPORT", 234i64), - ("IN", 251i64), - ("INDEX", 236i64), - ("INDEXES", 235i64), - ("INFILE", 237i64), - ("INITIAL_SIZE", 238i64), - ("INNER", 239i64), - ("INNODB", 844i64), - ("INOUT", 240i64), - ("INSENSITIVE", 241i64), - ("INSERT", 242i64), - ("INSERT_METHOD", 243i64), - ("INSTALL", 245i64), - ("INSTANCE", 244i64), - ("INT", 249i64), - ("INT1", 795i64), - ("INT2", 796i64), - ("INT3", 797i64), - ("INT4", 798i64), - ("INT8", 799i64), - ("INTEGER", 246i64), - ("INTERVAL", 247i64), - ("INTO", 248i64), - ("INVOKER", 250i64), - ("IO", 255i64), - ("IO_AFTER_GTIDS", 252i64), - ("IO_BEFORE_GTIDS", 253i64), - ("IO_THREAD", 254i64), - ("IPC", 256i64), - ("IS", 257i64), - ("ISOLATION", 258i64), - ("ISSUER", 259i64), - ("ITERATE", 260i64), - ("JOIN", 261i64), - ("JSON", 262i64), - ("KEY", 265i64), - ("KEY_BLOCK_SIZE", 264i64), - ("KEYS", 263i64), - ("KILL", 266i64), - ("LANGUAGE", 267i64), - ("LAST", 268i64), - ("LEADING", 269i64), - ("LEAVE", 271i64), - ("LEAVES", 270i64), - ("LEFT", 272i64), - ("LESS", 273i64), - ("LEVEL", 274i64), - ("LIKE", 275i64), - ("LIMIT", 276i64), - ("LINEAR", 277i64), - ("LINES", 278i64), - ("LINESTRING", 279i64), - ("LIST", 280i64), - ("LOAD", 281i64), - ("LOCAL", 284i64), - ("LOCALTIME", 282i64), - ("LOCALTIMESTAMP", 283i64), - ("LOCATOR", 285i64), - ("LOCK", 287i64), - ("LOCKS", 286i64), - ("LOGFILE", 288i64), - ("LOGS", 289i64), - ("LONG", 293i64), - ("LONG_NUM", 292i64), - ("LONGBLOB", 290i64), - ("LONGTEXT", 291i64), - ("LOOP", 294i64), - ("LOW_PRIORITY", 295i64), - ("MASTER", 316i64), - ("MASTER_AUTO_POSITION", 296i64), - ("MASTER_BIND", 297i64), - ("MASTER_CONNECT_RETRY", 298i64), - ("MASTER_DELAY", 299i64), - ("MASTER_HEARTBEAT_PERIOD", 319i64), - ("MASTER_HOST", 300i64), - ("MASTER_LOG_FILE", 301i64), - ("MASTER_LOG_POS", 302i64), - ("MASTER_PASSWORD", 303i64), - ("MASTER_PORT", 304i64), - ("MASTER_RETRY_COUNT", 305i64), - ("MASTER_SERVER_ID", 306i64), - ("MASTER_SSL", 314i64), - ("MASTER_SSL_CA", 308i64), - ("MASTER_SSL_CAPATH", 307i64), - ("MASTER_SSL_CERT", 309i64), - ("MASTER_SSL_CIPHER", 310i64), - ("MASTER_SSL_CRL", 311i64), - ("MASTER_SSL_CRLPATH", 312i64), - ("MASTER_SSL_KEY", 313i64), - ("MASTER_SSL_VERIFY_SERVER_CERT", 315i64), - ("MASTER_TLS_VERSION", 317i64), - ("MASTER_USER", 318i64), - ("MATCH", 320i64), - ("MAX", 326i64), - ("MAX_CONNECTIONS_PER_HOUR", 321i64), - ("MAX_QUERIES_PER_HOUR", 322i64), - ("MAX_ROWS", 323i64), - ("MAX_SIZE", 324i64), - ("MAX_STATEMENT_TIME", 325i64), - ("MAX_UPDATES_PER_HOUR", 327i64), - ("MAX_USER_CONNECTIONS", 328i64), - ("MAXVALUE", 329i64), - ("MEDIUM", 333i64), - ("MEDIUMBLOB", 330i64), - ("MEDIUMINT", 331i64), - ("MEDIUMTEXT", 332i64), - ("MEMORY", 334i64), - ("MERGE", 335i64), - ("MESSAGE_TEXT", 336i64), - ("MICROSECOND", 337i64), - ("MID", 338i64), - ("MIDDLEINT", 339i64), - ("MIGRATE", 340i64), - ("MIN", 345i64), - ("MIN_ROWS", 344i64), - ("MINUTE", 343i64), - ("MINUTE_MICROSECOND", 341i64), - ("MINUTE_SECOND", 342i64), - ("MOD", 349i64), - ("MODE", 346i64), - ("MODIFIES", 347i64), - ("MODIFY", 348i64), - ("MONTH", 350i64), - ("MULTILINESTRING", 351i64), - ("MULTIPOINT", 352i64), - ("MULTIPOLYGON", 353i64), - ("MUTEX", 354i64), - ("MYSQL_ERRNO", 355i64), - ("NAME", 357i64), - ("NAMES", 356i64), - ("NATIONAL", 358i64), - ("NATURAL", 359i64), - ("NCHAR", 361i64), - ("NCHAR_STRING", 360i64), - ("NDB", 362i64), - ("NDBCLUSTER", 363i64), - ("NEG", 364i64), - ("NEVER", 365i64), - ("NEW", 366i64), - ("NEXT", 367i64), - ("NO", 373i64), - ("NO_WAIT", 374i64), - ("NO_WRITE_TO_BINLOG", 375i64), - ("NODEGROUP", 368i64), - ("NONBLOCKING", 370i64), - ("NONE", 369i64), - ("NOT", 371i64), - ("NOW", 372i64), - ("NULL", 376i64), - ("NUMBER", 377i64), - ("NUMERIC", 378i64), - ("NVARCHAR", 379i64), - ("OFFLINE", 380i64), - ("OFFSET", 381i64), - ("OLD_PASSWORD", 382i64), - ("ON", 383i64), - ("ONE", 384i64), - ("ONLINE", 385i64), - ("ONLY", 386i64), - ("OPEN", 387i64), - ("OPTIMIZE", 388i64), - ("OPTIMIZER_COSTS", 389i64), - ("OPTION", 391i64), - ("OPTIONALLY", 392i64), - ("OPTIONS", 390i64), - ("OR", 394i64), - ("ORDER", 393i64), - ("OUT", 397i64), - ("OUTER", 395i64), - ("OUTFILE", 396i64), - ("OWNER", 398i64), - ("PACK_KEYS", 399i64), - ("PAGE", 400i64), - ("PARSER", 401i64), - ("PARTIAL", 402i64), - ("PARTITION", 405i64), - ("PARTITIONING", 403i64), - ("PARTITIONS", 404i64), - ("PASSWORD", 406i64), - ("PHASE", 407i64), - ("PLUGIN", 410i64), - ("PLUGIN_DIR", 409i64), - ("PLUGINS", 408i64), - ("POINT", 411i64), - ("POLYGON", 412i64), - ("PORT", 413i64), - ("POSITION", 414i64), - ("PRECEDES", 415i64), - ("PRECISION", 416i64), - ("PREPARE", 417i64), - ("PRESERVE", 418i64), - ("PREV", 419i64), - ("PRIMARY", 420i64), - ("PRIVILEGES", 421i64), - ("PROCEDURE", 422i64), - ("PROCESS", 423i64), - ("PROCESSLIST", 424i64), - ("PROFILE", 425i64), - ("PROFILES", 426i64), - ("PROXY", 427i64), - ("PURGE", 428i64), - ("QUARTER", 429i64), - ("QUERY", 430i64), - ("QUICK", 431i64), - ("RANGE", 432i64), - ("READ", 435i64), - ("READ_ONLY", 434i64), - ("READ_WRITE", 436i64), - ("READS", 433i64), - ("REAL", 437i64), - ("REBUILD", 438i64), - ("RECOVER", 439i64), - ("REDO_BUFFER_SIZE", 441i64), - ("REDOFILE", 440i64), - ("REDUNDANT", 442i64), - ("REFERENCES", 443i64), - ("REGEXP", 444i64), - ("RELAY", 445i64), - ("RELAY_LOG_FILE", 447i64), - ("RELAY_LOG_POS", 448i64), - ("RELAY_THREAD", 449i64), - ("RELAYLOG", 446i64), - ("RELEASE", 450i64), - ("RELOAD", 451i64), - ("REMOVE", 452i64), - ("RENAME", 453i64), - ("REORGANIZE", 454i64), - ("REPAIR", 455i64), - ("REPEAT", 457i64), - ("REPEATABLE", 456i64), - ("REPLACE", 458i64), - ("REPLICATE_DO_DB", 460i64), - ("REPLICATE_DO_TABLE", 462i64), - ("REPLICATE_IGNORE_DB", 461i64), - ("REPLICATE_IGNORE_TABLE", 463i64), - ("REPLICATE_REWRITE_DB", 466i64), - ("REPLICATE_WILD_DO_TABLE", 464i64), - ("REPLICATE_WILD_IGNORE_TABLE", 465i64), - ("REPLICATION", 459i64), - ("REQUIRE", 467i64), - ("RESET", 468i64), - ("RESIGNAL", 469i64), - ("RESTORE", 470i64), - ("RESTRICT", 471i64), - ("RESUME", 472i64), - ("RETURN", 475i64), - ("RETURNED_SQLSTATE", 473i64), - ("RETURNS", 474i64), - ("REVERSE", 476i64), - ("REVOKE", 477i64), - ("RIGHT", 478i64), - ("RLIKE", 479i64), - ("ROLLBACK", 480i64), - ("ROLLUP", 481i64), - ("ROTATE", 482i64), - ("ROUTINE", 483i64), - ("ROW", 487i64), - ("ROW_COUNT", 485i64), - ("ROW_FORMAT", 486i64), - ("ROWS", 484i64), - ("RTREE", 488i64), - ("SAVEPOINT", 489i64), - ("SCHEDULE", 490i64), - ("SCHEMA", 491i64), - ("SCHEMA_NAME", 492i64), - ("SCHEMAS", 493i64), - ("SECOND", 495i64), - ("SECOND_MICROSECOND", 494i64), - ("SECURITY", 496i64), - ("SELECT", 497i64), - ("SENSITIVE", 498i64), - ("SEPARATOR", 499i64), - ("SERIAL", 501i64), - ("SERIALIZABLE", 500i64), - ("SERVER", 503i64), - ("SERVER_OPTIONS", 504i64), - ("SESSION", 502i64), - ("SESSION_USER", 505i64), - ("SET", 506i64), - ("SET_VAR", 507i64), - ("SHARE", 508i64), - ("SHOW", 509i64), - ("SHUTDOWN", 510i64), - ("SIGNAL", 511i64), - ("SIGNED", 512i64), - ("SIMPLE", 513i64), - ("SLAVE", 514i64), - ("SLOW", 515i64), - ("SMALLINT", 516i64), - ("SNAPSHOT", 517i64), - ("SOCKET", 519i64), - ("SOME", 518i64), - ("SONAME", 520i64), - ("SOUNDS", 521i64), - ("SOURCE", 522i64), - ("SPATIAL", 523i64), - ("SPECIFIC", 524i64), - ("SQL", 537i64), - ("SQL_AFTER_GTIDS", 528i64), - ("SQL_AFTER_MTS_GAPS", 529i64), - ("SQL_BEFORE_GTIDS", 530i64), - ("SQL_BIG_RESULT", 531i64), - ("SQL_BUFFER_RESULT", 532i64), - ("SQL_CACHE", 533i64), - ("SQL_CALC_FOUND_ROWS", 534i64), - ("SQL_NO_CACHE", 535i64), - ("SQL_SMALL_RESULT", 536i64), - ("SQL_THREAD", 538i64), - ("SQL_TSI_DAY", 802i64), - ("SQL_TSI_HOUR", 803i64), - ("SQL_TSI_MICROSECOND", 804i64), - ("SQL_TSI_MINUTE", 805i64), - ("SQL_TSI_MONTH", 806i64), - ("SQL_TSI_QUARTER", 807i64), - ("SQL_TSI_SECOND", 808i64), - ("SQL_TSI_WEEK", 809i64), - ("SQL_TSI_YEAR", 810i64), - ("SQLEXCEPTION", 525i64), - ("SQLSTATE", 526i64), - ("SQLWARNING", 527i64), - ("SSL", 539i64), - ("STACKED", 540i64), - ("START", 543i64), - ("STARTING", 541i64), - ("STARTS", 542i64), - ("STATS_AUTO_RECALC", 544i64), - ("STATS_PERSISTENT", 545i64), - ("STATS_SAMPLE_PAGES", 546i64), - ("STATUS", 547i64), - ("STD", 551i64), - ("STDDEV", 549i64), - ("STDDEV_POP", 550i64), - ("STDDEV_SAMP", 548i64), - ("STOP", 552i64), - ("STORAGE", 553i64), - ("STORED", 554i64), - ("STRAIGHT_JOIN", 555i64), - ("STRING", 556i64), - ("SUBCLASS_ORIGIN", 557i64), - ("SUBDATE", 558i64), - ("SUBJECT", 559i64), - ("SUBPARTITION", 561i64), - ("SUBPARTITIONS", 560i64), - ("SUBSTR", 562i64), - ("SUBSTRING", 563i64), - ("SUM", 564i64), - ("SUPER", 565i64), - ("SUSPEND", 566i64), - ("SWAPS", 567i64), - ("SWITCHES", 568i64), - ("SYSDATE", 569i64), - ("SYSTEM_USER", 570i64), - ("TABLE", 574i64), - ("TABLE_CHECKSUM", 575i64), - ("TABLE_NAME", 576i64), - ("TABLE_REF_PRIORITY", 573i64), - ("TABLES", 571i64), - ("TABLESPACE", 572i64), - ("TEMPORARY", 577i64), - ("TEMPTABLE", 578i64), - ("TERMINATED", 579i64), - ("TEXT", 580i64), - ("THAN", 581i64), - ("THEN", 582i64), - ("TIME", 586i64), - ("TIMESTAMP", 583i64), - ("TIMESTAMP_ADD", 584i64), - ("TIMESTAMP_DIFF", 585i64), - ("TINYBLOB", 587i64), - ("TINYINT", 588i64), - ("TINYTEXT", 589i64), - ("TO", 590i64), - ("TRAILING", 591i64), - ("TRANSACTION", 592i64), - ("TRIGGER", 594i64), - ("TRIGGERS", 593i64), - ("TRIM", 595i64), - ("TRUE", 596i64), - ("TRUNCATE", 597i64), - ("TYPE", 599i64), - ("TYPES", 598i64), - ("UDF_RETURNS", 600i64), - ("UNCOMMITTED", 601i64), - ("UNDEFINED", 602i64), - ("UNDO", 605i64), - ("UNDO_BUFFER_SIZE", 604i64), - ("UNDOFILE", 603i64), - ("UNICODE", 606i64), - ("UNINSTALL", 607i64), - ("UNION", 608i64), - ("UNIQUE", 609i64), - ("UNKNOWN", 610i64), - ("UNLOCK", 611i64), - ("UNSIGNED", 612i64), - ("UNTIL", 613i64), - ("UPDATE", 614i64), - ("UPGRADE", 615i64), - ("USAGE", 616i64), - ("USE", 620i64), - ("USE_FRM", 619i64), - ("USER", 618i64), - ("USER_RESOURCES", 617i64), - ("USING", 621i64), - ("UTC_DATE", 622i64), - ("UTC_TIME", 624i64), - ("UTC_TIMESTAMP", 623i64), - ("VALIDATION", 625i64), - ("VALUE", 627i64), - ("VALUES", 626i64), - ("VAR_POP", 634i64), - ("VAR_SAMP", 635i64), - ("VARBINARY", 628i64), - ("VARCHAR", 629i64), - ("VARCHARACTER", 630i64), - ("VARIABLES", 631i64), - ("VARIANCE", 632i64), - ("VARYING", 633i64), - ("VIEW", 636i64), - ("VIRTUAL", 637i64), - ("WAIT", 638i64), - ("WARNINGS", 639i64), - ("WEEK", 640i64), - ("WEIGHT_STRING", 641i64), - ("WHEN", 642i64), - ("WHERE", 643i64), - ("WHILE", 644i64), - ("WITH", 645i64), - ("WITHOUT", 646i64), - ("WORK", 647i64), - ("WRAPPER", 648i64), - ("WRITE", 649i64), - ("X509", 650i64), - ("XA", 651i64), - ("XID", 652i64), - ("XML", 653i64), - ("XOR", 654i64), - ("YEAR", 656i64), - ("YEAR_MONTH", 655i64), - ("ZEROFILL", 657i64), - ("ACTIVE", 724i64), - ("ADMIN", 660i64), - ("ARRAY", 731i64), - ("ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS", 842i64), - ("BUCKETS", 675i64), - ("CLONE", 677i64), - ("COMPONENT", 664i64), - ("CUME_DIST", 678i64), - ("DEFINITION", 715i64), - ("DENSE_RANK", 679i64), - ("DESCRIPTION", 716i64), - ("EMPTY", 700i64), - ("ENFORCED", 730i64), - ("ENGINE_ATTRIBUTE", 848i64), - ("EXCEPT", 663i64), - ("EXCLUDE", 680i64), - ("FAILED_LOGIN_ATTEMPTS", 741i64), - ("FIRST_VALUE", 681i64), - ("FOLLOWING", 682i64), - ("GET_MASTER_PUBLIC_KEY_SYM", 713i64), - ("GET_SOURCE_PUBLIC_KEY", 840i64), - ("GROUPING", 672i64), - ("GROUPS", 683i64), - ("GTID_ONLY", 841i64), - ("HISTOGRAM", 674i64), - ("HISTORY", 705i64), - ("INACTIVE", 725i64), - ("INTERSECT", 811i64), - ("INVISIBLE", 661i64), - ("JSON_ARRAYAGG", 667i64), - ("JSON_OBJECTAGG", 666i64), - ("JSON_TABLE", 701i64), - ("JSON_VALUE", 850i64), - ("KEYRING", 847i64), - ("LAG", 684i64), - ("LAST_VALUE", 685i64), - ("LATERAL", 726i64), - ("LEAD", 686i64), - ("LOCKED", 670i64), - ("MASTER_COMPRESSION_ALGORITHM", 735i64), - ("MASTER_PUBLIC_KEY_PATH", 712i64), - ("MASTER_TLS_CIPHERSUITES", 738i64), - ("MASTER_ZSTD_COMPRESSION_LEVEL", 736i64), - ("MEMBER", 733i64), - ("NESTED", 702i64), - ("NETWORK_NAMESPACE", 729i64), - ("NOWAIT", 671i64), - ("NTH_VALUE", 687i64), - ("NTILE", 688i64), - ("NULLS", 689i64), - ("OF", 668i64), - ("OFF", 744i64), - ("OJ", 732i64), - ("OLD", 728i64), - ("OPTIONAL", 719i64), - ("ORDINALITY", 703i64), - ("ORGANIZATION", 717i64), - ("OTHERS", 690i64), - ("OVER", 691i64), - ("PASSWORD_LOCK_TIME", 740i64), - ("PATH", 704i64), - ("PERCENT_RANK", 692i64), - ("PERSIST", 658i64), - ("PERSIST_ONLY", 673i64), - ("PRECEDING", 693i64), - ("PRIVILEGE_CHECKS_USER", 737i64), - ("RANDOM", 734i64), - ("RANK", 694i64), - ("RECURSIVE", 665i64), - ("REDO_LOG", 846i64), - ("REFERENCE", 718i64), - ("REMOTE", 676i64), - ("REQUIRE_ROW_FORMAT", 739i64), - ("REQUIRE_TABLE_PRIMARY_KEY_CHECK", 742i64), - ("RESOURCE", 709i64), - ("RESPECT", 695i64), - ("RESTART", 714i64), - ("RETAIN", 727i64), - ("RETURNING", 851i64), - ("REUSE", 706i64), - ("ROLE", 659i64), - ("ROW_NUMBER", 696i64), - ("SECONDARY", 720i64), - ("SECONDARY_ENGINE", 721i64), - ("SECONDARY_ENGINE_ATTRIBUTE", 849i64), - ("SECONDARY_LOAD", 722i64), - ("SECONDARY_UNLOAD", 723i64), - ("SKIP", 669i64), - ("SOURCE_AUTO_POSITION", 813i64), - ("SOURCE_BIND", 814i64), - ("SOURCE_COMPRESSION_ALGORITHM", 815i64), - ("SOURCE_CONNECT_RETRY", 816i64), - ("SOURCE_CONNECTION_AUTO_FAILOVER", 817i64), - ("SOURCE_DELAY", 818i64), - ("SOURCE_HEARTBEAT_PERIOD", 819i64), - ("SOURCE_HOST", 820i64), - ("SOURCE_LOG_FILE", 821i64), - ("SOURCE_LOG_POS", 822i64), - ("SOURCE_PASSWORD", 823i64), - ("SOURCE_PORT", 824i64), - ("SOURCE_PUBLIC_KEY_PATH", 825i64), - ("SOURCE_RETRY_COUNT", 826i64), - ("SOURCE_SSL", 827i64), - ("SOURCE_SSL_CA", 828i64), - ("SOURCE_SSL_CAPATH", 829i64), - ("SOURCE_SSL_CERT", 830i64), - ("SOURCE_SSL_CIPHER", 831i64), - ("SOURCE_SSL_CRL", 832i64), - ("SOURCE_SSL_CRLPATH", 833i64), - ("SOURCE_SSL_KEY", 834i64), - ("SOURCE_SSL_VERIFY_SERVER_CERT", 835i64), - ("SOURCE_TLS_CIPHERSUITES", 836i64), - ("SOURCE_TLS_VERSION", 837i64), - ("SOURCE_USER", 838i64), - ("SOURCE_ZSTD_COMPRESSION_LEVEL", 839i64), - ("SRID", 707i64), - ("STREAM", 743i64), - ("SYSTEM", 710i64), - ("THREAD_PRIORITY", 708i64), - ("TIES", 697i64), - ("TLS", 845i64), - ("UNBOUNDED", 698i64), - ("VCPU", 711i64), - ("VISIBLE", 662i64), - ("WINDOW", 699i64), - ("ZONE", 843i64), -]; - -pub const VERSION_RULES: &[(i64, i64)] = &[ - (2i64, 50707i64), - (12i64, 50707i64), - (13i64, -80000i64), - (22i64, -50700i64), - (57i64, 50706i64), - (81i64, 50707i64), - (93i64, -50700i64), - (101i64, 50604i64), - (129i64, 50604i64), - (136i64, -80003i64), - (158i64, 50711i64), - (177i64, 50606i64), - (179i64, 50606i64), - (189i64, 50707i64), - (190i64, 50700i64), - (197i64, 50700i64), - (209i64, 50707i64), - (207i64, 50604i64), - (210i64, 50707i64), - (844i64, 50711i64), - (244i64, 50713i64), - (262i64, 50708i64), - (296i64, 50605i64), - (297i64, 50602i64), - (305i64, 50601i64), - (311i64, 50603i64), - (312i64, 50603i64), - (317i64, 50713i64), - (365i64, 50704i64), - (377i64, 50606i64), - (382i64, -50706i64), - (386i64, 50605i64), - (389i64, 50706i64), - (409i64, 50604i64), - (415i64, 50700i64), - (440i64, -80000i64), - (460i64, 50700i64), - (462i64, 50700i64), - (461i64, 50700i64), - (463i64, 50700i64), - (466i64, 50700i64), - (464i64, 50700i64), - (465i64, 50700i64), - (482i64, 50713i64), - (529i64, 50606i64), - (533i64, -80000i64), - (540i64, 50700i64), - (554i64, 50707i64), - (573i64, -80000i64), - (625i64, 50706i64), - (637i64, 50707i64), - (652i64, 50704i64), - (724i64, 80014i64), - (660i64, 80000i64), - (731i64, 80017i64), - (842i64, 80000i64), - (812i64, 80021i64), - (675i64, 80000i64), - (677i64, 80000i64), - (664i64, 80000i64), - (678i64, 80000i64), - (715i64, 80011i64), - (679i64, 80000i64), - (716i64, 80011i64), - (700i64, 80000i64), - (730i64, 80017i64), - (848i64, 80021i64), - (663i64, 80000i64), - (680i64, 80000i64), - (741i64, 80019i64), - (681i64, 80000i64), - (682i64, 80000i64), - (852i64, 80000i64), - (713i64, 80000i64), - (840i64, 80000i64), - (672i64, 80000i64), - (683i64, 80000i64), - (841i64, 80000i64), - (674i64, 80000i64), - (705i64, 80000i64), - (725i64, 80014i64), - (811i64, 80031i64), - (661i64, 80000i64), - (667i64, 80000i64), - (666i64, 80000i64), - (701i64, 80000i64), - (850i64, 80021i64), - (847i64, 80024i64), - (684i64, 80000i64), - (685i64, 80000i64), - (726i64, 80014i64), - (686i64, 80000i64), - (670i64, 80000i64), - (735i64, 80018i64), - (712i64, 80000i64), - (738i64, 80018i64), - (736i64, 80018i64), - (733i64, 80017i64), - (702i64, 80000i64), - (729i64, 80017i64), - (671i64, 80000i64), - (687i64, 80000i64), - (688i64, 80000i64), - (689i64, 80000i64), - (668i64, 80000i64), - (744i64, 80019i64), - (732i64, 80017i64), - (728i64, 80014i64), - (719i64, 80013i64), - (703i64, 80000i64), - (717i64, 80011i64), - (690i64, 80000i64), - (691i64, 80000i64), - (740i64, 80019i64), - (704i64, 80000i64), - (692i64, 80000i64), - (673i64, 80000i64), - (658i64, 80000i64), - (693i64, 80000i64), - (737i64, 80018i64), - (734i64, 80018i64), - (694i64, 80000i64), - (665i64, 80000i64), - (846i64, 80021i64), - (718i64, 80011i64), - (739i64, 80019i64), - (742i64, 80019i64), - (709i64, 80000i64), - (695i64, 80000i64), - (714i64, 80011i64), - (727i64, 80014i64), - (706i64, 80000i64), - (851i64, 80021i64), - (659i64, 80000i64), - (696i64, 80000i64), - (849i64, 80021i64), - (721i64, 80013i64), - (722i64, 80013i64), - (720i64, 80013i64), - (723i64, 80013i64), - (669i64, 80000i64), - (813i64, 80000i64), - (814i64, 80000i64), - (815i64, 80000i64), - (816i64, 80000i64), - (817i64, 80000i64), - (818i64, 80000i64), - (819i64, 80000i64), - (820i64, 80000i64), - (821i64, 80000i64), - (822i64, 80000i64), - (823i64, 80000i64), - (824i64, 80000i64), - (825i64, 80000i64), - (826i64, 80000i64), - (828i64, 80000i64), - (829i64, 80000i64), - (830i64, 80000i64), - (831i64, 80000i64), - (832i64, 80000i64), - (833i64, 80000i64), - (834i64, 80000i64), - (827i64, 80000i64), - (835i64, 80000i64), - (836i64, 80000i64), - (837i64, 80000i64), - (838i64, 80000i64), - (839i64, 80000i64), - (707i64, 80000i64), - (743i64, 80019i64), - (710i64, 80000i64), - (708i64, 80000i64), - (697i64, 80000i64), - (845i64, 80016i64), - (698i64, 80000i64), - (711i64, 80000i64), - (662i64, 80000i64), - (699i64, 80000i64), - (843i64, 80022i64), -]; - -pub const FUNCTION_TOKENS: &[i64] = &[ - 5i64, 35i64, 36i64, 38i64, 52i64, 95i64, 100i64, 102i64, 103i64, 108i64, 114i64, 115i64, - 182i64, 218i64, 326i64, 338i64, 345i64, 372i64, 414i64, 505i64, 551i64, 550i64, 548i64, 549i64, - 558i64, 562i64, 563i64, 564i64, 569i64, 570i64, 595i64, 634i64, 635i64, 632i64, -]; - -pub const TOKEN_SYNONYMS: &[(i64, i64)] = &[ - (59i64, 60i64), - (102i64, 100i64), - (103i64, 108i64), - (104i64, 372i64), - (117i64, 122i64), - (124i64, 126i64), - (144i64, 143i64), - (187i64, 71i64), - (193i64, 195i64), - (194i64, 146i64), - (852i64, 211i64), - (795i64, 588i64), - (796i64, 516i64), - (797i64, 331i64), - (798i64, 249i64), - (799i64, 31i64), - (246i64, 249i64), - (254i64, 449i64), - (282i64, 372i64), - (283i64, 372i64), - (338i64, 563i64), - (339i64, 331i64), - (362i64, 363i64), - (479i64, 444i64), - (491i64, 109i64), - (493i64, 110i64), - (505i64, 618i64), - (518i64, 16i64), - (802i64, 122i64), - (803i64, 229i64), - (804i64, 337i64), - (805i64, 343i64), - (806i64, 350i64), - (807i64, 429i64), - (808i64, 495i64), - (809i64, 640i64), - (810i64, 656i64), - (550i64, 551i64), - (549i64, 551i64), - (562i64, 563i64), - (570i64, 618i64), - (634i64, 632i64), - (630i64, 629i64), -]; - -pub const UNDERSCORE_CHARSET_NAMES: &[&str] = &[ - "_armscii8", - "_ascii", - "_big5", - "_binary", - "_cp1250", - "_cp1251", - "_cp1256", - "_cp1257", - "_cp850", - "_cp852", - "_cp866", - "_cp932", - "_dec8", - "_eucjpms", - "_euckr", - "_gb18030", - "_gb2312", - "_gbk", - "_geostd8", - "_greek", - "_hebrew", - "_hp8", - "_keybcs2", - "_koi8r", - "_koi8u", - "_latin1", - "_latin2", - "_latin5", - "_latin7", - "_macce", - "_macroman", - "_sjis", - "_swe7", - "_tis620", - "_ucs2", - "_ujis", - "_utf16", - "_utf16le", - "_utf32", - "_utf8", - "_utf8mb3", - "_utf8mb4", -]; - -pub fn token_id(name: &str) -> Option { - SCALAR_INT_CONSTANTS - .iter() - .find_map(|(constant_name, id)| (*constant_name == name).then_some(*id)) -} - -pub fn token_name(id: i64) -> Option<&'static str> { - SCALAR_INT_CONSTANTS - .iter() - .rev() - .find_map(|(constant_name, token_id)| (*token_id == id).then_some(*constant_name)) -} - -pub fn keyword_token(keyword: &str) -> Option { - KEYWORD_TOKENS - .iter() - .find_map(|(candidate, id)| (*candidate == keyword).then_some(*id)) -} - -pub fn version_rule(token_id: i64) -> Option { - VERSION_RULES - .iter() - .find_map(|(candidate, version)| (*candidate == token_id).then_some(*version)) -} - -pub fn is_function_token(token_id: i64) -> bool { - FUNCTION_TOKENS.contains(&token_id) -} - -pub fn token_synonym(token_id: i64) -> Option { - TOKEN_SYNONYMS - .iter() - .find_map(|(candidate, synonym)| (*candidate == token_id).then_some(*synonym)) -} - -pub fn is_underscore_charset(name: &str) -> bool { - UNDERSCORE_CHARSET_NAMES.contains(&name) -} - -pub fn register_lexer_constants(mut builder: ClassBuilder) -> ClassBuilder { - builder = builder - .constant("SQL_MODE_HIGH_NOT_PRECEDENCE", 1i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_MODE_PIPES_AS_CONCAT", 2i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_MODE_IGNORE_SPACE", 4i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_MODE_NO_BACKSLASH_ESCAPES", 8i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_MODE_ANSI_QUOTES", 16i64, &[]) - .unwrap(); - builder = builder - .constant("WHITESPACE_MASK", " \t\n\r\x0c\x0b", &[]) - .unwrap(); - builder = builder.constant("DIGIT_MASK", "0123456789", &[]).unwrap(); - builder = builder - .constant("HEX_DIGIT_MASK", "0123456789abcdefABCDEF", &[]) - .unwrap(); - builder = builder.constant("ACCESSIBLE_SYMBOL", 1i64, &[]).unwrap(); - builder = builder.constant("ACCOUNT_SYMBOL", 2i64, &[]).unwrap(); - builder = builder.constant("ACTION_SYMBOL", 3i64, &[]).unwrap(); - builder = builder.constant("ADD_SYMBOL", 4i64, &[]).unwrap(); - builder = builder.constant("ADDDATE_SYMBOL", 5i64, &[]).unwrap(); - builder = builder.constant("AFTER_SYMBOL", 6i64, &[]).unwrap(); - builder = builder.constant("AGAINST_SYMBOL", 7i64, &[]).unwrap(); - builder = builder.constant("AGGREGATE_SYMBOL", 8i64, &[]).unwrap(); - builder = builder.constant("ALGORITHM_SYMBOL", 9i64, &[]).unwrap(); - builder = builder.constant("ALL_SYMBOL", 10i64, &[]).unwrap(); - builder = builder.constant("ALTER_SYMBOL", 11i64, &[]).unwrap(); - builder = builder.constant("ALWAYS_SYMBOL", 12i64, &[]).unwrap(); - builder = builder.constant("ANALYSE_SYMBOL", 13i64, &[]).unwrap(); - builder = builder.constant("ANALYZE_SYMBOL", 14i64, &[]).unwrap(); - builder = builder.constant("AND_SYMBOL", 15i64, &[]).unwrap(); - builder = builder.constant("ANY_SYMBOL", 16i64, &[]).unwrap(); - builder = builder.constant("AS_SYMBOL", 17i64, &[]).unwrap(); - builder = builder.constant("ASC_SYMBOL", 18i64, &[]).unwrap(); - builder = builder.constant("ASCII_SYMBOL", 19i64, &[]).unwrap(); - builder = builder.constant("ASENSITIVE_SYMBOL", 20i64, &[]).unwrap(); - builder = builder.constant("AT_SYMBOL", 21i64, &[]).unwrap(); - builder = builder.constant("AUTHORS_SYMBOL", 22i64, &[]).unwrap(); - builder = builder - .constant("AUTOEXTEND_SIZE_SYMBOL", 23i64, &[]) - .unwrap(); - builder = builder - .constant("AUTO_INCREMENT_SYMBOL", 24i64, &[]) - .unwrap(); - builder = builder - .constant("AVG_ROW_LENGTH_SYMBOL", 25i64, &[]) - .unwrap(); - builder = builder.constant("AVG_SYMBOL", 26i64, &[]).unwrap(); - builder = builder.constant("BACKUP_SYMBOL", 27i64, &[]).unwrap(); - builder = builder.constant("BEFORE_SYMBOL", 28i64, &[]).unwrap(); - builder = builder.constant("BEGIN_SYMBOL", 29i64, &[]).unwrap(); - builder = builder.constant("BETWEEN_SYMBOL", 30i64, &[]).unwrap(); - builder = builder.constant("BIGINT_SYMBOL", 31i64, &[]).unwrap(); - builder = builder.constant("BINARY_SYMBOL", 32i64, &[]).unwrap(); - builder = builder.constant("BINLOG_SYMBOL", 33i64, &[]).unwrap(); - builder = builder.constant("BIN_NUM_SYMBOL", 34i64, &[]).unwrap(); - builder = builder.constant("BIT_AND_SYMBOL", 35i64, &[]).unwrap(); - builder = builder.constant("BIT_OR_SYMBOL", 36i64, &[]).unwrap(); - builder = builder.constant("BIT_SYMBOL", 37i64, &[]).unwrap(); - builder = builder.constant("BIT_XOR_SYMBOL", 38i64, &[]).unwrap(); - builder = builder.constant("BLOB_SYMBOL", 39i64, &[]).unwrap(); - builder = builder.constant("BLOCK_SYMBOL", 40i64, &[]).unwrap(); - builder = builder.constant("BOOLEAN_SYMBOL", 41i64, &[]).unwrap(); - builder = builder.constant("BOOL_SYMBOL", 42i64, &[]).unwrap(); - builder = builder.constant("BOTH_SYMBOL", 43i64, &[]).unwrap(); - builder = builder.constant("BTREE_SYMBOL", 44i64, &[]).unwrap(); - builder = builder.constant("BY_SYMBOL", 45i64, &[]).unwrap(); - builder = builder.constant("BYTE_SYMBOL", 46i64, &[]).unwrap(); - builder = builder.constant("CACHE_SYMBOL", 47i64, &[]).unwrap(); - builder = builder.constant("CALL_SYMBOL", 48i64, &[]).unwrap(); - builder = builder.constant("CASCADE_SYMBOL", 49i64, &[]).unwrap(); - builder = builder.constant("CASCADED_SYMBOL", 50i64, &[]).unwrap(); - builder = builder.constant("CASE_SYMBOL", 51i64, &[]).unwrap(); - builder = builder.constant("CAST_SYMBOL", 52i64, &[]).unwrap(); - builder = builder.constant("CATALOG_NAME_SYMBOL", 53i64, &[]).unwrap(); - builder = builder.constant("CHAIN_SYMBOL", 54i64, &[]).unwrap(); - builder = builder.constant("CHANGE_SYMBOL", 55i64, &[]).unwrap(); - builder = builder.constant("CHANGED_SYMBOL", 56i64, &[]).unwrap(); - builder = builder.constant("CHANNEL_SYMBOL", 57i64, &[]).unwrap(); - builder = builder.constant("CHARSET_SYMBOL", 58i64, &[]).unwrap(); - builder = builder.constant("CHARACTER_SYMBOL", 59i64, &[]).unwrap(); - builder = builder.constant("CHAR_SYMBOL", 60i64, &[]).unwrap(); - builder = builder.constant("CHECKSUM_SYMBOL", 61i64, &[]).unwrap(); - builder = builder.constant("CHECK_SYMBOL", 62i64, &[]).unwrap(); - builder = builder.constant("CIPHER_SYMBOL", 63i64, &[]).unwrap(); - builder = builder.constant("CLASS_ORIGIN_SYMBOL", 64i64, &[]).unwrap(); - builder = builder.constant("CLIENT_SYMBOL", 65i64, &[]).unwrap(); - builder = builder.constant("CLOSE_SYMBOL", 66i64, &[]).unwrap(); - builder = builder.constant("COALESCE_SYMBOL", 67i64, &[]).unwrap(); - builder = builder.constant("CODE_SYMBOL", 68i64, &[]).unwrap(); - builder = builder.constant("COLLATE_SYMBOL", 69i64, &[]).unwrap(); - builder = builder.constant("COLLATION_SYMBOL", 70i64, &[]).unwrap(); - builder = builder.constant("COLUMNS_SYMBOL", 71i64, &[]).unwrap(); - builder = builder.constant("COLUMN_SYMBOL", 72i64, &[]).unwrap(); - builder = builder.constant("COLUMN_NAME_SYMBOL", 73i64, &[]).unwrap(); - builder = builder - .constant("COLUMN_FORMAT_SYMBOL", 74i64, &[]) - .unwrap(); - builder = builder.constant("COMMENT_SYMBOL", 75i64, &[]).unwrap(); - builder = builder.constant("COMMITTED_SYMBOL", 76i64, &[]).unwrap(); - builder = builder.constant("COMMIT_SYMBOL", 77i64, &[]).unwrap(); - builder = builder.constant("COMPACT_SYMBOL", 78i64, &[]).unwrap(); - builder = builder.constant("COMPLETION_SYMBOL", 79i64, &[]).unwrap(); - builder = builder.constant("COMPRESSED_SYMBOL", 80i64, &[]).unwrap(); - builder = builder.constant("COMPRESSION_SYMBOL", 81i64, &[]).unwrap(); - builder = builder.constant("CONCURRENT_SYMBOL", 82i64, &[]).unwrap(); - builder = builder.constant("CONDITION_SYMBOL", 83i64, &[]).unwrap(); - builder = builder.constant("CONNECTION_SYMBOL", 84i64, &[]).unwrap(); - builder = builder.constant("CONSISTENT_SYMBOL", 85i64, &[]).unwrap(); - builder = builder.constant("CONSTRAINT_SYMBOL", 86i64, &[]).unwrap(); - builder = builder - .constant("CONSTRAINT_CATALOG_SYMBOL", 87i64, &[]) - .unwrap(); - builder = builder - .constant("CONSTRAINT_NAME_SYMBOL", 88i64, &[]) - .unwrap(); - builder = builder - .constant("CONSTRAINT_SCHEMA_SYMBOL", 89i64, &[]) - .unwrap(); - builder = builder.constant("CONTAINS_SYMBOL", 90i64, &[]).unwrap(); - builder = builder.constant("CONTEXT_SYMBOL", 91i64, &[]).unwrap(); - builder = builder.constant("CONTINUE_SYMBOL", 92i64, &[]).unwrap(); - builder = builder.constant("CONTRIBUTORS_SYMBOL", 93i64, &[]).unwrap(); - builder = builder.constant("CONVERT_SYMBOL", 94i64, &[]).unwrap(); - builder = builder.constant("COUNT_SYMBOL", 95i64, &[]).unwrap(); - builder = builder.constant("CPU_SYMBOL", 96i64, &[]).unwrap(); - builder = builder.constant("CREATE_SYMBOL", 97i64, &[]).unwrap(); - builder = builder.constant("CROSS_SYMBOL", 98i64, &[]).unwrap(); - builder = builder.constant("CUBE_SYMBOL", 99i64, &[]).unwrap(); - builder = builder.constant("CURDATE_SYMBOL", 100i64, &[]).unwrap(); - builder = builder.constant("CURRENT_SYMBOL", 101i64, &[]).unwrap(); - builder = builder - .constant("CURRENT_DATE_SYMBOL", 102i64, &[]) - .unwrap(); - builder = builder - .constant("CURRENT_TIME_SYMBOL", 103i64, &[]) - .unwrap(); - builder = builder - .constant("CURRENT_TIMESTAMP_SYMBOL", 104i64, &[]) - .unwrap(); - builder = builder - .constant("CURRENT_USER_SYMBOL", 105i64, &[]) - .unwrap(); - builder = builder.constant("CURSOR_SYMBOL", 106i64, &[]).unwrap(); - builder = builder.constant("CURSOR_NAME_SYMBOL", 107i64, &[]).unwrap(); - builder = builder.constant("CURTIME_SYMBOL", 108i64, &[]).unwrap(); - builder = builder.constant("DATABASE_SYMBOL", 109i64, &[]).unwrap(); - builder = builder.constant("DATABASES_SYMBOL", 110i64, &[]).unwrap(); - builder = builder.constant("DATAFILE_SYMBOL", 111i64, &[]).unwrap(); - builder = builder.constant("DATA_SYMBOL", 112i64, &[]).unwrap(); - builder = builder.constant("DATETIME_SYMBOL", 113i64, &[]).unwrap(); - builder = builder.constant("DATE_ADD_SYMBOL", 114i64, &[]).unwrap(); - builder = builder.constant("DATE_SUB_SYMBOL", 115i64, &[]).unwrap(); - builder = builder.constant("DATE_SYMBOL", 116i64, &[]).unwrap(); - builder = builder.constant("DAYOFMONTH_SYMBOL", 117i64, &[]).unwrap(); - builder = builder.constant("DAY_HOUR_SYMBOL", 118i64, &[]).unwrap(); - builder = builder - .constant("DAY_MICROSECOND_SYMBOL", 119i64, &[]) - .unwrap(); - builder = builder.constant("DAY_MINUTE_SYMBOL", 120i64, &[]).unwrap(); - builder = builder.constant("DAY_SECOND_SYMBOL", 121i64, &[]).unwrap(); - builder = builder.constant("DAY_SYMBOL", 122i64, &[]).unwrap(); - builder = builder.constant("DEALLOCATE_SYMBOL", 123i64, &[]).unwrap(); - builder = builder.constant("DEC_SYMBOL", 124i64, &[]).unwrap(); - builder = builder.constant("DECIMAL_NUM_SYMBOL", 125i64, &[]).unwrap(); - builder = builder.constant("DECIMAL_SYMBOL", 126i64, &[]).unwrap(); - builder = builder.constant("DECLARE_SYMBOL", 127i64, &[]).unwrap(); - builder = builder.constant("DEFAULT_SYMBOL", 128i64, &[]).unwrap(); - builder = builder - .constant("DEFAULT_AUTH_SYMBOL", 129i64, &[]) - .unwrap(); - builder = builder.constant("DEFINER_SYMBOL", 130i64, &[]).unwrap(); - builder = builder.constant("DELAYED_SYMBOL", 131i64, &[]).unwrap(); - builder = builder - .constant("DELAY_KEY_WRITE_SYMBOL", 132i64, &[]) - .unwrap(); - builder = builder.constant("DELETE_SYMBOL", 133i64, &[]).unwrap(); - builder = builder.constant("DESC_SYMBOL", 134i64, &[]).unwrap(); - builder = builder.constant("DESCRIBE_SYMBOL", 135i64, &[]).unwrap(); - builder = builder - .constant("DES_KEY_FILE_SYMBOL", 136i64, &[]) - .unwrap(); - builder = builder - .constant("DETERMINISTIC_SYMBOL", 137i64, &[]) - .unwrap(); - builder = builder.constant("DIAGNOSTICS_SYMBOL", 138i64, &[]).unwrap(); - builder = builder.constant("DIRECTORY_SYMBOL", 139i64, &[]).unwrap(); - builder = builder.constant("DISABLE_SYMBOL", 140i64, &[]).unwrap(); - builder = builder.constant("DISCARD_SYMBOL", 141i64, &[]).unwrap(); - builder = builder.constant("DISK_SYMBOL", 142i64, &[]).unwrap(); - builder = builder.constant("DISTINCT_SYMBOL", 143i64, &[]).unwrap(); - builder = builder.constant("DISTINCTROW_SYMBOL", 144i64, &[]).unwrap(); - builder = builder.constant("DIV_SYMBOL", 145i64, &[]).unwrap(); - builder = builder.constant("DOUBLE_SYMBOL", 146i64, &[]).unwrap(); - builder = builder.constant("DO_SYMBOL", 147i64, &[]).unwrap(); - builder = builder.constant("DROP_SYMBOL", 148i64, &[]).unwrap(); - builder = builder.constant("DUAL_SYMBOL", 149i64, &[]).unwrap(); - builder = builder.constant("DUMPFILE_SYMBOL", 150i64, &[]).unwrap(); - builder = builder.constant("DUPLICATE_SYMBOL", 151i64, &[]).unwrap(); - builder = builder.constant("DYNAMIC_SYMBOL", 152i64, &[]).unwrap(); - builder = builder.constant("EACH_SYMBOL", 153i64, &[]).unwrap(); - builder = builder.constant("ELSE_SYMBOL", 154i64, &[]).unwrap(); - builder = builder.constant("ELSEIF_SYMBOL", 155i64, &[]).unwrap(); - builder = builder.constant("ENABLE_SYMBOL", 156i64, &[]).unwrap(); - builder = builder.constant("ENCLOSED_SYMBOL", 157i64, &[]).unwrap(); - builder = builder.constant("ENCRYPTION_SYMBOL", 158i64, &[]).unwrap(); - builder = builder.constant("END_SYMBOL", 159i64, &[]).unwrap(); - builder = builder.constant("ENDS_SYMBOL", 160i64, &[]).unwrap(); - builder = builder - .constant("END_OF_INPUT_SYMBOL", 161i64, &[]) - .unwrap(); - builder = builder.constant("ENGINES_SYMBOL", 162i64, &[]).unwrap(); - builder = builder.constant("ENGINE_SYMBOL", 163i64, &[]).unwrap(); - builder = builder.constant("ENUM_SYMBOL", 164i64, &[]).unwrap(); - builder = builder.constant("ERROR_SYMBOL", 165i64, &[]).unwrap(); - builder = builder.constant("ERRORS_SYMBOL", 166i64, &[]).unwrap(); - builder = builder.constant("ESCAPED_SYMBOL", 167i64, &[]).unwrap(); - builder = builder.constant("ESCAPE_SYMBOL", 168i64, &[]).unwrap(); - builder = builder.constant("EVENTS_SYMBOL", 169i64, &[]).unwrap(); - builder = builder.constant("EVENT_SYMBOL", 170i64, &[]).unwrap(); - builder = builder.constant("EVERY_SYMBOL", 171i64, &[]).unwrap(); - builder = builder.constant("EXCHANGE_SYMBOL", 172i64, &[]).unwrap(); - builder = builder.constant("EXECUTE_SYMBOL", 173i64, &[]).unwrap(); - builder = builder.constant("EXISTS_SYMBOL", 174i64, &[]).unwrap(); - builder = builder.constant("EXIT_SYMBOL", 175i64, &[]).unwrap(); - builder = builder.constant("EXPANSION_SYMBOL", 176i64, &[]).unwrap(); - builder = builder.constant("EXPIRE_SYMBOL", 177i64, &[]).unwrap(); - builder = builder.constant("EXPLAIN_SYMBOL", 178i64, &[]).unwrap(); - builder = builder.constant("EXPORT_SYMBOL", 179i64, &[]).unwrap(); - builder = builder.constant("EXTENDED_SYMBOL", 180i64, &[]).unwrap(); - builder = builder.constant("EXTENT_SIZE_SYMBOL", 181i64, &[]).unwrap(); - builder = builder.constant("EXTRACT_SYMBOL", 182i64, &[]).unwrap(); - builder = builder.constant("FALSE_SYMBOL", 183i64, &[]).unwrap(); - builder = builder.constant("FAST_SYMBOL", 184i64, &[]).unwrap(); - builder = builder.constant("FAULTS_SYMBOL", 185i64, &[]).unwrap(); - builder = builder.constant("FETCH_SYMBOL", 186i64, &[]).unwrap(); - builder = builder.constant("FIELDS_SYMBOL", 187i64, &[]).unwrap(); - builder = builder.constant("FILE_SYMBOL", 188i64, &[]).unwrap(); - builder = builder - .constant("FILE_BLOCK_SIZE_SYMBOL", 189i64, &[]) - .unwrap(); - builder = builder.constant("FILTER_SYMBOL", 190i64, &[]).unwrap(); - builder = builder.constant("FIRST_SYMBOL", 191i64, &[]).unwrap(); - builder = builder.constant("FIXED_SYMBOL", 192i64, &[]).unwrap(); - builder = builder.constant("FLOAT4_SYMBOL", 193i64, &[]).unwrap(); - builder = builder.constant("FLOAT8_SYMBOL", 194i64, &[]).unwrap(); - builder = builder.constant("FLOAT_SYMBOL", 195i64, &[]).unwrap(); - builder = builder.constant("FLUSH_SYMBOL", 196i64, &[]).unwrap(); - builder = builder.constant("FOLLOWS_SYMBOL", 197i64, &[]).unwrap(); - builder = builder.constant("FORCE_SYMBOL", 198i64, &[]).unwrap(); - builder = builder.constant("FOREIGN_SYMBOL", 199i64, &[]).unwrap(); - builder = builder.constant("FOR_SYMBOL", 200i64, &[]).unwrap(); - builder = builder.constant("FORMAT_SYMBOL", 201i64, &[]).unwrap(); - builder = builder.constant("FOUND_SYMBOL", 202i64, &[]).unwrap(); - builder = builder.constant("FROM_SYMBOL", 203i64, &[]).unwrap(); - builder = builder.constant("FULL_SYMBOL", 204i64, &[]).unwrap(); - builder = builder.constant("FULLTEXT_SYMBOL", 205i64, &[]).unwrap(); - builder = builder.constant("FUNCTION_SYMBOL", 206i64, &[]).unwrap(); - builder = builder.constant("GET_SYMBOL", 207i64, &[]).unwrap(); - builder = builder.constant("GENERAL_SYMBOL", 208i64, &[]).unwrap(); - builder = builder.constant("GENERATED_SYMBOL", 209i64, &[]).unwrap(); - builder = builder - .constant("GROUP_REPLICATION_SYMBOL", 210i64, &[]) - .unwrap(); - builder = builder - .constant("GEOMETRYCOLLECTION_SYMBOL", 211i64, &[]) - .unwrap(); - builder = builder.constant("GEOMETRY_SYMBOL", 212i64, &[]).unwrap(); - builder = builder.constant("GET_FORMAT_SYMBOL", 213i64, &[]).unwrap(); - builder = builder.constant("GLOBAL_SYMBOL", 214i64, &[]).unwrap(); - builder = builder.constant("GRANT_SYMBOL", 215i64, &[]).unwrap(); - builder = builder.constant("GRANTS_SYMBOL", 216i64, &[]).unwrap(); - builder = builder.constant("GROUP_SYMBOL", 217i64, &[]).unwrap(); - builder = builder - .constant("GROUP_CONCAT_SYMBOL", 218i64, &[]) - .unwrap(); - builder = builder.constant("HANDLER_SYMBOL", 219i64, &[]).unwrap(); - builder = builder.constant("HASH_SYMBOL", 220i64, &[]).unwrap(); - builder = builder.constant("HAVING_SYMBOL", 221i64, &[]).unwrap(); - builder = builder.constant("HELP_SYMBOL", 222i64, &[]).unwrap(); - builder = builder - .constant("HIGH_PRIORITY_SYMBOL", 223i64, &[]) - .unwrap(); - builder = builder.constant("HOST_SYMBOL", 224i64, &[]).unwrap(); - builder = builder.constant("HOSTS_SYMBOL", 225i64, &[]).unwrap(); - builder = builder - .constant("HOUR_MICROSECOND_SYMBOL", 226i64, &[]) - .unwrap(); - builder = builder.constant("HOUR_MINUTE_SYMBOL", 227i64, &[]).unwrap(); - builder = builder.constant("HOUR_SECOND_SYMBOL", 228i64, &[]).unwrap(); - builder = builder.constant("HOUR_SYMBOL", 229i64, &[]).unwrap(); - builder = builder.constant("IDENTIFIED_SYMBOL", 230i64, &[]).unwrap(); - builder = builder.constant("IF_SYMBOL", 231i64, &[]).unwrap(); - builder = builder.constant("IGNORE_SYMBOL", 232i64, &[]).unwrap(); - builder = builder - .constant("IGNORE_SERVER_IDS_SYMBOL", 233i64, &[]) - .unwrap(); - builder = builder.constant("IMPORT_SYMBOL", 234i64, &[]).unwrap(); - builder = builder.constant("INDEXES_SYMBOL", 235i64, &[]).unwrap(); - builder = builder.constant("INDEX_SYMBOL", 236i64, &[]).unwrap(); - builder = builder.constant("INFILE_SYMBOL", 237i64, &[]).unwrap(); - builder = builder - .constant("INITIAL_SIZE_SYMBOL", 238i64, &[]) - .unwrap(); - builder = builder.constant("INNER_SYMBOL", 239i64, &[]).unwrap(); - builder = builder.constant("INOUT_SYMBOL", 240i64, &[]).unwrap(); - builder = builder.constant("INSENSITIVE_SYMBOL", 241i64, &[]).unwrap(); - builder = builder.constant("INSERT_SYMBOL", 242i64, &[]).unwrap(); - builder = builder - .constant("INSERT_METHOD_SYMBOL", 243i64, &[]) - .unwrap(); - builder = builder.constant("INSTANCE_SYMBOL", 244i64, &[]).unwrap(); - builder = builder.constant("INSTALL_SYMBOL", 245i64, &[]).unwrap(); - builder = builder.constant("INTEGER_SYMBOL", 246i64, &[]).unwrap(); - builder = builder.constant("INTERVAL_SYMBOL", 247i64, &[]).unwrap(); - builder = builder.constant("INTO_SYMBOL", 248i64, &[]).unwrap(); - builder = builder.constant("INT_SYMBOL", 249i64, &[]).unwrap(); - builder = builder.constant("INVOKER_SYMBOL", 250i64, &[]).unwrap(); - builder = builder.constant("IN_SYMBOL", 251i64, &[]).unwrap(); - builder = builder - .constant("IO_AFTER_GTIDS_SYMBOL", 252i64, &[]) - .unwrap(); - builder = builder - .constant("IO_BEFORE_GTIDS_SYMBOL", 253i64, &[]) - .unwrap(); - builder = builder.constant("IO_THREAD_SYMBOL", 254i64, &[]).unwrap(); - builder = builder.constant("IO_SYMBOL", 255i64, &[]).unwrap(); - builder = builder.constant("IPC_SYMBOL", 256i64, &[]).unwrap(); - builder = builder.constant("IS_SYMBOL", 257i64, &[]).unwrap(); - builder = builder.constant("ISOLATION_SYMBOL", 258i64, &[]).unwrap(); - builder = builder.constant("ISSUER_SYMBOL", 259i64, &[]).unwrap(); - builder = builder.constant("ITERATE_SYMBOL", 260i64, &[]).unwrap(); - builder = builder.constant("JOIN_SYMBOL", 261i64, &[]).unwrap(); - builder = builder.constant("JSON_SYMBOL", 262i64, &[]).unwrap(); - builder = builder.constant("KEYS_SYMBOL", 263i64, &[]).unwrap(); - builder = builder - .constant("KEY_BLOCK_SIZE_SYMBOL", 264i64, &[]) - .unwrap(); - builder = builder.constant("KEY_SYMBOL", 265i64, &[]).unwrap(); - builder = builder.constant("KILL_SYMBOL", 266i64, &[]).unwrap(); - builder = builder.constant("LANGUAGE_SYMBOL", 267i64, &[]).unwrap(); - builder = builder.constant("LAST_SYMBOL", 268i64, &[]).unwrap(); - builder = builder.constant("LEADING_SYMBOL", 269i64, &[]).unwrap(); - builder = builder.constant("LEAVES_SYMBOL", 270i64, &[]).unwrap(); - builder = builder.constant("LEAVE_SYMBOL", 271i64, &[]).unwrap(); - builder = builder.constant("LEFT_SYMBOL", 272i64, &[]).unwrap(); - builder = builder.constant("LESS_SYMBOL", 273i64, &[]).unwrap(); - builder = builder.constant("LEVEL_SYMBOL", 274i64, &[]).unwrap(); - builder = builder.constant("LIKE_SYMBOL", 275i64, &[]).unwrap(); - builder = builder.constant("LIMIT_SYMBOL", 276i64, &[]).unwrap(); - builder = builder.constant("LINEAR_SYMBOL", 277i64, &[]).unwrap(); - builder = builder.constant("LINES_SYMBOL", 278i64, &[]).unwrap(); - builder = builder.constant("LINESTRING_SYMBOL", 279i64, &[]).unwrap(); - builder = builder.constant("LIST_SYMBOL", 280i64, &[]).unwrap(); - builder = builder.constant("LOAD_SYMBOL", 281i64, &[]).unwrap(); - builder = builder.constant("LOCALTIME_SYMBOL", 282i64, &[]).unwrap(); - builder = builder - .constant("LOCALTIMESTAMP_SYMBOL", 283i64, &[]) - .unwrap(); - builder = builder.constant("LOCAL_SYMBOL", 284i64, &[]).unwrap(); - builder = builder.constant("LOCATOR_SYMBOL", 285i64, &[]).unwrap(); - builder = builder.constant("LOCKS_SYMBOL", 286i64, &[]).unwrap(); - builder = builder.constant("LOCK_SYMBOL", 287i64, &[]).unwrap(); - builder = builder.constant("LOGFILE_SYMBOL", 288i64, &[]).unwrap(); - builder = builder.constant("LOGS_SYMBOL", 289i64, &[]).unwrap(); - builder = builder.constant("LONGBLOB_SYMBOL", 290i64, &[]).unwrap(); - builder = builder.constant("LONGTEXT_SYMBOL", 291i64, &[]).unwrap(); - builder = builder.constant("LONG_NUM_SYMBOL", 292i64, &[]).unwrap(); - builder = builder.constant("LONG_SYMBOL", 293i64, &[]).unwrap(); - builder = builder.constant("LOOP_SYMBOL", 294i64, &[]).unwrap(); - builder = builder - .constant("LOW_PRIORITY_SYMBOL", 295i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_AUTO_POSITION_SYMBOL", 296i64, &[]) - .unwrap(); - builder = builder.constant("MASTER_BIND_SYMBOL", 297i64, &[]).unwrap(); - builder = builder - .constant("MASTER_CONNECT_RETRY_SYMBOL", 298i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_DELAY_SYMBOL", 299i64, &[]) - .unwrap(); - builder = builder.constant("MASTER_HOST_SYMBOL", 300i64, &[]).unwrap(); - builder = builder - .constant("MASTER_LOG_FILE_SYMBOL", 301i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_LOG_POS_SYMBOL", 302i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_PASSWORD_SYMBOL", 303i64, &[]) - .unwrap(); - builder = builder.constant("MASTER_PORT_SYMBOL", 304i64, &[]).unwrap(); - builder = builder - .constant("MASTER_RETRY_COUNT_SYMBOL", 305i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SERVER_ID_SYMBOL", 306i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_CAPATH_SYMBOL", 307i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_CA_SYMBOL", 308i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_CERT_SYMBOL", 309i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_CIPHER_SYMBOL", 310i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_CRL_SYMBOL", 311i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_CRLPATH_SYMBOL", 312i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_SSL_KEY_SYMBOL", 313i64, &[]) - .unwrap(); - builder = builder.constant("MASTER_SSL_SYMBOL", 314i64, &[]).unwrap(); - builder = builder - .constant("MASTER_SSL_VERIFY_SERVER_CERT_SYMBOL", 315i64, &[]) - .unwrap(); - builder = builder.constant("MASTER_SYMBOL", 316i64, &[]).unwrap(); - builder = builder - .constant("MASTER_TLS_VERSION_SYMBOL", 317i64, &[]) - .unwrap(); - builder = builder.constant("MASTER_USER_SYMBOL", 318i64, &[]).unwrap(); - builder = builder - .constant("MASTER_HEARTBEAT_PERIOD_SYMBOL", 319i64, &[]) - .unwrap(); - builder = builder.constant("MATCH_SYMBOL", 320i64, &[]).unwrap(); - builder = builder - .constant("MAX_CONNECTIONS_PER_HOUR_SYMBOL", 321i64, &[]) - .unwrap(); - builder = builder - .constant("MAX_QUERIES_PER_HOUR_SYMBOL", 322i64, &[]) - .unwrap(); - builder = builder.constant("MAX_ROWS_SYMBOL", 323i64, &[]).unwrap(); - builder = builder.constant("MAX_SIZE_SYMBOL", 324i64, &[]).unwrap(); - builder = builder - .constant("MAX_STATEMENT_TIME_SYMBOL", 325i64, &[]) - .unwrap(); - builder = builder.constant("MAX_SYMBOL", 326i64, &[]).unwrap(); - builder = builder - .constant("MAX_UPDATES_PER_HOUR_SYMBOL", 327i64, &[]) - .unwrap(); - builder = builder - .constant("MAX_USER_CONNECTIONS_SYMBOL", 328i64, &[]) - .unwrap(); - builder = builder.constant("MAXVALUE_SYMBOL", 329i64, &[]).unwrap(); - builder = builder.constant("MEDIUMBLOB_SYMBOL", 330i64, &[]).unwrap(); - builder = builder.constant("MEDIUMINT_SYMBOL", 331i64, &[]).unwrap(); - builder = builder.constant("MEDIUMTEXT_SYMBOL", 332i64, &[]).unwrap(); - builder = builder.constant("MEDIUM_SYMBOL", 333i64, &[]).unwrap(); - builder = builder.constant("MEMORY_SYMBOL", 334i64, &[]).unwrap(); - builder = builder.constant("MERGE_SYMBOL", 335i64, &[]).unwrap(); - builder = builder - .constant("MESSAGE_TEXT_SYMBOL", 336i64, &[]) - .unwrap(); - builder = builder.constant("MICROSECOND_SYMBOL", 337i64, &[]).unwrap(); - builder = builder.constant("MID_SYMBOL", 338i64, &[]).unwrap(); - builder = builder.constant("MIDDLEINT_SYMBOL", 339i64, &[]).unwrap(); - builder = builder.constant("MIGRATE_SYMBOL", 340i64, &[]).unwrap(); - builder = builder - .constant("MINUTE_MICROSECOND_SYMBOL", 341i64, &[]) - .unwrap(); - builder = builder - .constant("MINUTE_SECOND_SYMBOL", 342i64, &[]) - .unwrap(); - builder = builder.constant("MINUTE_SYMBOL", 343i64, &[]).unwrap(); - builder = builder.constant("MIN_ROWS_SYMBOL", 344i64, &[]).unwrap(); - builder = builder.constant("MIN_SYMBOL", 345i64, &[]).unwrap(); - builder = builder.constant("MODE_SYMBOL", 346i64, &[]).unwrap(); - builder = builder.constant("MODIFIES_SYMBOL", 347i64, &[]).unwrap(); - builder = builder.constant("MODIFY_SYMBOL", 348i64, &[]).unwrap(); - builder = builder.constant("MOD_SYMBOL", 349i64, &[]).unwrap(); - builder = builder.constant("MONTH_SYMBOL", 350i64, &[]).unwrap(); - builder = builder - .constant("MULTILINESTRING_SYMBOL", 351i64, &[]) - .unwrap(); - builder = builder.constant("MULTIPOINT_SYMBOL", 352i64, &[]).unwrap(); - builder = builder - .constant("MULTIPOLYGON_SYMBOL", 353i64, &[]) - .unwrap(); - builder = builder.constant("MUTEX_SYMBOL", 354i64, &[]).unwrap(); - builder = builder.constant("MYSQL_ERRNO_SYMBOL", 355i64, &[]).unwrap(); - builder = builder.constant("NAMES_SYMBOL", 356i64, &[]).unwrap(); - builder = builder.constant("NAME_SYMBOL", 357i64, &[]).unwrap(); - builder = builder.constant("NATIONAL_SYMBOL", 358i64, &[]).unwrap(); - builder = builder.constant("NATURAL_SYMBOL", 359i64, &[]).unwrap(); - builder = builder - .constant("NCHAR_STRING_SYMBOL", 360i64, &[]) - .unwrap(); - builder = builder.constant("NCHAR_SYMBOL", 361i64, &[]).unwrap(); - builder = builder.constant("NDB_SYMBOL", 362i64, &[]).unwrap(); - builder = builder.constant("NDBCLUSTER_SYMBOL", 363i64, &[]).unwrap(); - builder = builder.constant("NEG_SYMBOL", 364i64, &[]).unwrap(); - builder = builder.constant("NEVER_SYMBOL", 365i64, &[]).unwrap(); - builder = builder.constant("NEW_SYMBOL", 366i64, &[]).unwrap(); - builder = builder.constant("NEXT_SYMBOL", 367i64, &[]).unwrap(); - builder = builder.constant("NODEGROUP_SYMBOL", 368i64, &[]).unwrap(); - builder = builder.constant("NONE_SYMBOL", 369i64, &[]).unwrap(); - builder = builder.constant("NONBLOCKING_SYMBOL", 370i64, &[]).unwrap(); - builder = builder.constant("NOT_SYMBOL", 371i64, &[]).unwrap(); - builder = builder.constant("NOW_SYMBOL", 372i64, &[]).unwrap(); - builder = builder.constant("NO_SYMBOL", 373i64, &[]).unwrap(); - builder = builder.constant("NO_WAIT_SYMBOL", 374i64, &[]).unwrap(); - builder = builder - .constant("NO_WRITE_TO_BINLOG_SYMBOL", 375i64, &[]) - .unwrap(); - builder = builder.constant("NULL_SYMBOL", 376i64, &[]).unwrap(); - builder = builder.constant("NUMBER_SYMBOL", 377i64, &[]).unwrap(); - builder = builder.constant("NUMERIC_SYMBOL", 378i64, &[]).unwrap(); - builder = builder.constant("NVARCHAR_SYMBOL", 379i64, &[]).unwrap(); - builder = builder.constant("OFFLINE_SYMBOL", 380i64, &[]).unwrap(); - builder = builder.constant("OFFSET_SYMBOL", 381i64, &[]).unwrap(); - builder = builder - .constant("OLD_PASSWORD_SYMBOL", 382i64, &[]) - .unwrap(); - builder = builder.constant("ON_SYMBOL", 383i64, &[]).unwrap(); - builder = builder.constant("ONE_SYMBOL", 384i64, &[]).unwrap(); - builder = builder.constant("ONLINE_SYMBOL", 385i64, &[]).unwrap(); - builder = builder.constant("ONLY_SYMBOL", 386i64, &[]).unwrap(); - builder = builder.constant("OPEN_SYMBOL", 387i64, &[]).unwrap(); - builder = builder.constant("OPTIMIZE_SYMBOL", 388i64, &[]).unwrap(); - builder = builder - .constant("OPTIMIZER_COSTS_SYMBOL", 389i64, &[]) - .unwrap(); - builder = builder.constant("OPTIONS_SYMBOL", 390i64, &[]).unwrap(); - builder = builder.constant("OPTION_SYMBOL", 391i64, &[]).unwrap(); - builder = builder.constant("OPTIONALLY_SYMBOL", 392i64, &[]).unwrap(); - builder = builder.constant("ORDER_SYMBOL", 393i64, &[]).unwrap(); - builder = builder.constant("OR_SYMBOL", 394i64, &[]).unwrap(); - builder = builder.constant("OUTER_SYMBOL", 395i64, &[]).unwrap(); - builder = builder.constant("OUTFILE_SYMBOL", 396i64, &[]).unwrap(); - builder = builder.constant("OUT_SYMBOL", 397i64, &[]).unwrap(); - builder = builder.constant("OWNER_SYMBOL", 398i64, &[]).unwrap(); - builder = builder.constant("PACK_KEYS_SYMBOL", 399i64, &[]).unwrap(); - builder = builder.constant("PAGE_SYMBOL", 400i64, &[]).unwrap(); - builder = builder.constant("PARSER_SYMBOL", 401i64, &[]).unwrap(); - builder = builder.constant("PARTIAL_SYMBOL", 402i64, &[]).unwrap(); - builder = builder - .constant("PARTITIONING_SYMBOL", 403i64, &[]) - .unwrap(); - builder = builder.constant("PARTITIONS_SYMBOL", 404i64, &[]).unwrap(); - builder = builder.constant("PARTITION_SYMBOL", 405i64, &[]).unwrap(); - builder = builder.constant("PASSWORD_SYMBOL", 406i64, &[]).unwrap(); - builder = builder.constant("PHASE_SYMBOL", 407i64, &[]).unwrap(); - builder = builder.constant("PLUGINS_SYMBOL", 408i64, &[]).unwrap(); - builder = builder.constant("PLUGIN_DIR_SYMBOL", 409i64, &[]).unwrap(); - builder = builder.constant("PLUGIN_SYMBOL", 410i64, &[]).unwrap(); - builder = builder.constant("POINT_SYMBOL", 411i64, &[]).unwrap(); - builder = builder.constant("POLYGON_SYMBOL", 412i64, &[]).unwrap(); - builder = builder.constant("PORT_SYMBOL", 413i64, &[]).unwrap(); - builder = builder.constant("POSITION_SYMBOL", 414i64, &[]).unwrap(); - builder = builder.constant("PRECEDES_SYMBOL", 415i64, &[]).unwrap(); - builder = builder.constant("PRECISION_SYMBOL", 416i64, &[]).unwrap(); - builder = builder.constant("PREPARE_SYMBOL", 417i64, &[]).unwrap(); - builder = builder.constant("PRESERVE_SYMBOL", 418i64, &[]).unwrap(); - builder = builder.constant("PREV_SYMBOL", 419i64, &[]).unwrap(); - builder = builder.constant("PRIMARY_SYMBOL", 420i64, &[]).unwrap(); - builder = builder.constant("PRIVILEGES_SYMBOL", 421i64, &[]).unwrap(); - builder = builder.constant("PROCEDURE_SYMBOL", 422i64, &[]).unwrap(); - builder = builder.constant("PROCESS_SYMBOL", 423i64, &[]).unwrap(); - builder = builder.constant("PROCESSLIST_SYMBOL", 424i64, &[]).unwrap(); - builder = builder.constant("PROFILE_SYMBOL", 425i64, &[]).unwrap(); - builder = builder.constant("PROFILES_SYMBOL", 426i64, &[]).unwrap(); - builder = builder.constant("PROXY_SYMBOL", 427i64, &[]).unwrap(); - builder = builder.constant("PURGE_SYMBOL", 428i64, &[]).unwrap(); - builder = builder.constant("QUARTER_SYMBOL", 429i64, &[]).unwrap(); - builder = builder.constant("QUERY_SYMBOL", 430i64, &[]).unwrap(); - builder = builder.constant("QUICK_SYMBOL", 431i64, &[]).unwrap(); - builder = builder.constant("RANGE_SYMBOL", 432i64, &[]).unwrap(); - builder = builder.constant("READS_SYMBOL", 433i64, &[]).unwrap(); - builder = builder.constant("READ_ONLY_SYMBOL", 434i64, &[]).unwrap(); - builder = builder.constant("READ_SYMBOL", 435i64, &[]).unwrap(); - builder = builder.constant("READ_WRITE_SYMBOL", 436i64, &[]).unwrap(); - builder = builder.constant("REAL_SYMBOL", 437i64, &[]).unwrap(); - builder = builder.constant("REBUILD_SYMBOL", 438i64, &[]).unwrap(); - builder = builder.constant("RECOVER_SYMBOL", 439i64, &[]).unwrap(); - builder = builder.constant("REDOFILE_SYMBOL", 440i64, &[]).unwrap(); - builder = builder - .constant("REDO_BUFFER_SIZE_SYMBOL", 441i64, &[]) - .unwrap(); - builder = builder.constant("REDUNDANT_SYMBOL", 442i64, &[]).unwrap(); - builder = builder.constant("REFERENCES_SYMBOL", 443i64, &[]).unwrap(); - builder = builder.constant("REGEXP_SYMBOL", 444i64, &[]).unwrap(); - builder = builder.constant("RELAY_SYMBOL", 445i64, &[]).unwrap(); - builder = builder.constant("RELAYLOG_SYMBOL", 446i64, &[]).unwrap(); - builder = builder - .constant("RELAY_LOG_FILE_SYMBOL", 447i64, &[]) - .unwrap(); - builder = builder - .constant("RELAY_LOG_POS_SYMBOL", 448i64, &[]) - .unwrap(); - builder = builder - .constant("RELAY_THREAD_SYMBOL", 449i64, &[]) - .unwrap(); - builder = builder.constant("RELEASE_SYMBOL", 450i64, &[]).unwrap(); - builder = builder.constant("RELOAD_SYMBOL", 451i64, &[]).unwrap(); - builder = builder.constant("REMOVE_SYMBOL", 452i64, &[]).unwrap(); - builder = builder.constant("RENAME_SYMBOL", 453i64, &[]).unwrap(); - builder = builder.constant("REORGANIZE_SYMBOL", 454i64, &[]).unwrap(); - builder = builder.constant("REPAIR_SYMBOL", 455i64, &[]).unwrap(); - builder = builder.constant("REPEATABLE_SYMBOL", 456i64, &[]).unwrap(); - builder = builder.constant("REPEAT_SYMBOL", 457i64, &[]).unwrap(); - builder = builder.constant("REPLACE_SYMBOL", 458i64, &[]).unwrap(); - builder = builder.constant("REPLICATION_SYMBOL", 459i64, &[]).unwrap(); - builder = builder - .constant("REPLICATE_DO_DB_SYMBOL", 460i64, &[]) - .unwrap(); - builder = builder - .constant("REPLICATE_IGNORE_DB_SYMBOL", 461i64, &[]) - .unwrap(); - builder = builder - .constant("REPLICATE_DO_TABLE_SYMBOL", 462i64, &[]) - .unwrap(); - builder = builder - .constant("REPLICATE_IGNORE_TABLE_SYMBOL", 463i64, &[]) - .unwrap(); - builder = builder - .constant("REPLICATE_WILD_DO_TABLE_SYMBOL", 464i64, &[]) - .unwrap(); - builder = builder - .constant("REPLICATE_WILD_IGNORE_TABLE_SYMBOL", 465i64, &[]) - .unwrap(); - builder = builder - .constant("REPLICATE_REWRITE_DB_SYMBOL", 466i64, &[]) - .unwrap(); - builder = builder.constant("REQUIRE_SYMBOL", 467i64, &[]).unwrap(); - builder = builder.constant("RESET_SYMBOL", 468i64, &[]).unwrap(); - builder = builder.constant("RESIGNAL_SYMBOL", 469i64, &[]).unwrap(); - builder = builder.constant("RESTORE_SYMBOL", 470i64, &[]).unwrap(); - builder = builder.constant("RESTRICT_SYMBOL", 471i64, &[]).unwrap(); - builder = builder.constant("RESUME_SYMBOL", 472i64, &[]).unwrap(); - builder = builder - .constant("RETURNED_SQLSTATE_SYMBOL", 473i64, &[]) - .unwrap(); - builder = builder.constant("RETURNS_SYMBOL", 474i64, &[]).unwrap(); - builder = builder.constant("RETURN_SYMBOL", 475i64, &[]).unwrap(); - builder = builder.constant("REVERSE_SYMBOL", 476i64, &[]).unwrap(); - builder = builder.constant("REVOKE_SYMBOL", 477i64, &[]).unwrap(); - builder = builder.constant("RIGHT_SYMBOL", 478i64, &[]).unwrap(); - builder = builder.constant("RLIKE_SYMBOL", 479i64, &[]).unwrap(); - builder = builder.constant("ROLLBACK_SYMBOL", 480i64, &[]).unwrap(); - builder = builder.constant("ROLLUP_SYMBOL", 481i64, &[]).unwrap(); - builder = builder.constant("ROTATE_SYMBOL", 482i64, &[]).unwrap(); - builder = builder.constant("ROUTINE_SYMBOL", 483i64, &[]).unwrap(); - builder = builder.constant("ROWS_SYMBOL", 484i64, &[]).unwrap(); - builder = builder.constant("ROW_COUNT_SYMBOL", 485i64, &[]).unwrap(); - builder = builder.constant("ROW_FORMAT_SYMBOL", 486i64, &[]).unwrap(); - builder = builder.constant("ROW_SYMBOL", 487i64, &[]).unwrap(); - builder = builder.constant("RTREE_SYMBOL", 488i64, &[]).unwrap(); - builder = builder.constant("SAVEPOINT_SYMBOL", 489i64, &[]).unwrap(); - builder = builder.constant("SCHEDULE_SYMBOL", 490i64, &[]).unwrap(); - builder = builder.constant("SCHEMA_SYMBOL", 491i64, &[]).unwrap(); - builder = builder.constant("SCHEMA_NAME_SYMBOL", 492i64, &[]).unwrap(); - builder = builder.constant("SCHEMAS_SYMBOL", 493i64, &[]).unwrap(); - builder = builder - .constant("SECOND_MICROSECOND_SYMBOL", 494i64, &[]) - .unwrap(); - builder = builder.constant("SECOND_SYMBOL", 495i64, &[]).unwrap(); - builder = builder.constant("SECURITY_SYMBOL", 496i64, &[]).unwrap(); - builder = builder.constant("SELECT_SYMBOL", 497i64, &[]).unwrap(); - builder = builder.constant("SENSITIVE_SYMBOL", 498i64, &[]).unwrap(); - builder = builder.constant("SEPARATOR_SYMBOL", 499i64, &[]).unwrap(); - builder = builder - .constant("SERIALIZABLE_SYMBOL", 500i64, &[]) - .unwrap(); - builder = builder.constant("SERIAL_SYMBOL", 501i64, &[]).unwrap(); - builder = builder.constant("SESSION_SYMBOL", 502i64, &[]).unwrap(); - builder = builder.constant("SERVER_SYMBOL", 503i64, &[]).unwrap(); - builder = builder - .constant("SERVER_OPTIONS_SYMBOL", 504i64, &[]) - .unwrap(); - builder = builder - .constant("SESSION_USER_SYMBOL", 505i64, &[]) - .unwrap(); - builder = builder.constant("SET_SYMBOL", 506i64, &[]).unwrap(); - builder = builder.constant("SET_VAR_SYMBOL", 507i64, &[]).unwrap(); - builder = builder.constant("SHARE_SYMBOL", 508i64, &[]).unwrap(); - builder = builder.constant("SHOW_SYMBOL", 509i64, &[]).unwrap(); - builder = builder.constant("SHUTDOWN_SYMBOL", 510i64, &[]).unwrap(); - builder = builder.constant("SIGNAL_SYMBOL", 511i64, &[]).unwrap(); - builder = builder.constant("SIGNED_SYMBOL", 512i64, &[]).unwrap(); - builder = builder.constant("SIMPLE_SYMBOL", 513i64, &[]).unwrap(); - builder = builder.constant("SLAVE_SYMBOL", 514i64, &[]).unwrap(); - builder = builder.constant("SLOW_SYMBOL", 515i64, &[]).unwrap(); - builder = builder.constant("SMALLINT_SYMBOL", 516i64, &[]).unwrap(); - builder = builder.constant("SNAPSHOT_SYMBOL", 517i64, &[]).unwrap(); - builder = builder.constant("SOME_SYMBOL", 518i64, &[]).unwrap(); - builder = builder.constant("SOCKET_SYMBOL", 519i64, &[]).unwrap(); - builder = builder.constant("SONAME_SYMBOL", 520i64, &[]).unwrap(); - builder = builder.constant("SOUNDS_SYMBOL", 521i64, &[]).unwrap(); - builder = builder.constant("SOURCE_SYMBOL", 522i64, &[]).unwrap(); - builder = builder.constant("SPATIAL_SYMBOL", 523i64, &[]).unwrap(); - builder = builder.constant("SPECIFIC_SYMBOL", 524i64, &[]).unwrap(); - builder = builder - .constant("SQLEXCEPTION_SYMBOL", 525i64, &[]) - .unwrap(); - builder = builder.constant("SQLSTATE_SYMBOL", 526i64, &[]).unwrap(); - builder = builder.constant("SQLWARNING_SYMBOL", 527i64, &[]).unwrap(); - builder = builder - .constant("SQL_AFTER_GTIDS_SYMBOL", 528i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_AFTER_MTS_GAPS_SYMBOL", 529i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_BEFORE_GTIDS_SYMBOL", 530i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_BIG_RESULT_SYMBOL", 531i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_BUFFER_RESULT_SYMBOL", 532i64, &[]) - .unwrap(); - builder = builder.constant("SQL_CACHE_SYMBOL", 533i64, &[]).unwrap(); - builder = builder - .constant("SQL_CALC_FOUND_ROWS_SYMBOL", 534i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_NO_CACHE_SYMBOL", 535i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_SMALL_RESULT_SYMBOL", 536i64, &[]) - .unwrap(); - builder = builder.constant("SQL_SYMBOL", 537i64, &[]).unwrap(); - builder = builder.constant("SQL_THREAD_SYMBOL", 538i64, &[]).unwrap(); - builder = builder.constant("SSL_SYMBOL", 539i64, &[]).unwrap(); - builder = builder.constant("STACKED_SYMBOL", 540i64, &[]).unwrap(); - builder = builder.constant("STARTING_SYMBOL", 541i64, &[]).unwrap(); - builder = builder.constant("STARTS_SYMBOL", 542i64, &[]).unwrap(); - builder = builder.constant("START_SYMBOL", 543i64, &[]).unwrap(); - builder = builder - .constant("STATS_AUTO_RECALC_SYMBOL", 544i64, &[]) - .unwrap(); - builder = builder - .constant("STATS_PERSISTENT_SYMBOL", 545i64, &[]) - .unwrap(); - builder = builder - .constant("STATS_SAMPLE_PAGES_SYMBOL", 546i64, &[]) - .unwrap(); - builder = builder.constant("STATUS_SYMBOL", 547i64, &[]).unwrap(); - builder = builder.constant("STDDEV_SAMP_SYMBOL", 548i64, &[]).unwrap(); - builder = builder.constant("STDDEV_SYMBOL", 549i64, &[]).unwrap(); - builder = builder.constant("STDDEV_POP_SYMBOL", 550i64, &[]).unwrap(); - builder = builder.constant("STD_SYMBOL", 551i64, &[]).unwrap(); - builder = builder.constant("STOP_SYMBOL", 552i64, &[]).unwrap(); - builder = builder.constant("STORAGE_SYMBOL", 553i64, &[]).unwrap(); - builder = builder.constant("STORED_SYMBOL", 554i64, &[]).unwrap(); - builder = builder - .constant("STRAIGHT_JOIN_SYMBOL", 555i64, &[]) - .unwrap(); - builder = builder.constant("STRING_SYMBOL", 556i64, &[]).unwrap(); - builder = builder - .constant("SUBCLASS_ORIGIN_SYMBOL", 557i64, &[]) - .unwrap(); - builder = builder.constant("SUBDATE_SYMBOL", 558i64, &[]).unwrap(); - builder = builder.constant("SUBJECT_SYMBOL", 559i64, &[]).unwrap(); - builder = builder - .constant("SUBPARTITIONS_SYMBOL", 560i64, &[]) - .unwrap(); - builder = builder - .constant("SUBPARTITION_SYMBOL", 561i64, &[]) - .unwrap(); - builder = builder.constant("SUBSTR_SYMBOL", 562i64, &[]).unwrap(); - builder = builder.constant("SUBSTRING_SYMBOL", 563i64, &[]).unwrap(); - builder = builder.constant("SUM_SYMBOL", 564i64, &[]).unwrap(); - builder = builder.constant("SUPER_SYMBOL", 565i64, &[]).unwrap(); - builder = builder.constant("SUSPEND_SYMBOL", 566i64, &[]).unwrap(); - builder = builder.constant("SWAPS_SYMBOL", 567i64, &[]).unwrap(); - builder = builder.constant("SWITCHES_SYMBOL", 568i64, &[]).unwrap(); - builder = builder.constant("SYSDATE_SYMBOL", 569i64, &[]).unwrap(); - builder = builder.constant("SYSTEM_USER_SYMBOL", 570i64, &[]).unwrap(); - builder = builder.constant("TABLES_SYMBOL", 571i64, &[]).unwrap(); - builder = builder.constant("TABLESPACE_SYMBOL", 572i64, &[]).unwrap(); - builder = builder - .constant("TABLE_REF_PRIORITY_SYMBOL", 573i64, &[]) - .unwrap(); - builder = builder.constant("TABLE_SYMBOL", 574i64, &[]).unwrap(); - builder = builder - .constant("TABLE_CHECKSUM_SYMBOL", 575i64, &[]) - .unwrap(); - builder = builder.constant("TABLE_NAME_SYMBOL", 576i64, &[]).unwrap(); - builder = builder.constant("TEMPORARY_SYMBOL", 577i64, &[]).unwrap(); - builder = builder.constant("TEMPTABLE_SYMBOL", 578i64, &[]).unwrap(); - builder = builder.constant("TERMINATED_SYMBOL", 579i64, &[]).unwrap(); - builder = builder.constant("TEXT_SYMBOL", 580i64, &[]).unwrap(); - builder = builder.constant("THAN_SYMBOL", 581i64, &[]).unwrap(); - builder = builder.constant("THEN_SYMBOL", 582i64, &[]).unwrap(); - builder = builder.constant("TIMESTAMP_SYMBOL", 583i64, &[]).unwrap(); - builder = builder - .constant("TIMESTAMP_ADD_SYMBOL", 584i64, &[]) - .unwrap(); - builder = builder - .constant("TIMESTAMP_DIFF_SYMBOL", 585i64, &[]) - .unwrap(); - builder = builder.constant("TIME_SYMBOL", 586i64, &[]).unwrap(); - builder = builder.constant("TINYBLOB_SYMBOL", 587i64, &[]).unwrap(); - builder = builder.constant("TINYINT_SYMBOL", 588i64, &[]).unwrap(); - builder = builder.constant("TINYTEXT_SYMBOL", 589i64, &[]).unwrap(); - builder = builder.constant("TO_SYMBOL", 590i64, &[]).unwrap(); - builder = builder.constant("TRAILING_SYMBOL", 591i64, &[]).unwrap(); - builder = builder.constant("TRANSACTION_SYMBOL", 592i64, &[]).unwrap(); - builder = builder.constant("TRIGGERS_SYMBOL", 593i64, &[]).unwrap(); - builder = builder.constant("TRIGGER_SYMBOL", 594i64, &[]).unwrap(); - builder = builder.constant("TRIM_SYMBOL", 595i64, &[]).unwrap(); - builder = builder.constant("TRUE_SYMBOL", 596i64, &[]).unwrap(); - builder = builder.constant("TRUNCATE_SYMBOL", 597i64, &[]).unwrap(); - builder = builder.constant("TYPES_SYMBOL", 598i64, &[]).unwrap(); - builder = builder.constant("TYPE_SYMBOL", 599i64, &[]).unwrap(); - builder = builder.constant("UDF_RETURNS_SYMBOL", 600i64, &[]).unwrap(); - builder = builder.constant("UNCOMMITTED_SYMBOL", 601i64, &[]).unwrap(); - builder = builder.constant("UNDEFINED_SYMBOL", 602i64, &[]).unwrap(); - builder = builder.constant("UNDOFILE_SYMBOL", 603i64, &[]).unwrap(); - builder = builder - .constant("UNDO_BUFFER_SIZE_SYMBOL", 604i64, &[]) - .unwrap(); - builder = builder.constant("UNDO_SYMBOL", 605i64, &[]).unwrap(); - builder = builder.constant("UNICODE_SYMBOL", 606i64, &[]).unwrap(); - builder = builder.constant("UNINSTALL_SYMBOL", 607i64, &[]).unwrap(); - builder = builder.constant("UNION_SYMBOL", 608i64, &[]).unwrap(); - builder = builder.constant("UNIQUE_SYMBOL", 609i64, &[]).unwrap(); - builder = builder.constant("UNKNOWN_SYMBOL", 610i64, &[]).unwrap(); - builder = builder.constant("UNLOCK_SYMBOL", 611i64, &[]).unwrap(); - builder = builder.constant("UNSIGNED_SYMBOL", 612i64, &[]).unwrap(); - builder = builder.constant("UNTIL_SYMBOL", 613i64, &[]).unwrap(); - builder = builder.constant("UPDATE_SYMBOL", 614i64, &[]).unwrap(); - builder = builder.constant("UPGRADE_SYMBOL", 615i64, &[]).unwrap(); - builder = builder.constant("USAGE_SYMBOL", 616i64, &[]).unwrap(); - builder = builder - .constant("USER_RESOURCES_SYMBOL", 617i64, &[]) - .unwrap(); - builder = builder.constant("USER_SYMBOL", 618i64, &[]).unwrap(); - builder = builder.constant("USE_FRM_SYMBOL", 619i64, &[]).unwrap(); - builder = builder.constant("USE_SYMBOL", 620i64, &[]).unwrap(); - builder = builder.constant("USING_SYMBOL", 621i64, &[]).unwrap(); - builder = builder.constant("UTC_DATE_SYMBOL", 622i64, &[]).unwrap(); - builder = builder - .constant("UTC_TIMESTAMP_SYMBOL", 623i64, &[]) - .unwrap(); - builder = builder.constant("UTC_TIME_SYMBOL", 624i64, &[]).unwrap(); - builder = builder.constant("VALIDATION_SYMBOL", 625i64, &[]).unwrap(); - builder = builder.constant("VALUES_SYMBOL", 626i64, &[]).unwrap(); - builder = builder.constant("VALUE_SYMBOL", 627i64, &[]).unwrap(); - builder = builder.constant("VARBINARY_SYMBOL", 628i64, &[]).unwrap(); - builder = builder.constant("VARCHAR_SYMBOL", 629i64, &[]).unwrap(); - builder = builder - .constant("VARCHARACTER_SYMBOL", 630i64, &[]) - .unwrap(); - builder = builder.constant("VARIABLES_SYMBOL", 631i64, &[]).unwrap(); - builder = builder.constant("VARIANCE_SYMBOL", 632i64, &[]).unwrap(); - builder = builder.constant("VARYING_SYMBOL", 633i64, &[]).unwrap(); - builder = builder.constant("VAR_POP_SYMBOL", 634i64, &[]).unwrap(); - builder = builder.constant("VAR_SAMP_SYMBOL", 635i64, &[]).unwrap(); - builder = builder.constant("VIEW_SYMBOL", 636i64, &[]).unwrap(); - builder = builder.constant("VIRTUAL_SYMBOL", 637i64, &[]).unwrap(); - builder = builder.constant("WAIT_SYMBOL", 638i64, &[]).unwrap(); - builder = builder.constant("WARNINGS_SYMBOL", 639i64, &[]).unwrap(); - builder = builder.constant("WEEK_SYMBOL", 640i64, &[]).unwrap(); - builder = builder - .constant("WEIGHT_STRING_SYMBOL", 641i64, &[]) - .unwrap(); - builder = builder.constant("WHEN_SYMBOL", 642i64, &[]).unwrap(); - builder = builder.constant("WHERE_SYMBOL", 643i64, &[]).unwrap(); - builder = builder.constant("WHILE_SYMBOL", 644i64, &[]).unwrap(); - builder = builder.constant("WITH_SYMBOL", 645i64, &[]).unwrap(); - builder = builder.constant("WITHOUT_SYMBOL", 646i64, &[]).unwrap(); - builder = builder.constant("WORK_SYMBOL", 647i64, &[]).unwrap(); - builder = builder.constant("WRAPPER_SYMBOL", 648i64, &[]).unwrap(); - builder = builder.constant("WRITE_SYMBOL", 649i64, &[]).unwrap(); - builder = builder.constant("X509_SYMBOL", 650i64, &[]).unwrap(); - builder = builder.constant("XA_SYMBOL", 651i64, &[]).unwrap(); - builder = builder.constant("XID_SYMBOL", 652i64, &[]).unwrap(); - builder = builder.constant("XML_SYMBOL", 653i64, &[]).unwrap(); - builder = builder.constant("XOR_SYMBOL", 654i64, &[]).unwrap(); - builder = builder.constant("YEAR_MONTH_SYMBOL", 655i64, &[]).unwrap(); - builder = builder.constant("YEAR_SYMBOL", 656i64, &[]).unwrap(); - builder = builder.constant("ZEROFILL_SYMBOL", 657i64, &[]).unwrap(); - builder = builder.constant("PERSIST_SYMBOL", 658i64, &[]).unwrap(); - builder = builder.constant("ROLE_SYMBOL", 659i64, &[]).unwrap(); - builder = builder.constant("ADMIN_SYMBOL", 660i64, &[]).unwrap(); - builder = builder.constant("INVISIBLE_SYMBOL", 661i64, &[]).unwrap(); - builder = builder.constant("VISIBLE_SYMBOL", 662i64, &[]).unwrap(); - builder = builder.constant("EXCEPT_SYMBOL", 663i64, &[]).unwrap(); - builder = builder.constant("COMPONENT_SYMBOL", 664i64, &[]).unwrap(); - builder = builder.constant("RECURSIVE_SYMBOL", 665i64, &[]).unwrap(); - builder = builder - .constant("JSON_OBJECTAGG_SYMBOL", 666i64, &[]) - .unwrap(); - builder = builder - .constant("JSON_ARRAYAGG_SYMBOL", 667i64, &[]) - .unwrap(); - builder = builder.constant("OF_SYMBOL", 668i64, &[]).unwrap(); - builder = builder.constant("SKIP_SYMBOL", 669i64, &[]).unwrap(); - builder = builder.constant("LOCKED_SYMBOL", 670i64, &[]).unwrap(); - builder = builder.constant("NOWAIT_SYMBOL", 671i64, &[]).unwrap(); - builder = builder.constant("GROUPING_SYMBOL", 672i64, &[]).unwrap(); - builder = builder - .constant("PERSIST_ONLY_SYMBOL", 673i64, &[]) - .unwrap(); - builder = builder.constant("HISTOGRAM_SYMBOL", 674i64, &[]).unwrap(); - builder = builder.constant("BUCKETS_SYMBOL", 675i64, &[]).unwrap(); - builder = builder.constant("REMOTE_SYMBOL", 676i64, &[]).unwrap(); - builder = builder.constant("CLONE_SYMBOL", 677i64, &[]).unwrap(); - builder = builder.constant("CUME_DIST_SYMBOL", 678i64, &[]).unwrap(); - builder = builder.constant("DENSE_RANK_SYMBOL", 679i64, &[]).unwrap(); - builder = builder.constant("EXCLUDE_SYMBOL", 680i64, &[]).unwrap(); - builder = builder.constant("FIRST_VALUE_SYMBOL", 681i64, &[]).unwrap(); - builder = builder.constant("FOLLOWING_SYMBOL", 682i64, &[]).unwrap(); - builder = builder.constant("GROUPS_SYMBOL", 683i64, &[]).unwrap(); - builder = builder.constant("LAG_SYMBOL", 684i64, &[]).unwrap(); - builder = builder.constant("LAST_VALUE_SYMBOL", 685i64, &[]).unwrap(); - builder = builder.constant("LEAD_SYMBOL", 686i64, &[]).unwrap(); - builder = builder.constant("NTH_VALUE_SYMBOL", 687i64, &[]).unwrap(); - builder = builder.constant("NTILE_SYMBOL", 688i64, &[]).unwrap(); - builder = builder.constant("NULLS_SYMBOL", 689i64, &[]).unwrap(); - builder = builder.constant("OTHERS_SYMBOL", 690i64, &[]).unwrap(); - builder = builder.constant("OVER_SYMBOL", 691i64, &[]).unwrap(); - builder = builder - .constant("PERCENT_RANK_SYMBOL", 692i64, &[]) - .unwrap(); - builder = builder.constant("PRECEDING_SYMBOL", 693i64, &[]).unwrap(); - builder = builder.constant("RANK_SYMBOL", 694i64, &[]).unwrap(); - builder = builder.constant("RESPECT_SYMBOL", 695i64, &[]).unwrap(); - builder = builder.constant("ROW_NUMBER_SYMBOL", 696i64, &[]).unwrap(); - builder = builder.constant("TIES_SYMBOL", 697i64, &[]).unwrap(); - builder = builder.constant("UNBOUNDED_SYMBOL", 698i64, &[]).unwrap(); - builder = builder.constant("WINDOW_SYMBOL", 699i64, &[]).unwrap(); - builder = builder.constant("EMPTY_SYMBOL", 700i64, &[]).unwrap(); - builder = builder.constant("JSON_TABLE_SYMBOL", 701i64, &[]).unwrap(); - builder = builder.constant("NESTED_SYMBOL", 702i64, &[]).unwrap(); - builder = builder.constant("ORDINALITY_SYMBOL", 703i64, &[]).unwrap(); - builder = builder.constant("PATH_SYMBOL", 704i64, &[]).unwrap(); - builder = builder.constant("HISTORY_SYMBOL", 705i64, &[]).unwrap(); - builder = builder.constant("REUSE_SYMBOL", 706i64, &[]).unwrap(); - builder = builder.constant("SRID_SYMBOL", 707i64, &[]).unwrap(); - builder = builder - .constant("THREAD_PRIORITY_SYMBOL", 708i64, &[]) - .unwrap(); - builder = builder.constant("RESOURCE_SYMBOL", 709i64, &[]).unwrap(); - builder = builder.constant("SYSTEM_SYMBOL", 710i64, &[]).unwrap(); - builder = builder.constant("VCPU_SYMBOL", 711i64, &[]).unwrap(); - builder = builder - .constant("MASTER_PUBLIC_KEY_PATH_SYMBOL", 712i64, &[]) - .unwrap(); - builder = builder - .constant("GET_MASTER_PUBLIC_KEY_SYMBOL", 713i64, &[]) - .unwrap(); - builder = builder.constant("RESTART_SYMBOL", 714i64, &[]).unwrap(); - builder = builder.constant("DEFINITION_SYMBOL", 715i64, &[]).unwrap(); - builder = builder.constant("DESCRIPTION_SYMBOL", 716i64, &[]).unwrap(); - builder = builder - .constant("ORGANIZATION_SYMBOL", 717i64, &[]) - .unwrap(); - builder = builder.constant("REFERENCE_SYMBOL", 718i64, &[]).unwrap(); - builder = builder.constant("OPTIONAL_SYMBOL", 719i64, &[]).unwrap(); - builder = builder.constant("SECONDARY_SYMBOL", 720i64, &[]).unwrap(); - builder = builder - .constant("SECONDARY_ENGINE_SYMBOL", 721i64, &[]) - .unwrap(); - builder = builder - .constant("SECONDARY_LOAD_SYMBOL", 722i64, &[]) - .unwrap(); - builder = builder - .constant("SECONDARY_UNLOAD_SYMBOL", 723i64, &[]) - .unwrap(); - builder = builder.constant("ACTIVE_SYMBOL", 724i64, &[]).unwrap(); - builder = builder.constant("INACTIVE_SYMBOL", 725i64, &[]).unwrap(); - builder = builder.constant("LATERAL_SYMBOL", 726i64, &[]).unwrap(); - builder = builder.constant("RETAIN_SYMBOL", 727i64, &[]).unwrap(); - builder = builder.constant("OLD_SYMBOL", 728i64, &[]).unwrap(); - builder = builder - .constant("NETWORK_NAMESPACE_SYMBOL", 729i64, &[]) - .unwrap(); - builder = builder.constant("ENFORCED_SYMBOL", 730i64, &[]).unwrap(); - builder = builder.constant("ARRAY_SYMBOL", 731i64, &[]).unwrap(); - builder = builder.constant("OJ_SYMBOL", 732i64, &[]).unwrap(); - builder = builder.constant("MEMBER_SYMBOL", 733i64, &[]).unwrap(); - builder = builder.constant("RANDOM_SYMBOL", 734i64, &[]).unwrap(); - builder = builder - .constant("MASTER_COMPRESSION_ALGORITHM_SYMBOL", 735i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_ZSTD_COMPRESSION_LEVEL_SYMBOL", 736i64, &[]) - .unwrap(); - builder = builder - .constant("PRIVILEGE_CHECKS_USER_SYMBOL", 737i64, &[]) - .unwrap(); - builder = builder - .constant("MASTER_TLS_CIPHERSUITES_SYMBOL", 738i64, &[]) - .unwrap(); - builder = builder - .constant("REQUIRE_ROW_FORMAT_SYMBOL", 739i64, &[]) - .unwrap(); - builder = builder - .constant("PASSWORD_LOCK_TIME_SYMBOL", 740i64, &[]) - .unwrap(); - builder = builder - .constant("FAILED_LOGIN_ATTEMPTS_SYMBOL", 741i64, &[]) - .unwrap(); - builder = builder - .constant("REQUIRE_TABLE_PRIMARY_KEY_CHECK_SYMBOL", 742i64, &[]) - .unwrap(); - builder = builder.constant("STREAM_SYMBOL", 743i64, &[]).unwrap(); - builder = builder.constant("OFF_SYMBOL", 744i64, &[]).unwrap(); - builder = builder.constant("AT_AT_SIGN_SYMBOL", 745i64, &[]).unwrap(); - builder = builder.constant("AT_SIGN_SYMBOL", 746i64, &[]).unwrap(); - builder = builder.constant("CLOSE_CURLY_SYMBOL", 747i64, &[]).unwrap(); - builder = builder.constant("CLOSE_PAR_SYMBOL", 748i64, &[]).unwrap(); - builder = builder.constant("COLON_SYMBOL", 749i64, &[]).unwrap(); - builder = builder.constant("COMMA_SYMBOL", 750i64, &[]).unwrap(); - builder = builder.constant("DOT_SYMBOL", 751i64, &[]).unwrap(); - builder = builder.constant("OPEN_CURLY_SYMBOL", 752i64, &[]).unwrap(); - builder = builder.constant("OPEN_PAR_SYMBOL", 753i64, &[]).unwrap(); - builder = builder.constant("PARAM_MARKER", 754i64, &[]).unwrap(); - builder = builder.constant("SEMICOLON_SYMBOL", 755i64, &[]).unwrap(); - builder = builder.constant("ASSIGN_OPERATOR", 756i64, &[]).unwrap(); - builder = builder - .constant("BITWISE_AND_OPERATOR", 757i64, &[]) - .unwrap(); - builder = builder - .constant("BITWISE_NOT_OPERATOR", 758i64, &[]) - .unwrap(); - builder = builder - .constant("BITWISE_OR_OPERATOR", 759i64, &[]) - .unwrap(); - builder = builder - .constant("BITWISE_XOR_OPERATOR", 760i64, &[]) - .unwrap(); - builder = builder - .constant("CONCAT_PIPES_SYMBOL", 761i64, &[]) - .unwrap(); - builder = builder.constant("DIV_OPERATOR", 762i64, &[]).unwrap(); - builder = builder.constant("EQUAL_OPERATOR", 763i64, &[]).unwrap(); - builder = builder - .constant("GREATER_OR_EQUAL_OPERATOR", 764i64, &[]) - .unwrap(); - builder = builder - .constant("GREATER_THAN_OPERATOR", 765i64, &[]) - .unwrap(); - builder = builder - .constant("JSON_SEPARATOR_SYMBOL", 766i64, &[]) - .unwrap(); - builder = builder - .constant("JSON_UNQUOTED_SEPARATOR_SYMBOL", 767i64, &[]) - .unwrap(); - builder = builder - .constant("LESS_OR_EQUAL_OPERATOR", 768i64, &[]) - .unwrap(); - builder = builder.constant("LESS_THAN_OPERATOR", 769i64, &[]).unwrap(); - builder = builder - .constant("LOGICAL_AND_OPERATOR", 770i64, &[]) - .unwrap(); - builder = builder - .constant("LOGICAL_NOT_OPERATOR", 771i64, &[]) - .unwrap(); - builder = builder - .constant("LOGICAL_OR_OPERATOR", 772i64, &[]) - .unwrap(); - builder = builder.constant("MINUS_OPERATOR", 773i64, &[]).unwrap(); - builder = builder.constant("MOD_OPERATOR", 774i64, &[]).unwrap(); - builder = builder.constant("MULT_OPERATOR", 775i64, &[]).unwrap(); - builder = builder.constant("NOT_EQUAL_OPERATOR", 776i64, &[]).unwrap(); - builder = builder - .constant("NULL_SAFE_EQUAL_OPERATOR", 777i64, &[]) - .unwrap(); - builder = builder.constant("PLUS_OPERATOR", 778i64, &[]).unwrap(); - builder = builder - .constant("SHIFT_LEFT_OPERATOR", 779i64, &[]) - .unwrap(); - builder = builder - .constant("SHIFT_RIGHT_OPERATOR", 780i64, &[]) - .unwrap(); - builder = builder - .constant("BACK_TICK_QUOTED_ID", 781i64, &[]) - .unwrap(); - builder = builder.constant("BIN_NUMBER", 782i64, &[]).unwrap(); - builder = builder.constant("DECIMAL_NUMBER", 783i64, &[]).unwrap(); - builder = builder.constant("DOUBLE_QUOTED_TEXT", 784i64, &[]).unwrap(); - builder = builder.constant("FLOAT_NUMBER", 785i64, &[]).unwrap(); - builder = builder.constant("HEX_NUMBER", 786i64, &[]).unwrap(); - builder = builder.constant("INT_NUMBER", 787i64, &[]).unwrap(); - builder = builder.constant("LONG_NUMBER", 788i64, &[]).unwrap(); - builder = builder.constant("NCHAR_TEXT", 789i64, &[]).unwrap(); - builder = builder.constant("SINGLE_QUOTED_TEXT", 790i64, &[]).unwrap(); - builder = builder.constant("ULONGLONG_NUMBER", 791i64, &[]).unwrap(); - builder = builder.constant("AT_TEXT_SUFFIX", 792i64, &[]).unwrap(); - builder = builder.constant("IDENTIFIER", 793i64, &[]).unwrap(); - builder = builder.constant("UNDERSCORE_CHARSET", 794i64, &[]).unwrap(); - builder = builder.constant("INT1_SYMBOL", 795i64, &[]).unwrap(); - builder = builder.constant("INT2_SYMBOL", 796i64, &[]).unwrap(); - builder = builder.constant("INT3_SYMBOL", 797i64, &[]).unwrap(); - builder = builder.constant("INT4_SYMBOL", 798i64, &[]).unwrap(); - builder = builder.constant("INT8_SYMBOL", 799i64, &[]).unwrap(); - builder = builder.constant("NOT2_SYMBOL", 800i64, &[]).unwrap(); - builder = builder.constant("NULL2_SYMBOL", 801i64, &[]).unwrap(); - builder = builder.constant("SQL_TSI_DAY_SYMBOL", 802i64, &[]).unwrap(); - builder = builder - .constant("SQL_TSI_HOUR_SYMBOL", 803i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_MICROSECOND_SYMBOL", 804i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_MINUTE_SYMBOL", 805i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_MONTH_SYMBOL", 806i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_QUARTER_SYMBOL", 807i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_SECOND_SYMBOL", 808i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_WEEK_SYMBOL", 809i64, &[]) - .unwrap(); - builder = builder - .constant("SQL_TSI_YEAR_SYMBOL", 810i64, &[]) - .unwrap(); - builder = builder.constant("INTERSECT_SYMBOL", 811i64, &[]).unwrap(); - builder = builder.constant("ATTRIBUTE_SYMBOL", 812i64, &[]).unwrap(); - builder = builder - .constant("SOURCE_AUTO_POSITION_SYMBOL", 813i64, &[]) - .unwrap(); - builder = builder.constant("SOURCE_BIND_SYMBOL", 814i64, &[]).unwrap(); - builder = builder - .constant("SOURCE_COMPRESSION_ALGORITHM_SYMBOL", 815i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_CONNECT_RETRY_SYMBOL", 816i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_CONNECTION_AUTO_FAILOVER_SYMBOL", 817i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_DELAY_SYMBOL", 818i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_HEARTBEAT_PERIOD_SYMBOL", 819i64, &[]) - .unwrap(); - builder = builder.constant("SOURCE_HOST_SYMBOL", 820i64, &[]).unwrap(); - builder = builder - .constant("SOURCE_LOG_FILE_SYMBOL", 821i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_LOG_POS_SYMBOL", 822i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_PASSWORD_SYMBOL", 823i64, &[]) - .unwrap(); - builder = builder.constant("SOURCE_PORT_SYMBOL", 824i64, &[]).unwrap(); - builder = builder - .constant("SOURCE_PUBLIC_KEY_PATH_SYMBOL", 825i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_RETRY_COUNT_SYMBOL", 826i64, &[]) - .unwrap(); - builder = builder.constant("SOURCE_SSL_SYMBOL", 827i64, &[]).unwrap(); - builder = builder - .constant("SOURCE_SSL_CA_SYMBOL", 828i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_CAPATH_SYMBOL", 829i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_CERT_SYMBOL", 830i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_CIPHER_SYMBOL", 831i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_CRL_SYMBOL", 832i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_CRLPATH_SYMBOL", 833i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_KEY_SYMBOL", 834i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_SSL_VERIFY_SERVER_CERT_SYMBOL", 835i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_TLS_CIPHERSUITES_SYMBOL", 836i64, &[]) - .unwrap(); - builder = builder - .constant("SOURCE_TLS_VERSION_SYMBOL", 837i64, &[]) - .unwrap(); - builder = builder.constant("SOURCE_USER_SYMBOL", 838i64, &[]).unwrap(); - builder = builder - .constant("SOURCE_ZSTD_COMPRESSION_LEVEL_SYMBOL", 839i64, &[]) - .unwrap(); - builder = builder - .constant("GET_SOURCE_PUBLIC_KEY_SYMBOL", 840i64, &[]) - .unwrap(); - builder = builder.constant("GTID_ONLY_SYMBOL", 841i64, &[]).unwrap(); - builder = builder - .constant("ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_SYMBOL", 842i64, &[]) - .unwrap(); - builder = builder.constant("ZONE_SYMBOL", 843i64, &[]).unwrap(); - builder = builder.constant("INNODB_SYMBOL", 844i64, &[]).unwrap(); - builder = builder.constant("TLS_SYMBOL", 845i64, &[]).unwrap(); - builder = builder.constant("REDO_LOG_SYMBOL", 846i64, &[]).unwrap(); - builder = builder.constant("KEYRING_SYMBOL", 847i64, &[]).unwrap(); - builder = builder - .constant("ENGINE_ATTRIBUTE_SYMBOL", 848i64, &[]) - .unwrap(); - builder = builder - .constant("SECONDARY_ENGINE_ATTRIBUTE_SYMBOL", 849i64, &[]) - .unwrap(); - builder = builder.constant("JSON_VALUE_SYMBOL", 850i64, &[]).unwrap(); - builder = builder.constant("RETURNING_SYMBOL", 851i64, &[]).unwrap(); - builder = builder - .constant("GEOMCOLLECTION_SYMBOL", 852i64, &[]) - .unwrap(); - builder = builder.constant("COMMENT", 900i64, &[]).unwrap(); - builder = builder - .constant("MYSQL_COMMENT_START", 901i64, &[]) - .unwrap(); - builder = builder.constant("MYSQL_COMMENT_END", 902i64, &[]).unwrap(); - builder = builder.constant("WHITESPACE", 0i64, &[]).unwrap(); - builder = builder.constant("EOF", -1i64, &[]).unwrap(); - builder = builder.constant("TOKENS", array_tokens(), &[]).unwrap(); - builder = builder - .constant("FUNCTIONS", array_functions(), &[]) - .unwrap(); - builder = builder.constant("SYNONYMS", array_synonyms(), &[]).unwrap(); - builder = builder.constant("VERSIONS", array_versions(), &[]).unwrap(); - builder = builder - .constant("UNDERSCORE_CHARSETS", array_underscore_charsets(), &[]) - .unwrap(); - builder -} diff --git a/packages/php-ext-wp-mysql-parser/src/lib.rs b/packages/php-ext-wp-mysql-parser/src/lib.rs deleted file mode 100644 index 4e41bb6c4..000000000 --- a/packages/php-ext-wp-mysql-parser/src/lib.rs +++ /dev/null @@ -1,2110 +0,0 @@ -#![cfg_attr(windows, feature(abi_vectorcall))] - -use std::cell::RefCell; -use std::collections::{HashMap, HashSet}; -use std::os::raw::c_char; -use std::ptr; -use std::rc::Rc; -use std::sync::Arc; - -use ext_php_rs::convert::{FromZval, IntoZval, IntoZvalDyn}; -use ext_php_rs::exception::{PhpException, PhpResult}; -use ext_php_rs::ffi::{zend_class_entry, zend_object, zval}; -use ext_php_rs::flags::DataType; -use ext_php_rs::prelude::*; -use ext_php_rs::types::{ArrayKey, ZendCallable, ZendHashTable, ZendObject, Zval}; -use ext_php_rs::zend::{ClassEntry, ModuleEntry}; -use ext_php_rs::{info_table_end, info_table_row, info_table_start}; - -mod lexer_constants; -use lexer_constants as lex; -use lexer_constants::register_lexer_constants; - -const SQL_MODE_HIGH_NOT_PRECEDENCE: i64 = 1; -const SQL_MODE_PIPES_AS_CONCAT: i64 = 2; -const SQL_MODE_IGNORE_SPACE: i64 = 4; -const SQL_MODE_NO_BACKSLASH_ESCAPES: i64 = 8; -const SQL_MODE_ANSI_QUOTES: i64 = 16; -const STACK_RED_ZONE: usize = 128 * 1024; -const STACK_GROW_SIZE: usize = 8 * 1024 * 1024; - -extern "C" { - fn zend_update_property( - scope: *mut zend_class_entry, - object: *mut zend_object, - name: *const c_char, - name_length: usize, - value: *mut zval, - ); -} - -#[derive(Clone)] -struct BinaryString(Vec); - -impl IntoZval for BinaryString { - const TYPE: DataType = DataType::String; - const NULLABLE: bool = false; - - fn set_zval(self, zv: &mut Zval, _persistent: bool) -> ext_php_rs::error::Result<()> { - zv.set_binary(self.0); - Ok(()) - } -} - -fn php_error(message: impl ToString) -> PhpException { - PhpException::default(message.to_string()) -} - -fn php_function(name: &str) -> PhpResult> { - ZendCallable::try_from_name(name).map_err(php_error) -} - -struct PhpClasses { - parser_token: &'static ClassEntry, - mysql_token: &'static ClassEntry, - native_parser_node: &'static ClassEntry, -} - -fn php_classes() -> PhpResult { - Ok(PhpClasses { - parser_token: ClassEntry::try_find("WP_Parser_Token") - .ok_or_else(|| php_error("Missing WP_Parser_Token class"))?, - mysql_token: ClassEntry::try_find("WP_MySQL_Token") - .ok_or_else(|| php_error("Missing WP_MySQL_Token class"))?, - native_parser_node: ClassEntry::try_find("WP_MySQL_Native_Parser_Node") - .ok_or_else(|| php_error("Missing WP_MySQL_Native_Parser_Node class"))?, - }) -} - -fn update_object_property( - object: &mut ZendObject, - scope: &ClassEntry, - name: &str, - value: impl IntoZval, -) -> PhpResult<()> { - let mut value = value.into_zval(false).map_err(php_error)?; - unsafe { - zend_update_property( - ptr::from_ref(scope).cast_mut(), - ptr::from_mut(object), - name.as_ptr().cast::(), - name.len(), - ptr::from_mut(&mut value), - ); - } - Ok(()) -} - -fn create_mysql_token(sql_zval: &Zval, token: TokenInfo, no_backslash: bool) -> PhpResult { - let classes = php_classes()?; - create_mysql_token_with_classes(sql_zval, token, no_backslash, &classes) -} - -fn create_mysql_token_with_classes( - sql_zval: &Zval, - token: TokenInfo, - no_backslash: bool, - classes: &PhpClasses, -) -> PhpResult { - let id = token.id; - let start = i64::try_from(token.start).map_err(php_error)?; - let length = i64::try_from(token.end.saturating_sub(token.start)).map_err(php_error)?; - let mut object = classes.mysql_token.new(); - - update_object_property(&mut object, classes.parser_token, "id", id)?; - update_object_property(&mut object, classes.parser_token, "start", start)?; - update_object_property(&mut object, classes.parser_token, "length", length)?; - update_object_property( - &mut object, - classes.parser_token, - "input", - sql_zval.shallow_clone(), - )?; - update_object_property( - &mut object, - classes.mysql_token, - "sql_mode_no_backslash_escapes_enabled", - no_backslash, - )?; - - object.into_zval(false).map_err(php_error) -} - -fn sql_modes_mask(sql_modes: &[String]) -> i64 { - let mut mask = 0; - for sql_mode in sql_modes { - match sql_mode.to_ascii_uppercase().as_str() { - "HIGH_NOT_PRECEDENCE" => mask |= SQL_MODE_HIGH_NOT_PRECEDENCE, - "PIPES_AS_CONCAT" => mask |= SQL_MODE_PIPES_AS_CONCAT, - "IGNORE_SPACE" => mask |= SQL_MODE_IGNORE_SPACE, - "NO_BACKSLASH_ESCAPES" => mask |= SQL_MODE_NO_BACKSLASH_ESCAPES, - "ANSI_QUOTES" => mask |= SQL_MODE_ANSI_QUOTES, - "ANSI" => { - mask |= SQL_MODE_PIPES_AS_CONCAT | SQL_MODE_IGNORE_SPACE | SQL_MODE_ANSI_QUOTES - } - _ => {} - } - } - mask -} - -fn zval_to_weak_string_bytes(zv: &Zval) -> PhpResult> { - if let Some(bytes) = zv.binary::() { - return Ok(bytes); - } - if zv.is_null() || zv.is_false() { - return Ok(Vec::new()); - } - if zv.is_true() { - return Ok(b"1".to_vec()); - } - if let Some(value) = zv.long() { - return Ok(value.to_string().into_bytes()); - } - if let Some(value) = zv.double() { - return Ok(value.to_string().into_bytes()); - } - Err(php_error("Invalid value given for argument `sql`.")) -} - -fn byte_in(byte: u8, mask: &[u8]) -> bool { - mask.contains(&byte) -} - -fn span_while(bytes: &[u8], mut pos: usize, predicate: impl Fn(u8) -> bool) -> usize { - while pos < bytes.len() && predicate(bytes[pos]) { - pos += 1; - } - pos -} - -fn span_until(bytes: &[u8], mut pos: usize, needles: &[u8]) -> usize { - while pos < bytes.len() && !needles.contains(&bytes[pos]) { - pos += 1; - } - pos -} - -fn bytes_ascii_upper(bytes: &[u8]) -> String { - bytes - .iter() - .map(|byte| byte.to_ascii_uppercase() as char) - .collect() -} - -fn bytes_ascii_lower(bytes: &[u8]) -> String { - bytes - .iter() - .map(|byte| byte.to_ascii_lowercase() as char) - .collect() -} - -#[derive(Clone, Copy)] -struct TokenInfo { - id: i64, - start: usize, - end: usize, -} - -#[php_class] -#[php(name = "WP_MySQL_Native_Token_Stream")] -pub struct WpMySqlNativeTokenStream { - sql_zval: Zval, - tokens: Vec, - no_backslash: bool, -} - -#[php_impl] -#[php(change_method_case = "snake_case")] -impl WpMySqlNativeTokenStream { - pub fn count(&self) -> usize { - self.tokens.len() - } -} - -#[php_class] -#[php(name = "WP_MySQL_Native_Lexer", modifier = "register_lexer_constants")] -pub struct WpMySqlNativeLexer { - sql: Vec, - sql_zval: Zval, - mysql_version: i64, - sql_modes: i64, - bytes_already_read: usize, - token_starts_at: usize, - token_type: Option, - in_mysql_comment: bool, -} - -#[php_impl] -#[php(change_method_case = "snake_case")] -impl WpMySqlNativeLexer { - pub fn __construct( - sql: &Zval, - mysql_version: Option, - sql_modes: Option>, - ) -> PhpResult { - let mysql_version = mysql_version.unwrap_or(80038); - let sql_modes = sql_modes.unwrap_or_default(); - let sql = zval_to_weak_string_bytes(sql)?; - let sql_zval = BinaryString(sql.clone()) - .into_zval(false) - .map_err(php_error)?; - - Ok(Self { - sql, - sql_zval, - mysql_version, - sql_modes: sql_modes_mask(&sql_modes), - bytes_already_read: 0, - token_starts_at: 0, - token_type: None, - in_mysql_comment: false, - }) - } - - pub fn next_token(&mut self) -> bool { - if self.token_type == Some(lex::EOF) - || (self.token_type.is_none() && self.bytes_already_read > 0) - { - self.token_type = None; - return false; - } - - loop { - self.token_starts_at = self.bytes_already_read; - self.token_type = self.read_next_token(); - if !matches!( - self.token_type, - Some( - lex::WHITESPACE - | lex::COMMENT - | lex::MYSQL_COMMENT_START - | lex::MYSQL_COMMENT_END - ) - ) { - break; - } - } - - self.token_type.is_some() - } - - pub fn get_token(&mut self) -> PhpResult { - match self.current_token_info() { - Some(token) => self.create_token(token), - None => Ok(Zval::null()), - } - } - - pub fn remaining_tokens(&mut self) -> PhpResult> { - let mut tokens = Vec::new(); - while self.next_token() { - if let Some(token) = self.current_token_info() { - tokens.push(self.create_token(token)?); - } - } - Ok(tokens) - } - - pub fn native_token_stream(&mut self) -> WpMySqlNativeTokenStream { - let mut tokens = Vec::new(); - while self.next_token() { - if let Some(token) = self.current_token_info() { - tokens.push(token); - } - } - - WpMySqlNativeTokenStream { - sql_zval: self.sql_zval.shallow_clone(), - tokens, - no_backslash: self.is_sql_mode_active(SQL_MODE_NO_BACKSLASH_ESCAPES), - } - } - - pub fn get_mysql_version(&self) -> i64 { - self.mysql_version - } - - pub fn is_sql_mode_active(&self, mode: i64) -> bool { - (self.sql_modes & mode) != 0 - } - - pub fn get_token_id(token_name: String) -> Option { - lex::token_id(&token_name) - } - - pub fn get_token_name(token_id: i64) -> Option { - lex::token_name(token_id).map(ToOwned::to_owned) - } -} - -impl WpMySqlNativeLexer { - fn current_token_info(&self) -> Option { - self.token_type.map(|id| TokenInfo { - id, - start: self.token_starts_at, - end: self.bytes_already_read, - }) - } - - fn create_token(&self, token: TokenInfo) -> PhpResult { - create_mysql_token( - &self.sql_zval, - token, - self.is_sql_mode_active(SQL_MODE_NO_BACKSLASH_ESCAPES), - ) - } - - fn read_next_token(&mut self) -> Option { - let byte = self.byte_at(self.bytes_already_read); - let next_byte = self.byte_at(self.bytes_already_read + 1); - - let token = match byte { - Some(b'\'' | b'"' | b'`') => self.read_quoted_text(), - Some(byte) if byte.is_ascii_digit() => self.read_number(), - Some(b'.') => { - if next_byte.is_some_and(|byte| byte.is_ascii_digit()) { - self.read_number() - } else { - self.bytes_already_read += 1; - Some(lex::DOT_SYMBOL) - } - } - Some(b'=') => { - self.bytes_already_read += 1; - Some(lex::EQUAL_OPERATOR) - } - Some(b':') => { - self.bytes_already_read += 1; - if next_byte == Some(b'=') { - self.bytes_already_read += 1; - Some(lex::ASSIGN_OPERATOR) - } else { - Some(lex::COLON_SYMBOL) - } - } - Some(b'<') => self.read_less_than(next_byte), - Some(b'>') => self.read_greater_than(next_byte), - Some(b'!') => { - self.bytes_already_read += 1; - if next_byte == Some(b'=') { - self.bytes_already_read += 1; - Some(lex::NOT_EQUAL_OPERATOR) - } else { - Some(lex::LOGICAL_NOT_OPERATOR) - } - } - Some(b'+') => { - self.bytes_already_read += 1; - Some(lex::PLUS_OPERATOR) - } - Some(b'-') => self.read_minus(next_byte), - Some(b'*') => self.read_star(next_byte), - Some(b'/') => self.read_slash(next_byte), - Some(b'%') => { - self.bytes_already_read += 1; - Some(lex::MOD_OPERATOR) - } - Some(b'&') => { - self.bytes_already_read += 1; - if next_byte == Some(b'&') { - self.bytes_already_read += 1; - Some(lex::LOGICAL_AND_OPERATOR) - } else { - Some(lex::BITWISE_AND_OPERATOR) - } - } - Some(b'^') => { - self.bytes_already_read += 1; - Some(lex::BITWISE_XOR_OPERATOR) - } - Some(b'|') => { - self.bytes_already_read += 1; - if next_byte == Some(b'|') { - self.bytes_already_read += 1; - if self.is_sql_mode_active(SQL_MODE_PIPES_AS_CONCAT) { - Some(lex::CONCAT_PIPES_SYMBOL) - } else { - Some(lex::LOGICAL_OR_OPERATOR) - } - } else { - Some(lex::BITWISE_OR_OPERATOR) - } - } - Some(b'~') => { - self.bytes_already_read += 1; - Some(lex::BITWISE_NOT_OPERATOR) - } - Some(b',') => { - self.bytes_already_read += 1; - Some(lex::COMMA_SYMBOL) - } - Some(b';') => { - self.bytes_already_read += 1; - Some(lex::SEMICOLON_SYMBOL) - } - Some(b'(') => { - self.bytes_already_read += 1; - Some(lex::OPEN_PAR_SYMBOL) - } - Some(b')') => { - self.bytes_already_read += 1; - Some(lex::CLOSE_PAR_SYMBOL) - } - Some(b'{') => { - self.bytes_already_read += 1; - Some(lex::OPEN_CURLY_SYMBOL) - } - Some(b'}') => { - self.bytes_already_read += 1; - Some(lex::CLOSE_CURLY_SYMBOL) - } - Some(b'@') => self.read_at(next_byte), - Some(b'?') => { - self.bytes_already_read += 1; - Some(lex::PARAM_MARKER) - } - Some(b'\\') => { - self.bytes_already_read += 1; - if next_byte == Some(b'N') { - self.bytes_already_read += 1; - Some(lex::NULL2_SYMBOL) - } else { - None - } - } - Some(b'#') => Some(self.read_line_comment()), - Some(byte) if byte_in(byte, lex::WHITESPACE_MASK.as_bytes()) => { - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte_in(byte, lex::WHITESPACE_MASK.as_bytes()) - }); - Some(lex::WHITESPACE) - } - Some(b'x' | b'X' | b'b' | b'B') if next_byte == Some(b'\'') => self.read_number(), - Some(b'n' | b'N') if next_byte == Some(b'\'') => { - self.bytes_already_read += 1; - let token = self.read_quoted_text(); - if token == Some(lex::SINGLE_QUOTED_TEXT) { - Some(lex::NCHAR_TEXT) - } else { - token - } - } - None => Some(lex::EOF), - Some(_) => { - let started_at = self.bytes_already_read; - let mut token = self.read_identifier(); - if token == Some(lex::IDENTIFIER) { - if started_at > 0 && self.byte_at(started_at - 1) == Some(b'.') { - token = Some(lex::IDENTIFIER); - } else if self.byte_at(started_at) == Some(b'_') - && lex::is_underscore_charset(&bytes_ascii_lower( - &self.sql[self.token_starts_at..self.bytes_already_read], - )) - { - token = Some(lex::UNDERSCORE_CHARSET); - } else { - let identifier = - self.sql[self.token_starts_at..self.bytes_already_read].to_vec(); - token = Some(self.determine_identifier_or_keyword_type(&identifier)); - } - } - token - } - }; - - token - } - - fn byte_at(&self, pos: usize) -> Option { - self.sql.get(pos).copied() - } - - fn read_less_than(&mut self, next_byte: Option) -> Option { - self.bytes_already_read += 1; - if next_byte == Some(b'=') { - self.bytes_already_read += 1; - if self.byte_at(self.bytes_already_read) == Some(b'>') { - self.bytes_already_read += 1; - Some(lex::NULL_SAFE_EQUAL_OPERATOR) - } else { - Some(lex::LESS_OR_EQUAL_OPERATOR) - } - } else if next_byte == Some(b'>') { - self.bytes_already_read += 1; - Some(lex::NOT_EQUAL_OPERATOR) - } else if next_byte == Some(b'<') { - self.bytes_already_read += 1; - Some(lex::SHIFT_LEFT_OPERATOR) - } else { - Some(lex::LESS_THAN_OPERATOR) - } - } - - fn read_greater_than(&mut self, next_byte: Option) -> Option { - self.bytes_already_read += 1; - if next_byte == Some(b'=') { - self.bytes_already_read += 1; - Some(lex::GREATER_OR_EQUAL_OPERATOR) - } else if next_byte == Some(b'>') { - self.bytes_already_read += 1; - Some(lex::SHIFT_RIGHT_OPERATOR) - } else { - Some(lex::GREATER_THAN_OPERATOR) - } - } - - fn read_minus(&mut self, next_byte: Option) -> Option { - if next_byte == Some(b'-') - && self.bytes_already_read + 2 < self.sql.len() - && byte_in( - self.sql[self.bytes_already_read + 2], - lex::WHITESPACE_MASK.as_bytes(), - ) - { - Some(self.read_line_comment()) - } else if next_byte == Some(b'>') { - self.bytes_already_read += 2; - if self.byte_at(self.bytes_already_read) == Some(b'>') { - self.bytes_already_read += 1; - if self.mysql_version >= 50713 { - Some(lex::JSON_UNQUOTED_SEPARATOR_SYMBOL) - } else { - None - } - } else if self.mysql_version >= 50708 { - Some(lex::JSON_SEPARATOR_SYMBOL) - } else { - None - } - } else { - self.bytes_already_read += 1; - Some(lex::MINUS_OPERATOR) - } - } - - fn read_star(&mut self, next_byte: Option) -> Option { - self.bytes_already_read += 1; - if next_byte == Some(b'/') && self.in_mysql_comment { - self.bytes_already_read += 1; - self.in_mysql_comment = false; - Some(lex::MYSQL_COMMENT_END) - } else { - Some(lex::MULT_OPERATOR) - } - } - - fn read_slash(&mut self, next_byte: Option) -> Option { - if next_byte == Some(b'*') { - if self.byte_at(self.bytes_already_read + 2) == Some(b'!') { - Some(self.read_mysql_comment()) - } else { - self.bytes_already_read += 2; - self.read_comment_content(); - Some(lex::COMMENT) - } - } else { - self.bytes_already_read += 1; - Some(lex::DIV_OPERATOR) - } - } - - fn read_at(&mut self, next_byte: Option) -> Option { - self.bytes_already_read += 1; - if next_byte == Some(b'@') { - self.bytes_already_read += 1; - return Some(lex::AT_AT_SIGN_SYMBOL); - } - - let start = self.bytes_already_read; - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'.' | b'$') - }); - if self.bytes_already_read > start { - Some(lex::AT_TEXT_SUFFIX) - } else { - Some(lex::AT_SIGN_SYMBOL) - } - } - - fn read_identifier(&mut self) -> Option { - let started_at = self.bytes_already_read; - loop { - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'$') - }); - - let byte_1 = self.byte_at(self.bytes_already_read).unwrap_or(0); - if !(0xC2..=0xEF).contains(&byte_1) { - break; - } - - let byte_2 = self.byte_at(self.bytes_already_read + 1).unwrap_or(0); - if byte_1 <= 0xDF && (0x80..=0xBF).contains(&byte_2) { - self.bytes_already_read += 2; - continue; - } - - let byte_3 = self.byte_at(self.bytes_already_read + 2).unwrap_or(0); - if byte_1 <= 0xEF - && (0x80..=0xBF).contains(&byte_2) - && (0x80..=0xBF).contains(&byte_3) - && !(byte_1 == 0xED && byte_2 >= 0xA0) - && !(byte_1 == 0xE0 && byte_2 < 0xA0) - { - self.bytes_already_read += 3; - continue; - } - - break; - } - - (self.bytes_already_read > started_at).then_some(lex::IDENTIFIER) - } - - fn read_number(&mut self) -> Option { - let byte = self.byte_at(self.bytes_already_read); - let next_byte = self.byte_at(self.bytes_already_read + 1); - let third_byte = self.byte_at(self.bytes_already_read + 2); - let mut token_type; - - if (byte == Some(b'0') - && next_byte == Some(b'x') - && third_byte.is_some_and(|byte| byte_in(byte, lex::HEX_DIGIT_MASK.as_bytes()))) - || (matches!(byte, Some(b'x' | b'X')) && next_byte == Some(b'\'')) - { - let is_quoted = next_byte == Some(b'\''); - self.bytes_already_read += 2; - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte_in(byte, lex::HEX_DIGIT_MASK.as_bytes()) - }); - if is_quoted { - if self.byte_at(self.bytes_already_read) != Some(b'\'') { - return None; - } - self.bytes_already_read += 1; - } - token_type = lex::HEX_NUMBER; - } else if (byte == Some(b'0') - && next_byte == Some(b'b') - && matches!(third_byte, Some(b'0' | b'1'))) - || (matches!(byte, Some(b'b' | b'B')) && next_byte == Some(b'\'')) - { - let is_quoted = next_byte == Some(b'\''); - self.bytes_already_read += 2; - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - matches!(byte, b'0' | b'1') - }); - if is_quoted { - if self.byte_at(self.bytes_already_read) != Some(b'\'') { - return None; - } - self.bytes_already_read += 1; - } - token_type = lex::BIN_NUMBER; - } else { - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte.is_ascii_digit() - }); - token_type = lex::INT_NUMBER; - - if self.byte_at(self.bytes_already_read) == Some(b'.') { - self.bytes_already_read += 1; - token_type = lex::DECIMAL_NUMBER; - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte.is_ascii_digit() - }); - } - - let exponent = self.byte_at(self.bytes_already_read); - let next = self.byte_at(self.bytes_already_read + 1); - let has_exponent = matches!(exponent, Some(b'e' | b'E')) - && (next.is_some_and(|byte| byte.is_ascii_digit()) - || (matches!(next, Some(b'+' | b'-')) - && self - .byte_at(self.bytes_already_read + 2) - .is_some_and(|byte| byte.is_ascii_digit()))); - if has_exponent { - self.bytes_already_read += 2; - self.bytes_already_read = span_while(&self.sql, self.bytes_already_read, |byte| { - byte.is_ascii_digit() - }); - token_type = lex::FLOAT_NUMBER; - } - } - - let token_bytes = &self.sql[self.token_starts_at..self.bytes_already_read]; - let possible_identifier_prefix = token_type == lex::INT_NUMBER - || (token_bytes.first() == Some(&b'0') - && matches!(token_bytes.get(1), Some(b'b' | b'x'))); - - if possible_identifier_prefix && self.read_identifier() == Some(lex::IDENTIFIER) { - token_type = lex::IDENTIFIER; - } - - if token_type == lex::INT_NUMBER { - let mut bytes = &self.sql[self.token_starts_at..self.bytes_already_read]; - if bytes.len() < 10 { - return Some(lex::INT_NUMBER); - } - while bytes.first() == Some(&b'0') { - bytes = &bytes[1..]; - } - let len = bytes.len(); - return Some(if len < 10 { - lex::INT_NUMBER - } else if len == 10 { - if bytes > b"2147483647" { - lex::LONG_NUMBER - } else { - lex::INT_NUMBER - } - } else if len < 19 { - lex::LONG_NUMBER - } else if len == 19 { - if bytes > b"9223372036854775807" { - lex::ULONGLONG_NUMBER - } else { - lex::LONG_NUMBER - } - } else if len == 20 { - if bytes > b"18446744073709551615" { - lex::DECIMAL_NUMBER - } else { - lex::ULONGLONG_NUMBER - } - } else { - lex::DECIMAL_NUMBER - }); - } - - Some(token_type) - } - - fn read_quoted_text(&mut self) -> Option { - let quote = self.byte_at(self.bytes_already_read)?; - self.bytes_already_read += 1; - let is_identifier_quote = - quote == b'`' || (quote == b'"' && self.is_sql_mode_active(SQL_MODE_ANSI_QUOTES)); - let backslash_is_escape = - !is_identifier_quote && !self.is_sql_mode_active(SQL_MODE_NO_BACKSLASH_ESCAPES); - let mut at = self.bytes_already_read; - - loop { - at = span_until(&self.sql, at, &[quote]); - - if backslash_is_escape { - let mut i = 0usize; - while at > i && self.byte_at(at - i - 1) == Some(b'\\') { - i += 1; - } - if i % 2 == 1 { - at += 1; - if at > self.sql.len() { - return None; - } - continue; - } - } - - if self.byte_at(at) != Some(quote) { - return None; - } - - if self.byte_at(at + 1) == Some(quote) { - at += 2; - continue; - } - break; - } - - self.bytes_already_read = at + 1; - if is_identifier_quote { - return Some(lex::BACK_TICK_QUOTED_ID); - } - Some(match quote { - b'"' => lex::DOUBLE_QUOTED_TEXT, - _ => lex::SINGLE_QUOTED_TEXT, - }) - } - - fn read_line_comment(&mut self) -> i64 { - self.bytes_already_read = span_until(&self.sql, self.bytes_already_read, b"\r\n"); - lex::COMMENT - } - - fn read_mysql_comment(&mut self) -> i64 { - // MySQL-specific comments in the following forms: - // 1. /*! ... */ - The content is treated as SQL. - // 2. /*!80400 ... */ - SQL when the server version is at least 8.4.0. - // 3. /*!080400 ... */ - The same version in six-digit form (MySQL 8.1+). - // - // See: https://dev.mysql.com/doc/refman/8.4/en/comments.html - self.bytes_already_read += 3; // Consume the '/*!'. - - // Version has 5 digits (Mmmrr) or 6 digits (MMmmrr + whitespace, MySQL 8.1+). - let digit_start = self.bytes_already_read; - let digit_count = self.sql[digit_start..] - .iter() - .take(6) - .take_while(|byte| byte.is_ascii_digit()) - .count(); - let mut version_length = if digit_count < 5 { 0 } else { 5 }; - if digit_count == 6 - && self.mysql_version >= 80100 - && self - .byte_at(digit_start + 6) - .is_some_and(|byte| byte_in(byte, lex::WHITESPACE_MASK.as_bytes())) - { - version_length = 6; - } - let version = self.sql[digit_start..digit_start + version_length] - .iter() - .fold(0i64, |value, byte| value * 10 + i64::from(byte - b'0')); - - if self.mysql_version < version { - self.read_comment_content(); - lex::COMMENT - } else { - self.bytes_already_read += version_length; - self.in_mysql_comment = true; - lex::MYSQL_COMMENT_START - } - } - - fn read_comment_content(&mut self) { - loop { - self.bytes_already_read = span_until(&self.sql, self.bytes_already_read, b"*"); - self.bytes_already_read += 1; - match self.byte_at(self.bytes_already_read) { - None => break, - Some(b'/') => { - self.bytes_already_read += 1; - break; - } - _ => {} - } - } - } - - fn determine_identifier_or_keyword_type(&mut self, value: &[u8]) -> i64 { - let upper = bytes_ascii_upper(value); - let mut token_type = match lex::keyword_token(&upper) { - Some(token_type) => token_type, - None => return lex::IDENTIFIER, - }; - - if let Some(version) = lex::version_rule(token_type) { - if self.mysql_version < version || -version >= self.mysql_version { - return lex::IDENTIFIER; - } - } - - if token_type == lex::MAX_STATEMENT_TIME_SYMBOL - && !(self.mysql_version >= 50704 && self.mysql_version < 50708) - { - return lex::IDENTIFIER; - } - if token_type == lex::NONBLOCKING_SYMBOL - && !(self.mysql_version >= 50700 && self.mysql_version < 50706) - { - return lex::IDENTIFIER; - } - if token_type == lex::REMOTE_SYMBOL - && (self.mysql_version >= 80003 && self.mysql_version < 80014) - { - return lex::IDENTIFIER; - } - - if lex::is_function_token(token_type) { - let mut peek = self.bytes_already_read; - if self.is_sql_mode_active(SQL_MODE_IGNORE_SPACE) { - peek = span_while(&self.sql, peek, |byte| { - byte_in(byte, lex::WHITESPACE_MASK.as_bytes()) - }); - } - if self.byte_at(peek) != Some(b'(') { - return lex::IDENTIFIER; - } - } - - if token_type == lex::NOT_SYMBOL && self.is_sql_mode_active(SQL_MODE_HIGH_NOT_PRECEDENCE) { - token_type = lex::NOT2_SYMBOL; - } - - lex::token_synonym(token_type).unwrap_or(token_type) - } -} - -struct Grammar { - highest_terminal_id: i64, - rules: Vec>, - query_rule_id: i64, - select_statement_rule_id: Option, -} - -struct Rule { - branches: Vec>, - lookahead: Option>, - rule_name: String, - is_fragment: bool, -} - -impl Grammar { - fn rule(&self, rule_id: i64) -> Option<&Rule> { - usize::try_from(rule_id) - .ok() - .and_then(|index| self.rules.get(index)) - .and_then(Option::as_ref) - } -} - -#[php_class] -#[php(name = "WP_MySQL_Native_Grammar")] -pub struct WpMySqlNativeGrammar { - grammar: Arc, -} - -enum ParserTokenSource { - Php(Vec), - Native { - sql_zval: Zval, - tokens: Vec, - no_backslash: bool, - }, -} - -impl ParserTokenSource { - fn create_php_token_with_classes(&self, index: usize, classes: &PhpClasses) -> PhpResult { - match self { - Self::Php(tokens) => tokens - .get(index) - .map(Zval::shallow_clone) - .ok_or_else(|| php_error("Parser token index is out of range")), - Self::Native { - sql_zval, - tokens, - no_backslash, - } => { - let token = tokens - .get(index) - .copied() - .ok_or_else(|| php_error("Parser token index is out of range"))?; - create_mysql_token_with_classes(sql_zval, token, *no_backslash, classes) - } - } - } - - fn token_info(&self, index: usize) -> PhpResult { - match self { - Self::Php(tokens) => { - let token = tokens - .get(index) - .ok_or_else(|| php_error("Parser token index is out of range"))?; - let token_object = token - .object() - .ok_or_else(|| php_error("Parser token must be an object"))?; - let id = token_object.get_property::("id").map_err(php_error)?; - let start = token_object - .get_property::("start") - .map_err(php_error)?; - let length = token_object - .get_property::("length") - .map_err(php_error)?; - let start = usize::try_from(start).map_err(php_error)?; - let length = usize::try_from(length).map_err(php_error)?; - - Ok(TokenInfo { - id, - start, - end: start.saturating_add(length), - }) - } - Self::Native { tokens, .. } => tokens - .get(index) - .copied() - .ok_or_else(|| php_error("Parser token index is out of range")), - } - } -} - -#[derive(Clone, Copy)] -enum NativeAstChild { - Node(usize), - Token(usize), -} - -#[derive(Clone, Copy)] -enum NativeAstRoot { - No, - Empty, - Node(usize), - Token(usize), -} - -enum NativeParseMatch { - No, - Empty, - Node(usize), - Token(usize), - Fragment(Vec), -} - -struct NativeAstNode { - rule_id: i64, - children: Vec, - first_token: Option, - last_token: Option, - descendant_count: usize, -} - -struct NativeAstArena { - grammar: Arc, - token_source: Arc, - nodes: Vec, - root: NativeAstRoot, -} - -struct NativeAstState { - arena: Arc, - /// Per-AST identity map: node arena index → live PHP wrapper pointer. - /// - /// `WP_Parser_Node` callers expect stable child identity (mutate a child - /// once, walk past, walk back, the mutation is still there). Each - /// accessor in this extension constructs a fresh wrapper unless we - /// intern it here. The cache intentionally stores raw wrapper pointers, - /// not strong PHP references, so Rust can preserve identity without - /// pinning wrappers after PHP drops them. - node_cache: RefCell>, -} - -struct NativeAstWrapperEntry { - ast: Rc, - node_index: usize, - /// Materialized wrappers still participate in identity lookups but no - /// longer delegate reads through the native AST bridge. - is_materialized: bool, -} - -thread_local! { - static NATIVE_AST_WRAPPERS: RefCell> = RefCell::new(HashMap::new()); -} - -impl NativeAstArena { - fn new(grammar: Arc, token_source: Arc) -> Self { - Self { - grammar, - token_source, - nodes: Vec::new(), - root: NativeAstRoot::No, - } - } - - fn push_node(&mut self, rule_id: i64, children: Vec) -> usize { - let index = self.nodes.len(); - let mut first_token = None; - let mut last_token = None; - let mut descendant_count = 0; - for child in &children { - match child { - NativeAstChild::Node(child_index) => { - if let Some(node) = self.nodes.get(*child_index) { - descendant_count += 1 + node.descendant_count; - if first_token.is_none() { - first_token = node.first_token; - } - if node.last_token.is_some() { - last_token = node.last_token; - } - } - } - NativeAstChild::Token(token_index) => { - if first_token.is_none() { - first_token = Some(*token_index); - } - last_token = Some(*token_index); - descendant_count += 1; - } - } - } - - self.nodes.push(NativeAstNode { - rule_id, - children, - first_token, - last_token, - descendant_count, - }); - index - } - - fn node(&self, index: usize) -> PhpResult<&NativeAstNode> { - self.nodes - .get(index) - .ok_or_else(|| php_error("Native AST node index is out of range")) - } - - fn child_node_matches(&self, child: NativeAstChild, rule_name: Option<&str>) -> bool { - let NativeAstChild::Node(index) = child else { - return false; - }; - let Ok(node) = self.node(index) else { - return false; - }; - rule_name.is_none_or(|expected| { - self.grammar - .rule(node.rule_id) - .map(|rule| rule.rule_name == expected) - .unwrap_or(false) - }) - } - - fn child_token_matches(&self, child: NativeAstChild, token_id: Option) -> bool { - let NativeAstChild::Token(index) = child else { - return false; - }; - token_id.is_none_or(|expected| { - self.token_source - .token_info(index) - .map(|token| token.id == expected) - .unwrap_or(false) - }) - } - - fn descendant_stack(&self, index: usize) -> PhpResult> { - let node = self.node(index)?; - let mut stack = Vec::with_capacity(node.descendant_count); - stack.extend(node.children.iter().rev().copied()); - Ok(stack) - } -} - -fn native_ast_wrapper_key(wrapper_zval: &Zval) -> PhpResult { - let object = wrapper_zval - .object() - .ok_or_else(|| php_error("Missing native AST wrapper"))?; - Ok(ptr::from_ref(object) as usize) -} - -fn native_ast_from_wrapper(wrapper_zval: &Zval) -> PhpResult<(Rc, usize)> { - let key = native_ast_wrapper_key(wrapper_zval)?; - NATIVE_AST_WRAPPERS - .with(|wrappers| { - wrappers.borrow().get(&key).and_then(|entry| { - (!entry.is_materialized).then(|| (Rc::clone(&entry.ast), entry.node_index)) - }) - }) - .ok_or_else(|| php_error("Missing native AST handle")) -} - -fn register_native_ast_wrapper( - object: &ZendObject, - ast: &Rc, - node_index: usize, -) -> usize { - let key = ptr::from_ref(object) as usize; - NATIVE_AST_WRAPPERS.with(|wrappers| { - wrappers.borrow_mut().insert( - key, - NativeAstWrapperEntry { - ast: Rc::clone(ast), - node_index, - is_materialized: false, - }, - ); - }); - ast.node_cache.borrow_mut().insert(node_index, key); - key -} - -fn mark_native_ast_wrapper_materialized_key(key: usize) { - NATIVE_AST_WRAPPERS.with(|wrappers| { - if let Some(entry) = wrappers.borrow_mut().get_mut(&key) { - entry.is_materialized = true; - } - }); -} - -fn release_native_ast_wrapper_key(key: usize) { - let entry = NATIVE_AST_WRAPPERS.with(|wrappers| wrappers.borrow_mut().remove(&key)); - if let Some(entry) = entry { - let mut cache = entry.ast.node_cache.borrow_mut(); - if cache.get(&entry.node_index).copied() == Some(key) { - cache.remove(&entry.node_index); - } - } -} - -fn native_ast_wrapper_matches(key: usize, ast: &Rc, node_index: usize) -> bool { - NATIVE_AST_WRAPPERS.with(|wrappers| { - wrappers - .borrow() - .get(&key) - .is_some_and(|entry| Rc::ptr_eq(&entry.ast, ast) && entry.node_index == node_index) - }) -} - -/// Build a Zval that references an existing PHP object. -/// -/// Used on cache hits to hand a live wrapper back to PHP without allocating a -/// new object. `Zval::set_object()` bumps the object refcount for the returned -/// zval; the Rust cache only stores the pointer and does not own a reference. -unsafe fn zval_from_cached_object(key: usize) -> Zval { - let obj = &mut *(key as *mut ZendObject); - let mut zv = Zval::new(); - zv.set_object(obj); - zv -} - -impl NativeAstState { - fn new(arena: Arc) -> Rc { - Rc::new(Self { - arena, - node_cache: RefCell::new(HashMap::new()), - }) - } - - fn create_php_ast(self: &Rc) -> PhpResult { - let classes = php_classes()?; - self.create_php_ast_with_classes(&classes) - } - - fn create_php_ast_with_classes(self: &Rc, classes: &PhpClasses) -> PhpResult { - match self.arena.root { - NativeAstRoot::No => Ok(Zval::null()), - NativeAstRoot::Empty => { - let mut zval = Zval::new(); - zval.set_bool(true); - Ok(zval) - } - NativeAstRoot::Node(index) => self.create_php_node_with_classes(index, classes), - NativeAstRoot::Token(index) => self - .arena - .token_source - .create_php_token_with_classes(index, classes), - } - } - - /// Resolve a child slot to a Zval, going through the per-AST identity - /// cache for nodes. Tokens are not yet cached — they have no public - /// mutators and no caller in this repo relies on token identity. - fn cached_child_zval( - self: &Rc, - child: NativeAstChild, - classes: &PhpClasses, - ) -> PhpResult { - match child { - NativeAstChild::Node(index) => self.cached_node_zval(index, classes), - NativeAstChild::Token(index) => self - .arena - .token_source - .create_php_token_with_classes(index, classes), - } - } - - fn cached_node_zval(self: &Rc, index: usize, classes: &PhpClasses) -> PhpResult { - let cached_key = { - let cache = self.node_cache.borrow(); - cache.get(&index).copied() - }; - if let Some(key) = cached_key { - if native_ast_wrapper_matches(key, self, index) { - return Ok(unsafe { zval_from_cached_object(key) }); - } - self.node_cache.borrow_mut().remove(&index); - } - - self.create_php_node_with_classes(index, classes) - } - - fn create_php_node_with_classes( - self: &Rc, - index: usize, - classes: &PhpClasses, - ) -> PhpResult { - let node = self.arena.node(index)?; - let mut object = classes.native_parser_node.new(); - let rule_name = self - .arena - .grammar - .rule(node.rule_id) - .map(|rule| rule.rule_name.as_str()) - .unwrap_or_default(); - - update_object_property( - &mut object, - classes.native_parser_node, - "rule_id", - node.rule_id, - )?; - update_object_property( - &mut object, - classes.native_parser_node, - "rule_name", - rule_name.to_owned(), - )?; - - register_native_ast_wrapper(object.as_ref(), self, index); - object.into_zval(false).map_err(php_error) - } -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_release_wrapper(wrapper_zval: &Zval) -> PhpResult<()> { - let key = native_ast_wrapper_key(wrapper_zval)?; - release_native_ast_wrapper_key(key); - Ok(()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_materialize_wrapper(wrapper_zval: &Zval) -> PhpResult<()> { - let key = native_ast_wrapper_key(wrapper_zval)?; - mark_native_ast_wrapper_materialized_key(key); - Ok(()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_has_child(wrapper_zval: &Zval) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - Ok(!ast.arena.node(node_index)?.children.is_empty()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_has_child_node( - wrapper_zval: &Zval, - rule_name: Option, -) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - Ok(ast - .arena - .node(node_index)? - .children - .iter() - .copied() - .any(|child| ast.arena.child_node_matches(child, rule_name.as_deref()))) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_has_child_token( - wrapper_zval: &Zval, - token_id: Option, -) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - Ok(ast - .arena - .node(node_index)? - .children - .iter() - .copied() - .any(|child| ast.arena.child_token_matches(child, token_id))) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_first_child(wrapper_zval: &Zval) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - let Some(child) = ast.arena.node(node_index)?.children.first().copied() else { - return Ok(Zval::null()); - }; - ast.cached_child_zval(child, &classes) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_first_child_node( - wrapper_zval: &Zval, - rule_name: Option, -) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - for child in &ast.arena.node(node_index)?.children { - if ast.arena.child_node_matches(*child, rule_name.as_deref()) { - return ast.cached_child_zval(*child, &classes); - } - } - Ok(Zval::null()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_first_child_token( - wrapper_zval: &Zval, - token_id: Option, -) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - for child in &ast.arena.node(node_index)?.children { - if ast.arena.child_token_matches(*child, token_id) { - return ast.cached_child_zval(*child, &classes); - } - } - Ok(Zval::null()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_first_descendant_node( - wrapper_zval: &Zval, - rule_name: Option, -) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - let mut stack = ast.arena.descendant_stack(node_index)?; - while let Some(child) = stack.pop() { - if ast.arena.child_node_matches(child, rule_name.as_deref()) { - return ast.cached_child_zval(child, &classes); - } - if let NativeAstChild::Node(index) = child { - for child in ast.arena.node(index)?.children.iter().rev() { - stack.push(*child); - } - } - } - Ok(Zval::null()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_first_descendant_token( - wrapper_zval: &Zval, - token_id: Option, -) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - let mut stack = ast.arena.descendant_stack(node_index)?; - while let Some(child) = stack.pop() { - if ast.arena.child_token_matches(child, token_id) { - return ast.cached_child_zval(child, &classes); - } - if let NativeAstChild::Node(index) = child { - for child in ast.arena.node(index)?.children.iter().rev() { - stack.push(*child); - } - } - } - Ok(Zval::null()) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_children(wrapper_zval: &Zval) -> PhpResult> { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - ast.arena - .node(node_index)? - .children - .iter() - .copied() - .map(|child| ast.cached_child_zval(child, &classes)) - .collect() -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_child_nodes( - wrapper_zval: &Zval, - rule_name: Option, -) -> PhpResult> { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - ast.arena - .node(node_index)? - .children - .iter() - .copied() - .filter(|child| ast.arena.child_node_matches(*child, rule_name.as_deref())) - .map(|child| ast.cached_child_zval(child, &classes)) - .collect() -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_child_tokens( - wrapper_zval: &Zval, - token_id: Option, -) -> PhpResult> { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - ast.arena - .node(node_index)? - .children - .iter() - .copied() - .filter(|child| ast.arena.child_token_matches(*child, token_id)) - .map(|child| ast.cached_child_zval(child, &classes)) - .collect() -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_descendants(wrapper_zval: &Zval) -> PhpResult> { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - let root = ast.arena.node(node_index)?; - let mut descendants = Vec::with_capacity(root.descendant_count); - let mut stack = ast.arena.descendant_stack(node_index)?; - while let Some(child) = stack.pop() { - descendants.push(ast.cached_child_zval(child, &classes)?); - if let NativeAstChild::Node(index) = child { - for child in ast.arena.node(index)?.children.iter().rev() { - stack.push(*child); - } - } - } - Ok(descendants) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_descendant_nodes( - wrapper_zval: &Zval, - rule_name: Option, -) -> PhpResult> { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - let mut descendants = Vec::new(); - let mut stack = ast.arena.descendant_stack(node_index)?; - while let Some(child) = stack.pop() { - if ast.arena.child_node_matches(child, rule_name.as_deref()) { - descendants.push(ast.cached_child_zval(child, &classes)?); - } - if let NativeAstChild::Node(index) = child { - for child in ast.arena.node(index)?.children.iter().rev() { - stack.push(*child); - } - } - } - Ok(descendants) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_descendant_tokens( - wrapper_zval: &Zval, - token_id: Option, -) -> PhpResult> { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let classes = php_classes()?; - let mut descendants = Vec::new(); - let mut stack = ast.arena.descendant_stack(node_index)?; - while let Some(child) = stack.pop() { - if ast.arena.child_token_matches(child, token_id) { - descendants.push(ast.cached_child_zval(child, &classes)?); - } - if let NativeAstChild::Node(index) = child { - for child in ast.arena.node(index)?.children.iter().rev() { - stack.push(*child); - } - } - } - Ok(descendants) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_start(wrapper_zval: &Zval) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let node = ast.arena.node(node_index)?; - let token_index = node - .first_token - .ok_or_else(|| php_error("Native AST node has no descendant tokens"))?; - let token = ast.arena.token_source.token_info(token_index)?; - i64::try_from(token.start).map_err(php_error) -} - -#[php_function] -pub fn wp_sqlite_mysql_native_ast_get_length(wrapper_zval: &Zval) -> PhpResult { - let (ast, node_index) = native_ast_from_wrapper(wrapper_zval)?; - let node = ast.arena.node(node_index)?; - let first_token_index = node - .first_token - .ok_or_else(|| php_error("Native AST node has no descendant tokens"))?; - let last_token_index = node - .last_token - .ok_or_else(|| php_error("Native AST node has no descendant tokens"))?; - let first_token = ast.arena.token_source.token_info(first_token_index)?; - let last_token = ast.arena.token_source.token_info(last_token_index)?; - let length = last_token.end.saturating_sub(first_token.start); - i64::try_from(length).map_err(php_error) -} - -#[php_class] -#[php(name = "WP_MySQL_Native_Parser")] -pub struct WpMySqlNativeParser { - grammar: Arc, - token_source: Arc, - token_ids: Vec, - position: usize, - current_ast: Option>, - current_php_ast: Option, -} - -#[php_impl] -#[php(change_method_case = "snake_case")] -impl WpMySqlNativeParser { - pub fn __construct(grammar: &mut Zval, tokens: &mut Zval) -> PhpResult { - let grammar = export_grammar(grammar)?; - let (token_source, token_ids) = export_tokens(tokens)?; - - Ok(Self { - grammar, - token_source: Arc::new(token_source), - token_ids, - position: 0, - current_ast: None, - current_php_ast: None, - }) - } - - pub fn reset_tokens(&mut self, tokens: &mut Zval) -> PhpResult<()> { - let (token_source, token_ids) = export_tokens(tokens)?; - - self.token_source = Arc::new(token_source); - self.token_ids = token_ids; - self.position = 0; - self.current_ast = None; - self.current_php_ast = None; - - Ok(()) - } - - pub fn parse(&mut self) -> PhpResult { - stacker::maybe_grow(STACK_RED_ZONE, STACK_GROW_SIZE, || { - let ast = self.parse_native_ast()?; - self.create_php_ast(ast) - }) - } - - pub fn next_query(&mut self) -> PhpResult { - stacker::maybe_grow(STACK_RED_ZONE, STACK_GROW_SIZE, || self.next_query_inner()) - } - - pub fn get_query_ast(&mut self) -> PhpResult { - if let Some(ast) = self.current_php_ast.as_ref() { - return Ok(ast.shallow_clone()); - } - - let Some(native_ast) = self.current_ast.as_ref() else { - return Ok(Zval::null()); - }; - - let ast = self.create_php_ast(Rc::clone(native_ast))?; - self.current_php_ast = Some(ast); - match self.current_php_ast.as_ref() { - Some(ast) => Ok(ast.shallow_clone()), - None => Ok(Zval::null()), - } - } -} - -impl WpMySqlNativeParser { - fn next_query_inner(&mut self) -> PhpResult { - if self.position >= self.token_ids.len() { - self.current_ast = None; - self.current_php_ast = None; - return Ok(false); - } - - self.current_ast = Some(self.parse_native_ast()?); - self.current_php_ast = None; - Ok(true) - } - - fn parse_native_ast(&mut self) -> PhpResult> { - let mut arena = - NativeAstArena::new(Arc::clone(&self.grammar), Arc::clone(&self.token_source)); - let query_rule_id = self.grammar.query_rule_id; - arena.root = match self.parse_recursive_inner(&mut arena, query_rule_id)? { - NativeParseMatch::No => NativeAstRoot::No, - NativeParseMatch::Empty => NativeAstRoot::Empty, - NativeParseMatch::Node(index) => NativeAstRoot::Node(index), - NativeParseMatch::Token(index) => NativeAstRoot::Token(index), - NativeParseMatch::Fragment(children) => { - if children.is_empty() { - NativeAstRoot::Empty - } else { - NativeAstRoot::Node(arena.push_node(query_rule_id, children)) - } - } - }; - Ok(NativeAstState::new(Arc::new(arena))) - } - - fn parse_recursive_inner( - &mut self, - arena: &mut NativeAstArena, - rule_id: i64, - ) -> PhpResult { - if rule_id <= self.grammar.highest_terminal_id { - if self.position >= self.token_ids.len() { - return Ok(NativeParseMatch::No); - } - if rule_id == 0 { - return Ok(NativeParseMatch::Empty); - } - if self.token_ids[self.position] == rule_id { - let token_index = self.position; - self.position += 1; - return Ok(NativeParseMatch::Token(token_index)); - } - return Ok(NativeParseMatch::No); - } - - let grammar = unsafe { - // The parser owns an Arc to immutable grammar data for its full lifetime. - // Taking a raw shared reference avoids cloning hot branches just to satisfy - // the borrow checker while recursive parsing mutates only `position`. - &*Arc::as_ptr(&self.grammar) - }; - - let Some(rule) = grammar.rule(rule_id) else { - return Ok(NativeParseMatch::No); - }; - if rule.branches.is_empty() { - return Ok(NativeParseMatch::No); - } - - if let Some(lookahead) = rule.lookahead.as_ref() { - let token_id = self.token_ids.get(self.position).copied().unwrap_or(0); - if lookahead.binary_search(&token_id).is_err() && lookahead.binary_search(&0).is_err() { - return Ok(NativeParseMatch::No); - } - } - - let starting_position = self.position; - let starting_node_count = arena.nodes.len(); - let mut matched_children = None; - - for branch in &rule.branches { - self.position = starting_position; - arena.nodes.truncate(starting_node_count); - let mut children = Vec::new(); - let mut branch_matches = true; - - for &subrule_id in branch { - match self.parse_recursive_inner(arena, subrule_id)? { - NativeParseMatch::No => { - branch_matches = false; - break; - } - NativeParseMatch::Empty => {} - NativeParseMatch::Token(token_index) => { - children.push(NativeAstChild::Token(token_index)); - } - NativeParseMatch::Node(node_index) => { - children.push(NativeAstChild::Node(node_index)); - } - NativeParseMatch::Fragment(fragment_children) => { - children.extend(fragment_children); - } - } - } - - if branch_matches - && grammar.select_statement_rule_id == Some(rule_id) - && self - .token_ids - .get(self.position) - .is_some_and(|token_id| *token_id == lex::INTO_SYMBOL) - { - branch_matches = false; - } - - if branch_matches { - matched_children = Some(children); - break; - } - } - - let Some(children) = matched_children else { - self.position = starting_position; - arena.nodes.truncate(starting_node_count); - return Ok(NativeParseMatch::No); - }; - - if children.is_empty() { - Ok(NativeParseMatch::Empty) - } else if rule.is_fragment { - Ok(NativeParseMatch::Fragment(children)) - } else { - Ok(NativeParseMatch::Node(arena.push_node(rule_id, children))) - } - } - - fn create_php_ast(&self, ast: Rc) -> PhpResult { - stacker::maybe_grow(STACK_RED_ZONE, STACK_GROW_SIZE, || ast.create_php_ast()) - } -} - -fn export_grammar(grammar_zval: &mut Zval) -> PhpResult> { - if let Some(cached) = cached_native_grammar(grammar_zval)? { - return Ok(cached); - } - - let exported = php_function("wp_sqlite_mysql_native_export_grammar")? - .try_call(vec![&*grammar_zval as &dyn IntoZvalDyn]) - .map_err(php_error)?; - let array = exported - .array() - .ok_or_else(|| php_error("Exported grammar must be an array"))?; - - let highest_terminal_id = array - .get("highest_terminal_id") - .and_then(Zval::long) - .ok_or_else(|| php_error("Missing grammar highest_terminal_id"))?; - let parsed_rules = parse_rules( - array - .get("rules") - .and_then(Zval::array) - .ok_or_else(|| php_error("Missing grammar rules"))?, - )?; - let parsed_lookahead = parse_lookahead( - array - .get("lookahead_is_match_possible") - .and_then(Zval::array) - .ok_or_else(|| php_error("Missing grammar lookahead"))?, - )?; - let parsed_rule_names = parse_rule_names( - array - .get("rule_names") - .and_then(Zval::array) - .ok_or_else(|| php_error("Missing grammar rule_names"))?, - )?; - let parsed_fragment_ids = parse_id_set( - array - .get("fragment_ids") - .and_then(Zval::array) - .ok_or_else(|| php_error("Missing grammar fragment_ids"))?, - )?; - let query_rule_id = parsed_rule_names - .iter() - .find_map(|(id, name)| (name == "query").then_some(*id)) - .ok_or_else(|| php_error("Missing query grammar rule"))?; - let select_statement_rule_id = parsed_rule_names - .iter() - .find_map(|(id, name)| (name == "selectStatement").then_some(*id)); - let rules = build_rules( - parsed_rules, - parsed_lookahead, - parsed_rule_names, - parsed_fragment_ids, - )?; - - let grammar = Arc::new(Grammar { - highest_terminal_id, - rules, - query_rule_id, - select_statement_rule_id, - }); - - cache_native_grammar(grammar_zval, Arc::clone(&grammar))?; - - Ok(grammar) -} - -fn cached_native_grammar(grammar: &Zval) -> PhpResult>> { - let object = grammar - .object() - .ok_or_else(|| php_error("Parser grammar must be an object"))?; - let properties = object.get_properties().map_err(php_error)?; - let Some(native_grammar) = properties.get("native_grammar") else { - return Ok(None); - }; - let Some(native_grammar) = <&WpMySqlNativeGrammar as FromZval>::from_zval(native_grammar) - else { - return Ok(None); - }; - - Ok(Some(Arc::clone(&native_grammar.grammar))) -} - -fn cache_native_grammar(grammar_zval: &mut Zval, grammar: Arc) -> PhpResult<()> { - let object = grammar_zval - .object_mut() - .ok_or_else(|| php_error("Parser grammar must be an object"))?; - let native_grammar = WpMySqlNativeGrammar { grammar } - .into_zval(false) - .map_err(php_error)?; - object - .set_property("native_grammar", native_grammar) - .map_err(php_error) -} - -fn export_tokens(tokens: &mut Zval) -> PhpResult<(ParserTokenSource, Vec)> { - if let Some(stream) = <&WpMySqlNativeTokenStream as FromZval>::from_zval(tokens) { - let token_ids = stream.tokens.iter().map(|token| token.id).collect(); - return Ok(( - ParserTokenSource::Native { - sql_zval: stream.sql_zval.shallow_clone(), - tokens: stream.tokens.clone(), - no_backslash: stream.no_backslash, - }, - token_ids, - )); - } - - let array = tokens - .array() - .ok_or_else(|| php_error("Parser tokens must be an array"))?; - let mut token_objects = Vec::with_capacity(array.len()); - let mut token_ids = Vec::with_capacity(array.len()); - - for (_, token) in array { - let token_object = token - .object() - .ok_or_else(|| php_error("Parser token must be an object"))?; - let id = token_object.get_property::("id").map_err(php_error)?; - token_objects.push(token.shallow_clone()); - token_ids.push(id); - } - - Ok((ParserTokenSource::Php(token_objects), token_ids)) -} - -fn build_rules( - rules: HashMap>>, - lookahead: HashMap>, - rule_names: HashMap, - fragment_ids: HashSet, -) -> PhpResult>> { - let max_rule_id = rules - .keys() - .chain(lookahead.keys()) - .chain(rule_names.keys()) - .chain(fragment_ids.iter()) - .copied() - .max() - .unwrap_or(0); - let max_rule_index = usize::try_from(max_rule_id).map_err(php_error)?; - let mut dense_rules: Vec> = (0..=max_rule_index).map(|_| None).collect(); - - for (rule_id, branches) in rules { - let index = usize::try_from(rule_id).map_err(php_error)?; - let mut lookahead = lookahead.get(&rule_id).map(|set| { - let mut values: Vec = set.iter().copied().collect(); - values.sort_unstable(); - values - }); - if let Some(values) = lookahead.as_mut() { - values.dedup(); - } - - dense_rules[index] = Some(Rule { - branches, - lookahead, - rule_name: rule_names.get(&rule_id).cloned().unwrap_or_default(), - is_fragment: fragment_ids.contains(&rule_id), - }); - } - - Ok(dense_rules) -} - -fn parse_rules(array: &ZendHashTable) -> PhpResult>>> { - let mut rules = HashMap::new(); - for (rule_key, branches_zval) in array { - let rule_id = array_key_to_i64(rule_key)?; - let branches_array = branches_zval - .array() - .ok_or_else(|| php_error("Grammar branches must be arrays"))?; - let mut branches = Vec::with_capacity(branches_array.len()); - for (_, branch_zval) in branches_array { - let branch_array = branch_zval - .array() - .ok_or_else(|| php_error("Grammar branch must be an array"))?; - let mut branch = Vec::with_capacity(branch_array.len()); - for (_, subrule_zval) in branch_array { - branch.push( - subrule_zval - .long() - .ok_or_else(|| php_error("Grammar subrule must be an integer"))?, - ); - } - branches.push(branch); - } - rules.insert(rule_id, branches); - } - Ok(rules) -} - -fn parse_lookahead(array: &ZendHashTable) -> PhpResult>> { - let mut lookahead = HashMap::new(); - for (rule_key, lookup_zval) in array { - let rule_id = array_key_to_i64(rule_key)?; - let lookup_array = lookup_zval - .array() - .ok_or_else(|| php_error("Grammar lookahead entry must be an array"))?; - let mut set = HashSet::with_capacity(lookup_array.len()); - for (token_key, _) in lookup_array { - set.insert(array_key_to_i64(token_key)?); - } - lookahead.insert(rule_id, set); - } - Ok(lookahead) -} - -fn parse_rule_names(array: &ZendHashTable) -> PhpResult> { - let mut names = HashMap::new(); - for (rule_key, name_zval) in array { - names.insert( - array_key_to_i64(rule_key)?, - name_zval - .string() - .ok_or_else(|| php_error("Grammar rule name must be a string"))?, - ); - } - Ok(names) -} - -fn parse_id_set(array: &ZendHashTable) -> PhpResult> { - let mut set = HashSet::with_capacity(array.len()); - for (key, _) in array { - set.insert(array_key_to_i64(key)?); - } - Ok(set) -} - -fn array_key_to_i64(key: ArrayKey<'_>) -> PhpResult { - match key { - ArrayKey::Long(value) => Ok(value), - ArrayKey::String(value) => value.parse::().map_err(php_error), - ArrayKey::Str(value) => value.parse::().map_err(php_error), - } -} - -extern "C" fn php_module_info(_module: *mut ModuleEntry) { - info_table_start!(); - info_table_row!("wp_mysql_parser", "enabled"); - info_table_end!(); -} - -#[php_module] -pub fn get_module(module: ModuleBuilder) -> ModuleBuilder { - module - .class::() - .class::() - .class::() - .class::() - .function(wrap_function!(wp_sqlite_mysql_native_ast_release_wrapper)) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_materialize_wrapper - )) - .function(wrap_function!(wp_sqlite_mysql_native_ast_has_child)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_has_child_node)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_has_child_token)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_first_child)) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_get_first_child_node - )) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_get_first_child_token - )) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_get_first_descendant_node - )) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_get_first_descendant_token - )) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_children)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_child_nodes)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_child_tokens)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_descendants)) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_get_descendant_nodes - )) - .function(wrap_function!( - wp_sqlite_mysql_native_ast_get_descendant_tokens - )) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_start)) - .function(wrap_function!(wp_sqlite_mysql_native_ast_get_length)) - .info_function(php_module_info) -} diff --git a/packages/php-ext-wp-mysql-parser/tools/generate-lexer-constants.php b/packages/php-ext-wp-mysql-parser/tools/generate-lexer-constants.php deleted file mode 100644 index 78bca3075..000000000 --- a/packages/php-ext-wp-mysql-parser/tools/generate-lexer-constants.php +++ /dev/null @@ -1,229 +0,0 @@ -getConstants(); -$target = __DIR__ . '/../src/lexer_constants.rs'; - -function rust_string_literal( string $value ): string { - $literal = '"'; - $length = strlen( $value ); - for ( $i = 0; $i < $length; $i++ ) { - $byte = ord( $value[ $i ] ); - if ( 9 === $byte ) { - $literal .= '\\t'; - } elseif ( 10 === $byte ) { - $literal .= '\\n'; - } elseif ( 13 === $byte ) { - $literal .= '\\r'; - } elseif ( 34 === $byte ) { - $literal .= '\\"'; - } elseif ( 92 === $byte ) { - $literal .= '\\\\'; - } elseif ( $byte < 32 || $byte >= 127 ) { - $literal .= sprintf( '\\x%02x', $byte ); - } else { - $literal .= $value[ $i ]; - } - } - $literal .= '"'; - return $literal; -} - -function rust_value_literal( $value ): string { - if ( is_int( $value ) ) { - return $value . 'i64'; - } - - if ( is_bool( $value ) ) { - return $value ? 'true' : 'false'; - } - - if ( is_string( $value ) ) { - return rust_string_literal( $value ); - } - - throw new RuntimeException( 'Unsupported constant value type: ' . gettype( $value ) ); -} - -function rust_array_function_name( string $constant_name ): string { - return 'array_' . strtolower( preg_replace( '/[^A-Za-z0-9_]/', '_', $constant_name ) ); -} - -function rust_array_function( string $constant_name, array $value ): string { - $name = rust_array_function_name( $constant_name ); - $rust = "fn $name() -> ZBox {\n"; - $rust .= "\tlet mut array = persistent_array( " . count( $value ) . " );\n"; - - foreach ( $value as $key => $item ) { - $item_literal = rust_value_literal( $item ); - if ( is_int( $key ) ) { - $rust .= "\tarray.insert_at_index( {$key}i64, {$item_literal} ).unwrap();\n"; - } else { - $key_literal = rust_string_literal( $key ); - $rust .= "\tarray.insert( {$key_literal}, {$item_literal} ).unwrap();\n"; - } - } - - $rust .= "\tfreeze_array( &mut array );\n"; - $rust .= "\tarray\n"; - $rust .= "}\n\n"; - return $rust; -} - -$rust = <<; -const GC_IMMUTABLE: u32 = 1 << 6; - -extern "C" { - fn _zend_hash_init(ht: *mut HashTable, nSize: u32, pDestructor: DtorFunc, persistent: bool); -} - -fn persistent_array(capacity: usize) -> ZBox { - unsafe { - let pointer = libc::malloc(mem::size_of::()) as *mut ZendHashTable; - if pointer.is_null() { - panic!("Failed to allocate persistent Zend array"); - } - ptr::write_bytes(pointer, 0, 1); - _zend_hash_init(pointer, capacity as u32, None, true); - ZBox::from_raw(pointer) - } -} - -fn freeze_array(array: &mut ZendHashTable) { - unsafe { - array.gc.u.type_info |= GC_IMMUTABLE; - } -} - -RUST; - -foreach ( $constants as $name => $value ) { - if ( is_array( $value ) ) { - $rust .= rust_array_function( $name, $value ); - } -} - -$rust .= "pub const SCALAR_INT_CONSTANTS: &[(&str, i64)] = &[\n"; -foreach ( $constants as $name => $value ) { - if ( is_int( $value ) ) { - $rust .= "\t( \"$name\", {$value}i64 ),\n"; - } -} -$rust .= "];\n\n"; - -foreach ( $constants as $name => $value ) { - if ( is_int( $value ) ) { - $rust .= "pub const $name: i64 = {$value}i64;\n"; - } elseif ( is_bool( $value ) ) { - $rust .= 'pub const ' . $name . ': bool = ' . ( $value ? 'true' : 'false' ) . ";\n"; - } elseif ( is_string( $value ) ) { - $rust .= 'pub const ' . $name . ': &str = ' . rust_string_literal( $value ) . ";\n"; - } -} -$rust .= "\n"; - -$rust .= "pub const KEYWORD_TOKENS: &[(&str, i64)] = &[\n"; -foreach ( $constants['TOKENS'] as $key => $value ) { - $rust .= "\t( " . rust_string_literal( $key ) . ", {$value}i64 ),\n"; -} -$rust .= "];\n\n"; - -$rust .= "pub const VERSION_RULES: &[(i64, i64)] = &[\n"; -foreach ( $constants['VERSIONS'] as $key => $value ) { - $rust .= "\t( {$key}i64, {$value}i64 ),\n"; -} -$rust .= "];\n\n"; - -$rust .= "pub const FUNCTION_TOKENS: &[i64] = &[\n"; -foreach ( $constants['FUNCTIONS'] as $key => $value ) { - $rust .= "\t{$key}i64,\n"; -} -$rust .= "];\n\n"; - -$rust .= "pub const TOKEN_SYNONYMS: &[(i64, i64)] = &[\n"; -foreach ( $constants['SYNONYMS'] as $key => $value ) { - $rust .= "\t( {$key}i64, {$value}i64 ),\n"; -} -$rust .= "];\n\n"; - -$rust .= "pub const UNDERSCORE_CHARSET_NAMES: &[&str] = &[\n"; -foreach ( $constants['UNDERSCORE_CHARSETS'] as $key => $value ) { - $rust .= "\t" . rust_string_literal( $key ) . ",\n"; -} -$rust .= "];\n\n"; - -$rust .= <<<'RUST' -pub fn token_id(name: &str) -> Option { - SCALAR_INT_CONSTANTS - .iter() - .find_map(|(constant_name, id)| (*constant_name == name).then_some(*id)) -} - -pub fn token_name(id: i64) -> Option<&'static str> { - SCALAR_INT_CONSTANTS - .iter() - .rev() - .find_map(|(constant_name, token_id)| (*token_id == id).then_some(*constant_name)) -} - -pub fn keyword_token(keyword: &str) -> Option { - KEYWORD_TOKENS - .iter() - .find_map(|(candidate, id)| (*candidate == keyword).then_some(*id)) -} - -pub fn version_rule(token_id: i64) -> Option { - VERSION_RULES - .iter() - .find_map(|(candidate, version)| (*candidate == token_id).then_some(*version)) -} - -pub fn is_function_token(token_id: i64) -> bool { - FUNCTION_TOKENS.contains(&token_id) -} - -pub fn token_synonym(token_id: i64) -> Option { - TOKEN_SYNONYMS - .iter() - .find_map(|(candidate, synonym)| (*candidate == token_id).then_some(*synonym)) -} - -pub fn is_underscore_charset(name: &str) -> bool { - UNDERSCORE_CHARSET_NAMES.contains(&name) -} - -RUST; - -$rust .= << ClassBuilder { - -RUST; - -foreach ( $constants as $name => $value ) { - if ( is_array( $value ) ) { - $function_name = rust_array_function_name( $name ); - $rust .= "\tbuilder = builder.constant( \"$name\", $function_name(), &[] ).unwrap();\n"; - } elseif ( is_int( $value ) || is_bool( $value ) || is_string( $value ) ) { - $rust_value = rust_value_literal( $value ); - $rust .= "\tbuilder = builder.constant( \"$name\", $rust_value, &[] ).unwrap();\n"; - } -} - -$rust .= "\tbuilder\n}\n"; - -file_put_contents( $target, $rust ); diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/.gitignore b/packages/php-ext-wp-mysql-parser/wasm-spike/.gitignore deleted file mode 100644 index 9ad5440fd..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/ -*.log diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/Dockerfile.rust b/packages/php-ext-wp-mysql-parser/wasm-spike/Dockerfile.rust deleted file mode 100644 index 188b47dc2..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/Dockerfile.rust +++ /dev/null @@ -1,81 +0,0 @@ -# Layer that adds rustup + the wasm32-unknown-emscripten target on top of -# Playground's compile-extension image. -# -# Base image is the one produced by `@php-wasm/compile-extension`'s -# Dockerfile.ext, tagged as -# `playground-php-wasm:compile-extension-php-`. It -# already contains emsdk and a wasm-targeted PHP install with headers under -# /usr/local/include/php and a matching `php-config` on PATH — exactly what -# ext-php-rs's bindgen step needs to succeed. -# -# Build with: -# docker build \ -# --build-arg BASE_IMAGE=playground-php-wasm:compile-extension-php8-4-jspi \ -# --build-arg HOST_PHP_VERSION=8.4 \ -# --build-arg HOST_PHP_API_VERSION=20240924 \ -# -t playground-php-wasm-ext-rust:8.4-jspi \ -# -f Dockerfile.rust . - -ARG BASE_IMAGE=playground-php-wasm:compile-extension-php8-4-jspi -ARG HOST_PHP_VERSION=8.4 -ARG HOST_PHP_API_VERSION=20240924 - -FROM ${BASE_IMAGE} -ARG HOST_PHP_VERSION=8.4 -ARG HOST_PHP_API_VERSION=20240924 - -ENV RUSTUP_HOME=/root/rustup \ - CARGO_HOME=/root/cargo \ - PATH=/root/cargo/bin:/root/rustup/bin:/usr/local/bin:/usr/bin:/bin \ - HOST_PHP_VERSION=${HOST_PHP_VERSION} \ - HOST_PHP_API_VERSION=${HOST_PHP_API_VERSION} - -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl ca-certificates build-essential \ - libclang-dev clang llvm-dev pkg-config libxml2 libonig5 libsqlite3-0 \ - libargon2-1 libssl3 zlib1g libreadline8 \ - && rm -rf /var/lib/apt/lists/* - -# ext-php-rs shells out to `php -i` for version, debug, and ZTS metadata. The -# wasm-targeted PHP install in /usr/local has no CLI binary (--disable-cli), and -# copying a host PHP binary across Debian generations makes this layer depend on -# incompatible shared libraries. Keep the build contract narrow: report only the -# phpinfo keys ext-php-rs reads, while `PHP_CONFIG` continues to point at the -# wasm PHP install for headers and include paths. -RUN set -eux; \ - printf '%s\n' \ - '#!/usr/bin/env bash' \ - 'set -euo pipefail' \ - 'if [ "${1:-}" != "-i" ]; then' \ - ' echo "php-host-info only supports php -i for ext-php-rs build metadata" >&2' \ - ' exit 1' \ - 'fi' \ - 'cat < ${HOST_PHP_VERSION}' \ - 'PHP API => ${HOST_PHP_API_VERSION}' \ - 'Debug Build => no' \ - 'Thread Safety => disabled' \ - 'INFO' \ - > /usr/local/bin/php-host-info; \ - chmod +x /usr/local/bin/php-host-info; \ - /usr/local/bin/php-host-info -i | grep -q "PHP API => ${HOST_PHP_API_VERSION}" - -# Set PHP_CONFIG explicitly so bindgen uses the wasm PHP headers from the -# Playground compile-extension image, not any host PHP package that apt may -# provide as a transitive dependency. -ENV PHP_CONFIG=/usr/local/bin/php-config \ - PHP=/usr/local/bin/php-host-info - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ - | sh -s -- -y --default-toolchain stable --profile minimal \ - && /root/cargo/bin/rustup target add wasm32-unknown-emscripten \ - && /root/cargo/bin/rustup toolchain install nightly --profile minimal \ - --component rust-src \ - && /root/cargo/bin/rustup target add wasm32-unknown-emscripten --toolchain nightly - -# Make libclang discoverable for bindgen regardless of the exact package path. -RUN set -eux; \ - libclang="$(find /usr/lib -name 'libclang.so*' -print | sort | head -1)"; \ - test -n "$libclang"; \ - ln -sf "$libclang" /usr/lib/libclang.so -ENV LIBCLANG_PATH=/usr/lib diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md b/packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md deleted file mode 100644 index 51360d21f..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md +++ /dev/null @@ -1,138 +0,0 @@ -# wasm-spike: PHP.wasm side-module build of `wp_mysql_parser` - -## Current status - -The spike now builds and loads `wp_mysql_parser` in Playground across every -PHP version supported by the current `ext-php-rs` binding layer: 8.0 through -8.5, all JSPI. CI verifies each generated side module by loading its manifest -through Playground's compile-extension test harness and running a native lexer -smoke test. PHP 7.4 is outside this Rust path because `ext-php-rs` 0.15 -depends on PHP 8 Zend APIs and does not compile against PHP 7.4 headers. - -## PHP version scope - -This spike intentionally builds only PHP 8.0 through PHP 8.5. Adding PHP 7.4 -would require a different binding layer, or real PHP 7.4 support in -`ext-php-rs`; it is not a workflow-only change. The failures are in the -generated/wrapped Zend API surface itself, including PHP 8-only symbols and -struct fields. - -The build uses the published `@php-wasm/compile-extension` CLI for the phpize -side-module build, static archive force-linking, wasm-opt pass, and manifest -generation. A sparse Playground checkout is still required for the -`packages/php-wasm/compile` Docker assets and for CI's Playground load test. -The CLI is installed into an isolated temporary npm prefix before it is run; -the sparse Playground workspace also contains an unbuilt local -`@php-wasm/compile-extension` package, so relying on workspace `.bin` links -would bypass the published package. -The local glue that remains is Rust-specific: build `libwp_mysql_parser.a` -with the same Emscripten/PHP.wasm ABI and patch the vendored `ext-php-rs` -registry copy so it can run as a PHP.wasm side module. - -## Publishing a Playground extension artifact - -`.github/workflows/publish-wasm-extension-artifact.yml` builds the JSPI side -module for PHP 8.0 through 8.5, collects the side modules into one Actions -artifact, publishes the same bundle to the `gh-pages` branch, and writes a -Playground extension manifest using the sidecar format from -WordPress/wordpress-playground#3580: - -```json -{ - "name": "wp_mysql_parser", - "mode": "php-extension", - "artifacts": [ - { - "phpVersion": "8.4", - "sourcePath": "wp_mysql_parser-php8.4-jspi.so" - } - ] -} -``` - -The per-version build manifest comes from `@php-wasm/compile-extension` and -already uses `sourcePath` while omitting the retired `file` and `sha256` -artifact fields. The publish job writes a combined all-version manifest in the -same shape before uploading the final Actions artifact and publishing the -static bundle to GitHub Pages. The public URLs are: - -- `https://wordpress.github.io/sqlite-database-integration/wp_mysql_parser-wasm-extension/latest/manifest.json` -- `https://wordpress.github.io/sqlite-database-integration/wp_mysql_parser-wasm-extension//manifest.json` - -The uploaded manifest is intended for Playground builds that include the #3580 -resolver change; older Playground loaders still expect `file`. Checksums are -published separately in `SHA256SUMS`. The repository's GitHub Pages source -must be configured to publish from the `gh-pages` branch root for these URLs to -resolve. - -## What the Playground helper covers - -`@php-wasm/compile-extension` is complete enough to replace the custom -Stage 2 path that previously lived in this spike: - -- Builds the matching `playground-php-wasm:base` and per-version - compile-extension Docker images. -- Runs `phpize`, `emconfigure`, and `emmake` for JSPI side modules. -- Accepts Rust or C static archives via `--extra-ldflags` and force-links - `.a` inputs with `--whole-archive`. -- Runs `wasm-opt` when available. -- Emits a `sourcePath` manifest that the Playground runtime can load at - startup. - -The helper is not a full Rust build system. This crate still needs a -per-PHP-version prebuild step that produces a wasm32-unknown-emscripten -`staticlib` with matching PHP headers and host PHP CLI version, plus a tiny -phpize shim (`config.m4` and `wp_mysql_parser_shim.c`) so the helper has a -normal extension source directory to compile. - -## Remaining local compatibility patches - -The patches are applied only inside the Docker build container: - -- Switch the crate from `cdylib` to `staticlib`. -- Build Rust nightly with `-Zbuild-std=std,panic_abort`, `panic=abort`, and - position-independent code. -- Force bindgen/cc-rs to use the Emscripten sysroot plus - `ZEND_ENABLE_ZVAL_LONG64` and `__x86_64__`, matching PHP.wasm. -- Relax ext-php-rs's `PropertyDescriptor` size assertion for wasm32 + LONG64. -- Avoid ext-php-rs imports of Zend globals/functions that are not part of the - stable PHP.wasm side-module surface used by this extension. -- Use `zend_declare_class_constant_ex`, which PHP.wasm exports, instead of the - legacy class-constant helper. - -These should eventually move upstream into ext-php-rs or into a dedicated -Rust recipe in Playground, but they no longer duplicate the generic PHP.wasm -extension build and manifest machinery. - -## Files - -| Path | What it is | -| --- | --- | -| `Dockerfile.rust` | Rust/nightly/host-PHP layer on top of Playground's compile-extension image. | -| `build-in-docker-rust.sh` | Builds the Rust staticlib, then calls the published `@php-wasm/compile-extension` CLI. | -| `write-extension-manifest.mjs` | Writes the combined all-version artifact manifest for the publish workflow. | -| `shim/config.m4` | Minimal phpize wrapper. | -| `shim/wp_mysql_parser_shim.c` | Pulls the Rust `get_module()` symbol into the side-module link. | -| `run-spike.mjs` | Loads the generated manifest in Playground and verifies the native lexer. | - -## Reproduce - -```bash -cd packages/php-ext-wp-mysql-parser/wasm-spike - -PLAYGROUND_REPO=/abs/path/to/wordpress-playground \ - bash build-in-docker-rust.sh - -PLAYGROUND_REPO=/abs/path/to/wordpress-playground PHP_VERSION=8.4 \ - node run-spike.mjs -``` - -The workflow still uses a sparse checkout of `WordPress/wordpress-playground` -for `packages/php-wasm/compile` Docker assets and the Playground loader smoke -test, while the extension compile itself runs through an isolated install of -the published npm CLI. - -Follow-up for Playground: make `@php-wasm/compile-extension` self-contained so -external extension projects do not need to shallow or sparse checkout -`WordPress/wordpress-playground` just to access Docker assets or test harness -files. diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh b/packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh deleted file mode 100755 index f18d0e393..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh +++ /dev/null @@ -1,330 +0,0 @@ -#!/usr/bin/env bash -# Drives the two-stage build for the Rust ext-php-rs PHP extension targeting -# PHP.wasm side modules: -# -# 1. cargo build --release --target wasm32-unknown-emscripten -# inside playground-php-wasm-ext-rust:-, which -# layers rustup + ext-php-rs build metadata on top of the Playground -# compile-extension image. -# 2. Hand the resulting libwp_mysql_parser.a + C shim + config.m4 to -# `@php-wasm/compile-extension`, which owns phpize, emconfigure, -# emmake, wasm-opt, and manifest generation. -# -# Outputs: -# wasm-spike/dist/libwp_mysql_parser.a (Stage 1) -# wasm-spike/dist/wp_mysql_parser-php-jspi.so (Stage 2, wasm side module) -# wasm-spike/dist/manifest.json (written by @php-wasm/compile-extension) -set -euo pipefail - -PHP_VERSION="${PHP_VERSION:-8.4}" -ASYNC_MODE="${ASYNC_MODE:-jspi}" -SPIKE_DIR="$(cd "$(dirname "$0")" && pwd)" -CRATE_DIR="$(cd "$SPIKE_DIR/.." && pwd)" -OUT_DIR="${OUT_DIR:-$SPIKE_DIR/dist}" -COMPILE_EXTENSION_PACKAGE="${COMPILE_EXTENSION_PACKAGE:-@php-wasm/compile-extension@3.1.27}" -PLAYGROUND_REPO="${PLAYGROUND_REPO:-$(cd "$SPIKE_DIR/../../../../wordpress-playground" 2>/dev/null && pwd || true)}" -mkdir -p "$OUT_DIR" - -if [ "$ASYNC_MODE" != "jspi" ]; then - echo "Unsupported ASYNC_MODE: $ASYNC_MODE. @php-wasm/compile-extension is JSPI-only." >&2 - exit 1 -fi - -case "$PHP_VERSION" in - 8.0) PHP_API_VERSION=20200930; PHP_RELEASE=8.0.30 ;; - 8.1) PHP_API_VERSION=20210902; PHP_RELEASE=8.1.34 ;; - 8.2) PHP_API_VERSION=20220829; PHP_RELEASE=8.2.30 ;; - 8.3) PHP_API_VERSION=20230831; PHP_RELEASE=8.3.30 ;; - 8.4) PHP_API_VERSION=20240924; PHP_RELEASE=8.4.20 ;; - 8.5) PHP_API_VERSION=20250925; PHP_RELEASE=8.5.5 ;; - 7.4) - echo "Unsupported PHP_VERSION: 7.4" >&2 - echo "The WASM Rust build uses ext-php-rs 0.15, which depends on PHP 8 Zend APIs and does not compile against PHP 7.4 headers." >&2 - exit 1 - ;; - *) - echo "Unsupported PHP_VERSION: $PHP_VERSION. Supported values: 8.0, 8.1, 8.2, 8.3, 8.4, 8.5." >&2 - echo "PHP 7.4 is outside this WASM Rust path because ext-php-rs 0.15 requires PHP 8 Zend APIs." >&2 - exit 1 - ;; -esac - -if [ -z "$PLAYGROUND_REPO" ] || [ ! -f "$PLAYGROUND_REPO/packages/php-wasm/compile/Makefile" ] || [ ! -f "$PLAYGROUND_REPO/packages/php-wasm/compile-extension/docker/Dockerfile.ext" ]; then - echo "PLAYGROUND_REPO must point at a wordpress-playground checkout with packages/php-wasm/compile and packages/php-wasm/compile-extension/docker." >&2 - exit 1 -fi - -patch_compile_extension_cli() { - local cli_path="$1" - - # The npm CLI currently rebuilds the Docker images itself. This script has - # already prepared those exact images in Stage 0, so patch the pinned CLI to - # reuse them and fail loudly if the installed package changes shape. - node --input-type=module - "$cli_path" <<'NODE' -import { readFileSync, writeFileSync } from 'node:fs'; - -const cliPath = process.argv[2]; -let source = readFileSync(cliPath, 'utf8'); - -const replacements = [ - [ - 'async function k(e){await p("make",["base-image"],{cwd:e.compileRoot})}', - 'async function k(e){if(process.env.COMPILE_EXTENSION_SKIP_IMAGE_BUILD==="1"){await p("docker",["image","inspect","playground-php-wasm:base"],{stdio:"ignore"});console.log("Skipping compile-extension base image build; using existing playground-php-wasm:base");return}await p("make",["base-image"],{cwd:e.compileRoot})}', - ], - [ - 'async function j(e){const t=$(e);return await p("docker",["build","-f","compile-extension/docker/Dockerfile.ext",".",`--tag=${t}`,"--progress=plain","--build-arg",`PHP_VERSION=${e.phpRelease}`,"--build-arg","JSPI=yes"],{cwd:e.phpWasmRoot}),t}', - 'async function j(e){const t=$(e);if(process.env.COMPILE_EXTENSION_SKIP_IMAGE_BUILD==="1"){await p("docker",["image","inspect",t],{stdio:"ignore"});console.log(`Skipping compile-extension image build; using existing ${t}`);return t}return await p("docker",["build","-f","compile-extension/docker/Dockerfile.ext",".",`--tag=${t}`,"--progress=plain","--build-arg",`PHP_VERSION=${e.phpRelease}`,"--build-arg","JSPI=yes"],{cwd:e.phpWasmRoot}),t}', - ], -]; - -for (const [from, to] of replacements) { - if (!source.includes(from)) { - throw new Error(`Unable to patch @php-wasm/compile-extension CLI. Missing pattern: ${from}`); - } - source = source.replace(from, to); -} - -writeFileSync(cliPath, source); -NODE - - grep -q 'COMPILE_EXTENSION_SKIP_IMAGE_BUILD' "$cli_path" -} - -RUST_IMAGE="playground-php-wasm-ext-rust:${PHP_VERSION}-${ASYNC_MODE}" -BASE_IMAGE="playground-php-wasm:compile-extension-php${PHP_VERSION//./-}-${ASYNC_MODE}" - -echo "==> Stage 0: preparing $BASE_IMAGE via Playground compile-extension tooling" -if [ "${SKIP_BASE_IMAGE_BUILD:-}" = "1" ]; then - if ! docker image inspect playground-php-wasm:base >/dev/null 2>&1; then - echo "SKIP_BASE_IMAGE_BUILD=1 requires a preloaded playground-php-wasm:base image." >&2 - exit 1 - fi - echo "==> Stage 0: using preloaded playground-php-wasm:base" -else - BASE_IMAGE_DIR="$PLAYGROUND_REPO/packages/php-wasm/compile/base-image" - docker build \ - -f "$BASE_IMAGE_DIR/Dockerfile" \ - --tag="playground-php-wasm:base" \ - "$BASE_IMAGE_DIR" -fi -docker build \ - -f "$PLAYGROUND_REPO/packages/php-wasm/compile-extension/docker/Dockerfile.ext" \ - --tag="$BASE_IMAGE" \ - --progress=plain \ - --build-arg "PHP_VERSION=$PHP_RELEASE" \ - --build-arg "JSPI=yes" \ - "$PLAYGROUND_REPO/packages/php-wasm" - -echo "==> Stage 0: building $RUST_IMAGE" -docker build \ - --build-arg "BASE_IMAGE=$BASE_IMAGE" \ - --build-arg "HOST_PHP_VERSION=$PHP_VERSION" \ - --build-arg "HOST_PHP_API_VERSION=$PHP_API_VERSION" \ - -t "$RUST_IMAGE" \ - -f "$SPIKE_DIR/Dockerfile.rust" \ - "$SPIKE_DIR" - -echo "==> Stage 1: cargo build --target wasm32-unknown-emscripten" -# Feed the container script through stdin so Docker-side comments and strings -# cannot break host-shell quoting. -docker run --rm -i \ - -e "PHP_VERSION=$PHP_VERSION" \ - -e "PHP_API_VERSION=$PHP_API_VERSION" \ - -v "$CRATE_DIR":/src:ro \ - -v "$OUT_DIR":/out \ - --entrypoint bash \ - "$RUST_IMAGE" -s <<'EOF' - set -ex - source /root/emsdk/emsdk_env.sh - SYSROOT=/root/emsdk/upstream/emscripten/cache/sysroot - export CC=emcc CXX=em++ AR=emar - # bindgen does not pick up cargo target automatically. Steer its - # libclang invocation at the emscripten sysroot, and force - # ZEND_ENABLE_ZVAL_LONG64 + __x86_64__ so zend_long is i64 (the - # convention compile-extension uses for the C side too). - export BINDGEN_EXTRA_CLANG_ARGS="--target=wasm32-unknown-emscripten --sysroot=$SYSROOT -I$SYSROOT/include -DZEND_ENABLE_ZVAL_LONG64 -D__x86_64__" - - # cc-rs (used by ext-php-rs to compile wrapper.c) does not pick up - # -fPIC by default for wasm32. The side-module link demands PIC, so - # force it via the target-specific CFLAGS env var. - # - # `-sSUPPORT_LONGJMP=wasm` and `-fwasm-exceptions` must match the - # PHP-wasm main module's exception/longjmp ABI. Without them, the - # ext-php-rs `wrapper.c` is compiled with emscripten's legacy JS-based - # SjLj, which imports the `__THREW__` global. The main module exports - # only the wasm-native variants, so dlopen() rejects the side module - # with "bad export type for '__THREW__': undefined". - export CFLAGS_wasm32_unknown_emscripten="-fPIC -DZEND_ENABLE_ZVAL_LONG64 -D__x86_64__ -sSUPPORT_LONGJMP=wasm -fwasm-exceptions" - # Tell cargo/rustc to build with PIE-friendly relocations as well. - # `-C relocation-model=pic` is required for the side-module link. - # `-C panic=abort` keeps the Rust archive from importing the C++ - # exception tag (`__cpp_exception`) that the PHP-wasm main module - # does not export — without this, dlopen() fails with a - # WebAssembly.Instance LinkError on Import "env" "__cpp_exception". - export CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUSTFLAGS="-C relocation-model=pic -C panic=abort" - - # Operate on a copy so the sed Cargo.toml flip never touches /src. - rm -rf /work - mkdir -p /work - cp -a /src/. /work/ - cd /work - sed -i "s/crate-type = \[\"cdylib\"\]/crate-type = [\"staticlib\"]/" Cargo.toml - - # Pre-fetch so the registry sources are extracted, then patch - # ext-php-rs to relax a const assertion that does not hold when - # ZEND_ENABLE_ZVAL_LONG64 is forced on a 32-bit (wasm32) target. - cargo fetch >/dev/null 2>&1 || true - REG=$(find /root/cargo/registry/src -maxdepth 1 -type d -name "index.crates.io-*" | head -1) - chmod -R u+w "$REG" - - sed -i "s/12 \* std::mem::size_of::/24 * std::mem::size_of::/" \ - "$REG/ext-php-rs-0.15.12/src/internal/property.rs" - - # PHP.wasm does not export every Zend global as a wasm global that a side - # module can import. Avoid those imports by resolving class entries from - # the runtime class table when ext-php-rs needs them. - patch_class_entry() { - sed -i "s/unsafe { $1.as_ref() }.unwrap()/ClassEntry::try_find(\"$2\").unwrap()/" \ - "$REG/ext-php-rs-0.15.12/src/zend/ce.rs" - } - patch_class_entry zend_standard_class_def stdClass - patch_class_entry zend_ce_throwable Throwable - patch_class_entry zend_ce_exception Exception - patch_class_entry zend_ce_error_exception ErrorException - patch_class_entry zend_ce_compile_error CompileError - patch_class_entry zend_ce_parse_error ParseError - patch_class_entry zend_ce_type_error TypeError - patch_class_entry zend_ce_argument_count_error ArgumentCountError - patch_class_entry zend_ce_value_error ValueError - patch_class_entry zend_ce_arithmetic_error ArithmeticError - patch_class_entry zend_ce_division_by_zero_error DivisionByZeroError - patch_class_entry zend_ce_unhandled_match_error UnhandledMatchError - patch_class_entry zend_ce_traversable Traversable - patch_class_entry zend_ce_aggregate IteratorAggregate - patch_class_entry zend_ce_iterator Iterator - patch_class_entry zend_ce_arrayaccess ArrayAccess - patch_class_entry zend_ce_serializable Serializable - patch_class_entry zend_ce_countable Countable - patch_class_entry zend_ce_stringable Stringable - - # ClassEntry::try_find can ask Zend directly. The executor global check - # only forces an extra side-module import that PHP.wasm does not provide. - sed -i '/ExecutorGlobals::get().class_table()?;/d' \ - "$REG/ext-php-rs-0.15.12/src/zend/class.rs" - - # Class constant stub strings are only used for generated PHP stubs, but - # ext-php-rs computes them during module startup by walking the actual zval. - # The lexer registers several large array constants, and walking those - # arrays imports helpers such as zend_array_count that PHP.wasm does not - # expose as callable side-module functions. Keep runtime constant - # registration intact, but use a placeholder stub value for this WASM build. - sed -i 's/let stub = crate::convert::zval_to_stub(&zval);/let stub = String::from("null");/' \ - "$REG/ext-php-rs-0.15.12/src/builders/class.rs" - - # PHP.wasm exports zend_declare_class_constant_ex, but not the legacy - # zend_declare_class_constant helper. Use the exported API when ext-php-rs - # registers class constants. - sed -i '/zend_declare_class_constant,/a \ zend_declare_class_constant_ex,' \ - "$REG/ext-php-rs-0.15.12/allowed_bindings.rs" - sed -i \ - 's/zend_declare_class_constant, zend_declare_property,/zend_declare_class_constant_ex, zend_declare_property,/' \ - "$REG/ext-php-rs-0.15.12/src/builders/class.rs" - perl -0pi -e 's/zend_declare_class_constant\(\n\s+class,\n\s+CString::new\(name\.as_str\(\)\)\?\.as_ptr\(\),\n\s+name\.len\(\),\n\s+value,\n\s+\);/let mut name = ZendStr::new_interned(name.as_str(), true);\n zend_declare_class_constant_ex(\n class,\n name.as_mut_ptr(),\n value,\n crate::ffi::ZEND_ACC_PUBLIC as _,\n ptr::null_mut(),\n );/s' \ - "$REG/ext-php-rs-0.15.12/src/builders/class.rs" - - # ext-php-rs keeps helper functions for globals in one C translation unit. - # The Rust staticlib can pull in the whole object even when a helper is not - # called, so mark optional PHP globals weak to keep dlopen from requiring - # PHP.wasm exports for unused helpers. - sed -i \ - -e '/#pragma weak zend_one_char_string/a #pragma weak executor_globals' \ - -e '/#pragma weak zend_one_char_string/a #pragma weak compiler_globals' \ - -e '/#pragma weak zend_one_char_string/a #pragma weak core_globals' \ - -e '/#pragma weak zend_one_char_string/a #pragma weak sapi_globals' \ - -e '/#pragma weak zend_one_char_string/a #pragma weak file_globals' \ - -e '/#pragma weak zend_one_char_string/a #pragma weak sapi_module' \ - "$REG/ext-php-rs-0.15.12/src/wrapper.c" - - # php_eval is not used by this extension, but ext-php-rs exposes wrappers - # for it from wrapper.c. Since the wrapper object is linked into the static - # archive, those wrappers can still pull in PHP compile/execute symbols that - # PHP.wasm does not export. Stub the unused wrappers so module startup does - # not try to resolve them through JS import stubs. - sed -i '/^zend_op_array \*ext_php_rs_zend_compile_string(/,/^}/c\ -zend_op_array *ext_php_rs_zend_compile_string(zend_string *source, const char *filename) {\ - (void) source;\ - (void) filename;\ - return NULL;\ -}' "$REG/ext-php-rs-0.15.12/src/wrapper.c" - sed -i '/^void ext_php_rs_zend_execute(/,/^}/c\ -void ext_php_rs_zend_execute(zend_op_array *op_array) {\ - (void) op_array;\ -}' "$REG/ext-php-rs-0.15.12/src/wrapper.c" - - # Avoid ext-php-rs' direct Rust import of the sapi_module global in output - # helpers. Route it through the weak C wrapper instead. - sed -i 's/ffi::{php_output_write, php_printf, sapi_module}/ffi::{php_output_write, php_printf}/' \ - "$REG/ext-php-rs-0.15.12/src/zend/mod.rs" - sed -i 's/sapi_module\.ub_write/(*crate::ffi::ext_php_rs_sapi_module()).ub_write/' \ - "$REG/ext-php-rs-0.15.12/src/zend/mod.rs" - sed -i 's/sapi_module\.name/(*crate::ffi::ext_php_rs_sapi_module()).name/' \ - "$REG/ext-php-rs-0.15.12/src/zend/mod.rs" - - # Verify the targeted patches matched the registry sources before doing an - # expensive cargo build. - ! grep -Eq 'unsafe \{ (zend_standard_class_def|zend_ce_[a-z_]+)\.as_ref\(\) \}\.unwrap\(\)' \ - "$REG/ext-php-rs-0.15.12/src/zend/ce.rs" - ! grep -q 'ExecutorGlobals::get().class_table()' \ - "$REG/ext-php-rs-0.15.12/src/zend/class.rs" - ! grep -q 'let stub = crate::convert::zval_to_stub(&zval)' \ - "$REG/ext-php-rs-0.15.12/src/builders/class.rs" - grep -q 'zend_declare_class_constant_ex,' \ - "$REG/ext-php-rs-0.15.12/allowed_bindings.rs" - grep -q 'zend_declare_class_constant_ex(' \ - "$REG/ext-php-rs-0.15.12/src/builders/class.rs" - ! grep -q 'zend_declare_class_constant(' \ - "$REG/ext-php-rs-0.15.12/src/builders/class.rs" - ! grep -q 'return zend_compile_string' \ - "$REG/ext-php-rs-0.15.12/src/wrapper.c" - ! grep -q 'zend_execute(op_array' \ - "$REG/ext-php-rs-0.15.12/src/wrapper.c" - grep -q '#pragma weak file_globals' \ - "$REG/ext-php-rs-0.15.12/src/wrapper.c" - - # Use nightly + -Zbuild-std=std,panic_abort so libstd is rebuilt with - # panic=abort. Without rebuilding std, the precompiled libstd still - # contains panic-unwind code that imports __cpp_exception. - cargo +nightly build --release --target wasm32-unknown-emscripten \ - -Zbuild-std=std,panic_abort - cp target/wasm32-unknown-emscripten/release/libwp_mysql_parser.a /out/ -EOF - -echo "==> Stage 2: phpize + emconfigure + emmake (@php-wasm/compile-extension)" -SRC_STAGE="$(mktemp -d)" -CLI_STAGE="$(mktemp -d)" -trap 'rm -rf "$SRC_STAGE" "$CLI_STAGE"' EXIT -cp "$SPIKE_DIR/shim/config.m4" "$SRC_STAGE/" -cp "$SPIKE_DIR/shim/wp_mysql_parser_shim.c" "$SRC_STAGE/" -cp "$OUT_DIR/libwp_mysql_parser.a" "$SRC_STAGE/" - -ARTIFACT="wp_mysql_parser-php${PHP_VERSION}-${ASYNC_MODE}.so" -COMPILE_EXTENSION_CLI="$CLI_STAGE/node_modules/@php-wasm/compile-extension/cli.js" - -npm install --prefix "$CLI_STAGE" --no-audit --no-fund --ignore-scripts "$COMPILE_EXTENSION_PACKAGE" -patch_compile_extension_cli "$COMPILE_EXTENSION_CLI" - -( - cd "$PLAYGROUND_REPO" - COMPILE_EXTENSION_SKIP_IMAGE_BUILD=1 node "$COMPILE_EXTENSION_CLI" \ - --source "$SRC_STAGE" \ - --name wp_mysql_parser \ - --php-versions "$PHP_VERSION" \ - --out "$OUT_DIR" \ - --jobs 1 \ - --extra-ldflags "/build/libwp_mysql_parser.a" -) - -rm -rf "$SRC_STAGE" -trap - EXIT - -echo "==> Built $OUT_DIR/$ARTIFACT" diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs b/packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs deleted file mode 100755 index 2d8983afa..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env node -import { existsSync, readdirSync, readFileSync } from 'node:fs'; -import { resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const SPIKE_DIR = resolve(fileURLToPath(new URL('.', import.meta.url))); -const PHP_VERSION = process.env.PHP_VERSION || '8.4'; -const ASYNC_MODE = process.env.ASYNC_MODE || 'jspi'; -const EXTENSION_NAME = process.env.EXTENSION_NAME || 'wp_mysql_parser'; -const SIDE_MODULE = resolve( - process.env.SIDE_MODULE || - `${SPIKE_DIR}/dist/${EXTENSION_NAME}-php${PHP_VERSION}-${ASYNC_MODE}.so` -); -const PLAYGROUND_REPO = resolve( - process.env.PLAYGROUND_REPO || - `${SPIKE_DIR}/../../../../wordpress-playground-spike` -); -const EXPECTED_MISSING = new Set( - (process.env.PLAYGROUND_WEB_EXPECTED_MISSING_SYMBOLS || '') - .split(/[\s,]+/) - .filter(Boolean) -); - -function findWasmFile(dir) { - for (const entry of readdirSync(dir, { withFileTypes: true })) { - const path = resolve(dir, entry.name); - if (entry.isDirectory()) { - const nested = findWasmFile(path); - if (nested) { - return nested; - } - continue; - } - if (entry.isFile() && entry.name.endsWith('.wasm')) { - return path; - } - } - return null; -} - -function loadWasmModule(path) { - if (!existsSync(path)) { - console.error(`[web-compat] Missing ${path}`); - process.exit(2); - } - return new WebAssembly.Module(readFileSync(path)); -} - -const phpDir = PHP_VERSION.replace('.', '-'); -const webBuildDir = resolve( - PLAYGROUND_REPO, - `packages/php-wasm/web-builds/${phpDir}/${ASYNC_MODE}` -); -const webRuntime = findWasmFile(webBuildDir); -if (!webRuntime) { - console.error(`[web-compat] Could not find a PHP.wasm file under ${webBuildDir}`); - process.exit(2); -} - -const sideImports = WebAssembly.Module.imports(loadWasmModule(SIDE_MODULE)); -const importedFunctions = sideImports - .filter((entry) => entry.module === 'env' && entry.kind === 'function') - .map((entry) => entry.name) - .sort(); -const runtimeExports = new Map( - WebAssembly.Module.exports(loadWasmModule(webRuntime)).map((entry) => [ - entry.name, - entry.kind, - ]) -); -const missing = importedFunctions.filter( - (name) => runtimeExports.get(name) !== 'function' -); -const unexpectedMissing = missing.filter((name) => !EXPECTED_MISSING.has(name)); -const staleExpectedMissing = [...EXPECTED_MISSING].filter( - (name) => !missing.includes(name) -); - -console.log(`[web-compat] PHP ${PHP_VERSION} side module: ${SIDE_MODULE}`); -console.log(`[web-compat] PHP ${PHP_VERSION} web runtime: ${webRuntime}`); - -if (unexpectedMissing.length > 0 || staleExpectedMissing.length > 0) { - if (unexpectedMissing.length > 0) { - console.error( - `[web-compat] Missing browser runtime exports: ${unexpectedMissing.join(', ')}` - ); - } - if (staleExpectedMissing.length > 0) { - console.error( - `[web-compat] Expected missing exports are now available: ${staleExpectedMissing.join(', ')}` - ); - console.error( - '[web-compat] Update the browser demo PHP pin and remove the stale allowlist.' - ); - } - process.exit(1); -} - -if (missing.length > 0) { - console.log( - `[web-compat] Known browser runtime gap confirmed: ${missing.join(', ')}` - ); -} else { - console.log('[web-compat] Browser runtime exports all imported functions.'); -} diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/probe-host-cargo-wasm.sh b/packages/php-ext-wp-mysql-parser/wasm-spike/probe-host-cargo-wasm.sh deleted file mode 100755 index 144243d6c..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/probe-host-cargo-wasm.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Probe 1: try to cross-compile the ext-php-rs crate from the host with -# Emscripten on PATH. Expected to FAIL at the bindgen step inside ext-php-rs's -# build.rs because the host php-config points at native PHP headers and -# emscripten's clang chokes on the host system headers they pull in. -# -# Surfacing that failure is the point: it documents which knobs would have to -# move (PHP headers from a wasm-built PHP, plus an emcc-aware bindgen target) -# before any further work is meaningful. -set -uo pipefail - -cd "$(dirname "$0")/.." - -if ! command -v emcc >/dev/null 2>&1; then - echo "emcc not on PATH. Activate emsdk first." >&2 - exit 2 -fi - -if ! rustup target list --installed 2>/dev/null | grep -q wasm32-unknown-emscripten; then - rustup target add wasm32-unknown-emscripten -fi - -set -x -CC=emcc CXX=em++ AR=emar \ - cargo build --release --target wasm32-unknown-emscripten 2>&1 | tee wasm-spike/probe-host-cargo-wasm.log -exit "${PIPESTATUS[0]}" diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs b/packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs deleted file mode 100644 index 27c74a0c7..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs +++ /dev/null @@ -1,103 +0,0 @@ -// Headless Playground runner for the wasm-spike. Uses the stock -// load-built-extension.mjs harness shipped with @php-wasm/compile-extension. -// We feed it our manifest and a snippet of PHP that pokes the Rust parser, -// then assert the output. -// -// Run with: -// node packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs -// -// Optional env: PLAYGROUND_REPO=/path/to/wordpress-playground checkout. - -import { spawnSync } from 'node:child_process'; -import { existsSync } from 'node:fs'; -import { dirname, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const here = dirname(fileURLToPath(import.meta.url)); -const SPIKE_DIR = here; -const MANIFEST = resolve(SPIKE_DIR, 'dist/manifest.json'); -const PHP_VERSION = process.env.PHP_VERSION || '8.4'; - -if (!existsSync(MANIFEST)) { - console.error(`[spike] Missing ${MANIFEST}. Run build-in-docker-rust.sh first.`); - process.exit(2); -} - -const PLAYGROUND_REPO = - process.env.PLAYGROUND_REPO || - resolve(here, '../../../../wordpress-playground-spike'); - -if (!existsSync(resolve(PLAYGROUND_REPO, 'package.json'))) { - console.error(`[spike] PLAYGROUND_REPO not found at ${PLAYGROUND_REPO}`); - process.exit(2); -} - -const PHP_CODE = `native_token_stream(); -echo 'COUNT=', $stream->count(); -`; - -const EXPECTED = - 'COUNT=5'; - -// Probe JSPI up front: loadNodeRuntime asks wasm-feature-detect for it, and -// custom extensions only load under JSPI. If the probe fails here we know -// the harness will reject the side module before the runtime ever tries. -const probe = spawnSync( - process.execPath, - [ - '--experimental-wasm-jspi', - '-e', - "import('wasm-feature-detect').then(async ({ jspi }) => { process.exit((await jspi()) ? 0 : 42); })", - ], - { cwd: PLAYGROUND_REPO, stdio: 'inherit' } -); -if (probe.status !== 0) { - console.error( - `[spike] wasm-feature-detect/jspi probe failed (exit ${probe.status}). ` + - `Node ${process.version} cannot enable JSPI; aborting before runtime.` - ); - process.exit(probe.status || 1); -} - -const cmd = [ - '--experimental-wasm-jspi', - '--experimental-strip-types', - '--experimental-transform-types', - '--disable-warning=ExperimentalWarning', - '--import', - resolve( - PLAYGROUND_REPO, - 'packages/meta/src/node-es-module-loader/register.mts' - ), - resolve( - PLAYGROUND_REPO, - 'packages/php-wasm/compile-extension/tests/load-built-extension.mjs' - ), - MANIFEST, - PHP_VERSION, - PHP_CODE, - EXPECTED, -]; - -console.error('[spike] running load-built-extension.mjs against', MANIFEST); -const result = spawnSync(process.execPath, cmd, { - cwd: PLAYGROUND_REPO, - stdio: 'inherit', -}); -process.exit(result.status ?? 1); diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/shim/config.m4 b/packages/php-ext-wp-mysql-parser/wasm-spike/shim/config.m4 deleted file mode 100644 index c0cbb7dd5..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/shim/config.m4 +++ /dev/null @@ -1,21 +0,0 @@ -dnl C shim that lets the Playground compile-extension Docker pipeline (phpize + -dnl emconfigure + emmake) build a side module whose actual code is a -dnl pre-compiled Rust staticlib produced by `cargo build --target -dnl wasm32-unknown-emscripten --release`. -dnl -dnl The staticlib is NOT linked here through PHP_ADD_LIBRARY_WITH_PATH — -dnl libtool refuses to treat a wasm `.a` as a viable input for a `.so` -dnl link and silently degrades the build to a static module. Instead, the -dnl spike's wrapper (`build-in-docker-rust.sh`) passes the archive to -dnl `@php-wasm/compile-extension` via `--extra-ldflags -dnl /build/libwp_mysql_parser.a`, which injects it with `--whole-archive` -dnl into the final libtool link. - -PHP_ARG_ENABLE([wp_mysql_parser], - [whether to enable wp_mysql_parser], - [AS_HELP_STRING([--enable-wp_mysql_parser], [Enable wp_mysql_parser])], - [yes]) - -if test "$PHP_WP_MYSQL_PARSER" != "no"; then - PHP_NEW_EXTENSION(wp_mysql_parser, wp_mysql_parser_shim.c, $ext_shared) -fi diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/shim/wp_mysql_parser_shim.c b/packages/php-ext-wp-mysql-parser/wasm-spike/shim/wp_mysql_parser_shim.c deleted file mode 100644 index 3433e3a09..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/shim/wp_mysql_parser_shim.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Trivial shim. ext-php-rs already exports `get_module()` from the Rust - * crate when built with the `runtime` feature; phpize only needs a C - * translation unit so that Autoconf has something to compile and so the - * libtool archive command gets invoked. The real module entry comes from - * libwp_mysql_parser.a, force-linked through PHP_ADD_LIBRARY_WITH_PATH + - * --whole-archive in build-in-docker.sh. - */ -#include "php.h" - -/* Forward-declare so the linker keeps the symbol from the Rust archive. */ -extern zend_module_entry *get_module(void); - -/* Reference get_module so the static library is not GC'd by the linker - * even if the compile-extension whole-archive path changes. */ -zend_module_entry *(*wp_mysql_parser_keep_alive)(void) = get_module; diff --git a/packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs b/packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs deleted file mode 100644 index 86b073ae6..000000000 --- a/packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env node -import { existsSync } from 'node:fs'; -import { writeFile } from 'node:fs/promises'; -import { resolve } from 'node:path'; - -const DEFAULT_PHP_VERSIONS = ['8.5', '8.4', '8.3', '8.2', '8.1', '8.0']; - -const [, , outDirArg, ...argvPhpVersions] = process.argv; -const outDir = resolve(outDirArg || 'dist'); -const extensionName = process.env.EXTENSION_NAME || 'wp_mysql_parser'; -const asyncMode = process.env.ASYNC_MODE || 'jspi'; -const version = process.env.EXTENSION_VERSION || ''; -const envPhpVersions = (process.env.PHP_VERSIONS || '') - .split(/[,\s]+/) - .filter(Boolean); -const phpVersions = - argvPhpVersions.length > 0 - ? argvPhpVersions - : envPhpVersions.length > 0 - ? envPhpVersions - : DEFAULT_PHP_VERSIONS; - -const missingArtifacts = []; -const artifacts = phpVersions.map((phpVersion) => { - const sourcePath = `${extensionName}-php${phpVersion}-${asyncMode}.so`; - if (!existsSync(resolve(outDir, sourcePath))) { - missingArtifacts.push(sourcePath); - } - return { - phpVersion, - sourcePath, - }; -}); - -if (asyncMode !== 'jspi') { - console.error( - `Unsupported ASYNC_MODE: ${asyncMode}. Playground external extension manifests are JSPI-only.` - ); - process.exit(1); -} - -if (missingArtifacts.length > 0) { - console.error( - `Missing extension artifact(s) in ${outDir}: ${missingArtifacts.join(', ')}` - ); - process.exit(1); -} - -const manifest = { - name: extensionName, - mode: 'php-extension', - artifacts, -}; - -if (version) { - manifest.version = version; -} - -const manifestPath = resolve(outDir, 'manifest.json'); -await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`); -console.log(`Wrote ${manifestPath}`);