Skip to content

Commit 74f60a9

Browse files
committed
Impl code review feedback for PanicOnWarnings
- documentation - remove dev.yml - remove unused variable
1 parent 7f614e0 commit 74f60a9

3 files changed

Lines changed: 6 additions & 24 deletions

File tree

dev.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

doc/command-line-flags.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ List of metrics and threshold values; topping the threshold of any will cause th
202202

203203
Typically `gh-ost` is used to migrate tables on a master. If you wish to only perform the migration in full on a replica, connect `gh-ost` to said replica and pass `--migrate-on-replica`. `gh-ost` will briefly connect to the master but otherwise will make no changes on the master. Migration will be fully executed on the replica, while making sure to maintain a small replication lag.
204204

205+
### panic-on-warnings
206+
207+
When this flag is set, `gh-ost` will panic when SQL warnings indicating data loss are encountered when copying data. This flag helps prevent data loss scenarios with migrations touching unique keys, column collation and types, as well as `NOT NULL` constraints, where `MySQL` will silently drop inserted rows that no longer satisfy the updated constraint (also dependent on the configured `sql_mode`).
208+
209+
While `panic-on-warnings` is currently disabled by defaults, it will default to `true` in a future version of `gh-ost`.
210+
205211
### postpone-cut-over-flag-file
206212

207213
Indicate a file name, such that the final [cut-over](cut-over.md) step does not take place as long as the file exists.

go/sql/builder.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,12 @@ func BuildUniqueKeyRangeEndPreparedQueryViaOffset(databaseName, tableName string
275275

276276
uniqueKeyColumnNames := duplicateNames(uniqueKeyColumns.Names())
277277
uniqueKeyColumnAscending := make([]string, len(uniqueKeyColumnNames))
278-
uniqueKeyColumnDescending := make([]string, len(uniqueKeyColumnNames)) // TODO unused variable
279278
for i, column := range uniqueKeyColumns.Columns() {
280279
uniqueKeyColumnNames[i] = EscapeName(uniqueKeyColumnNames[i])
281280
if column.Type == EnumColumnType {
282281
uniqueKeyColumnAscending[i] = fmt.Sprintf("concat(%s) asc", uniqueKeyColumnNames[i])
283-
uniqueKeyColumnDescending[i] = fmt.Sprintf("concat(%s) desc", uniqueKeyColumnNames[i])
284282
} else {
285283
uniqueKeyColumnAscending[i] = fmt.Sprintf("%s asc", uniqueKeyColumnNames[i])
286-
uniqueKeyColumnDescending[i] = fmt.Sprintf("%s desc", uniqueKeyColumnNames[i])
287284
}
288285
}
289286
joinedColumnNames := strings.Join(uniqueKeyColumnNames, ", ")

0 commit comments

Comments
 (0)