From 88454b3320792a02b6d683e213e414d65fc6df8c Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Mon, 24 Jul 2017 16:22:59 +0300 Subject: [PATCH] SQL: comment and check about ALTER in update_auto_increment() --- sql/handler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/handler.cc b/sql/handler.cc index 9f4ab646aaa..7e7f161f14f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3029,7 +3029,8 @@ int handler::update_auto_increment() enum enum_check_fields save_count_cuted_fields; DBUG_ENTER("handler::update_auto_increment"); - if (table->versioned_by_sql()) + // System Versioning: handle ALTER ADD COLUMN AUTO_INCREMENT + if (thd->lex->sql_command == SQLCOM_ALTER_TABLE && table->versioned_by_sql()) { Field *end= table->vers_end_field(); DBUG_ASSERT(end);