~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

Merge of Prafulla

Show diffs side-by-side

added added

removed removed

Lines of Context:
2850
2850
  @endverbatim
2851
2851
 
2852
2852
  @param join       Join being processed
2853
 
  @param last_tab   Last table in current partial join order (this function is
2854
 
                    not called for empty partial join orders)
2855
2853
  @param next_tab   Table we're going to extend the current partial join with
2856
2854
 
2857
2855
  @retval
2860
2858
  @retval
2861
2859
    true   Requested join order extension not allowed.
2862
2860
*/
2863
 
bool check_interleaving_with_nj(JoinTable *last_tab, JoinTable *next_tab)
 
2861
bool check_interleaving_with_nj(JoinTable *next_tab)
2864
2862
{
2865
2863
  TableList *next_emb= next_tab->table->pos_in_table_list->getEmbedding();
2866
 
  Join *join= last_tab->join;
 
2864
  Join *join= next_tab->join;
2867
2865
 
2868
2866
  if ((join->cur_embedding_map & ~next_tab->embedding_map).any())
2869
2867
  {
3085
3083
  /*
3086
3084
    TODO:
3087
3085
    Excluding all expensive functions is too restritive we should exclude only
3088
 
    materialized IN because it is created later than this phase, and cannot be
3089
 
    evaluated at this point.
3090
 
    The condition should be something as (need to fix member access):
3091
 
      !(cond->type() == Item::FUNC_ITEM &&
3092
 
        ((Item_func*)cond)->func_name() == "<in_optimizer>" &&
3093
 
        ((Item_in_optimizer*)cond)->is_expensive()))
 
3086
    materialized IN subquery predicates because they can't yet be evaluated
 
3087
    here (they need additional initialization that is done later on).
 
3088
 
 
3089
    The proper way to exclude the subqueries would be to walk the cond tree and
 
3090
    check for materialized subqueries there.
 
3091
 
3094
3092
  */
3095
3093
  {
3096
3094
    *cond_value= eval_const_cond(cond) ? Item::COND_TRUE : Item::COND_FALSE;