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:
@ -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]);
|
||||
|
Reference in New Issue
Block a user