1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1

into neptunus.(none):/home/msvensson/mysql/bug10365
This commit is contained in:
msvensson@neptunus.(none)
2005-06-20 13:08:45 +02:00
9 changed files with 129 additions and 86 deletions

View File

@@ -244,15 +244,18 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
/* remove form file and isam files */
build_table_path(path, sizeof(path), db, alias, reg_ext);
}
if (drop_temporary ||
(access(path,F_OK) && ha_create_table_from_engine(thd,db,alias,TRUE)))
if (drop_temporary ||
(access(path,F_OK) &&
ha_create_table_from_engine(thd, db, alias)))
{
// Table was not found on disk and table can't be created from engine
if (if_exists)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
table->real_name);
else
error= 1;
error= 1;
}
else
{
@@ -1394,15 +1397,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
{
bool create_if_not_exists =
create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS;
if (!ha_create_table_from_engine(thd, db, table_name,
create_if_not_exists))
if (ha_table_exists_in_engine(thd, db, table_name))
{
DBUG_PRINT("info", ("Table already existed in handler"));
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= 0;
create_info->table_existed= 1; // Mark that table existed
error= 0;
}
else
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);