~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Mark Atwood
  • Date: 2011-06-27 19:01:37 UTC
  • mfrom: (2318.6.90 refactor16)
  • Revision ID: me@mark.atwood.name-20110627190137-iflt3vku0kw77l8a
mergeĀ lp:~olafvdspek/drizzle/refactor17

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
    {
2243
2239
  */
2244
2240
  for (uint32_t i= 0 ; i < send_group_parts ; i++)
2245
2241
  {
2246
 
    rollup.getNullItems()[i]= new (session->mem_root) Item_null_result();
 
2242
    rollup.getNullItems()[i]= new (session->mem) Item_null_result();
2247
2243
    List<Item> *rollup_fields= &rollup.getFields()[i];
2248
2244
    rollup_fields->clear();
2249
2245
    rollup.getRefPointerArrays()[i]= ref_array;
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)
2417
2411
              This is an element that is used by the GROUP BY and should be
2418
2412
              set to NULL in this level
2419
2413
            */
2420
 
                  Item_null_result *null_item= new (session->mem_root) Item_null_result();
2421
 
                  if (!null_item)
2422
 
                    return 1;
 
2414
                  Item_null_result *null_item= new (session->mem) Item_null_result();
2423
2415
            item->maybe_null= 1;    // Value will be null sometimes
2424
2416
                  null_item->result_field= item->get_tmp_table_field();
2425
2417
                  item= null_item;