Repository navigation
[CI Proof] convertMySQLDataType wraps Array/Variant-based geo types in Nullable, throwing ILLEGAL_TYPE_OF_ARGUMENT on nullable MySQL spatial columns - #110924
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ❌ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [e9d9379] Summary: ❌
AI ReviewSummaryThis PR rewrites the proof so it no longer hard-codes a specific nullable geometry type and instead checks the real contract: schema inference for nullable MySQL spatial columns must succeed, and reading a stored MySQL Missing context / blind spots
Final Verdict
|
1d47f46 to
4b0d6f0
Compare
A MySQL spatial column is nullable unless declared `NOT NULL`. With the `geometry` mapping on by default, `convertMySQLDataType` maps such a column to an `Array`/`Variant`-based geometric type and wraps it in `Nullable`, which cannot hold those types, so `DESCRIBE` throws `ILLEGAL_TYPE_OF_ARGUMENT`. The proof asserts schema inference succeeds and that a real MySQL `NULL` is preserved, without pinning a specific representation.
4b0d6f0 to
e9d9379
Compare
|
CI failure in |
|
✅ |
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
Suspected bug: convertMySQLDataType wraps Array/Variant-based geo types in Nullable, throwing ILLEGAL_TYPE_OF_ARGUMENT on nullable MySQL spatial columns
Root cause: src/DataTypes/convertMySQLDataType.cpp:171-172 applies
std::make_shared<DataTypeNullable>(res)toresregardless of whetherrescan be inside Nullable. Before this PR the non-Point spatial types producedString(canBeInsideNullable=true), soNullable(String)was valid; the new geo types (Array/Variantbased) cannot be insideNullable.Affected locations:
src/DataTypes/convertMySQLDataType.cpp:172— unconditional Nullable wrap of a geo-typed ressrc/DataTypes/convertMySQLDataType.cpp:143— linestring -> LineString (Array(Point)) branch; same for polygon/multilinestring/multipolygon/geometry at 147/151/155/163src/Databases/MySQL/FetchTablesColumnsList.cpp:119— passes is_nullable=true for nullable MySQL columns when external_table_functions_use_nulls (default true)Why CI is needed: By default (geometry mapping on), any MySQL integration over a table with a nullable spatial column becomes unusable - schema inference throws and the table cannot be created/described/read. This is a regression: those columns previously mapped to
Nullable(String)and worked. Affects themysql()table function,MySQLtable engine, andMySQLdatabase engine.Suggested fix: When the mapped type cannot be inside Nullable (e.g.
!res->canBeInsideNullable()), either skip the Nullable wrap for geo types (geo columns are inherently non-Nullable in ClickHouse) or fall back toNullable(String)for nullable spatial columns.Assumptions
The bot recorded these claims it could not verify directly from source. A maintainer ✅ confirms; ❌ flags a wrong premise (the bot should rework or close the finding).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — temporary CI proof PR, will be closed automatically.
Documentation entry for user-facing changes