Test suite incompatibility with MySQL 9.4: LIBRARY is a reserved word #7553

Open
opened 2026-01-22 15:53:17 +01:00 by admin · 0 comments
Owner

Originally created by @mbeccati on GitHub (Sep 19, 2025).

Bug Report

Q A
Version 2.2.x

Summary

Apparently since MySQL 9.4 "LIBRARY" is a reserved SQL word, so the Library Enum in the test suite is causing an SQL error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET' at line 1' while executing DDL: CREATE TABLE Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB

I was about to send a PR, but TBH I'm not sure if the driver should manage quoting the table name in case it's a reserved word, or if the entity should simply use a different table name.

Current behavior

  1. Doctrine\Tests\ORM\Functional\EnumTest::testEnumCollectionMatchingOnOneToMany with data set #0 (Doctrine\Common\Collections\Expr\Comparison Object (...))
    Doctrine\ORM\Tools\ToolsException: Schema-Tool failed with Error 'An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET' at line 1' while executing DDL: CREATE TABLE Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB

Expected behavior

Test(s) pass

How to reproduce

Run test suite with MySQL 9.4

Originally created by @mbeccati on GitHub (Sep 19, 2025). ### Bug Report | Q | A |-------------------------------------------- | ------ | Version | 2.2.x #### Summary Apparently since MySQL 9.4 "LIBRARY" is a reserved SQL word, so the Library Enum in the test suite is causing an SQL error: ``` SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET' at line 1' while executing DDL: CREATE TABLE Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ``` I was about to send a PR, but TBH I'm not sure if the driver should manage quoting the table name in case it's a reserved word, or if the entity should simply use a different table name. #### Current behavior 1) Doctrine\Tests\ORM\Functional\EnumTest::testEnumCollectionMatchingOnOneToMany with data set #0 (Doctrine\Common\Collections\Expr\Comparison Object (...)) Doctrine\ORM\Tools\ToolsException: Schema-Tool failed with Error 'An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET' at line 1' while executing DDL: CREATE TABLE Library (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB #### Expected behavior Test(s) pass #### How to reproduce Run test suite with MySQL 9.4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7553