fix: bailing out on no PRIMARY/UNIQUE KEY

This commit is contained in:
Shlomi Noach 2016-12-11 02:19:19 +01:00
parent 28557a60b0
commit 1d84cb933c
4 changed files with 12 additions and 1 deletions

View File

@ -95,7 +95,7 @@ func (this *Inspector) InspectTableColumnsAndUniqueKeys(tableName string) (colum
func (this *Inspector) InspectOriginalTable() (err error) {
this.migrationContext.OriginalTableColumns, this.migrationContext.OriginalTableUniqueKeys, err = this.InspectTableColumnsAndUniqueKeys(this.migrationContext.OriginalTableName)
if err == nil {
if err != nil {
return err
}
return nil

View File

@ -0,0 +1,9 @@
drop table if exists gh_ost_test;
create table gh_ost_test (
i int not null,
ts timestamp default current_timestamp,
dt datetime,
key i_idx(i)
) auto_increment=1;
drop event if exists gh_ost_test;

View File

@ -0,0 +1 @@
No PRIMARY nor UNIQUE key found in table

View File

@ -0,0 +1 @@
--alter="add column v varchar(32)"