1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-6605 Multiple Clients Inserting Causing Error: Failed to read auto-increment value from storage engine

* handler::get_auto_increment() was not expecting any errors from the storage engine.
  That was wrong, errors could happen.
* ha_partition::get_auto_increment() was doing index lookups in partition under a mutex.
  This was redundant (engine transaction isolation was covering that anyway)
  and harmful (causing deadlocks).
This commit is contained in:
Sergei Golubchik
2014-09-08 18:38:13 +02:00
parent 8deb9066e2
commit 6b720ae4cb
4 changed files with 91 additions and 12 deletions

View File

@@ -2819,15 +2819,10 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
if (error)
{
if (error == HA_ERR_END_OF_FILE || error == HA_ERR_KEY_NOT_FOUND)
{
/* No entry found, start with 1. */
nr= 1;
}
/* No entry found, that's fine */;
else
{
DBUG_ASSERT(0);
nr= ULONGLONG_MAX;
}
print_error(error, MYF(0));
nr= 1;
}
else
nr= ((ulonglong) table->next_number_field->