mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Foreign Key UUIDs in SQLite are Queried as RFC4122 Values iso Binary Values #7338
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 @gnito-org on GitHub (Mar 5, 2024).
Bug Report
Summary
When using UUIDs as keys in SQLite, retrieving records by primary key works fine, but retrieving records by foreign key does not work.
Current behavior
Table User:
Table AccessToken:
The SQL generated by ORM to retrieve a record by primary key is:
That works because the id is queried with a binary value.
The SQL generated by ORM to retrieve records by foreign key is:
That does not find any records because the foreign key is queried with an RFC4122 representation of the UUID.
Expected behavior
The foreign key should also be queried with the binary representation of the UUID because it is stored in SQLite as a BLOB.
Screenshots
The
idin the Entity:The foreign key:
The QueryBuilder:
The Symfony Profiler Doctrine tab:
@gnito-org commented on GitHub (Mar 16, 2024):
Incorrect diagnosis. Please refer to https://github.com/doctrine/orm/issues/11358.