-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix data loss when inserting duplicate values during a migration #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
57b77b3
4248710
d1ccd44
278ec29
c13be70
6b5c547
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1546,6 +1546,43 @@ func (this *Applier) ApplyDMLEventQueries(dmlEvents [](*binlog.BinlogDMLEvent)) | |||||||
| if execErr != nil { | ||||||||
| return rollback(execErr) | ||||||||
| } | ||||||||
|
|
||||||||
| // Check for warnings when PanicOnWarnings is enabled | ||||||||
| if this.migrationContext.PanicOnWarnings { | ||||||||
| //nolint:execinquery | ||||||||
| rows, err := tx.Query("SHOW WARNINGS") | ||||||||
| if err != nil { | ||||||||
|
Comment on lines
+1550
to
+1554
|
||||||||
| return rollback(err) | ||||||||
| } | ||||||||
| defer rows.Close() | ||||||||
| if err = rows.Err(); err != nil { | ||||||||
| return rollback(err) | ||||||||
| } | ||||||||
|
|
||||||||
| var sqlWarnings []string | ||||||||
| for rows.Next() { | ||||||||
| var level, message string | ||||||||
| var code int | ||||||||
| if err := rows.Scan(&level, &code, &message); err != nil { | ||||||||
|
Comment on lines
+1562
to
+1566
|
||||||||
| this.migrationContext.Log.Warningf("Failed to read SHOW WARNINGS row") | ||||||||
| continue | ||||||||
|
Comment on lines
+1567
to
+1568
|
||||||||
| this.migrationContext.Log.Warningf("Failed to read SHOW WARNINGS row") | |
| continue | |
| return rollback(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from existing code; will consider fixing in both places
Uh oh!
There was an error while loading. Please reload this page.