Skip to content
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

sql (fix): Quote digit QName parts to generate valid SQL #3493

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

takezoe
Copy link
Member

@takezoe takezoe commented Apr 20, 2024

No description provided.

@@ -463,9 +463,6 @@ object Expression {
QuotedIdentifier(x.stripPrefix("\"").stripSuffix("\""), None)
} else if (x.matches("[0-9]+")) {
DigitId(x, None)
} else if (!x.matches("[0-9a-zA-Z_]*")) {
// Quotations are needed with special characters to generate valid SQL
QuotedIdentifier(x, None)
Copy link
Member Author

@takezoe takezoe Apr 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to QName.sqlExpr so that this method can focus on identifier generation without handling special cases.

@takezoe takezoe force-pushed the sql-quote-qname-parts branch from 738b632 to 00f66ca Compare April 20, 2024 03:06
@takezoe takezoe changed the title sql (fix): Quote digit QName parts to generate SQL properly sql (fix): Quote digit QName parts to generate valid SQL Apr 20, 2024
@takezoe takezoe requested a review from xerial April 20, 2024 03:14
@xerial xerial merged commit ef113c7 into wvlet:main Apr 20, 2024
15 checks passed
@xerial
Copy link
Member

xerial commented Apr 20, 2024

Ok. Merged

@takezoe takezoe deleted the sql-quote-qname-parts branch April 22, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants