~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-27 14:23:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2350.
  • Revision ID: olafvdspek@gmail.com-20110627142335-38y17d8xxczy6ilm
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
634
634
      conds= having;
635
635
      having= 0;
636
636
    }
637
 
    else if ((conds=new Item_cond_and(conds,having)))
 
637
    else
638
638
    {
 
639
      conds= new Item_cond_and(conds,having);
 
640
 
639
641
      /*
640
642
        Item_cond_and can't be fixed after creation, so we do not check
641
643
        conds->fixed
1741
1743
      if (sort_table_cond)
1742
1744
      {
1743
1745
        if (!curr_table->select)
1744
 
          if (!(curr_table->select= new optimizer::SqlSelect()))
1745
 
            return;
 
1746
          curr_table->select= new optimizer::SqlSelect;
1746
1747
        if (!curr_table->select->cond)
1747
1748
          curr_table->select->cond= sort_table_cond;
1748
1749
        else          // This should never happen
1749
1750
        {
1750
 
          if (!(curr_table->select->cond=
1751
 
          new Item_cond_and(curr_table->select->cond,
1752
 
                sort_table_cond)))
1753
 
            return;
 
1751
          curr_table->select->cond= new Item_cond_and(curr_table->select->cond, sort_table_cond);
1754
1752
          /*
1755
1753
            Item_cond_and do not need fix_fields for execution, its parameters
1756
1754
            are fixed or do not need fix_fields, too
1759
1757
        }
1760
1758
        curr_table->select_cond= curr_table->select->cond;
1761
1759
        curr_table->select_cond->top_level_item();
1762
 
        curr_join->tmp_having= make_cond_for_table(curr_join->tmp_having,
1763
 
                    ~ (table_map) 0,
1764
 
                    ~used_tables, 0);
 
1760
        curr_join->tmp_having= make_cond_for_table(curr_join->tmp_having, ~ (table_map) 0, ~used_tables, 0);
1765
1761
      }
1766
1762
    }
1767
1763
    {
2286
2282
            result we do not include fields for constant expressions.
2287
2283
          */
2288
2284
          Item* new_item= new Item_func_rollup_const(item);
2289
 
          if (!new_item)
2290
 
            return 1;
2291
2285
          new_item->fix_fields(session, NULL);
2292
2286
          *it.ref()= new_item;
2293
2287
          for (Order *tmp= group_tmp; tmp; tmp= tmp->next)