summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-08-22 11:40:39 +0200
committerSergei Golubchik <sergii@pisem.net>2012-08-22 11:40:39 +0200
commitcefc30b1663114930439e03dec245604bc904604 (patch)
tree83a4479fe38adb24e478dde743856f04d65fa801 /sql/handler.cc
parent34f2f8ea41726d98e50752ff3453ebde70912c35 (diff)
parent171355077501da7ddd32778ab3ebe77c5f7ce7da (diff)
downloadmariadb-git-cefc30b1663114930439e03dec245604bc904604.tar.gz
merge with MySQL 5.1.65
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 234420b64a8..e56bb93caab 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2416,8 +2416,19 @@ int handler::update_auto_increment()
reservation means potentially losing unused values).
Note that in prelocked mode no estimation is given.
*/
+
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() */
@@ -4757,6 +4768,8 @@ int handler::ha_write_row(uchar *buf)
DBUG_RETURN(error);
if (unlikely(error= binlog_log_row(table, 0, buf, log_func)))
DBUG_RETURN(error); /* purecov: inspected */
+
+ DEBUG_SYNC_C("ha_write_row_end");
DBUG_RETURN(0);
}