MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:V Narayanan Date:November 22 2009 12:32pm
Subject:Re: bzr commit into mysql-5.1-bugteam branch (v.narayanan:3208)
Bug#47762
View as plain text  
Sergei Golubchik wrote:
> Hi, V!
>
> On Nov 20, V Narayanan wrote:
>   
>> #At
> file:///home/narayanan/Work/mysql_checkouts/shared_repository_directory/mysql-5.1-bugteam-47762-3/
> based on revid:sven.sandberg@stripped
>>
>>  3208 V Narayanan	2009-11-20
>>       Bug#47762 Incorrect result from MIN() when WHERE tests NOT NULL column for
> NULL
>>       
>>       The lookup of a NULL value in a column having a NOT NULL
>>       index was resulting in wrong query result. This was
>>       happening because NULLs were not being handled properly.
>>
>> === added file 'mysql-test/t/min_null_cond.test'
>> --- a/mysql-test/t/min_null_cond.test	1970-01-01 00:00:00 +0000
>> +++ b/mysql-test/t/min_null_cond.test	2009-11-20 04:02:14 +0000
>> @@ -0,0 +1,75 @@
>> === modified file 'sql/opt_sum.cc'
>> --- a/sql/opt_sum.cc	2009-10-14 08:46:50 +0000
>> +++ b/sql/opt_sum.cc	2009-11-20 04:02:14 +0000
>> @@ -527,7 +527,7 @@ bool simple_pred(Item_func *func_item, I
>>      {
>>        args[0]= item;
>>        item= func_item->arguments()[1];
>> -      if (!item->const_item())
>> +      if (!item->const_item() || item->type() == Item::NULL_ITEM)
>>          return 0;
>>        args[1]= item;
>>      }
>>     
>
> That's not enough. It handles the case
>
>     a = NULL
>
> but not
>
>    NULL = a
>
> (that's the 'else' branch, two lines down).
>
> Also, it doesn't cover BETWEEN (that's 'case 3' further down).
>
> Regards / Mit vielen Grüßen,
> Sergei
>
>   
Hi Serg,

Thank you for pointing this out. I have addressed your comments and have 
also
added tests for the new cases you pointed out.

Thanks once again,
Narayanan
Thread
bzr commit into mysql-5.1-bugteam branch (v.narayanan:3208) Bug#47762V Narayanan20 Nov
  • Re: bzr commit into mysql-5.1-bugteam branch (v.narayanan:3208)Bug#47762Sergei Golubchik20 Nov
    • Re: bzr commit into mysql-5.1-bugteam branch (v.narayanan:3208)Bug#47762V Narayanan20 Nov
    • Re: bzr commit into mysql-5.1-bugteam branch (v.narayanan:3208)Bug#47762V Narayanan22 Nov