Skip to content

[Compatibility]: INSERT IGNORE and UPDATE IGNORE reject invalid integer and date values #28680

Closed

Description

@Ariznawlll

Description

INSERT IGNORE and UPDATE IGNORE still return statement errors for invalid integer strings and invalid dates. MySQL downgrades those assignment errors, stores adjusted values, and reports warnings 1366/1264.

The same behavior was included in closed #25364, but it remains present on the latest main. Open #27340 covers numeric range overflow and saturation; this report covers invalid lexical conversions such as 'abc' -> INT and '2024-02-30' -> DATE.

Environment

  • Branch: main
  • Commit: 065a67528608c475d0219e0be6b7d454a58f7b1a
  • Deployment: local distributed launch, 2 CN / 1 TN / 1 LogService
  • MySQL control: 8.3.0

Steps to reproduce

create database if not exists ignore_conv;
use ignore_conv;
create table t(id int primary key, i tinyint, dt date);
set sql_mode='STRICT_TRANS_TABLES';

insert ignore into t(id,i) values(1,'abc');
insert ignore into t(id,dt) values(2,'2024-02-30');

insert into t values(3,7,'2024-01-01');
update ignore t
set i='abc', dt='2024-02-30'
where id=3;

Actual behavior

MatrixOne rejects the integer assignments with:

ERROR 20203 (HY000): invalid argument cast to int, bad value abc

It rejects the date assignment with:

ERROR 20203 (HY000): invalid argument parsedate, bad value 2024-02-30

The failed inserts leave no row. The failed update preserves the original (3,7,'2024-01-01') row.

MySQL executes the same statements, stores 0 for the invalid integer and 0000-00-00 for the invalid date, and reports:

Warning 1366 Incorrect integer value: 'abc' for column 'i' at row 1
Warning 1264 Out of range value for column 'dt' at row 1

The update reports both warnings and applies both adjusted values.

Expected behavior

Under IGNORE, invalid assignment conversions that MySQL downgrades should not abort the statement. MatrixOne should store the corresponding adjusted value and publish the matching warning diagnostics.

Stability and controls

  • Invalid integer INSERT: 3/3 errors in MatrixOne; 3/3 adjusted rows with warning 1366 in MySQL.
  • Invalid date INSERT: 3/3 errors in MatrixOne; 3/3 zero dates with warning 1264 in MySQL.
  • Combined UPDATE IGNORE: 3/3 atomic rejection in MatrixOne; 3/3 adjusted updates with two warnings in MySQL.
  • A valid INSERT IGNORE immediately succeeds and stores the exact integer/date values in MatrixOne.

Evidence

The statement outputs and post-error table state are retained with the local latest-main validation evidence.

Code analysis

The assignment cast paths still propagate lexical integer and date parsing failures before the IGNORE DML path can convert them into adjusted values and diagnostics. The newly merged #28459 warning collector covers rows rejected by duplicate and CHECK arbitration; it does not alter value-conversion semantics.

Regression coverage

Add SQL and binary-protocol prepared coverage for INSERT/UPDATE IGNORE with invalid integer, decimal lexical input, DATE/DATETIME input, multiple invalid columns in one row, warning codes/counts, post-error state, and statement reuse.

Related

Activity

  1. added this to the MO-202609 milestone on Sep 11, 2026
  2. added theissue type on Sep 11, 2026
  3. self-assigned this
    on Sep 11, 2026
  4. Ariznawlll commented on Sep 14, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:07b25969bfea9d4b76d3bf05d5b0497e4f36eba0
    • 部署:本地独立 1 CN / 1 TN / 1 LogService;每轮均重新启动服务后执行。
    • 执行:每项 SQL 回归连续 3 轮,输出逐轮一致。

    原问题验证

    • INSERT IGNORE/UPDATE IGNORE 对非法整数和日期会写入转换值并生成 MySQL warnings。

    Happy Path 覆盖

    • 覆盖合法 INSERT/UPDATE IGNORE;行可正常读取。

    Unhappy Path 覆盖

    • 非法整数与日期均产生 1264/1366 warning,实际写入 0 与 0000-00-00,UPDATE 路径同样正确。

    白盒验证

    • 以 MOTR 锁定 warning code、落盘值及 INSERT/UPDATE 两条路径。

    回归测试

    测试证据

    • 以上结果均在该 main commit 的独立环境获得;每轮无 stderr,三轮结果一致。

    测试结论

    测试通过。

  5. added 3 commits that reference this issue on Sep 17, 2026
    701279f
    546f30f
    204c93d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/compatibilitykind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions