List:Commits« Previous MessageNext Message »
From:Øystein Grøvlen Date:March 22 2011 3:01pm
Subject:Re: bzr commit into mysql-trunk branch (epotemkin:3003) Bug#11791705
View as plain text  
Hi,

Forgot to mention two minor details

On 02/21/11 03:17 PM, Evgeny Potemkin wrote:
...
> === modified file 'sql/item_subselect.cc'
> --- a/sql/item_subselect.cc	2011-02-18 10:46:59 +0000
> +++ b/sql/item_subselect.cc	2011-02-21 14:17:57 +0000
> @@ -2370,12 +2370,27 @@ int subselect_single_select_engine::exec
>                   Make sure that save_read_first_record usage doesn't
>                   intersect with join_materialize_table()'s.
>                 */

I am not sure the above comment is necessary anymore.  If you want to 
keep it, I think it should come after the comment below.

> -              DBUG_ASSERT(!tab->save_read_first_record);
>                 /* Change the access method to full table scan */
> -              tab->save_read_first_record= tab->read_first_record;
> +              if (tab->save_read_first_record.elements)

Since elements is an int, I prefer
   if (tab->save_read_first_record.elements > 0)

> +              {
> +                TABLE_LIST *tl= tab->table->pos_in_table_list;
> +                /*
> +                  This is a materializable derived table and it's not
> +                  materialized yet.
> +                */
> +                DBUG_ASSERT(tl->uses_materialization()&& 
> !tl->materialized);
> +                // Preserve join_materialize_table to be the first handler
> +                tab->save_read_first_record.push_front(
> +                  (READ_RECORD::Setup_func*)read_first_record_seq);
> +              }
> +              else
> +              {
> +                tab->save_read_first_record.push_front(
> +                  (READ_RECORD::Setup_func*)tab->read_first_record);
> +                tab->read_first_record= read_first_record_seq;
> +              }
>                 tab->save_read_record= tab->read_record.read_record;
>                 tab->read_record.read_record= rr_sequential;
> -              tab->read_first_record= read_first_record_seq;
>                 tab->read_record.record= tab->table->record[0];
>                 tab->read_record.thd= join->thd;
>                 tab->read_record.ref_length=
> tab->table->file->ref_length;
> @@ -2396,9 +2411,10 @@ int subselect_single_select_engine::exec
>         JOIN_TAB *tab= *ptab;
>         tab->read_record.record= 0;
>         tab->read_record.ref_length= 0;
> -      tab->read_first_record= tab->save_read_first_record;
> +      DBUG_ASSERT(tab->save_read_first_record.elements);

or DBUG_ASSERT(tab->save_read_first_record.elements > 0);

> +      tab->read_first_record=
> +        (READ_RECORD::Setup_func)tab->save_read_first_record.pop();
>         tab->read_record.read_record= tab->save_read_record;
> -      tab->save_read_first_record= NULL;
>       }
>       executed= true;
>
...

-- 
Øystein
Thread
bzr commit into mysql-trunk branch (epotemkin:3003) Bug#11791705Evgeny Potemkin21 Feb
  • Re: bzr commit into mysql-trunk branch (epotemkin:3003) Bug#11791705Øystein Grøvlen22 Mar
    • Re: bzr commit into mysql-trunk branch (epotemkin:3003) Bug#11791705Evgeny Potemkin23 Mar
      • Re: bzr commit into mysql-trunk branch (epotemkin:3003) Bug#11791705Øystein Grøvlen24 Mar
  • Re: bzr commit into mysql-trunk branch (epotemkin:3003) Bug#11791705Øystein Grøvlen22 Mar