mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge with 4.0.11
This commit is contained in:
@ -39,11 +39,28 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
uint order_num, ORDER *order,
|
||||
ha_rows *copied,ha_rows *deleted);
|
||||
|
||||
/*****************************************************************************
|
||||
** Remove all possbile tables and give a compact errormessage for all
|
||||
** wrong tables.
|
||||
** This will wait for all users to free the table before dropping it
|
||||
*****************************************************************************/
|
||||
/*
|
||||
delete (drop) tables.
|
||||
|
||||
SYNOPSIS
|
||||
mysql_rm_table()
|
||||
thd Thread handle
|
||||
tables List of tables to delete
|
||||
if_exists If 1, don't give error if one table doesn't exists
|
||||
|
||||
NOTES
|
||||
Will delete all tables that can be deleted and give a compact error
|
||||
messages for tables that could not be deleted.
|
||||
If a table is in use, we will wait for all users to free the table
|
||||
before dropping it
|
||||
|
||||
Wait if global_read_lock (FLUSH TABLES WITH READ LOCK) is set.
|
||||
|
||||
RETURN
|
||||
0 ok. In this case ok packet is sent to user
|
||||
-1 Error (Error message given but not sent to user)
|
||||
|
||||
*/
|
||||
|
||||
int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
|
||||
my_bool drop_temporary)
|
||||
@ -89,6 +106,26 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
delete (drop) tables.
|
||||
|
||||
SYNOPSIS
|
||||
mysql_rm_table_part2_with_lock()
|
||||
thd Thread handle
|
||||
tables List of tables to delete
|
||||
if_exists If 1, don't give error if one table doesn't exists
|
||||
dont_log_query Don't write query to log files
|
||||
|
||||
NOTES
|
||||
Works like documented in mysql_rm_table(), but don't check
|
||||
global_read_lock and don't send_ok packet to server.
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
1 error
|
||||
*/
|
||||
|
||||
int mysql_rm_table_part2_with_lock(THD *thd,
|
||||
TABLE_LIST *tables, bool if_exists,
|
||||
bool drop_temporary, bool dont_log_query)
|
||||
@ -111,6 +148,7 @@ int mysql_rm_table_part2_with_lock(THD *thd,
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Execute the drop of a normal or temporary table
|
||||
|
||||
@ -153,6 +191,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
for (table=tables ; table ; table=table->next)
|
||||
{
|
||||
char *db=table->db ? table->db : thd->db;
|
||||
mysql_ha_closeall(thd, table, 1);
|
||||
if (!close_temporary_table(thd, db, table->real_name))
|
||||
{
|
||||
tmp_table_deleted=1;
|
||||
@ -938,7 +977,7 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
|
||||
field=item->tmp_table_field(&tmp_table);
|
||||
else
|
||||
field=create_tmp_field(thd, &tmp_table, item, item->type(),
|
||||
(Item_result_field***) 0, &tmp_field,0,0);
|
||||
(Item ***) 0, &tmp_field,0,0);
|
||||
if (!field ||
|
||||
!(cr_field=new create_field(field,(item->type() == Item::FIELD_ITEM ?
|
||||
((Item_field *)item)->field :
|
||||
@ -1694,6 +1733,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
}
|
||||
send_ok(thd);
|
||||
}
|
||||
table_list->table=0; // For query cache
|
||||
query_cache_invalidate3(thd, table_list, 0);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user