Commit 954d4b1a 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 332ea21b
...@@ -3812,6 +3812,14 @@ ha_innobase::delete_row( ...@@ -3812,6 +3812,14 @@ 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;
/* 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 (!prebuilt->table->autoinc_inited) {
dict_table_autoinc_unlock(prebuilt->table);
error = innobase_get_auto_increment(&dummy); error = innobase_get_auto_increment(&dummy);
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {
...@@ -3819,6 +3827,9 @@ ha_innobase::delete_row( ...@@ -3819,6 +3827,9 @@ ha_innobase::delete_row(
} else { } else {
goto error_exit; goto error_exit;
} }
} else {
dict_table_autoinc_unlock(prebuilt->table);
}
} }
if (!prebuilt->upd_node) { if (!prebuilt->upd_node) {
......
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