Skip to content

Commit 1d84cb9

Browse files
author
Shlomi Noach
committed
fix: bailing out on no PRIMARY/UNIQUE KEY
1 parent 28557a6 commit 1d84cb9

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

go/logic/inspect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (this *Inspector) InspectTableColumnsAndUniqueKeys(tableName string) (colum
9595

9696
func (this *Inspector) InspectOriginalTable() (err error) {
9797
this.migrationContext.OriginalTableColumns, this.migrationContext.OriginalTableUniqueKeys, err = this.InspectTableColumnsAndUniqueKeys(this.migrationContext.OriginalTableName)
98-
if err == nil {
98+
if err != nil {
9999
return err
100100
}
101101
return nil
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
drop table if exists gh_ost_test;
2+
create table gh_ost_test (
3+
i int not null,
4+
ts timestamp default current_timestamp,
5+
dt datetime,
6+
key i_idx(i)
7+
) auto_increment=1;
8+
9+
drop event if exists gh_ost_test;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
No PRIMARY nor UNIQUE key found in table
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--alter="add column v varchar(32)"

0 commit comments

Comments
 (0)