List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:February 22 2008 8:35am
Subject:Re: bk commit into 5.0 tree (kaa:1.2607) BUG#33049
View as plain text  
Hi Igor,

ibabaev@stripped wrote:
> Hi Alexey,
> 
> See my notes below.
> 
> Regards,
> Igor.
> 
> Quoting Alexey Kopytov <alexeyk@stripped>:
> 
>> diff -Nrup a/sql/item_sum.cc b/sql/item_sum.cc
>> --- a/sql/item_sum.cc    2007-12-21 13:44:21 +03:00
>> +++ b/sql/item_sum.cc    2008-02-21 20:24:58 +03:00
>> @@ -597,10 +597,7 @@ Item_sum_hybrid::fix_fields(THD *thd, It
>>   result_field=0;
>>   null_value=1;
>>   fix_length_and_dec();
>> -  if (item->type() == Item::FIELD_ITEM)
>> -    hybrid_field_type= ((Item_field*) item)->field->type();
>> -  else
>> -    hybrid_field_type= Item::field_type();
>> +  hybrid_field_type= item->field_type();
>>
>>   if (check_sum_func(thd, ref))
>>     return TRUE;
> 
> This is a typical view related bug. So the test cases should be added to 
> view.test.
>

Ok, moved to view.test.

> Usually we fix such bugs in the following way:
> 
> An occurence of  (item->type() [== Item::FIELD_ITEM])
> is substituted for  (item->real_item()->type() [== Item::FIELD_ITEM])
> 
> So my suggestion is to apply this simple modification:
> 
>  fix_length_and_dec();
> + item= item->real_item();
>  if (item->type() == Item::FIELD_ITEM)
>    hybrid_field_type= ((Item_field*) item)->field->type();
>  else
>    hybrid_field_type= Item::field_type();
> 

Ok, done in the new patch.

> I checked that this fix works for your test. Please check that it works for
> test-as3ap as well.
> 

Yes, it does.

Best regards,

-- 
Alexey Kopytov, Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification
Thread
bk commit into 5.0 tree (kaa:1.2607) BUG#33049Alexey Kopytov22 Feb
Re: bk commit into 5.0 tree (kaa:1.2607) BUG#33049Alexey Kopytov22 Feb