Bad interactions with PostgreSQL query munging and embedded values #175
Labels
No labels
admin tools
api
bug
documentation
duplicate
enhancement
feature
help wanted
in progress
internals
invalid
packaging
question
testing
trivial
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: MensBeam/Arsse#175
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Natively PostgreSQL uses e.g.
$1
as a parameter marker instead of?
. PDO handles this conversion, but for the native driver we've had to change the markers ourselves.When this was originally implemented it was assumed all values would be placed in parameters and thus any
?
characters would be parameter markers and a simple string replacement could be used. Since then, strings are sometimes embedded to ease pressure on the limited number of parameter markers themselves; strings literals containing?
might therefore now appear in queries, breaking things spectacularly.Indeed, this part of query construction is poorly tested, so more tests are required. The simplest solution is probably to never embed any string which contains a question mark.