Skip to content

Fix EXPLAIN AST output for strings with embedded single quotes#34

Merged
kyleconroy merged 1 commit intomainfrom
claude/fix-next-test-8cPbB
Dec 24, 2025
Merged

Fix EXPLAIN AST output for strings with embedded single quotes#34
kyleconroy merged 1 commit intomainfrom
claude/fix-next-test-8cPbB

Conversation

@kyleconroy
Copy link
Copy Markdown
Collaborator

The escapeStringLiteral function was outputting just \' for embedded
single quotes, but ClickHouse EXPLAIN AST uses \\\' (escaped backslash

  • escaped quote) for embedded quotes within string literals.

This fix aligns with the behavior shown in many existing tests:

  • 00011_sorting: DateTime('Asia/Dubai')
  • 00324_hashing_enums: Enum8('Hello' = 0, 'World' = 1)
  • 00471_sql_style_quoting: hello'world
  • And many others

Also fixes test 03404's explain.txt which had incorrect escaping.

Enables 4 previously failing tests:

  • 01434_netloc_fuzz
  • 03003_sql_json_nonsense
  • 03521_tuple_of_dynamic_with_string_comparison
  • 03567_finalize_write_buffer_valid_utf8

The escapeStringLiteral function was outputting just `\'` for embedded
single quotes, but ClickHouse EXPLAIN AST uses `\\\'` (escaped backslash
+ escaped quote) for embedded quotes within string literals.

This fix aligns with the behavior shown in many existing tests:
- 00011_sorting: DateTime(\'Asia/Dubai\')
- 00324_hashing_enums: Enum8(\'Hello\' = 0, \'World\' = 1)
- 00471_sql_style_quoting: hello\'world
- And many others

Also fixes test 03404's explain.txt which had incorrect escaping.

Enables 4 previously failing tests:
- 01434_netloc_fuzz
- 03003_sql_json_nonsense
- 03521_tuple_of_dynamic_with_string_comparison
- 03567_finalize_write_buffer_valid_utf8
@kyleconroy kyleconroy merged commit 756753d into main Dec 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants