You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATEDATABASEquoted_prefix_name;
USE quoted_prefix_name;
CREATETABLEt (
id INTPRIMARY KEY,
`a:b`VARCHAR(32),
KEY idx_col (`a:b`(2))
);
SHOW CREATE TABLE t;
INSERT INTO t VALUES (1, 'ab-long');
Expected
A quoted column name is legal. Prefix-index metadata must preserve it losslessly, so SHOW CREATE TABLE and DML should succeed.
Actual
The CREATE TABLE statement succeeds but stores:
{"prefix_lengths":"a:b:2"}
Both SHOW CREATE TABLE and INSERT fail with:
ERROR 20301 (HY000): invalid input: invalid index prefix length "a:b:2"
The colon-delimited prefix_lengths encoding cannot represent legal column names containing ':' (and likewise has an ambiguous comma separator).
Scope / duplicate check
This is distinct from #26822 (stale prefix metadata after a rename), #26818 (direct unique-index extra filters), and #26813 (covering prefix lookup). I searched recent MatrixOne issues for "prefix length", "prefix_lengths", "SHOW CREATE index", and "column name prefix index"; none cover quoted delimiter-bearing column names.
Fixed in c019ffe6053784841d6973095875006658ba7edf.
Implementation:
Keep reading and writing the legacy prefix_lengths format for ordinary identifiers.
Use a lossless prefix_lengths_v2 JSON payload only when a column name contains ':' or ','.
Prefer v2 on read, validate malformed v2 metadata, and use the same writer when a RENAME COLUMN or CHANGE COLUMN operation changes a prefix-indexed name.
Compatibility decision: existing catalog metadata remains unchanged; v2 is opt-in solely for names the legacy encoding could never represent correctly.
Validation:
Added catalog round-trip/error tests and planner tests for both RENAME COLUMN and CHANGE COLUMN.
New distributed DDL coverage exercises CREATE TABLE, CREATE INDEX, ALTER TABLE ADD INDEX, metadata inspection, SHOW CREATE, flush, and FORCE/IGNORE INDEX: 28/28.
Verified on the exact merge commit ac339444b558daf2c3d7fe63f755743449db7696.
Baseline: a legal quoted column containing : or , was serialized through the ambiguous legacy prefix metadata, making SHOW CREATE and DML fail.
Fix verification: the merge emits lossless prefix_lengths_v2 metadata (for example {"a:b":3,"c,d":2}) and successfully covers CREATE TABLE, CREATE INDEX, ALTER ADD INDEX, RENAME to a delimiter-bearing name, FORCE/IGNORE lookup, and post-flush reads. Protocol-v13 gating was covered by focused tests: v12 rejects the new format during rolling upgrade; v13 accepts it.
Conclusion: the reported metadata-encoding defect is fixed. Closing.
Activity
LeftHandCold commentedon Aug 9, 2026
Fixed in c019ffe6053784841d6973095875006658ba7edf.
Implementation:
Compatibility decision: existing catalog metadata remains unchanged; v2 is opt-in solely for names the legacy encoding could never represent correctly.
Validation:
fix(index): encode prefix metadata for quoted columns (matrixorigin#2…
fix(index): encode prefix metadata for quoted columns (matrixorigin#2…
fix: harden regular prefix index correctness (#26829)
LeftHandCold commentedon Aug 11, 2026
Validation result — fixed by #26829.
Verified on the exact merge commit
ac339444b558daf2c3d7fe63f755743449db7696.Baseline: a legal quoted column containing
:or,was serialized through the ambiguous legacy prefix metadata, making SHOW CREATE and DML fail.Fix verification: the merge emits lossless
prefix_lengths_v2metadata (for example{"a:b":3,"c,d":2}) and successfully covers CREATE TABLE, CREATE INDEX, ALTER ADD INDEX, RENAME to a delimiter-bearing name, FORCE/IGNORE lookup, and post-flush reads. Protocol-v13 gating was covered by focused tests: v12 rejects the new format during rolling upgrade; v13 accepts it.Conclusion: the reported metadata-encoding defect is fixed. Closing.
fix: harden regular prefix index correctness (matrixorigin#26829)
fix: harden regular prefix index correctness (matrixorigin#26829)
fix: harden regular prefix index correctness (matrixorigin#26829)