Commit 5570ab37 authored by Eugene Kosov's avatar Eugene Kosov Committed by Aleksey Midenkov

SQL: history records became alive on copy [fixes #212]

parent 4b0f1284
......@@ -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
......@@ -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
......
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment