~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Brian Aker
  • Date: 2011-02-12 10:06:03 UTC
  • mfrom: (2154.2.16 drizzle-build)
  • Revision ID: brian@tangent.org-20110212100603-i5ww0s02p8l4a8q7
Merge in solaris tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
#include "drizzled/records.h"
53
53
#include "drizzled/internal/iocache.h"
54
54
#include "drizzled/drizzled.h"
 
55
#include "drizzled/plugin/storage_engine.h"
55
56
 
56
57
#include "drizzled/sql_union.h"
57
58
#include "drizzled/optimizer/key_field.h"
572
573
  sz= sizeof(optimizer::KeyField) *
573
574
      (((session->lex->current_select->cond_count+1)*2 +
574
575
        session->lex->current_select->between_count)*m+1);
575
 
  if (! (key_fields= (optimizer::KeyField*) session->alloc(sz)))
 
576
  if (! (key_fields= (optimizer::KeyField*) session->getMemRoot()->allocate(sz)))
576
577
    return true;
577
578
  and_level= 0;
578
579
  field= end= key_fields;
1004
1005
  j->ref.key_length=length;
1005
1006
  j->ref.key=(int) key;
1006
1007
  if (!(j->ref.key_buff= (unsigned char*) session->calloc(ALIGN_SIZE(length)*2)) ||
1007
 
      !(j->ref.key_copy= (StoredKey**) session->alloc((sizeof(StoredKey*) *
 
1008
      !(j->ref.key_copy= (StoredKey**) session->getMemRoot()->allocate((sizeof(StoredKey*) *
1008
1009
               (keyparts+1)))) ||
1009
 
      !(j->ref.items=    (Item**) session->alloc(sizeof(Item*)*keyparts)) ||
1010
 
      !(j->ref.cond_guards= (bool**) session->alloc(sizeof(uint*)*keyparts)))
 
1010
      !(j->ref.items=    (Item**) session->getMemRoot()->allocate(sizeof(Item*)*keyparts)) ||
 
1011
      !(j->ref.cond_guards= (bool**) session->getMemRoot()->allocate(sizeof(uint*)*keyparts)))
1011
1012
  {
1012
1013
    return(true);
1013
1014
  }
5636
5637
  {
5637
5638
    if (order->in_field_list)
5638
5639
    {
5639
 
      Order *ord=(Order*) session->memdup((char*) order,sizeof(Order));
 
5640
      Order *ord=(Order*) session->getMemRoot()->duplicate((char*) order,sizeof(Order));
5640
5641
      if (!ord)
5641
5642
        return 0;
5642
5643
      *prev=ord;
6291
6292
{
6292
6293
  /* List is reversed => we should reverse it before using */
6293
6294
  List_iterator_fast<TableList> ti(*tables);
6294
 
  TableList **table= (TableList **)session->alloc(sizeof(TableList*) *
 
6295
  TableList **table= (TableList **)session->getMemRoot()->allocate(sizeof(TableList*) *
6295
6296
                                                tables->elements);
6296
6297
  if (table == 0)
6297
6298
    return;  // out of memory