Repository navigation
fix(sql): preserve literals when rewriting backtick identifiers - #25
Merged
Merged
Conversation
Owner
|
@eddiethedean, thank you for your contribution, we will make it available in the next release on October 23rd. |
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.
Backticks inside SQL string values were being rewritten to double quotes, silently changing query results. For example:
This now returns the literal backticks unchanged. Backticks in comments and escaped identifier names also preserve their intended behavior.
Replace the global substitution with a scanner that preserves ordinary, E-prefixed, and dollar-quoted strings, existing quoted identifiers, and nested comments. Translate doubled backticks and embedded double quotes correctly. Match DuckDB's Unicode identifier and whitespace rules for typed literals, string continuations, and dollar tags. Statements without backticks return immediately, avoiding unnecessary scanning. Regression coverage uses the real Databricks SDK: 27 parametrized cases plus a typed-literal test.
Validation at
c0f3916:uv run pre-commit run --all-filesandgit diff --checkpassed.ui/src/components/results/results-grid.tsx(react-hooks/incompatible-library).To reproduce the full suite:
Maintainer handoff: this PR is open and ready for review, has no merge conflicts or unresolved review threads, and allows maintainer edits. GitHub currently reports merging as
BLOCKEDand publishes no CI checks for this head. A repository maintainer needs to confirm CI/workflow approval and any merge requirements before merging; the blocking reason is not visible with contributor read access. Compatibility across every supported DuckDB version has not been exercised.