summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-09-08 18:38:13 +0200
committerSergei Golubchik <sergii@pisem.net>2014-09-08 18:38:13 +0200
commit6b720ae4cb76228accc32c91c2c59eb3aa53b259 (patch)
treefc24adbadda74ba67ba3af42bf32c0b17e156602 /sql/handler.cc
parent8deb9066e230f8cba682d15ff4a05e543ed7ac23 (diff)
downloadmariadb-git-6b720ae4cb76228accc32c91c2c59eb3aa53b259.tar.gz
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).
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index efecd478019..086a6534120 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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->