~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

Split some classes from the range optimizer out in to their own header and implementation files.
Corrected the case on these classes also to adhere to the coding standards. Cleaned up any style
issues in any code I came across while moving code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
#include "drizzled/optimizer/sargable_param.h"
60
60
#include "drizzled/optimizer/key_use.h"
61
61
#include "drizzled/optimizer/range.h"
 
62
#include "drizzled/optimizer/quick_range_select.h"
62
63
 
63
64
using namespace std;
64
65
using namespace drizzled;
5154
5155
      */
5155
5156
      if (! select->quick->reverse_sorted())
5156
5157
      {
5157
 
        optimizer::QUICK_SELECT_DESC *tmp= NULL;
 
5158
        optimizer::QuickSelectDescending *tmp= NULL;
5158
5159
        bool error= false;
5159
5160
        int quick_type= select->quick->get_type();
5160
5161
        if (quick_type == optimizer::QuickSelectInterface::QS_TYPE_INDEX_MERGE ||
5164
5165
        {
5165
5166
          tab->limit= 0;
5166
5167
          select->quick= save_quick;
5167
 
          return(0);                   // Use filesort
 
5168
          return 0; // Use filesort
5168
5169
        }
5169
5170
 
5170
5171
        /* order_st BY range_key DESC */
5171
 
        tmp= new optimizer::QUICK_SELECT_DESC((optimizer::QuickRangeSelect*)(select->quick),
5172
 
                                              used_key_parts, &error);
5173
 
        if (!tmp || error)
 
5172
        tmp= new optimizer::QuickSelectDescending((optimizer::QuickRangeSelect*)(select->quick),
 
5173
                                                  used_key_parts, 
 
5174
                                                  &error);
 
5175
        if (! tmp || error)
5174
5176
        {
5175
5177
          delete tmp;
5176
 
                select->quick= save_quick;
5177
 
                tab->limit= 0;
5178
 
          return(0);            // Reverse sort not supported
 
5178
          select->quick= save_quick;
 
5179
          tab->limit= 0;
 
5180
          return 0; // Reverse sort not supported
5179
5181
        }
5180
5182
        select->quick=tmp;
5181
5183
      }
5195
5197
  }
5196
5198
  else if (select && select->quick)
5197
5199
    select->quick->sorted= 1;
5198
 
  return(1);
 
5200
  return 1;
5199
5201
}
5200
5202
 
5201
5203
/*