summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-05-16 14:10:18 +0530
committerAnnamalai Gurusami <annamalai.gurusami@oracle.com>2012-05-16 14:10:18 +0530
commit453fcc0cf59f64bef202b8d3f349f39631e3ff3a (patch)
treec5f28797156e9181681d6a0a1a1a4f5eeb4963c8 /sql/handler.cc
parentc5dc1ea52654627ac2f6f406a16bc04bead9ed0d (diff)
parentbcb5d73767fbc04c88d3c8b05eafbdc9a905ea1f (diff)
downloadmariadb-git-453fcc0cf59f64bef202b8d3f349f39631e3ff3a.tar.gz
Merge from mysql-5.1 to mysql-5.5.
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 b2cb7f1cf9a..812ed3523a0 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2528,6 +2528,17 @@ int handler::update_auto_increment()
reservation means potentially losing unused values).
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 /* go with the increasing defaults */
@@ -5121,6 +5132,8 @@ int handler::ha_write_row(uchar *buf)
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);
}