1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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+.
This commit is contained in:
Mattias Jonsson
2010-10-01 13:39:04 +02:00
parent a73b734949
commit a01773dbee
6 changed files with 72 additions and 2 deletions

View File

@ -2449,6 +2449,21 @@ err1:
/****************************************************************************
MODULE open/close object
****************************************************************************/
/**
A destructor for partition-specific TABLE_SHARE data.
*/
void ha_data_partition_destroy(void *ha_data)
{
if (ha_data)
{
HA_DATA_PARTITION *ha_part_data= (HA_DATA_PARTITION*) ha_data;
pthread_mutex_destroy(&ha_part_data->LOCK_auto_inc);
}
}
/*
Open handler object
@ -2605,6 +2620,8 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
}
DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data));
bzero(ha_data, sizeof(HA_DATA_PARTITION));
table_share->ha_data_destroy= ha_data_partition_destroy;
VOID(pthread_mutex_init(&ha_data->LOCK_auto_inc, MY_MUTEX_INIT_FAST));
}
if (is_not_tmp_table)
pthread_mutex_unlock(&table_share->mutex);