summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2009-03-11 18:18:44 -0600
committerTimothy Smith <timothy.smith@sun.com>2009-03-11 18:18:44 -0600
commit8cbd34f0d7a08f112ca4fb900bda31aeaf0703f1 (patch)
tree47a6ed3afb32b34d280a67e848d3134927abd6c6 /storage/innobase
parent08ee9470a97888380059f8f8b7e6dab1a0eb2da8 (diff)
downloadmariadb-git-8cbd34f0d7a08f112ca4fb900bda31aeaf0703f1.tar.gz
Applying InnoDB snashot 5.1-ss4350, part 5. Fixes
Bug #43203 Overflow from auto incrementing causes server segv Detailed revision comments: r4325 | sunny | 2009-03-02 02:28:52 +0200 (Mon, 02 Mar 2009) | 10 lines branches/5.1: Bug#43203: Overflow from auto incrementing causes server segv It was not a SIGSEGV but an assertion failure. The assertion was checking the invariant that *first_value passed in by MySQL doesn't contain a value that is greater than the max value for that type. The assertion has been changed to a check and if the value is greater than the max we report a generic AUTOINC failure. rb://93 Approved by Heikki
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/handler/ha_innodb.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b125c731228..a019b95a2bb 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7664,11 +7664,13 @@ ha_innobase::get_auto_increment(
prebuilt->autoinc_last_value = next_value;
- ut_a(prebuilt->autoinc_last_value >= *first_value);
-
- /* Update the table autoinc variable */
- dict_table_autoinc_update_if_greater(
- prebuilt->table, prebuilt->autoinc_last_value);
+ if (prebuilt->autoinc_last_value < *first_value) {
+ *first_value = (~(ulonglong) 0);
+ } else {
+ /* Update the table autoinc variable */
+ dict_table_autoinc_update_if_greater(
+ prebuilt->table, prebuilt->autoinc_last_value);
+ }
} else {
/* This will force write_row() into attempting an update
of the table's AUTOINC counter. */