From: Annamalai Gurusami Date: May 21 2012 12:08pm Subject: bzr push into mysql-trunk branch (annamalai.gurusami:3896 to 3897) List-Archive: http://lists.mysql.com/commits/143872 Message-Id: <201205211208.q4LC8tcm015491@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3897 Annamalai Gurusami 2012-05-21 [merge] Merge from mysql-5.5 to mysql-trunk. modified: sql/handler.cc 3896 Jorgen Loland 2012-05-21 WL#6158 followup Move counting of partial plans to best_access_path(). modified: mysql-test/r/greedy_search.result sql/sql_planner.cc === modified file 'sql/handler.cc' --- a/sql/handler.cc revid:jorgen.loland@stripped +++ b/sql/handler.cc revid:annamalai.gurusami@stripped @@ -3047,18 +3047,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() */ No bundle (reason: useless for push emails).