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
{{ message }}
Repository navigation
[Bug]: information_schema.columns exposes __mo_cpkey_col for composite primary keys, leaking through ODBC SQLColumns #26993
MatrixOne: main at 9a7c98b8f3aa07fad24b411d54c7a9f6cb3a8731
Protocol version: 8.0.30-MatrixOne-v
Local standalone build, WSL2 Ubuntu 24.04
Client controls: MySQL 9.7.1 CLI and MatrixOne ODBC 9.7.0-mo.1 x64
Reproduction
DROPDATABASE IF EXISTS mo_odbc_hidden;
CREATEDATABASEmo_odbc_hidden;
CREATETABLEmo_odbc_hidden.t (
a INTNOT NULL,
b INTNOT NULL,
v VARCHAR(10),
PRIMARY KEY (a, b)
);
SELECT ordinal_position, column_name, data_type, column_key, extra
FROMinformation_schema.columnsWHERE table_schema ='mo_odbc_hidden'AND table_name ='t'ORDER BY ordinal_position;
SHOW COLUMNS FROMmo_odbc_hidden.t;
Actual result
information_schema.columns returns an extra fourth column:
1 a int
2 b int
3 v varchar
4 __mo_cpkey_col varchar PRI
SHOW COLUMNS, SELECT *, and the user's DDL expose only a, b, and v.
The same behavior is visible through the public ODBC catalog API because
Connector/ODBC implements SQLColumns from information_schema.columns:
TPC-H SF1 lineitem has 16 user columns;
MatrixOne ODBC SQLColumns returns 17 columns, including __mo_cpkey_col;
TPC-H partsupp is affected for the same composite-primary-key reason.
Expected result
User-facing metadata views and protocol catalog APIs must not expose internal
storage columns. information_schema.columns and ODBC SQLColumns should
return only the columns visible through SHOW COLUMNS and SELECT *.
Impact
This breaks generic schema discovery for BI/ETL tools. Power Query Odbc.DataSource and Power BI Navigator consume ODBC catalog metadata, so an
internal MatrixOne column can appear in navigation/model metadata for every
table with a composite primary key. It also makes catalog metadata disagree
with result-set metadata and the actual selectable table shape.
The issue was found by the MatrixOne ODBC TPC-H SF1 public-data validation:
8 tables, 8,661,255 total rows, including 6,001,215 lineitem rows.
Activity
iamlinjunhong commentedon Aug 12, 2026
补充 Power Query / Power BI 实测:问题不只影响复合主键表。
对没有显式主键的表执行同样的 information_schema.columns / ODBC SQLColumns 枚举时,还会泄露 __mo_fake_pk_col。Microsoft 官方 Power Query SDK 测试框架通过 Odbc.DataSource 做导航和 schema discovery 时能够观察到这个内部列。
已在 ODBC 侧临时过滤 __mo_cpkey_col 和 __mo_fake_pk_col,以避免 Power BI 模型导入内部物理列;但根因仍建议在 MatrixOne 的用户可见元数据层修复,保证 information_schema.columns、SHOW COLUMNS、SELECT * 三者一致。
fix(sysview): hide internal columns from information schema (#27015)
fix(sysview): hide internal columns from information schema (matrixor…
fix(sysview): hide internal columns from information schema (matrixor…
fix(sysview): hide internal columns from information schema (matrixor…
fix(plan): reject explicit writes to hidden storage columns (#31321)