1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Review of new pushed code (XA & other)

Portability fixes and cleanups
Fixed setting of 'res' in mysql_execute_command()


sql/handler.cc:
  delete_table() will not return error for not found files if one handler file was found and deleted
sql/handler.h:
  Incremented MAX_HA so that ndb works again
  Don't convert char pointer to (my_xid*) as we don't know if the address is aligned on 8
sql/log.cc:
  Indentation fixes
  Simplified loop to find next log
  Fixed race condition in reset_logs that caused mix_innodb_myisam_binlog to fail
sql/log_event.cc:
  Don't convert char pointer to (my_xid*) as we don't know if the address is aligned on 8
sql/sql_acl.cc:
  Convert db name directly to avoid extra strmov
sql/sql_base.cc:
  Added comment
  Removed not needed code
sql/sql_db.cc:
  Added comment
  Remove not needed code
sql/sql_parse.cc:
  Always call mysql_rm_db() with lower case db name
  Ensure that 'res' is set correctly in mysql_execute_command()
  (One don't have to set res if one calls my_error() and res should be = 0 for correct commands)
sql/sql_repl.cc:
  Indentation fixes
  use packet->ptr() instead of packet->c_ptr()
sql/sql_table.cc:
  Join similar code when table didn't exist in engine
This commit is contained in:
unknown
2005-02-21 14:47:57 +02:00
parent da4604f9e8
commit d50af8aece
10 changed files with 146 additions and 138 deletions

View File

@ -218,7 +218,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
(void) unpack_filename(path,path);
}
if (drop_temporary ||
(access(path,F_OK) && ha_create_table_from_engine(thd,db,alias,TRUE)) ||
(access(path,F_OK) &&
ha_create_table_from_engine(thd,db,alias,TRUE)) ||
(!drop_view && mysql_frm_type(path) != FRMTYPE_TABLE))
{
if (if_exists)
@ -234,34 +235,28 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
db_type table_type= get_table_type(path);
*(end=fn_ext(path))=0; // Remove extension for delete
error=ha_delete_table(table_type, path);
if (error == ENOENT && if_exists)
error = 0;
if ((error == ENOENT || error == HA_ERR_NO_SUCH_TABLE) && if_exists)
{
/* Warn that the table did not exist in engine */
if (error == HA_ERR_NO_SUCH_TABLE)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
table->table_name);
error= 0;
}
if (error == HA_ERR_ROW_IS_REFERENCED)
{
/* the table is referenced by a foreign key constraint */
foreign_key_error=1;
}
if (!error || error == ENOENT)
if (!error || error == ENOENT || error == HA_ERR_NO_SUCH_TABLE)
{
int new_error;
/* Delete the table definition file */
strmov(end,reg_ext);
if (!(error=my_delete(path,MYF(MY_WME))))
if (!(new_error=my_delete(path,MYF(MY_WME))))
some_tables_deleted=1;
}
if (error == HA_ERR_NO_SUCH_TABLE)
{
/* The table did not exist in engine */
if (if_exists)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
table->table_name);
error= 0;
}
/* Delete the table definition file */
strmov(end,reg_ext);
if (!(my_delete(path,MYF(MY_WME))))
some_tables_deleted=1;
error|= new_error;
}
}
if (error)