Commit fc07884
committed
Fix EXPLAIN AST output for strings with embedded single quotes
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_utf81 parent c22b96e commit fc07884
7 files changed
Lines changed: 8 additions & 8 deletions
File tree
- internal/explain
- parser/testdata
- 01434_netloc_fuzz
- 03003_sql_json_nonsense
- 03404_ubsan_distinct_join_const_column
- 03521_tuple_of_dynamic_with_string_comparison
- 03567_finalize_write_buffer_valid_utf8
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments