Skip to content

Problem with UPDATE on DATE primary key (part) in MySQL #320

@jkavalik

Description

@jkavalik

Currently when any date/time column is used in the DB, it is mapped to a DateTimeImmutable. When such column is in the primary key, it is being formatted including the timezone specification. I have a problem with MariaDB where the updates are not happening, because the incorrectly formatted value is silently ignored. In MySQL such situation is even supposed to throw an error instead, which I was able to simulate by dropping the primary key from the table, which triggers the same error in MariaDB.
tracy_date_error

Selects work and can find the row, but they throw a warning anyway.

Would it be somehow possible to format the datetime for current platform? It is currently done in AbstractEntity where I am not sure such information would be available, and the string is needed for identity map functioning properly. But maybe the identity map could format it any way it wants to ensure proper indexing and the Mapper could use the Platform to format it properly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions