Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rodrigozietlow opened this issue Oct 19, 2018 · 0 comments

Comments

@rodrigozietlow
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant