~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_packrec.c

MergedĀ fromĀ Mats.

Show diffs side-by-side

added added

removed removed

Lines of Context:
793
793
                            uchar *end)
794
794
{
795
795
  if (get_bit(bit_buff))
796
 
    bfill((uchar*) to,(end-to),' ');
 
796
    memset((uchar*) to, ' ', (end-to));
797
797
  else
798
798
    decode_bytes(rec,bit_buff,to,end);
799
799
}
803
803
{
804
804
  uint spaces;
805
805
  if (get_bit(bit_buff))
806
 
    bfill((uchar*) to,(end-to),' ');
 
806
    memset((uchar*) to, ' ', (end-to));
807
807
  else
808
808
  {
809
809
    if (get_bit(bit_buff))
815
815
      }
816
816
      if (to+spaces != end)
817
817
        decode_bytes(rec,bit_buff,to,end-spaces);
818
 
      bfill((uchar*) end-spaces,spaces,' ');
 
818
      memset((uchar*) end-spaces, ' ', spaces);
819
819
    }
820
820
    else
821
821
      decode_bytes(rec,bit_buff,to,end);
835
835
    }
836
836
    if (to+spaces != end)
837
837
      decode_bytes(rec,bit_buff,to,end-spaces);
838
 
    bfill((uchar*) end-spaces,spaces,' ');
 
838
    memset((uchar*) end-spaces, ' ', spaces);
839
839
  }
840
840
  else
841
841
    decode_bytes(rec,bit_buff,to,end);
846
846
{
847
847
  uint spaces;
848
848
  if (get_bit(bit_buff))
849
 
    bfill((uchar*) to,(end-to),' ');
 
849
    memset((uchar*) to, ' ', (end-to));
850
850
  else
851
851
  {
852
852
    if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
856
856
    }
857
857
    if (to+spaces != end)
858
858
      decode_bytes(rec,bit_buff,to,end-spaces);
859
 
    bfill((uchar*) end-spaces,spaces,' ');
 
859
    memset((uchar*) end-spaces, ' ', spaces);
860
860
  }
861
861
}
862
862
 
871
871
  }
872
872
  if (to+spaces != end)
873
873
    decode_bytes(rec,bit_buff,to,end-spaces);
874
 
  bfill((uchar*) end-spaces,spaces,' ');
 
874
  memset((uchar*) end-spaces, ' ', spaces);
875
875
}
876
876
 
877
877
static void uf_space_prespace_selected(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
879
879
{
880
880
  uint spaces;
881
881
  if (get_bit(bit_buff))
882
 
    bfill((uchar*) to,(end-to),' ');
 
882
    memset((uchar*) to, ' ', (end-to));
883
883
  else
884
884
  {
885
885
    if (get_bit(bit_buff))
889
889
        bit_buff->error=1;
890
890
        return;
891
891
      }
892
 
      bfill((uchar*) to,spaces,' ');
 
892
      memset((uchar*) to, ' ', spaces);
893
893
      if (to+spaces != end)
894
894
        decode_bytes(rec,bit_buff,to+spaces,end);
895
895
    }
910
910
      bit_buff->error=1;
911
911
      return;
912
912
    }
913
 
    bfill((uchar*) to,spaces,' ');
 
913
    memset((uchar*) to, ' ', spaces);
914
914
    if (to+spaces != end)
915
915
      decode_bytes(rec,bit_buff,to+spaces,end);
916
916
  }
924
924
{
925
925
  uint spaces;
926
926
  if (get_bit(bit_buff))
927
 
    bfill((uchar*) to,(end-to),' ');
 
927
    memset((uchar*) to, ' ', (end-to));
928
928
  else
929
929
  {
930
930
    if ((spaces=get_bits(bit_buff,rec->space_length_bits))+to > end)
932
932
      bit_buff->error=1;
933
933
      return;
934
934
    }
935
 
    bfill((uchar*) to,spaces,' ');
 
935
    memset((uchar*) to, ' ', spaces);
936
936
    if (to+spaces != end)
937
937
      decode_bytes(rec,bit_buff,to+spaces,end);
938
938
  }
947
947
    bit_buff->error=1;
948
948
    return;
949
949
  }
950
 
  bfill((uchar*) to,spaces,' ');
 
950
  memset((uchar*) to, ' ', spaces);
951
951
  if (to+spaces != end)
952
952
    decode_bytes(rec,bit_buff,to+spaces,end);
953
953
}
1003
1003
    }
1004
1004
    decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
1005
1005
    _my_store_blob_length((uchar*) to,pack_length,length);
1006
 
    memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos,
1007
 
                 sizeof(char*));
 
1006
    memcpy((char*) to+pack_length,(char*) &bit_buff->blob_pos,
 
1007
           sizeof(char*));
1008
1008
    bit_buff->blob_pos+=length;
1009
1009
  }
1010
1010
}