Commit 028c933b authored by sunny's avatar sunny

We check whether the AUTOINC sub-system has been initialized (first) by

holding the AUTOINC mutex and if initialization is required then we
initialize using our normal procedure. This change is related to Bug#27950.
parent d1d15b3e
...@@ -3812,12 +3812,23 @@ ha_innobase::delete_row( ...@@ -3812,12 +3812,23 @@ ha_innobase::delete_row(
if (table->found_next_number_field && record == table->record[0]) { if (table->found_next_number_field && record == table->record[0]) {
ulonglong dummy = 0; ulonglong dummy = 0;
error = innobase_get_auto_increment(&dummy); /* First check whether the AUTOINC sub-system has been
initialized using the AUTOINC mutex. If not then we
do it the "proper" way, by acquiring the heavier locks. */
dict_table_autoinc_lock(prebuilt->table);
if (error == DB_SUCCESS) { if (!prebuilt->table->autoinc_inited) {
dict_table_autoinc_unlock(prebuilt->table);
error = innobase_get_auto_increment(&dummy);
if (error == DB_SUCCESS) {
dict_table_autoinc_unlock(prebuilt->table);
} else {
goto error_exit;
}
} else {
dict_table_autoinc_unlock(prebuilt->table); dict_table_autoinc_unlock(prebuilt->table);
} else {
goto error_exit;
} }
} }
......
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