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 (pingcap#10867) (pingcap#10868)

close pingcap#10859
  • Loading branch information
ti-chi-bot authored Apr 2, 2024
1 parent 06ec4a6 commit 85535a2
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 @@ -757,6 +757,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 85535a2

Please sign in to comment.