1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#12296 - CHECKSUM TABLE reports 0 for the table

Skipping deleted records instead of breaking the loop
during checksum calculation.


mysql-test/r/myisam.result:
  Bug#12296 - CHECKSUM TABLE reports 0 for the table
  The test result.
mysql-test/t/myisam.test:
  Bug#12296 - CHECKSUM TABLE reports 0 for the table
  The test case.
This commit is contained in:
unknown
2005-08-29 17:08:41 +02:00
parent 6318e449e3
commit ea36375027
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]);