Skip to content

Add MySQL-compatibility columns to INFORMATION_SCHEMA views - #109351

Merged
alexey-milovidov merged 20 commits into
masterfrom
information-schema-mysql-compat-columns
Jul 31, 2026
Merged

alexey-milovidov merged 20 commits into
masterfrom
information-schema-mysql-compat-columns

Conversation

@alexey-milovidov

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

Copy link
Copy Markdown
Member

Related: #48340

Extend the INFORMATION_SCHEMA views with the MySQL-only columns that MySQL-aware clients (JDBC/ODBC drivers, IDEs, BI tools, schema-management tools) rely on.

ClickHouse implements INFORMATION_SCHEMA following the SQL standard, so these MySQL vendor-extension columns were absent. A client that observes the MySQL wire-protocol handshake assumes MySQL semantics and issues MySQL-flavored catalog queries, which then fail at analysis time with UNKNOWN_IDENTIFIER (error 47) — the identifier cannot be resolved at all, so the client cannot even fall through on a NULL. For example:

SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'information_schema';

Added columns (both lowercase and uppercase aliases resolve, consistent with the rest of INFORMATION_SCHEMA):

  • SCHEMATA: default_collation_name (constant utf8mb4_0900_ai_ci, matching what the MySQL handshake advertises) and default_encryption (constant NO).
  • TABLES: engine (populated from system.tables), version, row_format, avg_row_length, max_data_length, data_free, auto_increment, create_time, update_time, check_time, checksum, create_options. Columns with no ClickHouse analog are NULL.
  • COLUMNS: column_key (PRI for primary-key columns), privileges, generation_expression (the expression of MATERIALIZED/ALIAS columns), and srs_id.

An audit of the remaining views found that STATISTICS and KEY_COLUMN_USAGE already expose the full MySQL column set.

Note on COLUMNS.privileges: it returns a constant select,insert,update,references regardless of the current user's grants (MySQL computes it from real grants), chosen for client compatibility and consistent with the pre-existing fabricated TABLES.table_collation. Happy to change it to an empty string if preferred.

Changelog category (leave one):

  • Improvement

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

Added MySQL-compatibility columns to INFORMATION_SCHEMA views: SCHEMATA.DEFAULT_COLLATION_NAME and DEFAULT_ENCRYPTION; TABLES.ENGINE and related MySQL columns; and COLUMNS.COLUMN_KEY, PRIVILEGES, GENERATION_EXPRESSION, SRS_ID. This lets MySQL-aware clients run their catalog introspection queries without hitting UNKNOWN_IDENTIFIER.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

🤖 Generated with Claude Code

Version info

  • Merged into: 26.8.1.529 (included in 26.8 and later)

MySQL-aware clients (JDBC/ODBC drivers, IDEs, BI tools, federated query
engines) issue MySQL-flavored catalog queries against `INFORMATION_SCHEMA`
when they observe the MySQL wire-protocol handshake. ClickHouse implements
`INFORMATION_SCHEMA` following the SQL standard, so MySQL-only columns are
absent and such queries fail at analysis time with `UNKNOWN_IDENTIFIER`.

For example, `SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA`
could not be resolved at all, because the identifier does not exist in the
view - the client cannot even fall through on a `NULL` value.

Add the commonly-required MySQL extension columns:

- `SCHEMATA`: `default_collation_name` (constant `utf8mb4_0900_ai_ci`,
  matching what the MySQL handshake advertises) and `default_encryption`
  (constant `NO`).
- `TABLES`: `engine`, `version`, `row_format`, `avg_row_length`,
  `max_data_length`, `data_free`, `auto_increment`, `create_time`,
  `update_time`, `check_time`, `checksum`, `create_options`. `engine` is
  populated from `system.tables`; the rest have no ClickHouse analog and are
  `NULL`.
- `COLUMNS`: `column_key` (`PRI` for primary-key columns), `privileges`,
  `generation_expression` (the expression of `MATERIALIZED`/`ALIAS` columns),
  and `srs_id`.

Both lowercase and uppercase aliases resolve, consistent with the rest of
`INFORMATION_SCHEMA`. An audit of the remaining views found that `STATISTICS`
and `KEY_COLUMN_USAGE` already expose the full MySQL column set.

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

clickhouse-gh Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0d1517b]

Summary: ✅


AI Review

Summary

This PR adds MySQL-compatibility columns to INFORMATION_SCHEMA, aligns the advertised MySQL collation across the handshake, result-set metadata, SHOW COLLATION, and INFORMATION_SCHEMA.COLLATIONS, and makes SHOW TABLE STATUS LIKE read from INFORMATION_SCHEMA.TABLES. After reconciling the earlier review threads against the current code, the only remaining concern is missing direct regression coverage for the COM_FIELD_LIST metadata fix.

Tests
  • ⚠️ [tests/integration/test_mysql_protocol/test.py:988] The new metadata assertions only cover a normal SELECT. The PR also changes COM_FIELD_LIST to share getColumnDefinition, but _com_field_list still only returns column names, so a regression in ColumnDefinition41.character_set, the MySQL type, or the flags on mysql_list_fields would pass the current suite. Add one focused assertion on that packet path, for example by extending _com_field_list to parse the returned metadata and checking that a string column reports charset 255 while a numeric column reports charset 63.
Final Verdict

The end-state code looks reasonable, but I would add the missing COM_FIELD_LIST metadata regression before merge.

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jul 3, 2026
The Fast test `02206_information_schema_show_database` failed because
adding the MySQL-compatibility columns to the `COLUMNS` and `TABLES`
views changed their `SHOW CREATE` output, but only the
`01161_information_schema.reference` file was regenerated. Regenerate
`02206_information_schema_show_database.reference` as well.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=20a44de7ff2527796d6c552b92feea0dda92a177&name_0=PR&name_1=Fast%20test

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

Copy link
Copy Markdown
Contributor

I took a pass at the two review comments here and pushed the result to a branch on my fork, in case it's useful — feel free to fold it into this PR's branch (or ignore it).

Patch (applies on top of the current PR head aead173f):

curl -sL https://github.com/flaviomalavazi/ClickHouse/commit/4178c94eed52eb8fdf270cde13aba4789ab7f820.patch | git am

What it changes:

  • COLUMNS.privileges → empty string instead of the hard-coded select,insert,update,references. system.columns is visible to users holding only SHOW COLUMNS, so a fabricated grant set would tell a read-only user the schema is writable. Empty matches the pre-existing SHOW FULL COLUMNS path (InterpreterShowColumnsQuery).
  • Keeps SCHEMATA.default_collation_name on the modern utf8mb4_0900_ai_ci and raises the MySQL handshake (MySQLHandler) to advertise the same collation (new CharacterSet::utf8mb4_0900_ai_ci = 255), rather than reverting the schema column to the deprecated utf8_general_ci. This keeps the wire identity and SCHEMATA.DEFAULT_COLLATION_NAME consistent on the modern, 4-byte-capable value.
  • Fixes the autogenerated COLUMNS docs block (it was listing STATISTICS columns such as non_unique/seq_in_index) and documents the four new columns.

Happy to adjust anything.

…e collation

Addresses the two review comments on PR #109351.

- `INFORMATION_SCHEMA.COLUMNS.privileges` now returns an empty string instead of
  the hard-coded `select,insert,update,references`. `system.columns` is visible
  to users holding only `SHOW COLUMNS`, so a fabricated grant set would tell a
  read-only user the schema is writable and only fail later with access-denied.
  Empty matches the pre-existing `SHOW FULL COLUMNS` path (`InterpreterShowColumnsQuery`).

- Keep `SCHEMATA.default_collation_name` on the modern `utf8mb4_0900_ai_ci` and
  raise the MySQL handshake to match it, rather than reverting the schema column
  to the deprecated `utf8_general_ci`. `MySQLHandler` now advertises
  `CharacterSet::utf8mb4_0900_ai_ci` (id 255, added to the `CharacterSet` enum),
  so the advertised wire collation and `SCHEMATA.DEFAULT_COLLATION_NAME` agree on
  the modern, 4-byte-capable collation.

- Correct the autogenerated `COLUMNS` documentation block, which listed
  `STATISTICS` columns (`non_unique`, `seq_in_index`, `cardinality`, ...), and
  document the new `column_key`, `privileges`, `generation_expression`, and
  `srs_id` columns.

- Update reference outputs (`01161`, `02206`, `04489`) for the empty `privileges`.

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

mintlify Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ClickHouse-docs 🟢 Ready View Preview Jul 6, 2026, 4:16 PM

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Updating the branch to fix the 04001_join_reorder_through_expression and 03532_window_function_and_null_source_max_threads tests, which were broken today in master.

Comment thread src/Server/MySQLHandler.cpp Resolved
flaviomalavazi added a commit to flaviomalavazi/ClickHouse that referenced this pull request Jul 6, 2026
…LE STATUS collation

Addresses the two follow-up review comments on PR ClickHouse#109351.

- Preserve ordinal positions of pre-existing `INFORMATION_SCHEMA` columns.
  The MySQL-compatibility columns were inserted in the middle of the `SCHEMATA`,
  `TABLES`, and `COLUMNS` view definitions, which shifted the ordinal positions
  of columns that already existed (`CATALOG_NAME`, `SCHEMA_NAME`, and the same
  pattern in `TABLES`/`COLUMNS`) and would break clients doing `SELECT *` or
  positional fetches against the previously released layout. The new columns are
  now appended after the pre-existing columns, so every prior column keeps its
  position. Column resolution is by name, so case-insensitive access is
  unaffected. References `01161` and `02206` regenerated accordingly; `04489`
  selects explicit columns and is unaffected.

- Align the fabricated `SHOW TABLE STATUS` collation with the rest of the MySQL
  surface. `MySQLHandler` returned `utf8_bin` for `SHOW TABLE STATUS.Collation`
  while `INFORMATION_SCHEMA.TABLES.table_collation` and the handshake advertise
  `utf8mb4_0900_ai_ci`; a client mixing the two introspection paths saw
  contradictory metadata. It now returns `utf8mb4_0900_ai_ci` too.

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

Copy link
Copy Markdown
Contributor

Follow-up addressing the two review comments above (ordinal shift + SHOW TABLE STATUS divergence). Pushed to the same fork branch; applies on top of the previous patch:

curl -sL https://github.com/flaviomalavazi/ClickHouse/commit/07e6cee0ddd0bcd00507b09facbf44b0da92730d.patch | git am

What it changes:

  • Preserve ordinal positions of the pre-existing columns. The MySQL-compatibility columns are now appended after the existing columns in SCHEMATA, TABLES, and COLUMNS, instead of being inserted in the middle — so CATALOG_NAME/SCHEMA_NAME (and the equivalents in TABLES/COLUMNS) keep their previously released positions and SELECT */positional clients aren't broken. Resolution is by name, so case-insensitive access is unaffected. References 01161 and 02206 are regenerated; 04489 selects explicit columns and is unchanged.
  • Align SHOW TABLE STATUS.Collation (MySQLHandler) from utf8_bin to utf8mb4_0900_ai_ci, so it agrees with INFORMATION_SCHEMA.TABLES.table_collation and the handshake. I left Row_format/sizes as-is, since making SHOW TABLE STATUS return NULL there would be its own (arguably client-breaking) change — happy to tackle full unification of the two surfaces separately if you'd prefer.

I validated the reordered views and regenerated references with clickhouse-local (the views parse and DESCRIBE to the intended order; the 02206 regeneration method was checked to reproduce the current reference byte-for-byte first), but I haven't run the stateless suite through a full build — CI will be the real confirmation there.

…LE STATUS collation

Addresses the two follow-up review comments on PR #109351.

- Preserve ordinal positions of pre-existing `INFORMATION_SCHEMA` columns.
  The MySQL-compatibility columns were inserted in the middle of the `SCHEMATA`,
  `TABLES`, and `COLUMNS` view definitions, which shifted the ordinal positions
  of columns that already existed (`CATALOG_NAME`, `SCHEMA_NAME`, and the same
  pattern in `TABLES`/`COLUMNS`) and would break clients doing `SELECT *` or
  positional fetches against the previously released layout. The new columns are
  now appended after the pre-existing columns, so every prior column keeps its
  position. Column resolution is by name, so case-insensitive access is
  unaffected. References `01161` and `02206` regenerated accordingly; `04489`
  selects explicit columns and is unaffected.

- Align the fabricated `SHOW TABLE STATUS` collation with the rest of the MySQL
  surface. `MySQLHandler` returned `utf8_bin` for `SHOW TABLE STATUS.Collation`
  while `INFORMATION_SCHEMA.TABLES.table_collation` and the handshake advertise
  `utf8mb4_0900_ai_ci`; a client mixing the two introspection paths saw
  contradictory metadata. It now returns `utf8mb4_0900_ai_ci` too.

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

Copy link
Copy Markdown
Contributor

I believe PR#109389 fixed the Stress Test issue, @alexey-milovidov

Resolve conflict in src/Server/MySQLHandler.cpp: master hardened
showTableStatusReplacementQuery against SQL injection (parse the LIKE
argument via tryParseSingleStringLiteral and re-quote it with
quoteString, sharing a single SELECT template). This PR only changed the
Collation column of that template from 'utf8_bin' to 'utf8mb4_0900_ai_ci'.

Kept master's injection-safe structure and re-applied the PR's Collation
change to the now-shared template. The PR's handshake charset change
(CharacterSet::utf8mb4_0900_ai_ci) did not conflict and is preserved.

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

Copy link
Copy Markdown
Contributor

We might need to merge PR#109415 to fix the new tests error

@flaviomalavazi

Copy link
Copy Markdown
Contributor

Seems that the error is unrelated to this PR.
BuzzHouse (amd_msan) failure is an unrelated pre-existing fuzzer flake. Logical error: Bad cast from type A to B (STID: 1499-60fe), which has hit 4 unrelated PRs since 2026-05-20 (0 failures caused by this PR).

…tent on the MySQL wire

The AI review requested two changes before approval:

1. `INFORMATION_SCHEMA.COLLATIONS` and `SHOW COLLATION` now expose a
   MySQL-compatibility row for `utf8mb4_0900_ai_ci` (charset `utf8mb4`,
   id 255), so a client that follows the collation advertised in the
   handshake, `SCHEMATA.DEFAULT_COLLATION_NAME`, or
   `TABLES.TABLE_COLLATION` into either discovery path finds it.
   The MySQL-specific attributes are appended after the existing columns
   to preserve ordinal positions, and are NULL for the ICU collations.

2. Result-set metadata and `COM_FIELD_LIST` now stamp textual columns
   with the same charset id as the handshake
   (`CharacterSet::utf8mb4_0900_ai_ci` instead of `utf8_general_ci`
   and `binary`), so drivers that validate
   `ColumnDefinition41.character_set` no longer see the session
   advertised as three different charsets depending on packet type.

Also added the requested MySQL-protocol integration test
(`test_collation_consistency`) asserting that the handshake,
`SHOW COLLATION`, `INFORMATION_SCHEMA`, and result-set column
metadata all agree, and extended the stateless test with the
`COLLATIONS` view coverage. The `01161` and `02206` reference
outputs are unaffected (verified against the rebuilt binary).

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=b0cca3209ae52b188fa092a31eb1e754db40608d&name_0=PR&name_1=BuzzHouse%20%28amd_msan%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.

Details: BuzzHouse (amd_msan) hit Logical error: 'Bad cast from type DB::ColumnVector<unsigned int> to DB::ColumnVector<int>' (STID: 1499-60fe) on INSERT INTO TABLE \t24` (`c0`) SELECT `c0` FROM generateRandom('`c0` Date', 10939399701133501558, 120, 13) LIMIT 234, where t24.c0is anEnum16in aSetengine table. It does not reproduce with a plainDate→Enum16insert (that correctly throwsCANNOT_CONVERT_TYPE), so it likely depends on the fuzzer's session settings. Unrelated to this PR, which only touches INFORMATION_SCHEMA` view definitions and the MySQL compatibility surface.

Meanwhile, commit b04e2f6 addresses the AI review's required actions: utf8mb4_0900_ai_ci is now discoverable through INFORMATION_SCHEMA.COLLATIONS and SHOW COLLATION, the same charset id is stamped in result-set metadata and COM_FIELD_LIST, and a MySQL-protocol integration test (test_collation_consistency) asserts that the handshake, SHOW COLLATION, INFORMATION_SCHEMA, and ColumnDefinition41.character_set all agree.

Comment thread src/Server/MySQLHandler.cpp Resolved
…WHERE

MySQL matches collation and charset names case-insensitively and resolves
column names in the WHERE clause of SHOW statements case-insensitively,
while ClickHouse compares strings bytewise and resolves identifiers
case-sensitively. So `SHOW COLLATION WHERE Charset = 'UTF8MB4'` returned
no rows although the advertised collation surface is case-insensitive.

Rewrite the parsed filter before re-serializing it: canonicalize
identifiers to the column names of the synthetic result set, and for
`=`, `!=`, `LIKE` and `IN` comparisons of a column against string
literals, lowercase both sides (every string value in the synthetic set
has a single known spelling, so this is lossless). Malformed tails still
fall through untranslated, preserving the injection-safety behavior.

Also generalize the `COLLATIONS` docs bullets to describe both
MySQL-compatibility rows (`utf8mb4_0900_ai_ci` and `binary`), and add
upper-case-literal regressions to `test_collation_consistency`.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=556cc7ea2fa8d317465e334b5c1b093052b09e3e&name_0=PR
#109351
Comment thread src/Server/MySQLHandler.cpp Resolved
…s, share SHOW TABLE STATUS mapping with INFORMATION_SCHEMA.TABLES

Two Majors from the AI review:
- `makeShowCollationsFilterCaseInsensitive` lowercased comparisons on any column
  and wrapped the identifier in `lower`, so a quoted numeric filter like
  `SHOW COLLATION WHERE Id = '255'` threw an exception instead of matching after
  numeric/string coercion. Case-folding now applies only to the string-valued
  columns of the synthetic result set (`Collation`, `Charset`, `Default`,
  `Compiled`, `Pad_attribute`).
- `SHOW TABLE STATUS` used its own mapping (constant '10'/'Dynamic', zero sizes,
  `metadata_modification_time`) that contradicted `INFORMATION_SCHEMA.TABLES`
  for the same object. It now selects from `INFORMATION_SCHEMA.TABLES`, so both
  MySQL introspection surfaces share one mapping.

With regression tests for quoted `Id`/`Sortlen` filters and for
`SHOW TABLE STATUS` / `INFORMATION_SCHEMA.TABLES` consistency.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=596e404c42bfaf17ea0d84aaf1e0064715722894&name_0=PR
Comment thread src/Server/MySQLHandler.cpp Resolved
alexey-milovidov and others added 3 commits July 24, 2026 05:19
…tabase

MySQL scopes `SHOW TABLE STATUS` to the session's default database, but the
translation to `INFORMATION_SCHEMA.TABLES` filtered only on `table_name`, so a
lookup also returned same-named tables from other databases. Constrain the
generated query with `table_schema = currentDatabase()`: the replacement is
executed with the session's query context, so `currentDatabase()` resolves to
the session database and follows later `USE` statements. MySQL's
`No database selected` state cannot arise, because a ClickHouse session always
has a current database.

Add a regression test with the same table name present in two databases,
checking per-database results, `USE` switching, and the empty set in a
database without a match.

Co-Authored-By: Claude Fable 5 <[email protected]>
…TATUS to the current database

The test asserted that `SHOW TABLE STATUS LIKE 'one'` issued while connected
to the `default` database returns `system.one` — exactly the cross-database
leak that the review-requested `table_schema = currentDatabase()` guard now
closes. Create a real `one` table in `default` for the duration of the test
instead of relying on the leak.

CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=c42d08c6596f1c9f475b84d2f5d4f01187310859&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29

Co-Authored-By: Claude Fable 5 <[email protected]>
…y for views

`table_type` in `INFORMATION_SCHEMA.TABLES` is derived from `has_own_data`
(`storesDataOnDisk`), so real user tables such as `Memory` classify as
`FOREIGN TABLE`. The previous guard `if(table_type = 'BASE TABLE', t.engine, NULL)`
therefore reported `ENGINE = NULL` for them, and `SHOW TABLE STATUS` inherited
the same `NULL`. Suppress the engine name only for the view-like rows
(`VIEW` / `SYSTEM VIEW`), keeping `t.engine` for every real table engine.

Adds regressions for a `Memory` table over both `INFORMATION_SCHEMA.TABLES`
(04489) and `SHOW TABLE STATUS` (test_mysql_protocol), and regenerates the
01161/02206 references.

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=2e594640c4335ac99d7081f392cf5dc9902bb9f8&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29 (02477_single_value_data_string_regression, a fleet-wide flake — 11 failures across unrelated PRs and master on 2026-07-24 per CI history) and the Fast test (arm_darwin) Server died during 02456_async_inserts_logs: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109351&sha=2e594640c4335ac99d7081f392cf5dc9902bb9f8&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29 — both are unrelated to this PR; provide a fix in a separate PR. If the fix is already in progress, link it here.

The Stress test (arm_debug) Logical error: Inconsistent KeyCondition behavior is already tracked in #111421 with a fix in progress: #109023.

@groeneai

Copy link
Copy Markdown
Collaborator

Both failures are unrelated to this PR, as noted. Findings and status:

1. 02477_single_value_data_string_regression (Stateless amd_asan_ubsan, distributed plan) - fix already in progress, no new PR needed.

SingleValueDataString::read pre-allocates the untrusted 4-byte size prefix (ffffff7f = 0x7fffffff, ~2 GiB) via an upfront buffer reserve before checking that the ~100500 bytes actually supplied are short. Under the tight per-query memory settings on this build variant the reserve trips the OvercommitTracker, so the query returns MEMORY_LIMIT_EXCEEDED (241) instead of the asserted CANNOT_READ_ALL_DATA (33). It is a fleet-wide flake (11 hits across unrelated PRs and master on 2026-07-24), not caused by this PR.

The fix is in progress in your own #110630 and #110632: both replace the upfront allocation in SingleValueData.cpp with an incremental read that fails cleanly with CANNOT_READ_ALL_DATA, and both add a memory-capped variant of this query to 02477. I will not open a duplicate.

2. Fast test (arm_darwin) "Server died" during 02456_async_inserts_logs - chronic macOS native-runner hang, no code fix.

I pulled the arm_darwin clickhouse-server.err.log for 2e594640: there is no <Fatal> and no Received signal anywhere in it. The server ends at Closed all listening sockets. Waiting for 84 outstanding connections., lldb failed to attach to it at 04:31:48, and the harness then sent SIGTERM. 02456 was just the in-flight test, timing out after 315.57s inside _cleanup_database. So this is the graceful-shutdown hang half of the runner family, not a crash.

Tracked in #103235 (closed 2026-07-23). No fixing PR exists for the hang sub-signature; the in-flight work is diagnostic tooling - #107173 and #111213, which fix macOS lldb attach and attach full server stack dumps so the next occurrence can be classified precisely. I have not opened a speculative code PR for it, since it is not reproducible off an Apple Silicon runner.

…in `TABLES`

The docs still said `engine` is `NULL` for every non-`BASE TABLE` row, but
since 40fd81e only `VIEW`/`SYSTEM VIEW` rows are nulled, while real
non-disk table engines such as `Memory` (`table_type = 'FOREIGN TABLE'`)
keep their engine name.

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexey-milovidov
alexey-milovidov requested a review from a team as a code owner July 31, 2026 07:24
# Result-set metadata: textual columns are stamped with the same charset id
# in ColumnDefinition41 packets, not with utf8_general_ci or binary.
cursor.execute("SELECT 'text' AS t, 1 AS n")
fields = {f.name: f.charsetnr for f in cursor._result.fields}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new regression stops at cursor._result.fields from a normal SELECT, but the code change in this PR is also fixing the COM_FIELD_LIST / mysql_list_fields metadata path to share getColumnDefinition. _com_field_list still only returns column names, so a future change that regresses ColumnDefinition41.character_set, the MySQL type, or the flags on COM_FIELD_LIST would pass this suite.

Please add one focused assertion on that packet path as well, for example by extending _com_field_list to return the parsed metadata and checking that a string column reports charset 255 while a numeric column reports charset 63.

@clickhouse-gh

clickhouse-gh Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.50% 86.50% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 78.60% 78.70% +0.10%

Changed lines: Changed C/C++ lines covered: 134/146 (91.78%) · Uncovered code

Full report · Diff report

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 31, 2026
@alexey-milovidov alexey-milovidov self-assigned this Jul 31, 2026
Merged via the queue into master with commit b1e3ccd Jul 31, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the information-schema-mysql-compat-columns branch July 31, 2026 16:30
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 31, 2026
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.

4 participants