Skip to content

Add "Maybe you meant ...?" hint to SHOW CREATE for a missing table - #110633

Merged
alexey-milovidov merged 23 commits into
masterfrom
show-create-table-hints
Jul 19, 2026
Merged

alexey-milovidov merged 23 commits into
masterfrom
show-create-table-hints

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

When SHOW CREATE TABLE (also SHOW CREATE VIEW / SHOW CREATE DICTIONARY) refers to a table that does not exist, the error was thrown without the "Maybe you meant ...?" suggestion that SELECT queries already produce for a similarly-named table. For example, a typo or a wrong/omitted database produced:

Code: 60. DB::Exception: There is no metadata of table emb_siglip2 in database default. (UNKNOWN_TABLE)

with no hint, even when a table with a close name exists in this or another database.

The hint is now added in the common IDatabase::getCreateTableQuery wrapper, so it applies to every database engine (the various getCreateTableQueryImpl overrides report a missing table with UNKNOWN_TABLE, CANNOT_GET_CREATE_TABLE_QUERY, or CANNOT_GET_CREATE_DICTIONARY_QUERY). The suggestion is computed after getCreateTableQueryImpl returns — i.e. outside any database lock it may hold, to avoid a deadlock — and only when the table is really absent, reusing the same TableNameHints machinery as SELECT:

Code: 60. DB::Exception: There is no metadata of table emb_siglip2 in database default: Maybe you meant default.emb_siglip3?. (UNKNOWN_TABLE)

The hint also respects the access model of SHOW CREATE DICTIONARY, which is authorized with the SHOW DICTIONARIES grant (it does not imply SHOW TABLES): TableNameHints now keeps a candidate name visible to a user holding only SHOW DICTIONARIES when the object really is a dictionary, so such a user gets the hint for a similarly-named dictionary while the names of tables remain invisible to them.

The same access model is enforced for an exact name too, not just for typo hints. Previously a user holding only SHOW DICTIONARIES could run SHOW CREATE DICTIONARY db.some_table on a hidden regular table and get ... is not a DICTIONARY, which confirmed that a table with that name exists — turning SHOW CREATE DICTIONARY into an existence oracle for tables the user is not allowed to see. For a user who can neither SHOW TABLES nor SHOW COLUMNS on the object, InterpreterShowCreateQuery now fetches and validates the same create query in a single lookup — there is no separate existence probe and hence no window in which the object could be dropped and recreated as a different kind — and reports a hidden regular table or a name that does not exist identically as a missing name (There is no dictionary ...), so these are indistinguishable to such a user and ... is not a DICTIONARY is unreachable for them. For such a user this path is fully fail-closed: the object is shown only when that single fetch positively proves it to be a dictionary; any other outcome — a hidden regular table, a name that does not exist, or any failure of the fetch itself (for example a hidden table that is still starting up, has corrupted metadata, or otherwise throws) — is reported identically as a missing dictionary. The decision does not depend on the error code, because getCreateTableQuery calls tryGetTable first and a hidden table's own load or startup failure would otherwise escape and distinguish it from a missing name. The swallowed error is not lost: it resurfaces when a user who is allowed to see the object really accesses it. Users who can also observe the object as a table keep the precise is not a DICTIONARY diagnostic. This mirrors InterpreterExistsQuery, which likewise answers a dictionary-only user from a single observation instead of a second visibility-changing lookup.

The suggestion follows this same access model. Access is checked on the requested identifier before any lookup, so the hint appears when the user's grant covers the requested name — a broad db.* / *.* grant, or the exact name itself. With an object-level SHOW grant scoped to a single name — e.g. GRANT SHOW DICTIONARIES ON db.dict_target or GRANT SHOW COLUMNS ON db.tbl_target — a misspelled name is not covered, so it is denied with ACCESS_DENIED and no hint is produced. This is deliberate and narrower than SELECT: SELECT resolves the name during analysis, before its access check, so it surfaces a hint and, for an existing but hidden object, distinguishes it from a missing name even under object-level grants. SHOW CREATE intentionally does not — checking access on the requested name first keeps it from becoming an existence oracle, so an existing but hidden object and a missing name are both reported as ACCESS_DENIED and stay indistinguishable to a user who is not granted on that name.

Changelog category (leave one):

  • Improvement

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

SHOW CREATE TABLE (and SHOW CREATE VIEW / SHOW CREATE DICTIONARY) now suggests a similarly-named table in the error message when the requested table does not exist, the same way SELECT queries do.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

When `SHOW CREATE TABLE` (or `VIEW`/`DICTIONARY`) refers to a table that
does not exist, the error was thrown without the "Maybe you meant ...?"
suggestion that `SELECT` queries already produce for a similarly-named
table, e.g.:

    Code: 60. DB::Exception: There is no metadata of table emb_siglip2 in database default. (UNKNOWN_TABLE)

The hint is now added in the common `IDatabase::getCreateTableQuery`
wrapper, so it applies to every database engine (the various
`getCreateTableQueryImpl` overrides report a missing table with
`UNKNOWN_TABLE`, `CANNOT_GET_CREATE_TABLE_QUERY`, or
`CANNOT_GET_CREATE_DICTIONARY_QUERY`). It is computed after
`getCreateTableQueryImpl` returns, i.e. outside any database lock it may
hold, to avoid a deadlock, and only when the table is really absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0c8e424]

Summary: ✅


AI Review

Summary

This PR extends SHOW CREATE missing-object hints to use the same Maybe you meant ...? machinery as unknown-table lookups, and it also tightens the SHOW CREATE DICTIONARY RBAC path so dictionary-only users cannot use it as a table-existence oracle. Most of the earlier review points are fixed in the current head, but I still do not think the final dictionary-only remask is safe as written because it now converts unrelated getCreateTableQuery failures into a false UNKNOWN_TABLE result for an authorized user.

Findings

⚠️ Majors

  • [src/Interpreters/InterpreterShowCreateQuery.cpp:122-136] [dismissed by author -- https://github.com/Add "Maybe you meant ...?" hint to SHOW CREATE for a missing table #110633#discussion_r3608883762] The new dictionary-only catch (...) remasks every getCreateTableQuery failure as There is no dictionary .... That does hide hidden-table startup failures, but it also hides failures for real dictionaries and even interruption/resource-limit failures (MEMORY_LIMIT_EXCEEDED, cancellation, corrupted metadata, etc.), so a user who is explicitly allowed to SHOW DICTIONARIES can still get a false "missing dictionary" result for an existing dictionary. Suggested fix: use a load-free object-kind probe (or another typed path that can prove "hidden table or missing name") and remask only those cases; at minimum, do not swallow interruption/resource-limit failures.
Final Verdict

Changes not yet ready: the dictionary-only remask still lies about existing dictionaries when getCreateTableQuery fails for reasons unrelated to name visibility.

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jul 16, 2026
Comment thread src/Databases/IDatabase.cpp Resolved
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, investigate the failure: AST fuzzer (amd_debug, targeted) — Logical error: '!part.empty()' (chassert(!part.empty()) at src/Parsers/ASTIdentifier.cpp:48, STID: 2508-3750) — and provide a fix in a separate PR. If a fix is already in progress, link it here.

This is unrelated to this PR's diff (only IDatabase.cpp/IDatabase.h and a new stateless test). The same signature also failed two days ago on the unrelated PR #109768, so it looks like a pre-existing fuzzer-found issue in ASTIdentifier formatting rather than something introduced here. I could not find an open tracking issue or existing fix for it.

…ableQuery, add dictionary-database test coverage

`isTableExist` can itself throw for remote engines like `DatabaseMySQL` and
`DatabaseMaterializedPostgreSQL` (both re-fetch metadata), which was replacing
the original, more informative exception (e.g. a MySQL connection failure)
with the new one raised while merely checking whether the table exists for
hint purposes. Swallow that secondary failure and preserve the original
exception instead.

Also add a stateless test case exercising the `CANNOT_GET_CREATE_DICTIONARY_QUERY`
branch via a `Dictionary`-engine database, which was previously untested.
Comment thread src/Databases/IDatabase.cpp Resolved
@groeneai

Copy link
Copy Markdown
Collaborator

Investigated. This is a pre-existing engine bug, unrelated to this PR's diff — confirmed via CIDB: STID 2508-3750 appears only on unrelated branches (this PR and #109768's followup_restrict), never on master, and the assertion is in ASTIdentifier construction, not in anything this PR touches.

Root cause: the fuzzed query is

EXPLAIN AST optimize = 1 SELECT count()
FROM dist_larger AS lt INNER JOIN dist_smaller AS rt ON lt.key = rt.key
SETTINGS distributed_product_mode = 'local', enable_analyzer = 1

where both are Distributed tables defined with an empty remote database (Distributed(cluster, '', 'table')). Under distributed_product_mode = 'local', InJoinSubqueriesPreprocessor::renameIfNeeded rewrites each to its remote table via ASTTableIdentifier::resetTable("", "table"). The ASTTableIdentifier(database, table) constructor unconditionally builds {"", "table"} — an empty leading name-part — which trips chassert(!part.empty()) at ASTIdentifier.cpp:48 and aborts in debug/sanitizer builds. The sibling ASTTableIdentifier(StorageID) constructor already handles empty-db correctly (single-part identifier); this constructor was the sole inconsistent one.

Fix in a separate PR: #110677. It mirrors the StorageID constructor (build a single-part identifier when the database is empty). Reproduced the abort locally on the baseline binary and confirmed the fix (server stays up, clean AST) with a new regression test.

This is distinct from the other !part.empty() family (STID 2508-2ef2, the backquoted-dotted-identifier lambda-arg case fixed by #108735) — different trigger, different construction path.

alexey-milovidov and others added 2 commits July 16, 2026 17:00
…ning out of stderr

The test creates a database with the deprecated `Ordinary` engine, and the server
emits the "Server has databases (for example ...) with Ordinary engine, which was
deprecated" warning once per server lifetime, synchronously within the first such
`CREATE DATABASE` query. Shell tests run `clickhouse-client` with
`--send_logs_level=warning`, so whenever this test happened to be the first one to
create an `Ordinary` database (always the case in the flaky check, sometimes in
parallel runs), the warning was forwarded to the client and failed the test with
"having stderror".

Pass `--send_logs_level=fatal` for that single statement, like other tests creating
`Ordinary` databases do (e.g. `04340_timeseries_rename_digest_mismatch`).

Failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110633&sha=4b1e0730977f25a9a7dab1e9a293fc65f2855c24&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20flaky%20check%29
PR: #110633

Co-Authored-By: Claude Fable 5 <[email protected]>
`SHOW CREATE DICTIONARY` is authorized with the `SHOW_DICTIONARIES` grant, which
does not imply `SHOW_TABLES`, but `TableNameHints` filtered hint candidates with
`SHOW_TABLES` only - so a user with dictionary-only visibility still got the bare
error without the "Maybe you meant ...?" hint.

Keep a candidate name visible when the user has `SHOW_DICTIONARIES` on it and the
object really is a dictionary: the grant by itself does not tell tables and
dictionaries apart, so the extra check is needed to avoid leaking the names of
tables to a user with only a dictionary-level grant.

Add an RBAC regression test covering both sides: the dictionary-only user gets the
hint for a similarly-named dictionary, and gets no hint (no name leak) for a typo
close to a table's name.

PR: #110633

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread src/Interpreters/DatabaseCatalog.cpp Resolved
The previous `SHOW_DICTIONARIES` fix classified every candidate name with
`IDatabase::tryGetTable` inside `TableNameHints::getAllRegisteredNames`. For a
user with `GRANT SHOW DICTIONARIES ON db.*`, `IAccessRights::isGranted` is true
for every name, so a single typo in `SHOW CREATE DICTIONARY` could synchronously
foreground-load every table in the database (each `tryGetTable` waits for
startup/lazy-load completion and `getAllTableNames` also returns not-yet-loaded
names), and could even trip an unrelated load failure while merely formatting an
error hint.

Keep `getAllRegisteredNames` a cheap, name-only filter: a name visible only
through `SHOW_DICTIONARIES` is now kept as a candidate without any load. The
dictionary classification moves to a new `TableNameHints::isHintNameVisible`,
applied only to the single closest ranked candidate in `getHintForTable` and
`getExtendedHintForTable`. That loads at most one table (the matched candidate),
and only when it is not already covered by `SHOW_TABLES` - so a dictionary-only
grant still cannot leak the names of similarly-named tables.

Behavior for `04545_show_create_table_hints` and
`04546_show_create_dictionary_hint_rbac` is unchanged.
Comment thread src/Interpreters/DatabaseCatalog.cpp Resolved
…t path fail-closed

Two follow-ups from the AI review of the SHOW CREATE hint change.

Major 1: `TableNameHints::getHintForTable` and `getExtendedHintForTable` filtered
visibility only after `IHints<>` had already truncated the candidates to a single
raw name. With a `SHOW_DICTIONARIES`-only grant, a closer hidden table could
therefore mask a farther but visible dictionary, so `SHOW CREATE DICTIONARY` fell
back to the bare error even though an allowed dictionary existed. Both methods now
ask `NamePrompter` for several ranked candidates (`max_hint_candidates`) and return
the closest one that is actually visible, so the closer hidden table is skipped and
the dictionary is suggested. The user-facing message still shows a single hint.

Major 2: `isHintNameVisible` loads the matched object via `tryGetTable` to confirm
it really is a dictionary, but `TableNameHints` is shared by generic unknown-table
paths (`IDatabase::getTable`, `DatabaseCatalog::tryGetTable`, `IdentifierResolver`),
not only by the guarded `SHOW CREATE` wrapper. On ordinary/atomic databases
`tryGetTable` waits for the matched table to start up and rethrows load errors, so a
plain missing-table lookup could surface an unrelated startup/load exception while
merely formatting a hint. `isHintNameVisible` now catches any such error and treats
it as "not visible", keeping hint computation fail-closed.

Extends `04546_show_create_dictionary_hint_rbac` with the masking case: a
dictionary-only user is suggested a visible dictionary even when a closer hidden
table exists, without leaking the table's name.
The `catch_all` style check flagged the `catch (...)` added in the previous
commit (fail-closed handling in `TableNameHints::isHintNameVisible`) as
silently swallowing exceptions. The swallow is intentional: it runs only while
formatting a hint for a missing table, and a load error there must not replace
the original `UNKNOWN_TABLE` error. Add the sanctioned `Ok` comment inside the
catch block to document this and satisfy the check.
alexey-milovidov and others added 4 commits July 17, 2026 15:44
…DICTIONARY probe

`SHOW CREATE DICTIONARY` is authorized with the `SHOW DICTIONARIES` grant,
which does not imply `SHOW TABLES` / `SHOW COLUMNS`. Previously, when a user
holding only `SHOW DICTIONARIES` named an object that turned out to be a
regular table rather than a dictionary, `InterpreterShowCreateQuery` fetched
its create query and threw `BAD_ARGUMENTS` `... is not a DICTIONARY` with the
table name. That let such a user tell a hidden table apart from a name that
does not exist - i.e. use `SHOW CREATE DICTIONARY` as an existence oracle for
tables they are not allowed to see. The earlier hint work only closed the
typo-based leak; this closes the exact-name probe too.

`InterpreterShowCreateQuery` now, before fetching the create query, checks -
only for a user who can neither `SHOW TABLES` nor `SHOW COLUMNS` on the object -
whether the name really is a dictionary. If it is not (a hidden table or a
missing name), both are reported identically as a missing dictionary
(`UNKNOWN_TABLE`, `There is no dictionary ...`), carrying the same
`Maybe you meant ...?` hint, which only ever suggests dictionaries to such a
user. Users who can also observe the object as a table keep the precise
`is not a DICTIONARY` diagnostic. This mirrors `InterpreterExistsQuery`, where
`EXISTS DICTIONARY` on a regular table reports non-existence for such a user.

Extends `04546_show_create_dictionary_hint_rbac` with the exact-name
regression: the dictionary-only user's error for a real table is
indistinguishable from a missing name and never says `is not a DICTIONARY`,
while a full-access user still gets that precise diagnostic.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The exact-name gate in `InterpreterShowCreateQuery` decided whether to
synthesize `There is no dictionary ...` via `DatabaseCatalog::isDictionaryExist`,
which calls `tryGetTable` - on Ordinary/Atomic databases that waits for the
probed table to start up and rethrows load failures. A user with only
`SHOW DICTIONARIES` probing a hidden table that is still starting up or fails
to load would get the load error instead of the synthetic missing-dictionary
error, making the hidden table distinguishable from a missing name again.
Probe under a local try/catch and treat any failure as "not a dictionary",
same fail-closed treatment as `TableNameHints::isHintNameVisible`.
alexey-milovidov and others added 2 commits July 18, 2026 01:50
The previous fix probed `DatabaseCatalog::isDictionaryExist` before fetching
the create query, so a dictionary-only user could reach `... is not a
DICTIONARY` for a hidden regular table if the object was dropped and recreated
as a table between the probe and `getCreateTableQuery` - reopening the
existence oracle via TOCTOU.

`InterpreterShowCreateQuery` now fetches and validates the *same* create query
in a single lookup for a user who can neither `SHOW TABLES` nor `SHOW COLUMNS`
the object: there is no separate existence probe and thus no window in which
the object could change kind. If the fetched object is not a dictionary - a
hidden table, a name that vanished, or one that fails to load - it is reported
identically to a missing dictionary, with the same "Maybe you meant ...?" hint.
Users who can also observe the object as a table keep the precise `... is not a
DICTIONARY` diagnostic, which a dictionary-only user can now never reach. This
mirrors `InterpreterExistsQuery`, which likewise answers a dictionary-only user
from a single observation instead of a second visibility-changing lookup.

The `04546_show_create_dictionary_hint_rbac` test gains the TOCTOU settled
end-state: a dictionary replaced by a regular table under the same name is
still reported to a dictionary-only user as a missing dictionary, never as
`... is not a DICTIONARY`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Comment thread src/Interpreters/DatabaseCatalog.cpp Resolved
… hidden-table match

The AI review flagged that `TableNameHints::getHintForTable` jumped straight to
`getExtendedHintForTable` (cross-database search) as soon as the closest raw
candidate was an exact match for the probed name. On the remasked
`SHOW CREATE DICTIONARY` path a `SHOW DICTIONARIES`-only user probing a hidden
regular table `db.foo` exactly, while the same database also holds a visible
dictionary `db.foos` (one edit away), then got the bare
`There is no dictionary db.foo` error instead of the available same-database
`Maybe you meant db.foos?` hint - so the exact-name path did not preserve the
same hint behavior as an ordinary missing dictionary.

Skip only the exact candidate itself and keep scanning the remaining local
candidates for the closest *visible* one before falling back to cross-database
search. The empty-results case still falls through to the extended search. The
exact-match skip previously also covered a transiently unretrievable name (a
table not yet loaded at startup, or a stale-UUID lookup); that behavior is kept,
it just no longer abandons the rest of the local candidates.

Extends `04546_show_create_dictionary_hint_rbac` with a regression for an exact
hidden-table probe (`mask_target`) against a similarly named visible dictionary
(`mask_targets`) in the same database: the dictionary-only user is now pointed at
`mask_targets`, the hidden table's own name never leaks, and the probe stays
reported as a missing dictionary rather than `... is not a DICTIONARY`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
alexey-milovidov and others added 2 commits July 18, 2026 09:16
…ntract

The AI review noted that the new "Maybe you meant ...?" hint is unreachable
under object-level `SHOW` grants: `InterpreterShowCreateQuery` checks access on
the requested identifier before any lookup, so `GRANT SHOW DICTIONARIES ON
db.dict_target` + `SHOW CREATE DICTIONARY db.dict_targe` (and the analogous
`SHOW COLUMNS` case for `SHOW CREATE TABLE`/`VIEW`) is denied with
`ACCESS_DENIED` and never reaches the hint path.

This is deliberate rather than a defect. Unlike `SELECT`, whose analyzer
resolves the name before its access check - and so surfaces a hint and, for an
existing but hidden object, tells it apart from a missing name even under an
object-level grant - `SHOW CREATE` must not become an existence oracle. Checking
access on the requested name first means an existing but hidden object and a
missing name are both reported as `ACCESS_DENIED`, indistinguishable to a user
not granted on that name. Verified locally: `SHOW CREATE TABLE db.secret`
(hidden, exists) and `SHOW CREATE TABLE db.secre` (missing) both return
`ACCESS_DENIED`, whereas `SELECT` returns `ACCESS_DENIED` vs `UNKNOWN_TABLE`.

Per the review's "narrow the contract explicitly and cover that restriction in
tests" option, this documents the contract at the access check in
`InterpreterShowCreateQuery.cpp` and adds
`04611_show_create_hint_object_level_grant`, covering the DICTIONARY
(`SHOW DICTIONARIES`) and TABLE/VIEW (`SHOW COLUMNS`) surfaces, the
oracle-safety property, and a broad-grant contrast that keeps the hint.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
alexey-milovidov and others added 4 commits July 18, 2026 14:36
…RY instead of masking them

For a user authorized with only `SHOW DICTIONARIES`, the exact-name path in
`InterpreterShowCreateQuery` fetched the create query under a `catch (...)` that
treated *every* failure as "not a dictionary" and remasked it to
`There is no dictionary ...`. That was too broad: `DatabaseOnDisk::getCreateTableQueryImpl`
calls `tryGetTable` first, and `DatabaseWithOwnTablesBase::tryGetTable` waits on the
startup task and rethrows load failures. So an exact `SHOW CREATE DICTIONARY db.dict`
against a real dictionary that fails to load or start up would falsely report that the
dictionary does not exist - regressing diagnostics for an authorized user and diverging
from `EXISTS DICTIONARY`, which surfaces the load failure.

Narrow the remask to *missing* names only: keep reporting a missing dictionary (with the
"Maybe you meant ...?" hint) when the fetch fails with `UNKNOWN_TABLE`,
`CANNOT_GET_CREATE_TABLE_QUERY`, or `CANNOT_GET_CREATE_DICTIONARY_QUERY` - the same set the
`IDatabase::getCreateTableQuery` wrapper uses to detect an absent object - so a hidden
regular table and a name that does not exist stay indistinguishable to this user (the
existence-oracle protection is preserved). Any other failure - most notably a genuine
load/startup failure of an object that really exists - is preserved and surfaced, matching
`EXISTS DICTIONARY`. This also replaces the broad `catch (...)` with a typed
`catch (const Exception &)` that rethrows the non-missing case.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…lure

The exact-name protection for `SHOW CREATE DICTIONARY` keyed the remask on
`getCreateTableQuery`'s error code, remasking only the three "missing name"
codes and re-throwing anything else. But `getCreateTableQuery` calls
`tryGetTable` first, which rethrows a hidden regular table's own load/startup
failure (or a parse failure on corrupted metadata). So a user holding only
`SHOW DICTIONARIES`, probing a hidden regular table that was still starting up,
had corrupted metadata, or otherwise threw a non-"missing" error, got that
distinguishing exception instead of the synthetic `There is no dictionary ...`
- reopening the existence oracle this path is meant to close.

Make the dictionary-only path fully fail-closed: the object is shown only when
the single `getCreateTableQuery` fetch positively proves it to be a dictionary.
Any other outcome - a hidden regular table, a name that does not exist, or *any*
failure of the fetch - is reported identically as a missing dictionary with the
same "Maybe you meant ...?" hint. The decision no longer depends on the error
code, so a hidden table's load/startup/metadata failure can no longer leak its
existence. The swallowed error is not lost: it resurfaces when a user who is
allowed to see the object really accesses it.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.10% 86.10% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 78.20% 78.20% +0.00%

Changed lines: Changed C/C++ lines covered: 89/95 (93.68%) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It was funny to read, but okay.

@alexey-milovidov alexey-milovidov self-assigned this Jul 19, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 19, 2026
Merged via the queue into master with commit 0bf386e Jul 19, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the show-create-table-hints branch July 19, 2026 01:33
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 19, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…ning out of stderr

The test creates a database with the deprecated `Ordinary` engine, and the server
emits the "Server has databases (for example ...) with Ordinary engine, which was
deprecated" warning once per server lifetime, synchronously within the first such
`CREATE DATABASE` query. Shell tests run `clickhouse-client` with
`--send_logs_level=warning`, so whenever this test happened to be the first one to
create an `Ordinary` database (always the case in the flaky check, sometimes in
parallel runs), the warning was forwarded to the client and failed the test with
"having stderror".

Pass `--send_logs_level=fatal` for that single statement, like other tests creating
`Ordinary` databases do (e.g. `04340_timeseries_rename_digest_mismatch`).

Failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110633&sha=4b1e0730977f25a9a7dab1e9a293fc65f2855c24&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20flaky%20check%29
PR: ClickHouse#110633

Co-Authored-By: Claude Fable 5 <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
`SHOW CREATE DICTIONARY` is authorized with the `SHOW_DICTIONARIES` grant, which
does not imply `SHOW_TABLES`, but `TableNameHints` filtered hint candidates with
`SHOW_TABLES` only - so a user with dictionary-only visibility still got the bare
error without the "Maybe you meant ...?" hint.

Keep a candidate name visible when the user has `SHOW_DICTIONARIES` on it and the
object really is a dictionary: the grant by itself does not tell tables and
dictionaries apart, so the extra check is needed to avoid leaking the names of
tables to a user with only a dictionary-level grant.

Add an RBAC regression test covering both sides: the dictionary-only user gets the
hint for a similarly-named dictionary, and gets no hint (no name leak) for a typo
close to a table's name.

PR: ClickHouse#110633

Co-Authored-By: Claude Fable 5 <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…e-hints

Add "Maybe you meant ...?" hint to SHOW CREATE for a missing table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements 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.

3 participants