summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorserg@sergbook.mysql.com <>2003-03-31 23:14:26 +0400
committerserg@sergbook.mysql.com <>2003-03-31 23:14:26 +0400
commit91d6ec343884e7f900dfbac41130d365999240b9 (patch)
tree11a64e2559175719b5ebced7d91d2316bcc2060a /sql/handler.cc
parente9492a1d83672712a3635261bcc5689daa9157b2 (diff)
downloadmariadb-git-91d6ec343884e7f900dfbac41130d365999240b9.tar.gz
don't increment LAST_INSERT_ID() when incremented value cannot be stored in auto_increment column (e.g. is too big)
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 5353e78cd11..e288d590e88 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -660,8 +660,8 @@ void handler::update_auto_increment()
thd->next_insert_id=0; // Clear after use
else
nr=get_auto_increment();
- thd->insert_id((ulonglong) nr);
- table->next_number_field->store(nr);
+ if (!table->next_number_field->store(nr))
+ thd->insert_id((ulonglong) nr);
auto_increment_column_changed=1;
DBUG_VOID_RETURN;
}