Skip to content

Fix escaping for some SHOW queries#89942

Merged
alexey-milovidov merged 6 commits intomasterfrom
fix_some_escaping
Nov 14, 2025
Merged

Fix escaping for some SHOW queries#89942
alexey-milovidov merged 6 commits intomasterfrom
fix_some_escaping

Conversation

@alesapin
Copy link
Copy Markdown
Member

@alesapin alesapin commented Nov 12, 2025

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix wrong escaping for SHOW COLUMNS and SHOW FUNCTIONS queries.

(cherry picked from commit 08dc90b736b9fe29e662a12dd04a6d461dd5af1c)
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Nov 12, 2025

Workflow [PR], commit [fabd077]

Summary:

job_name test_name status info comment
BuzzHouse (amd_debug) failure
Buzzing result failure cidb
BuzzHouse (amd_tsan) failure
Buzzing result failure cidb
BuzzHouse (amd_ubsan) failure
Buzzing result failure cidb

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label Nov 12, 2025
@thevar1able thevar1able self-assigned this Nov 12, 2025
Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

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

.

@alexey-milovidov
Copy link
Copy Markdown
Member

With the SQLite database created on top of a prepared .sqlite3 file?

@alesapin
Copy link
Copy Markdown
Member Author

alesapin commented Nov 13, 2025

@alexey-milovidov which query you need to write in clickhouse-client to trigger this logic? You cannot specify arbitrary string as table name.

@alexey-milovidov
Copy link
Copy Markdown
Member

According to the code, it will be EXISTS TABLE from the SQLite database.

@alesapin
Copy link
Copy Markdown
Member Author

@alexey-milovidov our parser will not allow you to type arbitrary string in EXISTS TABLE query, it parses identifiers:


alesapin-workstation :) exists table like '%aaa%'

Syntax error: failed at position 19 ('%aaa%'):

exists table like '%aaa%'

Expected one of: token, Dot, INTO OUTFILE, FORMAT, SETTINGS, ParallelWithClause, PARALLEL WITH, end of query

alesapin-workstation :) exists table '%aaa%'

Syntax error: failed at position 14 ('%aaa%'):

exists table '%aaa%'

Expected identifier

Co-authored-by: Alexey Milovidov <milovidov@clickhouse.com>
@alexey-milovidov
Copy link
Copy Markdown
Member

Identifiers can be arbitrary non-empty strings.

@alexey-milovidov
Copy link
Copy Markdown
Member

alexey-milovidov commented Nov 14, 2025

EXISTS TABLE sqlite."a'b''c\\'d\\"

@alexey-milovidov
Copy link
Copy Markdown
Member

FYI, "Bugfix validation" shows that the new tests pass on the master branch. If it's not the case, ask our CI team.

@alexey-milovidov alexey-milovidov merged commit fafd19a into master Nov 14, 2025
125 of 130 checks passed
@alexey-milovidov alexey-milovidov deleted the fix_some_escaping branch November 14, 2025 20:39
@alexey-milovidov alexey-milovidov added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Nov 14, 2025
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 14, 2025
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 14, 2025
robot-ch-test-poll1 added a commit that referenced this pull request Nov 14, 2025
Cherry pick #89942 to 25.3: Fix escaping for some `SHOW` queries
robot-ch-test-poll1 added a commit that referenced this pull request Nov 14, 2025
Cherry pick #89942 to 25.8: Fix escaping for some `SHOW` queries
robot-ch-test-poll1 added a commit that referenced this pull request Nov 14, 2025
Cherry pick #89942 to 25.9: Fix escaping for some `SHOW` queries
robot-ch-test-poll1 added a commit that referenced this pull request Nov 14, 2025
Cherry pick #89942 to 25.10: Fix escaping for some `SHOW` queries
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 14, 2025
clickhouse-gh bot added a commit that referenced this pull request Nov 14, 2025
Backport #89942 to 25.10: Fix escaping for some `SHOW` queries
clickhouse-gh bot added a commit that referenced this pull request Nov 14, 2025
Backport #89942 to 25.9: Fix escaping for some `SHOW` queries
alexey-milovidov added a commit that referenced this pull request Nov 17, 2025
Backport #89942 to 25.8: Fix escaping for some `SHOW` queries
alexey-milovidov added a commit that referenced this pull request Nov 17, 2025
Backport #89942 to 25.3: Fix escaping for some `SHOW` queries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants