Hi!
On Mar 05, mattiasj@stripped wrote:
> ChangeSet@stripped, 2008-03-05 23:56:06+01:00, mattiasj@witty. +3 -0
> Bug#33479: auto_increment failures in partitioning
thanks.
ok to push
with out change.
> diff -Nrup a/sql/ha_partition.cc b/sql/ha_partition.cc
> --- a/sql/ha_partition.cc 2007-12-20 19:16:51 +01:00
> +++ b/sql/ha_partition.cc 2008-03-05 23:56:03 +01:00
> @@ -2953,13 +2980,25 @@ int ha_partition::delete_all_rows()
> {
> int error;
> handler **file;
> + THD *thd= current_thd;
> DBUG_ENTER("ha_partition::delete_all_rows");
>
> + if (thd->lex->sql_command == SQLCOM_TRUNCATE)
> + {
> + HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
> + lock_auto_increment();
> + ha_data->next_auto_inc_val= 0;
> + ha_data->auto_inc_initialized= FALSE;
> + unlock_auto_increment();
> + }
> file= m_file;
> do
> {
> if ((error= (*file)->ha_delete_all_rows()))
> DBUG_RETURN(error);
> + /* must reset the auto_increment for some engines (eg MyISAM) */
> + if (thd->lex->sql_command == SQLCOM_TRUNCATE)
> + (*file)->ha_reset_auto_increment(0);
No, let's call it MyISAM bug that should be fixed in MyISAM, not in
partitioning code. Remove this workaround, please.
> } while (*(++file));
> DBUG_RETURN(0);
> }
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer/Server Architect
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Dachauer Str. 37, D-80335 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140