summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-05-21 17:27:21 +0530
committerAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-05-21 17:27:21 +0530
commit41c37c77b4ac5fdac811fa2c19c459137c819156 (patch)
tree91e59a9772972888d9d6cf95e4a7d02dae9a871b /sql/handler.cc
parenta73d2ae02c594e74c6deb91a09a789a91e0dcc05 (diff)
parente979417c06f98f8ca81a7442d93f53d9aec79446 (diff)
downloadmariadb-git-41c37c77b4ac5fdac811fa2c19c459137c819156.tar.gz
Merge from mysql-5.1 to mysql-5.5
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 812ed3523a0..310e23574dc 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2529,18 +2529,18 @@ int handler::update_auto_increment()
Note that in prelocked mode no estimation is given.
*/
- /*
- For multi-row inserts, if the bulk inserts cannot be started, the
- handler::estimation_rows_to_insert will not be set. Set it here.
- */
- if ((estimation_rows_to_insert == 0) &&
- (thd->lex->many_values.elements > 0))
- {
- estimation_rows_to_insert= thd->lex->many_values.elements;
- }
-
if ((auto_inc_intervals_count == 0) && (estimation_rows_to_insert > 0))
nb_desired_values= estimation_rows_to_insert;
+ else if ((auto_inc_intervals_count == 0) &&
+ (thd->lex->many_values.elements > 0))
+ {
+ /*
+ For multi-row inserts, if the bulk inserts cannot be started, the
+ handler::estimation_rows_to_insert will not be set. But we still
+ want to reserve the autoinc values.
+ */
+ nb_desired_values= thd->lex->many_values.elements;
+ }
else /* go with the increasing defaults */
{
/* avoid overflow in formula, with this if() */