Repository navigation
Closed
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- Deployment: local multi-CN (
launch-multi-cn), verified through both CNs - Server:
8.0.30-MatrixOne-v20260826 - JDBC controls: MySQL Connector/J 8.0.33, 8.4.0, and 9.7.0
Actual Behavior
Standard schema introspection returns missing, duplicate, and internal metadata:
information_schema.KEY_COLUMN_USAGEcontains only foreign keys. PRIMARY and UNIQUE key columns are absent.information_schema.TABLE_CONSTRAINTSomits FOREIGN KEY constraints, includes ordinary non-constraint indexes asMULTIPLE, and returns one row per index column/internal index part rather than one row per constraint.information_schema.COLUMNSexposes__mo_index_*internal table columns. It also reports a column covered only by a non-unique index asCOLUMN_KEY='UNI'instead ofMUL.information_schema.STATISTICSand Connector/JgetIndexInfo()return three identical rows for one logical IVF index.
Three fresh-schema runs produced the same compact result:
run kcu_actual tc_actual hidden_columns ivf_rows indexed_column_key
1 1 11 15 3 UNI
2 1 11 15 3 UNI
3 1 11 15 3 UNI
Connector/J 8.0.33, 8.4.0, and 9.7.0 all returned 22 hidden index-column rows for the larger fixture and three vidx rows.
Expected Behavior
KEY_COLUMN_USAGEcontains PRIMARY, UNIQUE, and FOREIGN KEY columns with correct ordinals.TABLE_CONSTRAINTScontains one row per PRIMARY/UNIQUE/FOREIGN KEY/CHECK constraint and excludes ordinary, full-text, and vector indexes.- Internal
__mo_index_*tables are not exposed throughinformation_schema.COLUMNSor JDBC metadata. - Non-unique indexed columns report
COLUMN_KEY='MUL'. - One logical single-column IVF index produces one
STATISTICS/getIndexInfo()row.
Steps to Reproduce
DROP DATABASE IF EXISTS metadata_repro;
CREATE DATABASE metadata_repro;
USE metadata_repro;
CREATE TABLE parent(
id INT PRIMARY KEY,
code VARCHAR(20),
UNIQUE KEY uq_code(code)
);
CREATE TABLE child(
id INT PRIMARY KEY,
pid INT,
a INT,
b INT,
UNIQUE KEY uq_ab(a,b),
KEY idx_b(b),
CONSTRAINT fk_pid FOREIGN KEY(pid) REFERENCES parent(id)
);
CREATE TABLE vec(id INT PRIMARY KEY, embedding VECF32(3));
CREATE INDEX vidx USING IVFFLAT ON vec(embedding)
LISTS=2 OP_TYPE 'vector_l2_ops';
SELECT * FROM information_schema.KEY_COLUMN_USAGE
WHERE TABLE_SCHEMA='metadata_repro';
SELECT TABLE_NAME,CONSTRAINT_NAME,CONSTRAINT_TYPE
FROM information_schema.TABLE_CONSTRAINTS
WHERE TABLE_SCHEMA='metadata_repro';
SELECT TABLE_NAME,COLUMN_NAME,COLUMN_KEY
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA='metadata_repro';
SELECT TABLE_NAME,INDEX_NAME,SEQ_IN_INDEX,COLUMN_NAME,INDEX_TYPE
FROM information_schema.STATISTICS
WHERE TABLE_SCHEMA='metadata_repro';Additional information
The behavior follows directly from the current view definitions in pkg/util/sysview/predefined.go: KEY_COLUMN_USAGE selects only mo_foreign_keys; TABLE_CONSTRAINTS selects raw mo_indexes rows without logical-constraint grouping; COLUMNS does not filter the index-table prefix; and STATISTICS exposes all IVF internal index parts. Existing BVT covers individual FK/index queries but does not assert cross-view completeness, uniqueness, or hidden-object filtering.
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't working
Activity
fix: correct information_schema constraint and index metadata (#27752)
Ariznawlll commentedon Aug 28, 2026
最新 main 复测 3/3:KEY_COLUMN_USAGE、TABLE_CONSTRAINTS、STATISTICS(含向量索引)均无重复/幽灵条目;隐藏列数为 0,普通索引标识正确。现有 information_schema / foreign-key BVT 覆盖此类元数据契约。无需 big-data、PITR/snapshot、stability 或 chaos。结论:关闭。
Ariznawlll commentedon Aug 28, 2026
更正补充:验证基线为 MatrixOne main 28769ff。连续三轮确认 KCU、TC、STATISTICS 均无重复或内部表泄漏。
fix: correct information_schema constraint and index metadata (matrix…
fix: correct information_schema constraint and index metadata (matrix…
fix: correct information_schema constraint and index metadata (matrix…