~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/filesort.cc

  • Committer: Brian Aker
  • Date: 2011-02-14 05:47:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2167.
  • Revision ID: brian@tangent.org-20110214054707-61nsqgg1g4w1zhx1
Merge in all changes for current_session, etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include "drizzled/atomics.h"
48
48
#include "drizzled/global_buffer.h"
49
49
 
 
50
#include <drizzled/sort_field.h>
 
51
 
50
52
 
51
53
using namespace std;
52
54
 
564
566
  if (! indexfile && ! quick_select)
565
567
  {
566
568
    next_pos=(unsigned char*) 0;                        /* Find records in sequence */
567
 
    file->startTableScan(1);
 
569
    if (file->startTableScan(1))
 
570
      return(HA_POS_ERROR);
568
571
    file->extra_opt(HA_EXTRA_CACHE, getSession().variables.read_buff_size);
569
572
  }
570
573
 
574
577
    if (select->quick->reset())
575
578
      return(HA_POS_ERROR);
576
579
 
577
 
    read_record_info.init_read_record(&getSession(), select->quick->head, select, 1, 1);
 
580
    if (read_record_info.init_read_record(&getSession(), select->quick->head, select, 1, 1))
 
581
      return(HA_POS_ERROR);
578
582
  }
579
583
 
580
584
  /* Remember original bitmaps */
914
918
        }
915
919
      case DECIMAL_RESULT:
916
920
        {
917
 
          my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf);
 
921
          type::Decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf);
918
922
          if (maybe_null)
919
923
          {
920
924
            if (item->null_value)
925
929
            }
926
930
            *to++=1;
927
931
          }
928
 
          my_decimal2binary(E_DEC_FATAL_ERROR, dec_val, to,
929
 
                            item->max_length - (item->decimals ? 1:0),
930
 
                            item->decimals);
 
932
          dec_val->val_binary(E_DEC_FATAL_ERROR, to,
 
933
                              item->max_length - (item->decimals ? 1:0),
 
934
                              item->decimals);
931
935
          break;
932
936
        }
933
937
      case REAL_RESULT:
1524
1528
        break;
1525
1529
      case DECIMAL_RESULT:
1526
1530
        sortorder->length=
1527
 
          my_decimal_get_binary_size(sortorder->item->max_length -
 
1531
          class_decimal_get_binary_size(sortorder->item->max_length -
1528
1532
                                     (sortorder->item->decimals ? 1 : 0),
1529
1533
                                     sortorder->item->decimals);
1530
1534
        break;