Skip to content

Fix Display of quoted identifiers with a backslash before the quote - #2593

Open
mvisani wants to merge 4 commits into
apache:mainfrom
mvisani:fix-quoted-ident-backslash-display
Open

mvisani wants to merge 4 commits into
apache:mainfrom
mvisani:fix-quoted-ident-backslash-display

Conversation

@mvisani

@mvisani mvisani commented Sep 28, 2026

Copy link
Copy Markdown

The tokenizer never treated a backslash as an escape inside a quoted identifier, but EscapeQuotedString assumed a quote after a backslash was already escaped. The rendered SQL was then unterminated, e.g. SELECT "a\""" displayed as SELECT "a\"" and failed to re-parse. Found by fuzzing fuzz_parse_roundtrip.

The tokenizer never treats a backslash as an escape inside a quoted identifier, but EscapeQuotedString assumed a quote after a backslash was already escaped. The rendered SQL was then unterminated, e.g. SELECT "a\""" displayed as SELECT "a\"" and failed to re-parse. Found by fuzz_parse_roundtrip.
@github-actions

Copy link
Copy Markdown

No dialect label was applied because the title does not name a SQL dialect.

If this change targets one or more dialects, edit the title to <Dialect>[, <Dialect>]: <description>, add a Dialects: <Dialect>[, <Dialect>] line to the description, or reply with one. Reply Dialects: none if the change is dialect-agnostic.

@LucaCappelletti94 LucaCappelletti94 added bug Something isn't working fuzzer A bug found by the fuzzer waiting on reviewer PR needs to be reviewed labels Sep 28, 2026
@LucaCappelletti94

Copy link
Copy Markdown
Contributor

@mvisani add to the fuzzer seed corpus the crashing case, so it will be faster to get to next time around

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.10%. Comparing base (560a13c) to head (6e23a7b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2593   +/-   ##
=======================================
  Coverage   81.09%   81.10%           
=======================================
  Files          42       42           
  Lines       33684    33695   +11     
  Branches    33684    33695   +11     
=======================================
+ Hits        27316    27327   +11     
  Misses       2798     2798           
  Partials     3570     3570           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fuzzer A bug found by the fuzzer waiting on reviewer PR needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants