doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.94k stars 2.52k forks source link

UUID Relation cannot be built corerctly in some cases #11705

Open bytes-commerce opened 2 weeks ago

bytes-commerce commented 2 weeks ago

Bug Report

Q A
Version 2.17.2

Summary

In some cases it seems Doctrine is not able to correctly load entities that have a UUID foreign key set up.

Current behavior

I load an object that contains a relation to another object, with FK UUID. Upon inspection, I can verify that only 3 of 4 elements are loaded (by checking the content of the relation children). However, all UUIDs are correctly instanciated.

Here you can see that Doctrine is able to load the UUIDs correctly: grafik

Here you can see that its unable to report the properties values correctly: grafik

Here you can see that the ID is query-able via MySQL Workbench: grafik

Now comes the interesting part, it seems that for example EasyAdmin is loading it differently and thus, finding the data values correctly: grafik

Here you can see this very same UUID is not able to query the element when using UNHEX (which is more likely to be used I'd assume): grafik

Here are information for the specific elements in the DB: UUID Works
0192f361-bfac-7e90-80e0-382f9f6edfab :no_entry_sign:
0192ef68-73da-7497-a446-bf3a300d0a41 :heavy_check_mark:
0192f26c-da9f-7ebd-8538-28d8e3163b1e :heavy_check_mark:
0192f26d-2e06-7560-8a83-ce406955add6 :heavy_check_mark:

I cannot see much of a difference between these UUIDs.

Expected behavior

The collection contains 4 full elements that have all kind of data.

How to reproduce

I cannot really reproduce it; i just happen to see it in my local environment right now. This is the first time I see such an error and without changing my code, I cannot reproduce the issue again. So it must be connceted to the UUID, or the way how its being called.