summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-11-11 22:46:14 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-11-11 22:46:14 +0400
commit383de0fd1f7b855276f5bec37f38de6dbf70e938 (patch)
tree965755bc94a1806fc0a4acfc0b789fb9680d44ec /sql/sql_table.cc
parent06a91b18d76599cbad2b2bd08464ae47bd8a7e01 (diff)
parentf76beb080c4938fcf8f037a9fc8e370427f8eba0 (diff)
downloadmariadb-git-383de0fd1f7b855276f5bec37f38de6dbf70e938.tar.gz
Merge 10.0-monty -> 10.0
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index ce4839fc580..a6bfcc2bbd0 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -6752,7 +6752,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
List<Key_part_spec> key_parts;
uint db_create_options= (table->s->db_create_options
& ~(HA_OPTION_PACK_RECORD));
- uint used_fields= create_info->used_fields;
+ uint used_fields;
KEY *key_info=table->key_info;
bool rc= TRUE;
bool modified_primary_key= FALSE;
@@ -6760,6 +6760,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
Field **f_ptr,*field;
DBUG_ENTER("mysql_prepare_alter_table");
+ /*
+ Merge incompatible changes flag in case of upgrade of a table from an
+ old MariaDB or MySQL version. This ensures that we don't try to do an
+ online alter table if field packing or character set changes are required.
+ */
+ create_info->used_fields|= table->s->incompatible_version;
+ used_fields= create_info->used_fields;
+
create_info->varchar= FALSE;
/* Let new create options override the old ones */
if (!(used_fields & HA_CREATE_USED_MIN_ROWS))
@@ -7744,8 +7752,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DEBUG_SYNC(thd, "alter_table_before_open_tables");
uint tables_opened;
+
+ thd->open_options|= HA_OPEN_FOR_ALTER;
bool error= open_tables(thd, &table_list, &tables_opened, 0,
&alter_prelocking_strategy);
+ thd->open_options&= ~HA_OPEN_FOR_ALTER;
DEBUG_SYNC(thd, "alter_opened_table");