summaryrefslogtreecommitdiff
path: root/storage/innobase/row
diff options
context:
space:
mode:
authorTimothy Smith <timothy.smith@sun.com>2008-12-14 13:42:37 -0700
committerTimothy Smith <timothy.smith@sun.com>2008-12-14 13:42:37 -0700
commit220ee82cb7248dd9381805f0de3c737f97f3e577 (patch)
tree6143c8dce388d1d9b50fe12ba3f7f61cce1bbe8a /storage/innobase/row
parent968608efb7ed797879327d68afe4dc8ad06a1e4f (diff)
downloadmariadb-git-220ee82cb7248dd9381805f0de3c737f97f3e577.tar.gz
Apply InnoDB snapshot innodb-5.1-2858, part 7.
A follow-up fix for Bug 38839, which exposed a pre-existing bug in the autoinc handling. Detailed revision comments: r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug 39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3
Diffstat (limited to 'storage/innobase/row')
-rw-r--r--storage/innobase/row/row0mysql.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 74bf2267a3e..a3e2549f517 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -661,7 +661,13 @@ row_create_prebuilt(
prebuilt->old_vers_heap = NULL;
- prebuilt->last_value = 0;
+ prebuilt->autoinc_offset = 0;
+
+ /* Default to 1, we will set the actual value later in
+ ha_innobase::get_auto_increment(). */
+ prebuilt->autoinc_increment = 1;
+
+ prebuilt->autoinc_last_value = 0;
return(prebuilt);
}