~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Brian Aker
  • Date: 2009-07-11 07:38:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1093.
  • Revision ID: brian@gaz-20090711073837-2t11jeg84kd40n8r
Sorting methods into class files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4689
4689
  @return
4690
4690
    return one of enum_nested_loop_state, except NESTED_LOOP_NO_MORE_ROWS.
4691
4691
*/
4692
 
enum_nested_loop_state sub_select(JOIN *join,JoinTable *join_tab,bool end_of_records)
 
4692
enum_nested_loop_state sub_select(JOIN *join, JoinTable *join_tab, bool end_of_records)
4693
4693
{
4694
4694
  join_tab->table->null_row=0;
4695
4695
  if (end_of_records)
4701
4701
 
4702
4702
  if (join_tab->flush_weedout_table)
4703
4703
  {
4704
 
    do_sj_reset(join_tab->flush_weedout_table);
 
4704
    join_tab->flush_weedout_table->reset();
4705
4705
  }
4706
4706
 
4707
4707
  if (join->resume_nested_loop)
4755
4755
  return rc;
4756
4756
}
4757
4757
 
4758
 
/*
4759
 
  SemiJoinDuplicateElimination: Reset the temporary table
4760
 
*/
4761
 
int do_sj_reset(SemiJoinTable *sj_tbl)
4762
 
{
4763
 
  if (sj_tbl->tmp_table)
4764
 
    return sj_tbl->tmp_table->file->ha_delete_all_rows();
4765
 
  return 0;
4766
 
}
4767
 
 
4768
4758
int safe_index_read(JoinTable *tab)
4769
4759
{
4770
4760
  int error;
6722
6712
  return(sort);
6723
6713
}
6724
6714
 
6725
 
void read_cached_record(JoinTable *tab)
6726
 
{
6727
 
  unsigned char *pos;
6728
 
  uint32_t length;
6729
 
  bool last_record;
6730
 
  CACHE_FIELD *copy,*end_field;
6731
 
 
6732
 
  last_record= tab->cache.record_nr++ == tab->cache.ptr_record;
6733
 
  pos= tab->cache.pos;
6734
 
  for (copy= tab->cache.field, end_field= copy+tab->cache.fields;
6735
 
       copy < end_field;
6736
 
       copy++)
6737
 
  {
6738
 
    if (copy->blob_field)
6739
 
    {
6740
 
      if (last_record)
6741
 
      {
6742
 
        copy->blob_field->set_image(pos, copy->length+sizeof(char*),
6743
 
                  copy->blob_field->charset());
6744
 
        pos+=copy->length+sizeof(char*);
6745
 
      }
6746
 
      else
6747
 
      {
6748
 
        copy->blob_field->set_ptr(pos, pos+copy->length);
6749
 
        pos+=copy->length+copy->blob_field->get_length();
6750
 
      }
6751
 
    }
6752
 
    else
6753
 
    {
6754
 
      if (copy->strip)
6755
 
      {
6756
 
        length= uint2korr(pos);
6757
 
        memcpy(copy->str, pos+2, length);
6758
 
        memset(copy->str+length, ' ', copy->length-length);
6759
 
        pos+= 2 + length;
6760
 
      }
6761
 
      else
6762
 
      {
6763
 
        memcpy(copy->str,pos,copy->length);
6764
 
        pos+=copy->length;
6765
 
      }
6766
 
    }
6767
 
  }
6768
 
  tab->cache.pos=pos;
6769
 
  return;
6770
 
}
6771
 
 
6772
6715
/*
6773
6716
  eq_ref: Create the lookup key and check if it is the same as saved key
6774
6717