diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-09-28 20:43:56 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-09-28 20:43:56 -0400 |
commit | c916085e271cd049537b1e07b36cd060c44750bd (patch) | |
tree | 337ddfcd033174143cf9bd08e6ba50174459d7ff /sql/sql_table.cc | |
parent | 023366e6eb68edca3858c32e7492788e047d927a (diff) | |
parent | f1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff) | |
download | mariadb-git-c916085e271cd049537b1e07b36cd060c44750bd.tar.gz |
bzr merge -rtag:mariadb-10.0.14 maria/10.0/
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1a4f8fce158..606c33aeed9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4372,9 +4372,6 @@ handler *mysql_create_frm_image(THD *thd, DBUG_RETURN(NULL); } - if (check_engine(thd, db, table_name, create_info)) - DBUG_RETURN(NULL); - set_table_default_charset(thd, create_info, (char*) db); db_options= create_info->table_options; @@ -4780,6 +4777,9 @@ int create_table_impl(THD *thd, THD_STAGE_INFO(thd, stage_creating_table); + if (check_engine(thd, orig_db, orig_table_name, create_info)) + goto err; + if (create_table_mode == C_ASSISTED_DISCOVERY) { /* check that it's used correctly */ @@ -5029,7 +5029,10 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, */ thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); if (thd->locked_tables_list.reopen_tables(thd)) + { thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); + result= 1; + } else { TABLE *table= pos_in_locked_tables->table; @@ -5348,6 +5351,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, if (res) { + /* is_error() may be 0 if table existed and we generated a warning */ res= thd->is_error(); goto err; } @@ -5430,7 +5434,10 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, */ thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); if (thd->locked_tables_list.reopen_tables(thd)) + { thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); + res= 1; // We got an error + } else { /* |