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.check_constraints does not exist — breaks Prisma db pull / db push / migrate dev (v3.0.11 & 4.0-dev) #24730
information_schema.check_constraints does not exist. All other relevant IS views are present and queryable (tables, columns, statistics, key_column_usage, referential_constraints, table_constraints, views) — only check_constraints is missing. Prisma's MySQL schema connector queries it unconditionally in its describe_schema step, so every introspection-based command fails.
Steps to Reproduce
SELECT*FROMinformation_schema.check_constraintsLIMIT1;
-- ERROR 1064 (HY000): SQL parser error: table "check_constraints" does not exist
Prisma impact
prisma db pull, prisma db push, andprisma migrate dev all fail at the same place:
Error: SQL parser error: table "check_constraints" does not exist
0: sql_schema_connector::flavour::mysql::connection::describe_schema
at .../flavour/mysql/connection.rs:34
Only prisma migrate deploy (applies pre-generated SQL, no introspection) works. Authoring new migrations requires the offline workaround prisma migrate diff --from-empty --to-schema-datamodel ./schema.prisma --script.
Expected Behavior
MySQL 8 exposes information_schema.check_constraints (per SQL standard / MySQL 8.0.16+), even if empty. Providing an empty-but-present view would unblock Prisma introspection and other schema tools (Atlas, etc.).
Test context — Found while testing Prisma ORM (v5.22) compatibility against MatrixOne. Reproduced on both:
Prod cloud — 8.0.30-MatrixOne-v3.0.11
4.0 dev line — nightly-0bfda604 (select version() → 8.0.30-MatrixOne-v)
(Results on the older v3.0.5 are intentionally omitted.)
Activity
Ariznawlll commentedon Aug 14, 2026
测试版本
mainde40fe49fd105bd4d77bde8989369cec1fe65c76原问题验证
information_schema.check_constraints已存在且可查询:无 CHECK 的测试 schema 返回 0 行;创建两个命名 CHECK 后,能够准确返回constraint_catalog/schema/name/check_clause,不再出现 table does not exist。完整矩阵及 MOTR 定向回归连续执行 3 轮均通过。Happy Path 覆盖
information_schema.table_constraints交叉核对,名称、类型及 clause 均准确。Unhappy Path 覆盖
value >= 0的 INSERT 返回 3819,未插入部分数据。value < 100的 UPDATE 返回 3819,原行仍为(1,10),(2,99)。白盒验证
exact main 上 planner 与
mo_check_constraintstable-function 的定向 UT 连续 3 轮通过,覆盖协议门控、列裁剪、空约束、解码、LIMIT 和错误恢复;本轮关闭依据为正式 public SQL 元数据接口的黑盒结果,不涉及并发共享状态,因此不单独增加 race gate。回归测试
已加入 MOTR PR #109:
issue_24730_check_constraints_metadata.test。定向--repeat 3为 3/3 通过;完整14_issue_regression中本用例通过。元数据存在性和约束原子性均可用小数据确定性覆盖,不需要大数据量回归。测试证据
d72bc6ad7e2d65dfc408c939a0eeb15fda3d8d5f测试结论
测试通过。