Using IDENTITY in a update does not quote table name #7447

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

Originally created by @tomme87 on GitHub (Dec 3, 2024).

Bug Report

Q A
Version 3.3.0
Driver postgresql

Summary

When I'm using the IDENTITY function 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 User entity have the following table attribute: #[ORM\Table(name: '`user`')]

Originally created by @tomme87 on GitHub (Dec 3, 2024). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------------------------------- | ------ | Version | 3.3.0 | Driver | postgresql #### Summary <!-- Provide a summary describing the problem you are experiencing. --> When I'm using the `IDENTITY` function 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 `User` entity have the following table attribute: ``#[ORM\Table(name: '`user`')]`` <!-- Provide a failing Unit or Functional Test - you can submit one in a Pull Request separately, referencing this bug report. And if you feel like it, why not fix the bug while you're at it? If that is too difficult, provide a link to a minimal repository containing an application that reproduces the bug. If the bug is simple, you may provide a code snippet instead, or even a list of steps. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7447