Skip to content

Quote the LIBRARY column for MySQL 9.2+ - #608

Merged
tonygermano merged 2 commits into
OpenIntegrationEngine:mainfrom
tonygermano:fix/mysql-reserved-library
Dec 2, 2026
Merged

tonygermano merged 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

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Test Results

  149 files  + 2    149 suites  +2   4m 16s ⏱️ + 1m 0s
1 010 tests + 2  1 010 ✅ + 2  0 💤 ±0  0 ❌ ±0 
1 388 runs  +56  1 382 ✅ +56  6 💤 ±0  0 ❌ ±0 

Results for commit b27df60. ± Comparison against base commit 75c52f6.

♻️ This comment has been updated with latest results.

@pacmano1 pacmano1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran the upgrade path: a 4.6.0 database with a code template library on MySQL 8.4, MySQL upgraded in place to 9.7, then this PR's base and head on copies. The base logs "Failed to migrate serialized data", the library 404s and saving one 500s. The head migrates the library to 4.7.0 and it reads and saves fine.

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>
@tonygermano
tonygermano force-pushed the fix/mysql-reserved-library branch from 55585f2 to b27df60 Compare December 1, 2026 23:47
@tonygermano
tonygermano merged commit 5503785 into OpenIntegrationEngine:main Dec 2, 2026
13 checks passed
@tonygermano
tonygermano deleted the fix/mysql-reserved-library branch December 2, 2026 00:00
@tonygermano tonygermano added this to the 4.8.0 milestone Dec 2, 2026
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

4 participants