Skip to content

Quote the LIBRARY column for MySQL 9.2+ - #608

Open
tonygermano wants to merge 2 commits into
OpenIntegrationEngine:mainfrom
tonygermano:fix/mysql-reserved-library
Open

tonygermano wants to merge 2 commits into
OpenIntegrationEngine:mainfrom
tonygermano:fix/mysql-reserved-library

Conversation

@tonygermano

@tonygermano tonygermano commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Fixes #607

MySQL 9.2 made LIBRARY a reserved word, so CREATE TABLE CODE_TEMPLATE_LIBRARY fails and a fresh install can't create its schema.

  • Backtick-quote the column in the MySQL schema, the 3.2.2-3.3.0 delta and mysql-codeTemplate.xml.
  • The migrators' SQL is shared across databases, so Migrator.quoteColumn() adds the backticks only when the database type is mysql. MigratorTest covers it, since ServerMigratorTest runs on Derby only.
  • Existing installs need no schema change, and the other databases are untouched.
  • The alpine-temurin21-mysql CI configuration actually ran MariaDB, which doesn't reserve LIBRARY. It is renamed to alpine-temurin21-mariadb, and alpine-temurin21-mysql now runs mysql:9.7. This is the second commit, so it can be dropped separately.

Claude checked:

  • The unmodified schema script fails on mysql:9.2 and runs cleanly on mysql:9.1.
  • With the fix, the schema script runs on mysql:9.2 and mysql:9.7, and insert, update and select on `LIBRARY` work on 9.2.
  • ./gradlew clean build passed before MigratorTest was added; after that only MigratorTest was run.
  • Not checked: the full OIE container against the new MySQL configuration (its first CI run is the test), and the Java migration paths against a real MySQL server. Update: CI checks all passed

🤖 Drafted with Claude Code

MySQL 9.2 made LIBRARY a reserved word, so creating
CODE_TEMPLATE_LIBRARY failed with a syntax error and the rest of
mysql-database.sql never ran. Quote the column with backticks in the
MySQL schema, the 3.2.2-3.3.0 delta and the MySQL code template mapper.

The migrators share their SQL across databases, so add
Migrator.quoteColumn() to quote only when the database type is mysql and
use it for the two LIBRARY statements there. MigratorTest covers it,
since ServerMigratorTest runs on Derby only and never reaches the quoted
path.

Verified on MySQL 9.2.0: the schema script runs and the column can be
inserted, updated and selected.

Issue: OpenIntegrationEngine#607
Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Tony Germano <tony@germano.name>
The mysql configuration actually ran MariaDB, which does not reserve
LIBRARY, so it could not catch the MySQL 9.2 failure fixed in the
previous commit. Rename it to alpine-temurin21-mariadb and make
alpine-temurin21-mysql use the mysql image (9.7).

Issue: OpenIntegrationEngine#607
Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Tony Germano <tony@germano.name>
@github-actions

Copy link
Copy Markdown

Test Results

  149 files  + 2    149 suites  +2   4m 50s ⏱️ +58s
1 008 tests + 2  1 008 ✅ + 2  0 💤 ±0  0 ❌ ±0 
1 386 runs  +56  1 380 ✅ +56  6 💤 ±0  0 ❌ ±0 

Results for commit 55585f2. ± Comparison against base commit 1ad22b1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot deploy OIE with MySQL 9.2+ because of reserved word LIBRARY

2 participants