-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
tests: add tests for go/sqlescape
#14987
tests: add tests for go/sqlescape
#14987
Conversation
Signed-off-by: Manik Rana <[email protected]>
Signed-off-by: Manik Rana <[email protected]>
Signed-off-by: Manik Rana <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14987 +/- ##
=======================================
Coverage 47.49% 47.49%
=======================================
Files 1149 1149
Lines 239475 239475
=======================================
+ Hits 113730 113749 +19
+ Misses 117138 117121 -17
+ Partials 8607 8605 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Maniktherana ! We can see that the package's code coverage went from 61.29% on main to 100% in the PR branch:
- https://app.codecov.io/gh/vitessio/vitess/tree/main/go%2Fsqlescape
- https://app.codecov.io/gh/vitessio/vitess/pull/14987/tree/go/sqlescape
Regarding your question... I think that Escape followed by Unescape should produce that same string that we started with. You're right that currently it does not as EscapeID escapes inner backticks but UnescapeID does not do the reverse. I think that's a bug. What do you think @rohit-nayak-ps ?
@mattlord if this is the case, I'd be happy to raise an issue and follow it up with a fix |
Yes, this is a bug. |
Signed-off-by: Manik Rana <[email protected]>
going to keep this as draft until #14992 is resolved |
@Maniktherana Do you want to take a stab at fixing the issue as well, given that you're the one who uncovered it? If you don't want to, that's fine as well, in that case, I shall pick it up. |
@GuptaManan100 I'm already on it :) |
Signed-off-by: Manik Rana <[email protected]>
Merge main to add-tests-sqlescape
Signed-off-by: Manik Rana <[email protected]>
Signed-off-by: Manik Rana <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, both on finding the bug, and also on the fix.
Description
Adds tests for
go/sqlescape
Question: if
EscapeID
for the stringa`a
returns`a``a`
, shouldUnescapeID
reverse it? Because currently it simply returnsa``a
, removing the outer backticks without halving the ones inside the stringRelated Issue(s)
#14931
Checklist
Deployment Notes