-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Bug Report
| Q | A |
|---|---|
| Version | 4.4.1 |
Summary
Small unsigned bigint with string in entity property type produces unnecessary changeset
Current behavior
Unnecessary changeset
Expected behavior
No changeset
How to reproduce
I am using unsigned bigint to store custom ids (xxhash64). It can be from 0 to 18446744073709551615, and max value can not be casted to php int, because max php int is 9223372036854775807 in 64bit systems (smaller than max xxhash64 value). But it is still valid unsigned bigint value for mysql. Since it can not be casted to int for all values, i am using string property type in entity class. If id from database is greater than 9223372036854775807 , the originalData in unit of work is string, but if it can be casted to php int, originalData in unitofwork contains int value and when computing changeset value from entity !== original value (cause different types), and then unitofwork produces unnecessary changeset
So, fetching entity with this id and immediatly calling flush after this produces unnecessary update query and changeset looks like this:
