~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_checksum.c

  • Committer: Monty Taylor
  • Date: 2008-12-06 22:41:03 UTC
  • mto: (656.1.7 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: monty@inaugust.com-20081206224103-jdouqwt9hb0f01y1
Moved non-working tests into broken suite for easier running of working tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/* Calculate a checksum for a row */
17
17
 
18
 
#include "myisam_priv.h"
19
 
 
20
 
using namespace drizzled;
21
 
 
22
 
internal::ha_checksum mi_checksum(MI_INFO *info, const unsigned char *buf)
 
18
#include "myisamdef.h"
 
19
 
 
20
ha_checksum mi_checksum(MI_INFO *info, const unsigned char *buf)
23
21
{
24
22
  uint32_t i;
25
 
  internal::ha_checksum crc=0;
 
23
  ha_checksum crc=0;
26
24
  MI_COLUMNDEF *rec=info->s->rec;
27
25
 
28
26
  for (i=info->s->base.fields ; i-- ; buf+=(rec++)->length)
40
38
    }
41
39
    case FIELD_VARCHAR:
42
40
    {
43
 
      uint32_t pack_length= ha_varchar_packlength(rec->length-1);
 
41
      uint32_t pack_length= HA_VARCHAR_PACKLENGTH(rec->length-1);
44
42
      if (pack_length == 1)
45
43
        length= (ulong) *(unsigned char*) buf;
46
44
      else
53
51
      pos=buf;
54
52
      break;
55
53
    }
56
 
    crc=internal::my_checksum(crc, pos ? pos : (unsigned char*) "", length);
 
54
    crc=my_checksum(crc, pos ? pos : (unsigned char*) "", length);
57
55
  }
58
56
  return crc;
59
57
}
60
58
 
61
59
 
62
 
internal::ha_checksum mi_static_checksum(MI_INFO *info, const unsigned char *pos)
 
60
ha_checksum mi_static_checksum(MI_INFO *info, const unsigned char *pos)
63
61
{
64
 
  return internal::my_checksum(0, pos, info->s->base.reclength);
 
62
  return my_checksum(0, pos, info->s->base.reclength);
65
63
}