convertQuestionMark function improperly handles single quotes in comments #1954
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1954
Loading…
Reference in New Issue
Block a user
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?
The
convertQuestionMark
function converts ? SQL parameters to $1, $2 and so on. It tries to ignore question marks inside single-quoted strings. However, it does this very simplisticially, simply alternating each time a single quote occurs in the SQL string. This is not always correct, as SQL comments may contain single quotes, and this makes the parsing of the rest of the string incorrect.These tests both fail with the current implementation:
convertQuestionMark function improperly handles single quotesto convertQuestionMark function improperly handles single quotes in commentsCould you send a PR to fix that?
Closed by #1955