summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2003-03-31 23:14:26 +0400
committerunknown <serg@sergbook.mysql.com>2003-03-31 23:14:26 +0400
commit76bd91752616f251cd7177971e30ec2e8939d356 (patch)
tree11a64e2559175719b5ebced7d91d2316bcc2060a /sql/handler.cc
parent7e13ac1242b8e9f229b76687622bc1f5de301b92 (diff)
downloadmariadb-git-76bd91752616f251cd7177971e30ec2e8939d356.tar.gz
don't increment LAST_INSERT_ID() when incremented value cannot be stored in auto_increment column (e.g. is too big)
mysql-test/r/auto_increment.result: more tests mysql-test/t/auto_increment.test: more tests
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;
}