-
Notifications
You must be signed in to change notification settings - Fork 77
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
PROD-2083: fix for mysql reserved word escaping #5072
PROD-2083: fix for mysql reserved word escaping #5072
Conversation
…mysql-reserved-word-escaping
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Passing run #8850 ↗︎
Details:
Review all test suite changes for PR #5072 ↗︎ |
@@ -364,7 +364,7 @@ def get_formatted_query_string( | |||
clauses: List[str], | |||
) -> str: | |||
"""Returns an SQL query string.""" | |||
return f"SELECT {field_list} FROM {self.node.collection.name} WHERE {' OR '.join(clauses)}" | |||
return f"SELECT {field_list} FROM `{self.node.collection.name}` WHERE {' OR '.join(clauses)}" |
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.
early drive-by review - i think you found the right spot for this! 🎊
…aping table names
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5072 +/- ##
=======================================
Coverage 86.41% 86.42%
=======================================
Files 356 356
Lines 22171 22181 +10
Branches 2913 2913
=======================================
+ Hits 19159 19169 +10
Misses 2497 2497
Partials 515 515 ☔ 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.
Looks good! I think you're missing adding a Changelog entry 😄 and also filling out the PR description
Passing run #8851 ↗︎
Details:
Review all test suite changes for PR #5072 ↗︎ |
Closes # PROD-2083
Description Of Changes
Escapes table names for mysql/postgresql, mysql in backticks and postgresql in double quotes. Prevents errors on collections with tables named with reserved keywords.
Code Changes
add a QueryConfig for mysql and postgresql which uses backticks or double quotes depending on which dialect
Steps to Confirm
Lead
table has been added to the mysqlPre-Merge Checklist
CHANGELOG.md
main
downgrade()
migration is correct and works