test: verify LIKE filter in update queries uses parameterized values#2124
Open
Br1an67 wants to merge 1 commit intotortoise:developfrom
Open
test: verify LIKE filter in update queries uses parameterized values#2124Br1an67 wants to merge 1 commit intotortoise:developfrom
Br1an67 wants to merge 1 commit intotortoise:developfrom
Conversation
Member
|
Test seems to be failing |
Add a regression test for issue tortoise#1225. The LIKE pattern from contains() filter is passed as a parameterized query value (not rendered inline), so the % wildcards never conflict with MySQL driver's %s parameter substitution. Fixes tortoise#1225
67b7310 to
f91bb39
Compare
Member
|
I lost track of this PR's sense - it now just adds test? Logic that it should have fixed actually works properly? Or why issue originally arised? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a regression test for #1225.
The LIKE pattern generated by
contains()/startswith()/endswith()filters is passed as a parameterized query value (not rendered inline in the SQL template). This means the%wildcards in the LIKE pattern never conflict with the MySQL driver's%sparameter substitution.The test verifies the correct parameterized SQL for all four backends:
LIKE %sLIKE $2 ESCAPE '\\'LIKE %s ESCAPE '\\'LIKE ? ESCAPE '\\'Fixes #1225