~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_hash.cc

  • Committer: Brian Aker
  • Date: 2009-10-07 16:29:08 UTC
  • mfrom: (1161.1.7 fix-key_type)
  • Revision ID: brian@gaz-20091007162908-dkbo2z385i7kiyvn
Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
711
711
      unsigned char *pos= (unsigned char*) rec + seg->start;
712
712
 
713
713
#ifdef HAVE_ISNAN
714
 
      if (seg->type == HA_KEYTYPE_FLOAT)
715
 
      {
716
 
        float nr;
717
 
        float4get(nr, pos);
718
 
        if (isnan(nr))
719
 
        {
720
 
          /* Replace NAN with zero */
721
 
          memset(key, 0, length);
722
 
          key+= length;
723
 
          continue;
724
 
        }
725
 
      }
726
 
      else if (seg->type == HA_KEYTYPE_DOUBLE)
 
714
      if (seg->type == HA_KEYTYPE_DOUBLE)
727
715
      {
728
716
        double nr;
729
717
        float8get(nr, pos);
925
913
  const unsigned char *key=  (unsigned char*) record + keyseg->start;
926
914
 
927
915
  switch (info->s->auto_key_type) {
928
 
  case HA_KEYTYPE_INT8:
929
 
    s_value= (int64_t) *(char*)key;
930
 
    break;
931
916
  case HA_KEYTYPE_BINARY:
932
917
    value=(uint64_t)  *(unsigned char*) key;
933
918
    break;
934
 
  case HA_KEYTYPE_SHORT_INT:
935
 
    s_value= (int64_t) sint2korr(key);
936
 
    break;
937
 
  case HA_KEYTYPE_USHORT_INT:
938
 
    value=(uint64_t) uint2korr(key);
939
 
    break;
940
919
  case HA_KEYTYPE_LONG_INT:
941
920
    s_value= (int64_t) sint4korr(key);
942
921
    break;
943
922
  case HA_KEYTYPE_ULONG_INT:
944
923
    value=(uint64_t) uint4korr(key);
945
924
    break;
946
 
  case HA_KEYTYPE_INT24:
947
 
    s_value= (int64_t) sint3korr(key);
948
 
    break;
949
925
  case HA_KEYTYPE_UINT24:
950
926
    value=(uint64_t) uint3korr(key);
951
927
    break;
952
 
  case HA_KEYTYPE_FLOAT:                        /* This shouldn't be used */
953
 
  {
954
 
    float f_1;
955
 
    float4get(f_1,key);
956
 
    /* Ignore negative values */
957
 
    value = (f_1 < (float) 0.0) ? 0 : (uint64_t) f_1;
958
 
    break;
959
 
  }
960
928
  case HA_KEYTYPE_DOUBLE:                       /* This shouldn't be used */
961
929
  {
962
930
    double f_1;