diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2020-04-02 20:48:38 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2020-04-02 20:48:38 +0300 |
commit | ba34f409ad104471d1f642a86bf192f1d9c3537d (patch) | |
tree | 28571e55871fa024dd2b9249211ae6b7c8438bf0 /sql/sql_table.cc | |
parent | 44c6c7a9236dbbe35e8fda22b36466b6000038d6 (diff) | |
download | mariadb-git-ba34f409ad104471d1f642a86bf192f1d9c3537d.tar.gz |
MDEV-21688 Assertion or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table
Earlier skip of history row. Cleanup of dead code for VTMD.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 690ff1efcca..13c23b323e5 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -10379,7 +10379,6 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool make_versioned= !from->versioned() && to->versioned(); bool make_unversioned= from->versioned() && !to->versioned(); bool keep_versioned= from->versioned() && to->versioned(); - bool drop_history= false; // XXX Field *to_row_start= NULL, *to_row_end= NULL, *from_row_end= NULL; MYSQL_TIME query_start; DBUG_ENTER("copy_data_between_tables"); @@ -10507,10 +10506,6 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, { from_row_end= from->vers_end_field(); } - else if (keep_versioned && drop_history) - { - from_row_end= from->vers_end_field(); - } THD_STAGE_INFO(thd, stage_copy_to_tmp_table); /* Tell handler that we have values for all columns in the to table */ @@ -10542,6 +10537,13 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, error= 1; break; } + + if (make_unversioned) + { + if (!from_row_end->is_max()) + continue; // Drop history rows. + } + if (unlikely(++thd->progress.counter >= time_to_report_progress)) { time_to_report_progress+= MY_HOW_OFTEN_TO_WRITE/10; @@ -10561,20 +10563,12 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, copy_ptr->do_copy(copy_ptr); } - if (drop_history && from_row_end && !from_row_end->is_max()) - continue; - if (make_versioned) { to_row_start->set_notnull(); to_row_start->store_time(&query_start); to_row_end->set_max(); } - else if (make_unversioned) - { - if (!from_row_end->is_max()) - continue; // Drop history rows. - } prev_insert_id= to->file->next_insert_id; if (to->default_field) |