Skip to content

[Subtask]: Support MySQL REPLACE syntax variants #24947

Closed

Description

@ck89119

Parent Issue

Parent issue: #24918

Detail of Subtask

Support MySQL-compatible REPLACE syntax variants that MatrixOne currently rejects:

  • REPLACE INTO dst TABLE src
  • REPLACE LOW_PRIORITY INTO ...
  • REPLACE DELAYED INTO ...

Reference examples from the parent issue:

replace into t_table_dst table t_table_src;
replace low_priority into t_mod values(1,20);
replace delayed into t_mod values(1,30);

MySQL accepts these forms. DELAYED is converted to plain REPLACE with a warning in MySQL 8.0. MatrixOne currently rejects them in the parser.

Describe implementation you've considered

Extend the parser and AST/planner coverage for the accepted MySQL forms. LOW_PRIORITY can be parsed and ignored if MatrixOne has no equivalent scheduling behavior. DELAYED should follow the project's compatibility policy for deprecated MySQL syntax, ideally accepting it with a warning if warning infrastructure is available.

Additional information

Parent context: #24918, comment section 7.

MySQL reference: https://dev.mysql.com/doc/refman/8.4/en/replace.html

Activity

  1. added this to the MO-202606 milestone on Jun 12, 2026
  2. self-assigned this
    on Jun 12, 2026
  3. added
    severity/s0
    on Jun 12, 2026
  4. added
    severity/s1
    and removed
    severity/s0
    on Jun 30, 2026
  5. modified the milestones: MO-202606, MO-202607 on Jun 30, 2026
  6. Ariznawlll commented on Jul 1, 2026

    @Ariznawlll
    Collaborator

    Verified on latest origin/main at 0e8602b78.

    Validation environment:

    MatrixOne: git_version() = 0e8602b78
    MySQL oracle: 8.0.45
    

    Tested the three syntax variants from this issue:

    replace into t_table_dst table t_table_src;
    replace low_priority into t_mod values(1,20);
    replace delayed into t_mod values(1,30);

    Result:

    1. REPLACE INTO dst TABLE src

      • MySQL: accepted and copied/replaced rows from src into dst.
      • MO latest main: accepted, final table result matched MySQL.
    2. REPLACE LOW_PRIORITY INTO ...

      • MySQL: accepted.
      • MO latest main: accepted, final table result matched MySQL.
    3. REPLACE DELAYED INTO ...

      • MySQL: accepted, converts it to plain REPLACE, and reports warning 3005: REPLACE DELAYED is no longer supported. The statement was converted to REPLACE.
      • MO latest main: statement is accepted and data is replaced successfully, but SHOW WARNINGS returns a parser-style error instead of the MySQL deprecated-syntax warning:
    +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Level | Code | Message                                                                                                                                                                                             |
    +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Error | 1064 | SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 9 near " $$"; |
    +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    

    Conclusion: the parser no longer rejects these three forms on latest main, so the main functionality requested by this subtask appears fixed. The remaining behavior to confirm with R&D is whether REPLACE DELAYED should also emit a MySQL-compatible deprecation warning instead of the current parser-style warning entry.

  7. Ariznawlll commented on Aug 5, 2026

    @Ariznawlll
    Collaborator

    motr 黑盒回归补充

    已将该子任务加入 motr PR #75:

    • 用例:issue_24947_replace_syntax_variants.test
    • 覆盖 REPLACE ... TABLE 的覆盖写入、列清单 + ORDER BY/LIMIT,以及 LOW_PRIORITY、DELAYED 和语句后会话可用性。
    • MatrixOne main@607a9263616ea883ac02c052529d2aa4c62ac051 连续 3/3 通过(57/57 statements)。
    • 修复前 6c0d12dfc3c3c8cab7439beaa8efb00b8349a599 复现失败:REPLACE ... TABLE 在 parser 阶段返回 1064。

    该用例能够捕获历史缺陷,已固化预期结果。

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

Metadata

Metadata

Assignees

Labels

kind/subtaskseverity/s1

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions