Skip to content

Commit cf46532

Browse files
committed
Add the MySQL server query corpus to the package
Bring the query corpus extracted from the MySQL server test suite, with the tooling that generates it, into the package: data/mysql-server-query-corpus/ plus a bin/build-corpus orchestrator (composer run build-corpus) that fetches the mysql-test directory at the pinned tag and extracts the queries. The SQLite driver package keeps its own copy for now; it will be retired when the driver is ported to this package.
1 parent 829ab36 commit cf46532

5 files changed

Lines changed: 115521 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Build the MySQL server query corpus from the MySQL server test suite.
4+
#
5+
# Runs the full pipeline end to end:
6+
# 1. Fetch the mysql-test directory from the pinned mysql-server tag.
7+
# 2. Extract the SQL queries into data/mysql-server-query-corpus/.
8+
#
9+
# Requirements: bash, git, php. Override the MySQL version with MYSQL_TAG
10+
# (default: mysql-8.4.10).
11+
#
12+
set -euo pipefail
13+
14+
package_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
15+
tools_dir="$package_dir/tools"
16+
17+
bash "$tools_dir/fetch-mysql-tests.sh"
18+
19+
echo "Generating the query corpus ..."
20+
php "$tools_dir/generate-query-corpus.php"
21+
22+
echo "Done."

‎packages/mysql-parser/composer.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"scripts": {
1515
"build-grammar": [
1616
"./bin/build-grammar"
17+
],
18+
"build-corpus": [
19+
"./bin/build-corpus"
1720
]
1821
}
1922
}

0 commit comments

Comments
 (0)