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
[Compatibility] Common MySQL zero DATETIME literals block application schema loading #29207
A supported MySQL application schema/data initialization can fail on MatrixOne when it inserts the conventional zero datetime literal 0000-00-00 00:00:00 into a nullable DATETIME column. This blocks the application before scenario workflows can execute.
MatrixOne source checkout used by the local cluster: ba8954d543af0bdfb1948a8b89f77f5235ac9259
Reproduced during local 16-application scenario-runner validation on 2026-09-21.
Application evidence
The yshop application pod failed during schema/data initialization with:
ERROR 1366 (HY000): truncated type datetime value 0000-00-00 00:00:00 for column value, 1
The adapter was healthy, but the application remained unready and its workflow preflight could not run.
Minimal reproduction
DROPDATABASE IF EXISTS mo_zero_datetime_repro;
CREATEDATABASEmo_zero_datetime_repro;
USE mo_zero_datetime_repro;
CREATETABLEt_zero (value DATETIME);
INSERT INTO t_zero VALUES ('0000-00-00 00:00:00');
Actual result:
ERROR 1366 (HY000): truncated type datetime value 0000-00-00 00:00:00 for column value, 1
Expected behavior
For MySQL-compatible mode, MatrixOne should either accept and preserve the zero datetime according to the active SQL mode, or reject it with a documented, explicit compatibility contract. A legacy MySQL application should not fail with a generic truncation error during initialization when its schema and insert are otherwise valid for MySQL compatibility mode.
Follow-up from validation: the local session default includes NO_ZERO_DATE and STRICT_TRANS_TABLES, so the rejection is expected under that strict mode. The same MatrixOne build accepts the value after SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION'. The compatibility question is therefore mode/configuration dependent: yshop does not establish a permissive session mode before loading its legacy data. This issue is retained as a compatibility follow-up for a clearer/documented contract (or application-side mode handling), not as proof that strict-mode rejection is independently incorrect.
Activity
daviszhen commentedon Sep 21, 2026
Follow-up from validation: the local session default includes
NO_ZERO_DATEandSTRICT_TRANS_TABLES, so the rejection is expected under that strict mode. The same MatrixOne build accepts the value afterSET SESSION sql_mode='NO_ENGINE_SUBSTITUTION'. The compatibility question is therefore mode/configuration dependent: yshop does not establish a permissive session mode before loading its legacy data. This issue is retained as a compatibility follow-up for a clearer/documented contract (or application-side mode handling), not as proof that strict-mode rejection is independently incorrect.daviszhen commentedon Sep 22, 2026
补充 YShop 应用证据(关联汇总 #29220):
YShop 上游
yshop-mall-boot/sql/yshop-mall-boot.sql包含0000-00-00 00:00:00的 DATETIME 初始化值,其中至少有 NOT NULL 种子列。MatrixOne 初始化时返回 DATETIME 截断错误,应用保持未就绪。当前适配器将该值替换为
1970-01-01 00:00:00后可以启动,但会改变原始数据语义。因此适配后的 workflow 通过不能代表原始 MySQL 初始化脚本兼容;应按当前 SQL mode 支持零日期,或给出明确的兼容契约。daviszhen commentedon Sep 23, 2026
补充线上应用场景验证证据(2026-09-23):
yshop应用初始化时写入 MySQL 兼容的0000-00-00 00:00:00,应用 readiness 未通过;该现象与本 issue 的 zero-DATETIME schema/data loading 复现一致。另有yshop场景的近期运行记录尚未完成,因此本次未重复触发运行。docs/test: cover temporal compatibility exceptions (#29683)
Ariznawlll commentedon Oct 14, 2026
补充零部件日期的 DATE/DATETIME 持久化路径,供本 issue 一并评估。MatrixOne 服务源码 commit
2ce4e58af6f03b943ee288ffad81012766cf830a,MySQL 8.0.45;两端均显式执行SET SESSION sql_mode='',每轮使用新库重复 3 次:MySQL 三轮均存储并读回前两行的零月日期(例如
2024-00-00/2024-00-00 12:34:56),并从中提取2024 / 0 / 0;有效日期控制也正常。MO 三轮均在写入零月值时返回ERROR 20203: invalid argument parsedate, bad value 2024-00-00,语句中断。这里测的是非零年份的零月/零日日期;它与原 reproducer 的全零日期值不同,但同样受
NO_ZERO_IN_DATE/ 当前 sessionsql_mode是否允许零部件影响。Ariznawlll commentedon Oct 14, 2026
补充单列复核,避免 DATE 与 DATETIME 的结果被合并描述(MySQL 8.0.45 与 MatrixOne 服务源码 commit
2ce4e58af6f03b943ee288ffad81012766cf830a,sql_mode='',每个类型各重复 3 次):DATE:MySQL 接受并读回2024-00-00;MO 每轮写入都返回ERROR 20203: invalid argument parsedate, bad value 2024-00-00。DATETIME:MySQL 接受并读回2024-00-00 12:34:56;MO 每轮写入都返回ERROR 20301: invalid input: invalid datetime value 2024-00-00 12:34:56。2024-02-29/2024-02-29 12:34:56在两个引擎都可写入并原样读回。因此原 comment 中的失败分别在 DATE 与 DATETIME 列上独立重现,不是复合列中某一列导致的误判。
Ariznawlll commentedon Oct 14, 2026
继续补充 DDL DEFAULT 路径,DATE 与 DATETIME 分别使用新 schema 重复 3 次,session 均设为
sql_mode='':MySQL 8.0.45 两种定义均成功,
SHOW CREATE TABLE保留对应默认值;MO 分别在CREATE TABLE阶段拒绝,DATE 报ERROR 20203: invalid argument parsedate,DATETIME 报ERROR 20301: invalid datetime value。有效日期默认值建表、插入默认值和读回在两端一致。这与前两条 comment 中的 DML 拒绝相同,说明 permissive mode 下的非零年份零月日期在表默认值定义阶段也不能进入 MO 表结构。