#4521·ent

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:

  1. Round-trips into generated DDL via addColumn.Attr(c.Attr), and
  2. Feeds nullability detection (c.Nullable = c.Attr == "" in cType-adjacent code), so a NOT SECONDARY column 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

  1. MySQL 8.x DB System with HeatWave; run SECONDARY_LOAD or ALTER TABLE t MODIFY c BLOB NOT SECONDARY.
  2. SELECT EXTRA FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t' shows NOT SECONDARY.
  3. 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