summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 1a9ec5bbf70..1489ead8b5a 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -44,6 +44,7 @@ typedef struct st_partition_share
typedef struct st_ha_data_partition
{
ulonglong next_auto_inc_val; /**< first non reserved value */
+ pthread_mutex_t LOCK_auto_inc;
bool auto_inc_initialized;
} HA_DATA_PARTITION;
@@ -153,6 +154,10 @@ private:
*/
bool m_extra_cache;
uint m_extra_cache_size;
+ /* The same goes for HA_EXTRA_PREPARE_FOR_UPDATE */
+ bool m_extra_prepare_for_update;
+ /* Which partition has active cache */
+ uint m_extra_cache_part_id;
void init_handler_variables();
/*
@@ -942,8 +947,9 @@ private:
DBUG_ASSERT(table_share->ha_data && !auto_increment_lock);
if(table_share->tmp_table == NO_TMP_TABLE)
{
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
auto_increment_lock= TRUE;
- pthread_mutex_lock(&table_share->mutex);
+ pthread_mutex_lock(&ha_data->LOCK_auto_inc);
}
}
virtual void unlock_auto_increment()
@@ -956,7 +962,8 @@ private:
*/
if(auto_increment_lock && !auto_increment_safe_stmt_log_lock)
{
- pthread_mutex_unlock(&table_share->mutex);
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ pthread_mutex_unlock(&ha_data->LOCK_auto_inc);
auto_increment_lock= FALSE;
}
}