Skip to content

Update entity triggering Invalid Parameter Number when PDO is set to ATTR_EMULATE_PREPARES false #59

@rodrigozietlow

Description

@rodrigozietlow

PDO's emulation for prepared statements can duplicate repeated placeholders (as stated in https://stackoverflow.com/questions/42244086/why-pdo-doesnt-allow-multiple-placeholders-with-the-same-name), but it won't work if you work with emulation set to false, in which case Maphper update-after-insert-failed will throw a PDOException Invalid parameter number because the query uses 2 placeholders with the same name for the pk, one in the update code and one in the where code. Ex:
UPDATE table SET id = :id, x = :x WHERE id = :id
I can submit a PR to fix this when i find some time, but can you take a look if i'm not missing anything?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions