mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
into a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0 mysql-test/r/temp_table.result: Auto merged mysql-test/r/warnings.result: Auto merged sql/sql_db.cc: Auto merged client/mysqltest.c: Auto merged mysql-test/t/innodb.test: Auto merged sql/filesort.cc: Auto merged sql/sql_select.cc: Auto merged mysql-test/r/create.result: Merged from 4.1 to 5.0 mysql-test/r/innodb.result: Merged from 4.1 to 5.0 mysql-test/t/create.test: Merged from 4.1 to 5.0 sql/item_cmpfunc.cc: Merged from 4.1 to 5.0 sql/sql_table.cc: Merged from 4.1 to 5.0
This commit is contained in:
@ -1562,6 +1562,9 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
||||
{
|
||||
create_info->table_existed= 1; // Mark that table existed
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
||||
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
|
||||
alias);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
|
||||
@ -1575,12 +1578,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
if (!access(path,F_OK))
|
||||
{
|
||||
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
|
||||
{
|
||||
create_info->table_existed= 1; // Mark that table existed
|
||||
error= FALSE;
|
||||
}
|
||||
else
|
||||
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
|
||||
goto warn;
|
||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@ -1603,12 +1602,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
DBUG_PRINT("info", ("Table with same name already existed in handler"));
|
||||
|
||||
if (create_if_not_exists)
|
||||
{
|
||||
create_info->table_existed= 1; // Mark that table existed
|
||||
error= FALSE;
|
||||
}
|
||||
else
|
||||
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
|
||||
goto warn;
|
||||
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@ -1641,6 +1636,14 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
error= FALSE;
|
||||
goto end;
|
||||
|
||||
warn:
|
||||
error= 0;
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
||||
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
|
||||
alias);
|
||||
create_info->table_existed= 1; // Mark that table existed
|
||||
|
||||
end:
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
|
Reference in New Issue
Block a user