DDC-481: Incorrect table aliasing when using quoting on table names #598

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

Originally created by @doctrinebot on GitHub (Mar 29, 2010).

Jira issue originally created by user mluiten:

I need to quote several table names (because of reserved words within MySQL) like so:

/****
 * @Entity
 * @Table(name="`Column`")
 */
class Column extends OptionAbstract

Another entity Question is related one-to-many to these entities, however, when trying to fetch the relation I get SQL errors because it seems to use the backtick as the table alias, which is illegal. An example of the query it's generating:

SELECT `0.id AS id1, `0.name AS name2, `0.sequence AS sequence3, `0.question*id AS question_id4 FROM `Column` `0 WHERE question*id = ?
Originally created by @doctrinebot on GitHub (Mar 29, 2010). Jira issue originally created by user mluiten: I need to quote several table names (because of reserved words within MySQL) like so: ``` /**** * @Entity * @Table(name="`Column`") */ class Column extends OptionAbstract ``` Another entity Question is related one-to-many to these entities, however, when trying to fetch the relation I get SQL errors because it seems to use the backtick as the table alias, which is illegal. An example of the query it's generating: ``` SELECT `0.id AS id1, `0.name AS name2, `0.sequence AS sequence3, `0.question*id AS question_id4 FROM `Column` `0 WHERE question*id = ? ```
admin added the Bug label 2026-01-22 12:43:48 +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#598