Commit e98fd1d6 authored by Mattias Jonsson's avatar Mattias Jonsson

Manual merge of bug#51851 from mysql-5.1-bugteam into mysql-5.5-bugteam

parents b7acb88c 4ef9195e
......@@ -8,10 +8,8 @@ DROP TABLE IF EXISTS t1;
--echo #
--echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into
--echo # partitioned MyISAM table
perl;
open( INIT, ">init_file.txt");
print INIT "abcd\n";
close( INIT );
--write_file init_file.txt
abcd
EOF
CREATE TABLE t1
......
......@@ -426,6 +426,18 @@ void TABLE_SHARE::destroy()
info_it->flags= 0;
}
}
if (ha_data_destroy)
{
ha_data_destroy(ha_data);
ha_data_destroy= NULL;
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (ha_part_data_destroy)
{
ha_part_data_destroy(ha_part_data);
ha_part_data_destroy= NULL;
}
#endif /* WITH_PARTITION_STORAGE_ENGINE */
/*
Make a copy since the share is allocated in its own root,
and free_root() updates its argument after freeing the memory.
......@@ -1704,11 +1716,17 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
delete handler_file;
my_hash_free(&share->name_hash);
if (share->ha_data_destroy)
{
share->ha_data_destroy(share->ha_data);
share->ha_data_destroy= NULL;
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (share->ha_part_data_destroy)
{
share->ha_part_data_destroy(share->ha_part_data);
#endif
share->ha_data_destroy= NULL;
}
#endif /* WITH_PARTITION_STORAGE_ENGINE */
open_table_error(share, error, share->open_errno, errarg);
DBUG_RETURN(error);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment