mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Using IDENTITY in a update does not quote table name #7447
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tomme87 on GitHub (Dec 3, 2024).
Bug Report
Summary
When I'm using the
IDENTITYfunction in a update DQL, the table name is not quoted in the resulting SQL.Current behavior
DQL:
UPDATE App\Entity\User u SET u.deletedAt = :now WHERE IDENTITY(u.userIdentifier) IN(1, 2, 3)Results in this SQL:
UPDATE "user" SET deleted_at = ? WHERE user.user_identifier_id IN (1, 2, 3)Which results in a "syntax error"
Expected behavior
I expect the resulting SQL to be:
UPDATE "user" SET deleted_at = ? WHERE "user".user_identifier_id IN (1, 2, 3)How to reproduce
My examples above is pretty clear, but let me know if you need more info.
I can add that my
Userentity have the following table attribute:#[ORM\Table(name: '`user`')]