1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#12296 - CHECKSUM TABLE reports 0 for the table

Skipping deleted records instead of breaking the loop
during checksum calculation.
This commit is contained in:
ingo@mysql.com
2005-08-29 17:08:41 +02:00
parent 32e3238da7
commit 330eb04536
3 changed files with 37 additions and 1 deletions

View File

@ -3745,9 +3745,16 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
protocol->store_null();
else
{
while (!t->file->rnd_next(t->record[0]))
for (;;)
{
ha_checksum row_crc= 0;
int error= t->file->rnd_next(t->record[0]);
if (unlikely(error))
{
if (error == HA_ERR_RECORD_DELETED)
continue;
break;
}
if (t->record[0] != (byte*) t->field[0]->ptr)
row_crc= my_checksum(row_crc, t->record[0],
((byte*) t->field[0]->ptr) - t->record[0]);