List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:March 7 2008 7:14pm
Subject:Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479
View as plain text  
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
Thread
bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479mattiasj5 Mar
  • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Sergei Golubchik7 Mar
    • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Sergei Golubchik7 Mar
      • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Mattias Jonsson8 Mar
        • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Sergei Golubchik10 Mar
  • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Guilhem Bichot13 Mar
    • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Mattias Jonsson14 Mar
      • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Guilhem Bichot18 Mar
        • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Mattias Jonsson27 Mar
          • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Guilhem Bichot28 Mar
            • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Mattias Jonsson1 Apr
              • Re: bk commit into 5.1 tree (mattiasj:1.2518) BUG#33479Guilhem Bichot10 Apr