Skip to content

[Bug]: LOAD DATA without FIELDS rejects tab-separated input instead of defaulting to TAB #33508

Todo

Description

@Ariznawlll

Branch and revision

Official main at 6540533196711f09e6b1279066063cb90043ebd8; runtime git_version() matched the full SHA.

An isolated macOS arm64 MatrixOne service was compared with a separately initialized MySQL 8.0.45 instance. Every round used a fresh database and the same input bytes.

Summary

When LOAD DATA INFILE omits the FIELDS clause, MatrixOne rejects a valid tab-separated file with 20301 instead of using MySQL's default TAB field separator.

This is the default-separator component formerly consolidated into #31232. The INLINE CSV/JSONLINE NULLIF and LINES STARTING BY fixes passed independently and do not cover this file-loader default.

Reproduction

Create this exact 15-byte input (tabs between the two fields):

from pathlib import Path
Path('/test-owned/input.tsv').write_bytes(b'1\talpha\n2\tbeta\n')

Then run:

CREATE TABLE tab_dst(id INT, s VARCHAR(20));
LOAD DATA INFILE '/test-owned/input.tsv' INTO TABLE tab_dst;
SELECT * FROM tab_dst ORDER BY id;

For the MySQL control, transfer the identical bytes with the standard client-side form:

LOAD DATA LOCAL INFILE '/test-owned/input.tsv' INTO TABLE tab_dst;

Neither statement specifies a FIELDS separator.

Actual behavior

MatrixOne, 3/3 rounds:

ERROR 20301: invalid input: the data of row 1 contained is not equal to input columns

The target table remains empty, and SELECT 42 succeeds afterward on the same connection.

MySQL 8.0.45, 3/3 rounds:

(1, 'alpha')
(2, 'beta')

Expected behavior

With no FIELDS TERMINATED BY clause, LOAD DATA should default to TAB and import the two rows exactly, matching MySQL. An omitted separator must not be replaced with a comma default.

Scope

  • MatrixOne server-side INFILE and MySQL LOCAL INFILE transport differ, but both loaders receive the same original bytes and neither is given an explicit separator.
  • This report does not claim coverage of explicit empty separators, very large sharded input, or every external-table/replanning combination.

Split from the consolidated #31232 tracker so the fixed INLINE option propagation can be closed independently of the remaining default-TAB defect.

Activity

  1. added
    kind/bug
    on Nov 30, 2026
  2. added theissue type on Nov 30, 2026
  3. added this to the MO-202611 milestone on Nov 30, 2026
  4. iamlinjunhong commented on Dec 3, 2026

    @iamlinjunhong
    Contributor

    暂缓开发,先保留本项开放。原始报告见 #31725。

    之前的 QA 在 main 6540533196 上用相同的 TAB 文件验证了三轮:省略 FIELDS 时 MatrixOne 均报 20301,对照 MySQL 8.0.45 均能正确导入。本次核对 main 3a1d7780c7 的源码,导入路径仍默认使用逗号;本次没有重新运行服务。

    恢复开发前,需要先确定升级后的默认行为。直接改为 TAB 会改变已有 CSV 脚本的含义:依赖隐式逗号的导入可能报列数错误,也可能把整行读入第一列。这些脚本需要显式写 FIELDS TERMINATED BY ','。另外,#22570 曾专门对齐默认导出和导入的分隔符,单改导入还会影响默认 OUTFILE 文件的回读。

    建议优先评估保留现有默认值、由用户显式选择 MySQL 兼容行为的方案;若采用该方案,需要同步调整本 issue 对默认 TAB 的验收要求。兼容策略待定,当前暂停实现。

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

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions