Commit 41c37c77 authored by Annamalai Gurusami's avatar Annamalai Gurusami

Merge from mysql-5.1 to mysql-5.5

parents a73d2ae0 e979417c
......@@ -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() */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment