List:Commits« Previous MessageNext Message »
From:Roy Lyseng Date:May 5 2011 8:11am
Subject:Re: bzr commit into mysql-trunk branch (roy.lyseng:3368) Bug#56881
Bug#11764086
View as plain text  
Hi Jørgen,

On 05.05.11 10.04, Jorgen Loland wrote:
> Hi Roy,
>
> Thank you for fixing this bug. Patch approved.
>
> On 05/05/2011 09:42 AM, Roy Lyseng wrote:
>> === modified file 'sql/item_cmpfunc.cc'
>> --- a/sql/item_cmpfunc.cc 2011-04-26 08:49:10 +0000
>> +++ b/sql/item_cmpfunc.cc 2011-05-05 07:41:53 +0000
>> @@ -1764,6 +1764,17 @@ bool Item_in_optimizer::fix_fields(THD *
>> with_sum_func= with_sum_func || args[1]->with_sum_func;
>> used_tables_cache|= args[1]->used_tables();
>> not_null_tables_cache|= args[1]->not_null_tables();
>> +
>> + if (!sub->is_top_level_item())
>> + {
>> + /*
>> + This is a NOT IN subquery predicate (or equivalent). Null values passed
>> + from outer tables and used in the left-hand expression of the predicate
>> + must be considered in the evaluation, hence filter out these tables
>> + from the set of null-rejecting tables.
>> + */
>> + not_null_tables_cache&= ~args[0]->not_null_tables();
>> + }
>> const_item_cache&= args[1]->const_item();
>> fixed= 1;
>> return FALSE;
>
> Suggestion: replace all args[1] with sub in this method.
>
If it is OK with you, I'd like to keep the patch minimal. Long-term I'd like to 
delete the Item_in_optimizer class entirely.

Thanks,
Roy
Thread
bzr commit into mysql-trunk branch (roy.lyseng:3368) Bug#56881 Bug#11764086Roy Lyseng5 May
  • Re: bzr commit into mysql-trunk branch (roy.lyseng:3368) Bug#56881Bug#11764086Jorgen Loland5 May
    • Re: bzr commit into mysql-trunk branch (roy.lyseng:3368) Bug#56881Bug#11764086Roy Lyseng5 May
      • Re: bzr commit into mysql-trunk branch (roy.lyseng:3368) Bug#56881Bug#11764086Jorgen Loland5 May