Skip to content

[Bug]: non-strict LOCAL LOAD aborts on integer over-max text instead of clamping #30494

Closed as not planned

Description

@iamlinjunhong

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

HEAD (detached at task workspace)

Commit ID

ff2acc1ace1a4b8a37dde011a9aa529ff2286c30

Other Environment Information

  • Hardware parameters: Apple Silicon, darwin/arm64
  • OS type: macOS 15.5 (24F74)
  • Others: standalone mo-service from the above commit on frontend port 26201; MySQL 8.0.46 control instance on port 23506

Actual Behavior

With sql_mode='' and duplicate/conversion IGNORE, a LOCAL CSV containing the valid decimal integer text 2147483648 aborts the entire statement in MatrixOne:

ERROR 20101 (HY000): internal error: the input value '2147483648' is not int32 type for column 1

No row is available from the target table.

Expected Behavior

The non-strict conversion clamps the value to 2147483647; MySQL 8.0.46 produces:

id  n
1   2147483647

Steps to Reproduce

Create this local file:

id,n
1,2147483648

Then run:

drop database if exists loom_repro;
create database loom_repro;
use loom_repro;
set sql_mode='';
create table t(id int primary key, n int);
load data local infile '/tmp/repro_int_over_max.csv' ignore into table t
  fields terminated by ',' lines terminated by '\n' ignore 1 lines;
select * from t order by id;

Additional information

The LOCAL non-strict path recognizes the text as numeric and invokes loadDataNonStrictNumericPrefix (pkg/sql/colexec/external/external.go:1571). That helper returns the complete numeric prefix /tmp/repro_int_over_max.csv value 2147483648; the subsequent INT32 parse rejects it. The non-strict/IGNORE assignment policy must apply MySQL's range clamping rather than propagating the range error.

Issue #25366 established that non-strict LOCAL LOAD adjusts invalid numeric text such as abc to 0. This case is distinct: the text is a well-formed decimal integer and only its value exceeds the destination range. No matching open issue or PR was found.

Full reproduction, exactly as Loom ran it
printf '%s\n' 'id,n' '1,2147483648' > /tmp/repro_int_over_max.csv
mysql --local-infile=1 -h 127.0.0.1 -P 26201 -u root -p111 --force -e "drop database if exists loom_repro; create database loom_repro; use loom_repro; set sql_mode=''; create table t(id int primary key, n int); load data local infile '/tmp/repro_int_over_max.csv' ignore into table t fields terminated by ',' lines terminated by '\n' ignore 1 lines; select * from t order by id"

Found by Loom bug hunt (module: custom-a9872c7d6e; tests: unit, white-box, end-to-end)

Activity

  1. added
    kind/bug
    on Oct 17, 2026
  2. XuPeng-SH commented on Oct 22, 2026

    @XuPeng-SH
    Contributor

    This report is now tracked together with #30499. The canonical issue retains explicit acceptance cases for the behavior described here. This is an administrative duplicate/consolidation closure only; the underlying defect is not claimed fixed. The original description and discussion remain available on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions