Commit 02f1a6cb authored by Mattias Jonsson's avatar Mattias Jonsson

post merge fix

parent 9368f11b
......@@ -935,22 +935,16 @@ class ha_partition :public handler
/* lock already taken */
if (auto_increment_safe_stmt_log_lock)
return;
#ifdef WITH_PARTITION_STORAGE_ENGINE
DBUG_ASSERT(table_share->ha_part_data && !auto_increment_lock);
#endif
if(table_share->tmp_table == NO_TMP_TABLE)
{
auto_increment_lock= TRUE;
#ifdef WITH_PARTITION_STORAGE_ENGINE
mysql_mutex_lock(&table_share->ha_part_data->LOCK_auto_inc);
#endif
}
}
virtual void unlock_auto_increment()
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
DBUG_ASSERT(table_share->ha_part_data);
#endif
/*
If auto_increment_safe_stmt_log_lock is true, we have to keep the lock.
It will be set to false and thus unlocked at the end of the statement by
......@@ -958,25 +952,19 @@ class ha_partition :public handler
*/
if(auto_increment_lock && !auto_increment_safe_stmt_log_lock)
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
mysql_mutex_unlock(&table_share->ha_part_data->LOCK_auto_inc);
#endif
auto_increment_lock= FALSE;
}
}
virtual void set_auto_increment_if_higher(Field *field)
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
ulonglong nr= (((Field_num*) field)->unsigned_flag ||
field->val_int() > 0) ? field->val_int() : 0;
#endif
lock_auto_increment();
#ifdef WITH_PARTITION_STORAGE_ENGINE
DBUG_ASSERT(table_share->ha_part_data->auto_inc_initialized == TRUE);
/* must check when the mutex is taken */
if (nr >= table_share->ha_part_data->next_auto_inc_val)
table_share->ha_part_data->next_auto_inc_val= nr + 1;
#endif
unlock_auto_increment();
}
......
......@@ -18,7 +18,9 @@
#include "sql_lex.h" // Sql_statement
#include "sql_admin.h" // Analyze/Check/.._table_statement
#include "sql_partition_admin.h" // Alter_table_*_partition
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h" // ha_partition
#endif
#include "sql_base.h" // open_and_lock_tables
#ifndef WITH_PARTITION_STORAGE_ENGINE
......
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