summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-06-15 16:00:54 -0400
committerunknown <mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-06-15 16:00:54 -0400
commit1dd45d5c5f90a8350b31809be5014c8284ffc008 (patch)
treefbc9333153633d7302f904e7c59cb89c9ae0935d /sql/sql_table.cc
parented849efcc176b4d7b500ca69cf0ee7b1ec39f8ab (diff)
parent6dd40f3e0ab74846d7793cc32065b4c2aa7741f5 (diff)
downloadmariadb-git-1dd45d5c5f90a8350b31809be5014c8284ffc008.tar.gz
Merge c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/clean-mysql-5.1
into c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug20397 mysql-test/r/partition_error.result: Auto merged mysql-test/t/partition_error.test: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 58a123d6602..d379af3b3eb 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5008,7 +5008,22 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
old_db_type= table->s->db_type;
if (!create_info->db_type)
- create_info->db_type= old_db_type;
+ {
+ if (table->part_info &&
+ create_info->used_fields & HA_CREATE_USED_ENGINE)
+ {
+ /*
+ This case happens when the user specified
+ ENGINE = x where x is a non-existing storage engine
+ We set create_info->db_type to default_engine_type
+ to ensure we don't change underlying engine type
+ due to a erroneously given engine name.
+ */
+ create_info->db_type= table->part_info->default_engine_type;
+ }
+ else
+ create_info->db_type= old_db_type;
+ }
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (prep_alter_part_table(thd, table, alter_info, create_info, old_db_type,