MySQL HeatWave: schema inspection fails on columns marked NOT SECONDARY
Author: DvorinkaCreated Sep 18, 2026Updated Sep 18, 2026
Summary
On MySQL DB Systems with HeatWave enabled, Guided Load (or manual ALTER TABLE ... MODIFY col <type> NOT SECONDARY) persists a NOT SECONDARY marker in INFORMATION_SCHEMA.COLUMNS.EXTRA. (*MySQL).scanColumn reads extra verbatim into Column.Attr, which then:
- Round-trips into generated DDL via
addColumn→.Attr(c.Attr), and - Feeds nullability detection (
c.Nullable = c.Attr == ""incType-adjacent code), so aNOT SECONDARYcolumn is treated as non-nullable.
The result: client.Schema.Create(ctx) fails or produces wrong diffs on any HeatWave-enabled instance. BLOB columns are the common trigger since HeatWave auto-excludes them.
Reproduce
- MySQL 8.x DB System with HeatWave; run
SECONDARY_LOADorALTER TABLE t MODIFY c BLOB NOT SECONDARY. SELECT EXTRA FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t'showsNOT SECONDARY.- Run any ent app using auto-migration → migration fails at startup.
Expected
Schema inspection should strip vendor-specific NOT SECONDARY/SECONDARY markers from EXTRA before populating Column.Attr (they are engine attributes, not column attributes for diffing purposes).
Environment
- ent v0.13.0
- MySQL HeatWave (Oracle Cloud)
- Reported downstream at cloudreve/cloudreve#3452
Source: ent/ent