summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-10-01 13:39:04 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-10-01 13:39:04 +0200
commita01773dbee1318e0894057daed544188b14f90c8 (patch)
tree7fe8671cad7f06c8a5522b17b3dedf8bd449e3d2 /sql/table.cc
parenta73b734949dde2725ed0bddaceef79c9be581ff8 (diff)
downloadmariadb-git-a01773dbee1318e0894057daed544188b14f90c8.tar.gz
Bug#51851: Server with SBR locks mutex twice on
LOAD DATA into partitioned MyISAM table Problem was that both partitioning and myisam used the same table_share->mutex for different protections (auto inc and repair). Solved by adding a specific mutex for the partitioning auto_increment. Also adding destroying the ha_data structure in free_table_share (which is to be propagated into 5.5). This is a 5.1 ONLY patch, already fixed in 5.5+.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index e989ab039a0..18523f08551 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -425,6 +425,11 @@ void free_table_share(TABLE_SHARE *share)
key_info->flags= 0;
}
}
+ if (share->ha_data_destroy)
+ {
+ share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
/* We must copy mem_root from share because share is allocated through it */
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
free_root(&mem_root, MYF(0)); // Free's share
@@ -1616,6 +1621,11 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
delete crypted;
delete handler_file;
hash_free(&share->name_hash);
+ if (share->ha_data_destroy)
+ {
+ share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
open_table_error(share, error, share->open_errno, errarg);
DBUG_RETURN(error);