diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_partition.cc | 26 | ||||
-rw-r--r-- | sql/handler.cc | 4 |
2 files changed, 14 insertions, 16 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index e47da94ab20..8a0b9822493 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -10645,22 +10645,20 @@ int ha_partition::calculate_checksum() } } m_pre_calling= FALSE; - if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM))) + + handler **file= m_file; + do { - handler **file= m_file; - do + if ((error= (*file)->calculate_checksum())) { - if ((error= (*file)->calculate_checksum())) - { - DBUG_RETURN(error); - } - if (!(*file)->stats.checksum_null) - { - stats.checksum+= (*file)->stats.checksum; - stats.checksum_null= FALSE; - } - } while (*(++file)); - } + DBUG_RETURN(error); + } + if (!(*file)->stats.checksum_null) + { + stats.checksum+= (*file)->stats.checksum; + stats.checksum_null= FALSE; + } + } while (*(++file)); DBUG_RETURN(0); } diff --git a/sql/handler.cc b/sql/handler.cc index 908d49d861a..dfb5c69e675 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -5054,7 +5054,7 @@ int handler::calculate_checksum() return HA_ERR_ABORTED_BY_USER; ha_checksum row_crc= 0; - error= table->file->ha_rnd_next(table->record[0]); + error= ha_rnd_next(table->record[0]); if (error) break; @@ -5108,7 +5108,7 @@ int handler::calculate_checksum() stats.checksum+= row_crc; } - table->file->ha_rnd_end(); + ha_rnd_end(); return error == HA_ERR_END_OF_FILE ? 0 : error; } |