Skip to content

Commit

Permalink
ticdc: fix ddl exchange partition xxxx with validation to deal with…
Browse files Browse the repository at this point in the history
… `with validation` correctly (#10867)

close #10859
  • Loading branch information
hongyunyan authored Apr 1, 2024
1 parent e6a5d72 commit 4024a44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cdc/model/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,10 @@ func (d *DDLEvent) FromJobWithArgs(
d.Query = fmt.Sprintf("ALTER TABLE `%s`.`%s` EXCHANGE PARTITION `%s` WITH TABLE `%s`.`%s`",
tableInfo.TableName.Schema, tableInfo.TableName.Table, partName,
preTableInfo.TableName.Schema, preTableInfo.TableName.Table)

if strings.HasSuffix(upperQuery, "WITHOUT VALIDATION") {
d.Query += " WITHOUT VALIDATION"
}
default:
d.Query = job.Query
}
Expand Down

0 comments on commit 4024a44

Please sign in to comment.