summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <mskold@mysql.com>2005-04-13 16:24:17 +0200
committerunknown <mskold@mysql.com>2005-04-13 16:24:17 +0200
commitf0438d548731b674ba989710da0994ac752c623d (patch)
treea1492386b6bc2738d5f8216a4814cf7d15ec4dad /myisam
parent5630f0731ab020471108c67e7ae962ba6eaef625 (diff)
parentf53284f1933d721e3f2a583c2849d9c1b2e2b740 (diff)
downloadmariadb-git-f0438d548731b674ba989710da0994ac752c623d.tar.gz
Merge
innobase/dict/dict0dict.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/include/dict0dict.h: Auto merged innobase/row/row0mysql.c: Auto merged myisam/mi_check.c: Auto merged myisam/mi_dynrec.c: Auto merged myisam/myisamdef.h: Auto merged mysql-test/r/kill.result: Auto merged mysql-test/t/kill.test: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/main.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged sql/ha_innodb.cc: Auto merged sql/mysqld.cc: Auto merged
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_check.c7
-rw-r--r--myisam/mi_dynrec.c11
-rw-r--r--myisam/myisamdef.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index dd8cc736741..2949b39183d 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -972,7 +972,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
info->checksum=mi_checksum(info,record);
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
{
- if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len))
+ if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len,
+ test(info->s->calc_checksum)))
{
mi_check_print_error(param,"Found wrong packed record at %s",
llstr(start_recpos,llbuff));
@@ -3025,7 +3026,9 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
if ((param->testflag & (T_EXTEND | T_REP)) || searching)
{
if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff,
- sort_param->find_length))
+ sort_param->find_length,
+ (param->testflag & T_QUICK) &&
+ test(info->s->calc_checksum)))
{
mi_check_print_info(param,"Found wrong packed record at %s",
llstr(sort_param->start_recpos,llbuff));
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index 9d8e161b8fe..3a4dafade23 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -816,7 +816,7 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
*/
my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
- ulong packed_length)
+ ulong packed_length, my_bool with_checksum)
{
uint length,new_length,flag,bit,i;
char *pos,*end,*packpos,*to;
@@ -920,13 +920,10 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
(bit != 1 && (flag & ~(bit - 1))))
goto err;
- if (info->s->calc_checksum)
+ if (with_checksum && ((uchar) info->checksum != (uchar) *to))
{
- if ((uchar) info->checksum != (uchar) *to)
- {
- DBUG_PRINT("error",("wrong checksum for row"));
- goto err;
- }
+ DBUG_PRINT("error",("wrong checksum for row"));
+ goto err;
}
DBUG_RETURN(0);
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index b66d7e71a05..a2d3dedf6df 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -584,7 +584,7 @@ extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**);
extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from,
ulong reclength);
extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos,
- ulong reclength);
+ ulong packed_length, my_bool with_checkum);
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
my_off_t next_filepos,byte **record,
ulong *reclength,int *flag);