mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into kindahl-laptop.dnsalias.net:/home/bk/b23051-mysql-5.1-rpl BitKeeper/deleted/.del-binlog_row_blackhole.result: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/share/errmsg.txt: Auto merged storage/blackhole/ha_blackhole.h: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged storage/innobase/handler/ha_innodb.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged mysql-test/t/partition_hash.test: Manual merge sql/handler.h: Manual merge sql/set_var.cc: Manual merge sql/sql_class.h: Manual merge sql/sql_insert.cc: Manual merge sql/sql_parse.cc: Manual merge
This commit is contained in:
@@ -3341,8 +3341,15 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
|
||||
table->reginfo.lock_type=TL_WRITE;
|
||||
hooks->prelock(&table, 1); // Call prelock hooks
|
||||
if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
|
||||
MYSQL_LOCK_IGNORE_FLUSH, ¬_used)))
|
||||
MYSQL_LOCK_IGNORE_FLUSH, ¬_used)) ||
|
||||
hooks->postlock(&table, 1))
|
||||
{
|
||||
if (*lock)
|
||||
{
|
||||
mysql_unlock_tables(thd, *lock);
|
||||
*lock= 0;
|
||||
}
|
||||
|
||||
if (!create_info->table_existed)
|
||||
drop_open_table(thd, table, create_table->db, create_table->table_name);
|
||||
DBUG_RETURN(0);
|
||||
@@ -3377,24 +3384,35 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
|
||||
*/
|
||||
class MY_HOOKS : public TABLEOP_HOOKS {
|
||||
public:
|
||||
MY_HOOKS(select_create *x) : ptr(x) { }
|
||||
MY_HOOKS(select_create *x, TABLE_LIST *create_table,
|
||||
TABLE_LIST *select_tables)
|
||||
: ptr(x), all_tables(*create_table)
|
||||
{
|
||||
all_tables.next_global= select_tables;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void do_prelock(TABLE **tables, uint count)
|
||||
virtual int do_postlock(TABLE **tables, uint count)
|
||||
{
|
||||
THD *thd= const_cast<THD*>(ptr->get_thd());
|
||||
if (int error= decide_logging_format(thd, &all_tables))
|
||||
return error;
|
||||
|
||||
TABLE const *const table = *tables;
|
||||
if (ptr->get_thd()->current_stmt_binlog_row_based &&
|
||||
if (thd->current_stmt_binlog_row_based &&
|
||||
!table->s->tmp_table &&
|
||||
!ptr->get_create_info()->table_existed)
|
||||
{
|
||||
ptr->binlog_show_create_table(tables, count);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
select_create *ptr;
|
||||
TABLE_LIST all_tables;
|
||||
};
|
||||
|
||||
MY_HOOKS hooks(this);
|
||||
MY_HOOKS hooks(this, create_table, select_tables);
|
||||
hook_ptr= &hooks;
|
||||
|
||||
unit= u;
|
||||
|
Reference in New Issue
Block a user