Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

handle-error replace can't handle default value conflict in optimistic mode. #1484

Closed
GMHDBJD opened this issue Mar 8, 2021 · 0 comments · Fixed by #1496
Closed

handle-error replace can't handle default value conflict in optimistic mode. #1484

GMHDBJD opened this issue Mar 8, 2021 · 0 comments · Fixed by #1496
Labels
severity/major type/bug This issue is a bug report

Comments

@GMHDBJD
Copy link
Collaborator

GMHDBJD commented Mar 8, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
run_sql_source1 "alter table ${shardddl1}.${tb1} add new_col1 int default 0;"
run_sql_source2 "alter table ${shardddl1}.${tb1} add new_col1 int default -1;" // conflict detect

replace source2's ddl

handle-error test replace -s mysql-replica-02 "alter table shardddl1.tb1 add new_col1 int default 0;"
  1. What did you expect to see?
    task continue
  2. What did you see instead?
    error occur
there will be conflicts if DDLs [ALTER TABLE `shardddl`.`tb` ADD COLUMN `new_col1` INT DEFAULT 0] are applied to the downstream. old table info: CREATE TABLE `tbl`(`id` INT(11) NOT NULL, `new_col1` INT(11) DEFAULT -1, PRIMARY KEY (`id`)) CHARSET LATIN1 COLLATE LATIN1_BIN, new table info: CREATE TABLE `tbl`(`id` INT(11) NOT NULL, `new_col1` INT(11) DEFAULT 0, PRIMARY KEY (`id`)) CHARSET LATIN1 COLLATE LATIN1_BIN, RawCause: at tuple index 2: at map key \"new_col1\": at tuple index 0: distinct singletons (-1 vs 0)
  1. Root cause
    we save new table info before detect conflict
    when replace ddl, new ddl will be conflict with previous error ddl
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity/major type/bug This issue is a bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants