~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/myisampack.c

  • Committer: Brian Aker
  • Date: 2008-08-05 04:10:42 UTC
  • mfrom: (261.2.8 codestyle)
  • mto: This revision was merged to the branch mainline in revision 263.
  • Revision ID: brian@tangent.org-20080805041042-1l4893r3bwy2lxz2
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
911
911
            if (element->count == 1)
912
912
            {
913
913
              /* Copy the new column value into 'tree_buff'. */
914
 
              memcpy(count->tree_pos,pos,(size_t) count->field_length);
 
914
              memcpy(count->tree_pos, pos, count->field_length);
915
915
              /* Adjust the key pointer in the tree. */
916
916
              tree_set_pointer(element,count->tree_pos);
917
917
              /* Point behind the last column value so far. */
978
978
        {
979
979
          uint field_length=count->field_length -portable_sizeof_char_ptr;
980
980
          ulong blob_length= _mi_calc_blob_length(field_length, start_pos);
981
 
          memcpy((char*) &pos,  start_pos+field_length,sizeof(char*));
 
981
          memcpy(&pos, start_pos + field_length, sizeof(char*));
982
982
          end_pos=pos+blob_length;
983
983
          tot_blob_length+=blob_length;
984
984
          set_if_bigger(count->max_length,blob_length);
1000
1000
        {
1001
1001
          uint i;
1002
1002
          /* Zero fields are just counted. Go to the next record. */
1003
 
          if (!memcmp((uchar*) start_pos,zero_string,count->field_length))
 
1003
          if (!memcmp(start_pos,zero_string,count->field_length))
1004
1004
          {
1005
1005
            count->zero_fields++;
1006
1006
            continue;
1113
1113
  uint space_fields,fill_zero_fields,field_count[(int) FIELD_enum_val_count];
1114
1114
  my_off_t old_length,new_length,length;
1115
1115
 
1116
 
  memset((uchar*) field_count, 0, sizeof(field_count));
 
1116
  memset(field_count, 0, sizeof(field_count));
1117
1117
  space_fields=fill_zero_fields=0;
1118
1118
 
1119
1119
  for (; trees-- ; huff_counts++)
1796
1796
              i->tree->tree_pack_length+j->tree->tree_pack_length+
1797
1797
              ALLOWED_JOIN_DIFF)
1798
1798
          {
1799
 
            memcpy((uchar*) i->counts,(uchar*) count.counts,
1800
 
                   sizeof(count.counts[0])*256);
 
1799
            memcpy(i->counts, count.counts, sizeof(count.counts[0])*256);
1801
1800
            my_free((uchar*) j->tree->element_buffer,MYF(0));
1802
1801
            j->tree->element_buffer=0;
1803
1802
            j->tree=i->tree;
1804
 
            memcpy((uchar*) i->counts,(uchar*) count.counts,
1805
 
                   sizeof(count.counts[0])*256);
 
1803
            memcpy(i->counts, count.counts, sizeof(count.counts[0])*256);
1806
1804
            if (make_huff_tree(i->tree,i))
1807
1805
              return (uint) -1;
1808
1806
          }
2377
2375
 
2378
2376
        switch (count->field_type) {
2379
2377
        case FIELD_SKIP_ZERO:
2380
 
          if (!memcmp((uchar*) start_pos,zero_string,field_length))
 
2378
          if (!memcmp(start_pos,zero_string,field_length))
2381
2379
          {
2382
2380
            write_bits(1,1);
2383
2381
            start_pos=end_pos;
2476
2474
            write_bits(0,1);
2477
2475
            /* Write the blob length. */
2478
2476
            write_bits(blob_length,count->length_bits);
2479
 
            memcpy(&blob,end_pos-portable_sizeof_char_ptr, sizeof(char*));
 
2477
            memcpy(&blob, end_pos - portable_sizeof_char_ptr, sizeof(char*));
2480
2478
            blob_end=blob+blob_length;
2481
2479
            /* Encode the blob bytes. */
2482
2480
            for ( ; blob < blob_end ; blob++)