mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 23:25:34 +02:00
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 :))
This commit is contained in:
parent
ecc7001fbf
commit
eb5f968c45
15 changed files with 118 additions and 84 deletions
|
|
@ -1328,7 +1328,7 @@ int extend;
|
|||
print_error("Found wrong record at %lu",(ulong) start_recpos);
|
||||
got_error=1;
|
||||
}
|
||||
crc^=checksum(record,info->s->base.reclength);
|
||||
crc^=_nisam_checksum(record,info->s->base.reclength);
|
||||
link_used+=info->s->pack.ref_length;
|
||||
used+=block_info.rec_len+info->s->pack.ref_length;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -358,6 +358,7 @@ extern int _nisam_read_pack_record(N_INFO *info,ulong filepos,byte *buf);
|
|||
extern int _nisam_read_rnd_pack_record(N_INFO*, byte *,ulong, int);
|
||||
extern int _nisam_pack_rec_unpack(N_INFO *info,byte *to,byte *from,
|
||||
uint reclength);
|
||||
extern ulong _nisam_checksum(const byte *mem, uint count);
|
||||
|
||||
typedef struct st_sortinfo {
|
||||
uint key_length;
|
||||
|
|
|
|||
19
isam/open.c
19
isam/open.c
|
|
@ -453,3 +453,22 @@ static void setup_key_functions(register N_KEYDEF *keyinfo)
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
Calculate a long checksum for a memoryblock. Used to verify pack_isam
|
||||
|
||||
SYNOPSIS
|
||||
checksum()
|
||||
mem Pointer to memory block
|
||||
count Count of bytes
|
||||
*/
|
||||
|
||||
ulong _nisam_checksum(const byte *mem, uint count)
|
||||
{
|
||||
ulong crc;
|
||||
for (crc= 0; count-- ; mem++)
|
||||
crc= ((crc << 1) + *((uchar*) mem)) +
|
||||
test(crc & ((ulong) 1L << (8*sizeof(ulong)-1)));
|
||||
return crc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -738,7 +738,7 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
|
|||
{
|
||||
if (! error)
|
||||
{
|
||||
crc^=checksum(record,reclength);
|
||||
crc^=_nisam_checksum(record,reclength);
|
||||
for (pos=record,count=huff_counts ;
|
||||
count < end_count ;
|
||||
count++,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue