~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Lee Bieber
  • Date: 2010-11-05 20:22:41 UTC
  • mfrom: (1907.1.2 build)
  • Revision ID: kalebral@gmail.com-20101105202241-1fm31t0y0fvdwcd3
Merge Brian - Adding FileSort class, merge in catalog tree
Merge Joe - fix bug 670971: InnoDB does not complete shutdown with transaction log enabled

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
#include "drizzled/optimizer/quick_range_select.h"
63
63
#include "drizzled/optimizer/quick_ror_intersect_select.h"
64
64
 
 
65
#include "drizzled/filesort.h"
 
66
 
65
67
using namespace std;
66
68
 
67
69
namespace drizzled
5011
5013
    return(0);
5012
5014
  for (Order *ord= join->order; ord; ord= ord->next)
5013
5015
    length++;
5014
 
  if (!(join->sortorder=
5015
 
        make_unireg_sortorder(order, &length, join->sortorder)))
5016
 
    goto err;
 
5016
  if (!(join->sortorder= make_unireg_sortorder(order, &length, join->sortorder)))
 
5017
  {
 
5018
    return(-1);
 
5019
  }
5017
5020
 
5018
5021
  table->sort.io_cache= new internal::IO_CACHE;
5019
5022
  table->status=0;                              // May be wrong if quick_select
5048
5051
                                                                 &tab->ref,
5049
5052
                                                                 tab->found_records))))
5050
5053
      {
5051
 
        goto err;
 
5054
        return(-1);
5052
5055
      }
5053
5056
    }
5054
5057
  }
5055
5058
 
5056
5059
  if (table->getShare()->getType())
5057
5060
    table->cursor->info(HA_STATUS_VARIABLE);    // Get record count
5058
 
  table->sort.found_records=filesort(session, table,join->sortorder, length,
5059
 
                                     select, filesort_limit, 0,
5060
 
                                     &examined_rows);
 
5061
 
 
5062
  FileSort filesort(*session);
 
5063
  table->sort.found_records=filesort.run(table,join->sortorder, length,
 
5064
                                         select, filesort_limit, 0,
 
5065
                                         &examined_rows);
5061
5066
  tab->records= table->sort.found_records;      // For SQL_CALC_ROWS
5062
5067
  if (select)
5063
5068
  {
5075
5080
    table->key_read=0;
5076
5081
    table->cursor->extra(HA_EXTRA_NO_KEYREAD);
5077
5082
  }
 
5083
 
5078
5084
  return(table->sort.found_records == HA_POS_ERROR);
5079
 
err:
5080
 
  return(-1);
5081
5085
}
5082
5086
 
5083
5087
int remove_dup_with_compare(Session *session, Table *table, Field **first_field, uint32_t offset, Item *having)