List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:January 31 2008 3:17pm
Subject:RE: bk commit into 6.0 tree (cbell:1.2784) BUG#33172
View as plain text  
Hi Alik, 

I have a new patch ready. See:

http://lists.mysql.com/commits/41506

Note: This is a second patch because I merged the WL#4205 code and can't (or
don't know how) to redo my original patch.

I also address your points below.

> > I would extend open_schema_table() with COND* parameter - 
> that would 
> > make it much more general as one could open a I_S table 
> with arbitrary 
> > select condition. The usage would be then:
> >
> > COND *cond;
> >
> > <build condition cond>
> >
> > TABLE *t= open_schema_table(thd, st, cond);
> 
> Agreed with open_schema_table() signature.
> 
> However, I think the code should be something like:
> 
> COND *cond= create_db_select_condition(...) TABLE *t= 
> open_schema_table(thd, st, cond); ...
> delete cond;

Well, I cannot change the signature like Rafal requested. To build the COND*
tree one needs the table and open_schema_table returns the table pointer. So
it has to be done in two steps.  

> > OPTIONAL: I'm not sure if it really makes sense to extract this 
> > functionality into a separate function. The code creating 
> appropriate 
> > WHERE clause could be used directly inside 
> > InformationSchemaIterator::prepare_is_table().
> 
> I would keep it in a separate function for the sake of 
> keeping functions small.

Agreed.

> > > +COND *create_db_select_condition(THD *thd,
> > > +                                 TABLE *t,
> > > +                                 List<LEX_STRING> db_list)
> 
> Chuck, you pass List by value here. I think, you didn't mean that.
> Let's pass it by pointer.

DOH! Sometimes I amaze myself with the obsurdity of my gaffs.

> Another thing: I guess created COND* object should be deleted 
> somewhere/somehow?

I'm not sure how to do this. Simply doing "delete cond" doesn't work because
it deletes too much and blows core. However, the method
Query_arena::free_items() does indeed delete the COND* tree so all is well
in this respect.

Chuck

Thread
bk commit into 6.0 tree (cbell:1.2784) BUG#33172cbell30 Jan
  • Re: bk commit into 6.0 tree (cbell:1.2784) BUG#33172Rafal Somla30 Jan
    • Re: bk commit into 6.0 tree (cbell:1.2784) BUG#33172Alexander Nozdrin31 Jan
      • RE: bk commit into 6.0 tree (cbell:1.2784) BUG#33172Chuck Bell31 Jan
    • RE: bk commit into 6.0 tree (cbell:1.2784) BUG#33172Chuck Bell31 Jan
      • Re: bk commit into 6.0 tree (cbell:1.2784) BUG#33172Rafal Somla5 Feb