Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
v4.0.0-rc3
Commit ID
8.0.30-MatrixOne-v4.0.0-rc3
Other Environment Information
- Hardware parameters: N/A
- OS type: N/A
- Others: Reproduced via cross-language ORM compatibility testing (PHP / Python / Java / Node.js) over the MySQL 8.0.30 wire protocol. The minimal repro below uses raw SQL so it is driver-independent.
Actual Behavior
Two related problems block every schema-introspection / migration tool tested:
- Missing tables:
information_schema.collation_character_set_applicabilityandinformation_schema.check_constraintsdo not exist.-- Doctrine DBAL listTables()/introspectTable(), CakePHP describe(): 1064 SQL parser error: table "collation_character_set_applicability" does not exist 1064 SQL parser error: table "check_constraints" does not exist ONLY_FULL_GROUP_BYrejection on atablesintrospection query that the MySQL planner accepts:-- Hibernate hbm2ddl=update/validate, Flyway, Liquibase: 1149 SQL syntax error: column "tables.TABLE_TYPE" must appear in the GROUP BY clause
Single-table column metadata is also inaccurate: varchar CHARACTER_MAXIMUM_LENGTH and decimal NUMERIC_PRECISION/SCALE come back NULL, DATA_TYPE is upper-cased, TEXT CHARACTER_MAXIMUM_LENGTH = 0, and foreign keys are not exposed via JDBC getImportedKeys / DBAL listTableForeignKeys.
Expected Behavior
These information_schema tables/columns exist and behave as in MySQL 8.0, and the introspection queries above succeed.
Steps to Reproduce
SELECT * FROM information_schema.collation_character_set_applicability LIMIT 1; -- 1064 table does not exist
SELECT * FROM information_schema.check_constraints LIMIT 1; -- 1064 table does not existAdditional information
Impact: Doctrine Migrations, CakePHP ORM reflection, Hibernate auto-DDL, Flyway and Liquibase all fail — i.e. the standard migration path for Symfony, Laravel (CakePHP), and Spring Boot apps. Liquibase is 0/9 in the suite.
Background: dengn/php-tester#3, dengn/php-tester#6 (and CakePHP in dengn/php-tester#1).
Activity
[-][introspection] `information_schema` gaps break schema-migration tooling[/-][+][Bug]: information_schema gaps break schema-migration tooling[/+]gouhongshen commentedon Jul 12, 2026
拿到了。Keycloak 26.6.4 内置的 mysql-connector-j 9.6.0 执行的是下面这条预编译 SQL:
SELECT
TABLE_SCHEMA AS TABLE_CAT,
NULL AS TABLE_SCHEM,
TABLE_NAME,
CASE
WHEN TABLE_TYPE = 'BASE TABLE' THEN
CASE
WHEN TABLE_SCHEMA = 'mysql'
OR TABLE_SCHEMA = 'performance_schema'
OR TABLE_SCHEMA = 'sys'
THEN 'SYSTEM TABLE'
ELSE 'TABLE'
END
WHEN TABLE_TYPE = 'TEMPORARY' THEN 'LOCAL_TEMPORARY'
ELSE TABLE_TYPE
END AS TABLE_TYPE,
TABLE_COMMENT AS REMARKS,
NULL AS TYPE_CAT,
NULL AS TYPE_SCHEM,
NULL AS TYPE_NAME,
NULL AS SELF_REFERENCING_COL_NAME,
NULL AS REF_GENERATION
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = ?
AND TABLE_NAME = ?
HAVING TABLE_TYPE IN (?, ?, ?, ?, ?)
ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME;
这次 Liquibase 初始化大致绑定为:
TABLE_SCHEMA = keycloak_groupby_repro
TABLE_NAME = DATABASECHANGELOG
TABLE_TYPE = TABLE
剩余类型参数为 NULL。
关键点是:原始 SQL 本身没有 GROUP BY,但使用了:
HAVING TABLE_TYPE IN (...)
这里的 TABLE_TYPE 又是 CASE ... END AS TABLE_TYPE 的别名。MatrixOne 在处理 HAVING/别名和
information_schema.tables 时进入聚合校验,最终错误里显示成:
column "tables.TABLE_TYPE" must appear in the GROUP BY clause
所以不兼容点已经比较明确:MySQL Connector/J 的 getTables() 元数据查询使用 HAVING TABLE_TYPE,而 MatrixOne 不
能按 MySQL 语义执行它。
aqqi666 commentedon Aug 9, 2026
补充:4.1.x 复测与 Keycloak 影响
版本复测
在 8.0.30-MatrixOne-v4.1.2 上,MySQL Connector/J
DatabaseMetaData.getTables()形态 SQL 仍失败:错误(与 issue 描述一致):
更简形态同样失败:
4.1.3 / 4.1.4
查阅 v4.1.3、v4.1.4 release notes:均无
HAVING/GROUP BY/INFORMATION_SCHEMA.TABLES/ JDBCgetTables相关修复(4.1.4 仅 lock wait timeout + CTAS quoted alias)。无证据表明 4.1.4 已解决本问题。产品影响(moi-uc / Keycloak)
mysql-connector-j9.x 在 Liquibase 初始化时会调用getTables()探测DATABASECHANGELOG。uc-keycloak-mysql),uc-server 业务库才用 MatrixOneuc。请将本 issue 视为 4.1 线仍 open 的兼容缺口;若已在更新分支修复,请标注目标版本。
aqqi666 commentedon Aug 10, 2026
UC 侧跟踪 issue:matrixorigin/matrixflow#14803 — Keycloak 因 information_schema 兼容性问题无法使用 MatrixOne 作为持久化库,当前 GitOps 通过独立
uc-keycloak-mysql规避。Ariznawlll commentedon Aug 14, 2026
测试版本
maina2f89230085a0f6650ec7bb7017ba6b8a97c9efc原问题验证
使用 MySQL Connector/J 8.0.15 和 8.0.33 分别独立执行 3 次:创建临时表后调用
DatabaseMetaData.getTables(null, null, "t", new String[]{"TABLE"})。两种驱动均 3/3 失败,错误稳定为:
ERROR 1149 (HY000): column "tables.TABLE_TYPE" must appear in the GROUP BY clause or be used in an aggregate functionHappy Path 覆盖
getTables(null, null, "t", null)每次均能返回目标表。getColumns与getPrimaryKeys每次均能返回对应元数据。Unhappy Path 覆盖
无额外非法参数场景;本次失败的
types={"TABLE"}是 JDBC 的正常元数据调用,不作为非法输入。白盒验证
不适用:本次为最新主线 JDBC 兼容性复测,未包含产品修复。
回归测试
未新增仓库用例;建议在 JDBC 集成回归中固定
getTables(..., new String[]{"TABLE"})与无types对照。测试证据
8.0.15: passed=9, failed=3;8.0.33: passed=9, failed=3。每个失败均为带TABLE类型筛选的getTables调用,其余三个元数据对照通过。测试结论
测试不通过。
daviszhen commentedon Aug 17, 2026
matrixone_issue_25103_benchbase.md
47 remaining items
fix: add information_schema collation applicability view (matrixorigi…
fix: expose complete information_schema column metadata (matrixorigin…
fix: add information_schema collation applicability view (matrixorigi…
fix: expose complete information_schema column metadata (matrixorigin…
fix: add information_schema collation applicability view (matrixorigi…
fix: expose complete information_schema column metadata (matrixorigin…
Ariznawlll commentedon Sep 20, 2026
测试版本
main56f7d1eae392b5f3de33e1ea43c916956c50b833验证范围
本次只复验
DatabaseMetaData.getImportedKeys()在两个 schema 存在同名parent、child和fk_parent时的跨 schema 重复问题,并按照升级 Connector/J 的处理策略验收;不把 Connector/J 8.0.33 的已知驱动缺陷归因于 MatrixOne。原问题验证
每轮均新建 target/decoy 两个 schema。两个 schema 的表名和外键名相同,但 decoy FK 使用不同的父键及删除规则,以便识别错误跨 schema JOIN。连接启用
useInformationSchema=true&nullDatabaseMeansCurrent=true,每个版本独立执行 3 轮并在每轮结束后删除两个测试 schema。getImportedKeys(target, null, "child")getImportedKeys(null, null, "child")CONSTRAINT_SCHEMA的 JOIN 返回重复元数据8.4.0 与 9.7.0 的实际 JDBC API 都能正确限定到 target schema;8.0.33 的重复结果与官方 Connector/J 8.4.0 release note 所述
getImportedKeys()错误 JOIN 一致:https://dev.mysql.com/doc/relnotes/connector-j/en/news-8-4-0.html。覆盖范围
边界与异常路径
现有自动化回归
在同一 commit 上执行:
结果为
ok github.com/matrixorigin/matrixone/pkg/tests/issues。该已有 Go 回归覆盖information_schema列元数据及包含CONSTRAINT_SCHEMA的外键 JOIN;本次真实 JDBC 版本矩阵为补充验收,不写入依赖本机 Java jar 的仓库用例。测试结论
Connector/J 升级至 8.4.0+ 后,
getImportedKeys()跨 schema 重复问题不再出现;8.0.33 属于驱动已知问题,不作为 MatrixOne 修复要求。测试通过。
daviszhen commentedon Sep 23, 2026
补充线上应用场景验证证据(2026-09-23):
erupt和favorites-web的 Hibernate 启动 metadata 查询均因TABLE_TYPE must appear in the GROUP BY clause失败,导致应用 readiness 不通过。这两个应用复现了本 issue 中 information_schema / ONLY_FULL_GROUP_BY 兼容性问题。feat(collation): add versioned metadata with legacy-only admission (#…
daviszhen commentedon Oct 16, 2026
v4.2.5 arm64: JDBC-level signature, plus a silent-failure trap
Replayed on
matrixorigin/matrixone:latest(arm64/linux,VERSION()=8.0.30-MatrixOne-v4.2.5), Connector/J 8.0.33, MySQL 8.0.46 as baseline. Two additions to this issue:1. Exact JDBC signature. With a default connection,
DatabaseMetaData.getTables()throws before returning anything:Sweeping 19 commonly used
DatabaseMetaDatamethods on the same release, 18/19 work — the single failure isgetTables.getColumns,getIndexInfo,getPrimaryKeys,getImportedKeys,getExportedKeys,getSchemas,getCatalogs,getTableTypes,getTypeInfo,getProcedures,getBestRowIdentifier,getVersionColumnsetc. all return rows. SincegetTables()is the entry point for ORM dialect init, code generators and schema tooling, this is a startup-level risk even though the rest of the metadata surface is fine.2. A silent-failure trap worth documenting. Removing
ONLY_FULL_GROUP_BYfrom the sessionsql_modemakes the exception disappear — butgetTables()then silently returns 0 tables:getTables()information_schema.columns/statisticsuseInformationSchema=true)SQLSyntaxErrorExceptionsql_modewithoutONLY_FULL_GROUP_BYuseInformationSchema=falseThe middle row is worse than the failure it "fixes": tools see an empty schema and may conclude the database has no tables, while the metadata tables themselves are perfectly populated.
Working workaround: add
useInformationSchema=falseto the JDBC URL, which makes Connector/J take theSHOW-based fallback path. With that parameter all 19/19 metadata methods return correct results. It would help to document this (and to warn explicitly against usingsql_modeto work aroundgetTables()), because the natural first reaction is to changesql_mode.daviszhen commentedon Oct 17, 2026
Follow-up: the
getTables()failure is driver-version dependentRunning the same JDBC call against MatrixOne v4.2.5 (arm64) with three Connector/J versions changed the picture in a way that is relevant to the impact assessment in this issue:
SQLSyntaxErrorException: column "tables.TABLE_TYPE" must appear in the GROUP BY clause...So the failure is confined to the 8.x Connector/J code paths: 5.1.x does not build the
information_schemaquery that trips the strictONLY_FULL_GROUP_BYcheck, and therefore never hits this. Applications pinned to the legacy driver — which is common in older Java stacks — are unaffected; anything on 8.x hits it and needs theuseInformationSchema=falseworkaround (verified: with that parameter all 19 metadata methods return correct results on 8.0.33/8.4.0).Everything else in the matrix was consistent across all three drivers on MatrixOne: full-type
setObjectwrites,getObject/getStringround-trips (except the legacy driver's own datetime formatting, mentioned in #29904), single-row generated keys, and the SSL /allowPublicKeyRetrievalparameters.Ariznawlll commentedon Oct 19, 2026
测试版本
main:873282742714436bff407dfcdbbe879147162bd3(执行前核对远端refs/heads/main与隔离工作树一致)。原问题验证
原报告的
information_schema.collation_character_set_applicability和check_constraints在当前 main 均存在,计数分别为 8 和 0;后者为 0 行是本轮未建立 CHECK 约束的内容结果,并非缺表。原 Connector/JgetTables的CASE ... AS TABLE_TYPE、HAVING TABLE_TYPE IN (...)查询形态直接执行成功,能返回目标元数据,不再报TABLE_TYPE must appear in GROUP BY。通过真实 JDBC API,8.0.33 和 8.4.0 的
DatabaseMetaData.getTables(schema,null,"child",{"TABLE"})各 3/3 返回 1 条目标表;同一轮的getImportedKeys(schema,null,"child")各 3/3 返回 1 条目标外键。测试使用useInformationSchema=true,没有借助SHOWfallback 或移除ONLY_FULL_GROUP_BY来规避原路径。Happy Path 覆盖
collation_character_set_applicability返回 8 行,check_constraints可正常查询。getTables类型筛选和getImportedKeys各版本各 3/3,实际计数都是 1。getTables形态 SQL 对照返回目标行;已有 Go 回归验证字符长度、DECIMAL 精度/scale、时间精度、FLOAT 的 NULL/值,以及带 schema 限定的外键 JOIN。Unhappy Path 覆盖
useInformationSchema=true且传types={"TABLE"};在两个 Connector/J 8.x 版本中均未出现 1149 错误或空表静默返回。同库 parent→child 外键也未丢失;本轮未重复测试跨 schema 同名外键干扰。白盒验证
当前 main 现有
pkg/tests/issues/issue_25103_test.go的TestIssue25103InformationSchemaMetadata覆盖上述列类型/NULL 元数据和外键完整 schema JOIN。本轮未修改产品代码;以该现有 Go 用例和真实 JDBC 协议调用双重核对现行 main 行为。旧 v4.2.5 镜像此前的失败证据不等同于这次 main 的结果。回归测试
在同一 main SHA 上运行现有 Go 回归:
mo-cgo-test -count=3 -run '^TestIssue25103InformationSchemaMetadata$' ./pkg/tests/issues,结果 PASS。按本轮“现有 Go 回归已覆盖即可”的验收口径,没有重复新增 MOTR 用例。完整 Go suite、MOTR suite、集成 CI,以及 Keycloak/Hibernate/Liquibase 整应用启动本次未运行。测试证据
tables=1 importedKeys=1。tables=1 importedKeys=1。information_schema两表 SQL 查询成功;原CASE/HAVING元数据形态返回 1 条目标行。ok github.com/matrixorigin/matrixone/pkg/tests/issues(-count=3)。测试结论
测试通过。