You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
discovery: warn when a table publishes with an empty DDL #558
discovery.attachDDL joins system.tables.create_table_query onto the schema it
built from system.columns. A table that appears in system.columns but not in system.tables publishes with DDL == "" — no log line, no counter, nothing an
operator could notice.
Why it matters
Today DDL has no reader, so an empty value is inert. It stops being inert as
soon as the chtypes layer wires up: an empty DDL there is indistinguishable
from "this table has no engine information", and the natural coding of that is
to skip the table's type checks rather than fail. That is a fail-open shape,
and it would be introduced by a caller that never sees the gap.
The two queries are separate round trips (see the comment in refresh), so the
window is real even on a healthy server: a table dropped between them lands in
exactly this state.
Ask
In attachDDL, log a warning naming the table when a schema entry gets no create_table_query, so it is visible without a debugger.
When chtypes starts reading DDL, treat empty as an error for that
table — never as "no engine info".
Item (1) is the cheap half and belongs in internal/discovery. Item (2) is a
constraint on the consumer, recorded here so it is not rediscovered late.
Provenance
Raised in the chtypes-side review of the #549–#555 stack. Deliberately not
folded into #550, which was green and under human review at the time.
Activity