1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-16 22:03:23 +03:00

Add debug lock checks to autoinc functions. Add lock guards around an

invocation of dict_table_autoinc_initialize().
This commit is contained in:
sunny
2007-09-25 07:16:56 +00:00
parent b44b2ae51d
commit 60167ee9d4
2 changed files with 6 additions and 0 deletions

View File

@@ -441,6 +441,8 @@ dict_table_autoinc_initialize(
dict_table_t* table, /* in: table */ dict_table_t* table, /* in: table */
ib_longlong value) /* in: next value to assign to a row */ ib_longlong value) /* in: next value to assign to a row */
{ {
ut_ad(mutex_own(&table->autoinc_mutex));
table->autoinc_inited = TRUE; table->autoinc_inited = TRUE;
table->autoinc = value; table->autoinc = value;
} }
@@ -457,6 +459,8 @@ dict_table_autoinc_read(
{ {
ib_longlong value; ib_longlong value;
ut_ad(mutex_own(&table->autoinc_mutex));
if (!table->autoinc_inited) { if (!table->autoinc_inited) {
value = 0; value = 0;

View File

@@ -2895,7 +2895,9 @@ next_rec:
/* MySQL calls ha_innobase::reset_auto_increment() which does /* MySQL calls ha_innobase::reset_auto_increment() which does
the same thing. */ the same thing. */
dict_table_autoinc_lock(table);
dict_table_autoinc_initialize(table, 0); dict_table_autoinc_initialize(table, 0);
dict_table_autoinc_unlock(table);
dict_update_statistics(table); dict_update_statistics(table);
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);