DDC-344: Table names are not escaped #426

Open
opened 2026-01-22 12:37:54 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 17, 2010).

Jira issue originally created by user nicokaiser:

Table names (and maybe also attribute names?) are not escaped when SQL is generated.
This means, if you create something like this

/****
 * @Entity
 * @Table(name="groups")
 */
class Group
...

the generated SQL code will be "CREATE TABLE group (id INT...", which fails because "group" is a reserved keyword. It should be escaped with backticks: "CREATE TABLE group (id INT..."

Originally created by @doctrinebot on GitHub (Feb 17, 2010). Jira issue originally created by user nicokaiser: Table names (and maybe also attribute names?) are not escaped when SQL is generated. This means, if you create something like this ``` /**** * @Entity * @Table(name="groups") */ class Group ... ``` the generated SQL code will be "CREATE TABLE group (id INT...", which fails because "group" is a reserved keyword. It should be escaped with backticks: "CREATE TABLE `group` (id INT..."
admin added the Bug label 2026-01-22 12:37:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#426