Commit ecdf9792 authored by Monty's avatar Monty

Fixed that CREATE TABLE code used the right create_info

- The old code used the original create_info from lex, not the new one
  that includes more information (like OPT_OR_REPLACE).
  The bug was not discovered as the code in lock_table_named() only
  checked for OPT_OR_REPLACE in case of timeout errors.
  As lock_table_names will be fixed as part of BACKUP STAGE's, there
  is no changes in lock_table_names() in this commit.
- Removed also the 'temporary' copy of statement flags to thd for
  lock_table_names()
parent 4f541c5f
......@@ -4186,11 +4186,7 @@ mysql_execute_command(THD *thd)
goto end_with_restore_list;
}
/* Copy temporarily the statement flags to thd for lock_table_names() */
uint save_thd_create_info_options= thd->lex->create_info.options;
thd->lex->create_info.options|= create_info.options;
res= open_and_lock_tables(thd, create_info, lex->query_tables, TRUE, 0);
thd->lex->create_info.options= save_thd_create_info_options;
if (unlikely(res))
{
/* Got error or warning. Set res to 1 if error */
......
......@@ -5543,12 +5543,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
properly isolated from all concurrent operations which matter.
*/
/* Copy temporarily the statement flags to thd for lock_table_names() */
// QQ: is this really needed???
uint save_thd_create_info_options= thd->lex->create_info.options;
thd->lex->create_info.options|= create_info->options;
res= open_tables(thd, &thd->lex->query_tables, &not_used, 0);
thd->lex->create_info.options= save_thd_create_info_options;
res= open_tables(thd, *create_info, &thd->lex->query_tables, &not_used, 0);
if (res)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment