Skip to content

Unnecessary changesets when using unsigned bigint #7314

@den-kuz

Description

@den-kuz

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:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions