Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
Describe what's wrong
SELECT INDEX_LENGTH FROM information_schema.tables fails with UNKNOWN_IDENTIFIER, breaking the pattern where every column has both lowercase and UPPERCASE aliases
Root cause: tables.sql: INDEX_LENGTH was not added to the UPPERCASE column definitions (lines 13-18) nor to the SELECT aliases (lines 39-46), while all other columns have both lowercase and UPPERCASE versions
Why we believe this is a bug: tables.sql lines 13-18: The column definition lists TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, TABLE_ROWS, DATA_LENGTH, TABLE_COLLATION, TABLE_COMMENT — but INDEX_LENGTH is missing. Similarly the SELECT clause has no index_length AS INDEX_LENGTH alias.
Affected locations:
src/Storages/System/information_schema/tables.sql:17 — Missing INDEX_LENGTH in uppercase column definitions
src/Storages/System/information_schema/tables.sql:44 — Missing index_length AS INDEX_LENGTH in SELECT aliases
Impact: MySQL clients that query INFORMATION_SCHEMA.TABLES using uppercase INDEX_LENGTH will get an error. This breaks MySQL compatibility which is the stated goal of the PR.
Does it reproduce on most recent release?
Yes — confirmed on current master (commit 4bb74310a97c).
How to reproduce
SELECT INDEX_LENGTH FROM information_schema.tables WHERE table_schema = 'system' AND table_name = 'one' ORDER BY INDEX_LENGTH;
Try it on ClickHouse Fiddle
Expected behavior
Error message and/or stacktrace
Code: 47. DB::Exception: Unknown expression identifier `INDEX_LENGTH`
Additional context
Suggested fix: Add INDEX_LENGTH Nullable(UInt64) to the UPPERCASE column definitions, and add index_length AS INDEX_LENGTH to the SELECT aliases between DATA_LENGTH and TABLE_COLLATION.
Analysis details: Confidence HIGH | Severity P2 | Testability: STATELESS_SQL
Found during automated review of PR #78119.
ClickGapAI · Confidence: HIGH · Severity: P2 · Finding: h_pr78119_002
Version info
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
Describe what's wrong
SELECT INDEX_LENGTH FROM information_schema.tables fails with UNKNOWN_IDENTIFIER, breaking the pattern where every column has both lowercase and UPPERCASE aliases
Root cause: tables.sql: INDEX_LENGTH was not added to the UPPERCASE column definitions (lines 13-18) nor to the SELECT aliases (lines 39-46), while all other columns have both lowercase and UPPERCASE versions
Why we believe this is a bug: tables.sql lines 13-18: The column definition lists TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, TABLE_ROWS, DATA_LENGTH, TABLE_COLLATION, TABLE_COMMENT — but INDEX_LENGTH is missing. Similarly the SELECT clause has no
index_length AS INDEX_LENGTHalias.Affected locations:
src/Storages/System/information_schema/tables.sql:17— Missing INDEX_LENGTH in uppercase column definitionssrc/Storages/System/information_schema/tables.sql:44— Missing index_length AS INDEX_LENGTH in SELECT aliasesImpact: MySQL clients that query INFORMATION_SCHEMA.TABLES using uppercase INDEX_LENGTH will get an error. This breaks MySQL compatibility which is the stated goal of the PR.
Does it reproduce on most recent release?
Yes — confirmed on current
master(commit4bb74310a97c).How to reproduce
Try it on ClickHouse Fiddle
Expected behavior
Error message and/or stacktrace
Additional context
Suggested fix: Add
INDEX_LENGTHNullable(UInt64) to the UPPERCASE column definitions, and addindex_length AS INDEX_LENGTHto the SELECT aliases between DATA_LENGTH and TABLE_COLLATION.Analysis details: Confidence HIGH | Severity P2 | Testability:
STATELESS_SQLFound during automated review of PR #78119.
ClickGapAI · Confidence: HIGH · Severity: P2 · Finding:
h_pr78119_002Version info
INDEX_LENGTHcolumn alias toinformation_schema.tables#10170526.4.1.707