Skip to content

Commit

Permalink
SQL: history records became alive on copy [fixes #212]
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgs authored and midenok committed Jul 3, 2017
1 parent 4b0f128 commit 5570ab3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 0 additions & 2 deletions mysql-test/suite/versioning/r/alter.result
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ t CREATE TABLE `t` (
select * from t;
a b
2 NULL
1 NULL
alter table t drop column b, algorithm=copy;
show create table t;
Table Create Table
Expand All @@ -393,7 +392,6 @@ t CREATE TABLE `t` (
select * from t;
a b
2 NULL
1 NULL
alter table t drop column b, algorithm=inplace;
show create table t;
Table Create Table
Expand Down
12 changes: 11 additions & 1 deletion sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10052,7 +10052,17 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
error= 1;
break;
}
error=to->file->ha_write_row(to->record[0]);
if (keep_versioned && to->versioned_by_engine() &&
!thd->variables.vers_ddl_survival)
{
to->s->versioned= false;
}
error= to->file->ha_write_row(to->record[0]);
if (keep_versioned && to->versioned_by_engine() &&
!thd->variables.vers_ddl_survival)
{
to->s->versioned= true;
}
to->auto_increment_field_not_null= FALSE;
if (error)
{
Expand Down

0 comments on commit 5570ab3

Please sign in to comment.