summaryrefslogtreecommitdiff
path: root/myisam/mi_checksum.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-08-05 21:14:15 +0200
committerunknown <serg@serg.mylan>2003-08-05 21:14:15 +0200
commiteb5f968c455276ba2d13e5b44edadef1294d5ab5 (patch)
tree7f824b71d5779659b28c60ef72d0b119daa9ccf9 /myisam/mi_checksum.c
parentecc7001fbfc1b30a1bbd856b7a093045ccdf3c00 (diff)
downloadmariadb-git-eb5f968c455276ba2d13e5b44edadef1294d5ab5.tar.gz
table checksum background:
my_checksum() mysys function NISAM checksum code moved from mysys to isam/ - it's obsolete MyISAM checksum code moved to mysys table's checksum accessible from sql layer SHOW TABLE STATUS shows checksum (WL#646) code cleanup include/my_sys.h: table checksum background: my_checksum() mysys function include/myisam.h: table checksum background: my_checksum() mysys function MyISAM checksum code moved to mysys isam/isamchk.c: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete isam/isamdef.h: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete isam/open.c: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete isam/pack_isam.c: table checksum background: NISAM checksum code moved from mysys to isam/ - it's obsolete myisam/mi_checksum.c: table checksum background: my_checksum() mysys function MyISAM checksum code moved to mysys mysys/checksum.c: table checksum background: my_checksum() mysys function MyISAM checksum code moved to mysys sql/ha_myisam.cc: table checksum background: table's checksum accessible from sql layer sql/ha_myisam.h: table checksum background: table's checksum accessible from sql layer sql/handler.h: table checksum background: table's checksum accessible from sql layer code cleanup sql/sql_lex.h: table checksum background: table's checksum accessible from sql layer code cleanup sql/sql_select.cc: warning removed sql/sql_show.cc: SHOW TABLE STATUS shows checksum (WL#646) sql/sql_yacc.yy: cleanup (DROP TABLES syntax added as a side effect :))
Diffstat (limited to 'myisam/mi_checksum.c')
-rw-r--r--myisam/mi_checksum.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/myisam/mi_checksum.c b/myisam/mi_checksum.c
index a760b03a032..982f77ee81f 100644
--- a/myisam/mi_checksum.c
+++ b/myisam/mi_checksum.c
@@ -28,30 +28,29 @@ ha_checksum mi_checksum(MI_INFO *info, const byte *buf)
{
const byte *pos;
const byte *end;
+ ulong length;
switch (rec->type) {
case FIELD_BLOB:
{
- ulong length=_mi_calc_blob_length(rec->length-
+ length=_mi_calc_blob_length(rec->length-
mi_portable_sizeof_char_ptr,
buf);
memcpy((char*) &pos, buf+rec->length- mi_portable_sizeof_char_ptr,
sizeof(char*));
- end=pos+length;
break;
}
case FIELD_VARCHAR:
{
- uint length;
length=uint2korr(buf);
- pos=buf+2; end=pos+length;
+ pos=buf+2;
break;
}
default:
- pos=buf; end=buf+rec->length;
+ length=rec->length;
+ pos=buf;
break;
}
- for ( ; pos != end ; pos++)
- crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
+ crc=my_checksum(crc, pos, length);
}
return crc;
}
@@ -59,9 +58,5 @@ ha_checksum mi_checksum(MI_INFO *info, const byte *buf)
ha_checksum mi_static_checksum(MI_INFO *info, const byte *pos)
{
- ha_checksum crc;
- const byte *end=pos+info->s->base.reclength;
- for (crc=0; pos != end; pos++)
- crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
- return crc;
+ return my_checksum(0, pos, info->s->base.reclength);
}