summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-05-02 13:09:27 +0200
committerSergei Golubchik <serg@mariadb.org>2019-05-07 18:40:36 +0200
commitffb83ba65026e2af547b44601c4894437e4f031c (patch)
tree02c7c81c6ffb615514048b8613e067668d0cac27 /sql/ha_partition.cc
parent651a43e0a0361098c35164a128ca588a2989d8e1 (diff)
downloadmariadb-git-ffb83ba65026e2af547b44601c4894437e4f031c.tar.gz
cleanup: move checksum code to handler class
make live checksum to be returned in handler::info(), and slow table-scan checksum to be calculated in handler::checksum(). part of MDEV-16249 CHECKSUM TABLE for a spider table is not parallel and saves all data in memory in the spider head by default
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc30
1 files changed, 4 insertions, 26 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 98a3259a39b..6371c330170 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -8202,8 +8202,9 @@ int ha_partition::info(uint flag)
stats.deleted= 0;
stats.data_file_length= 0;
stats.index_file_length= 0;
- stats.check_time= 0;
stats.delete_length= 0;
+ stats.check_time= 0;
+ stats.checksum= 0;
for (i= bitmap_get_first_set(&m_part_info->read_partitions);
i < m_tot_parts;
i= bitmap_get_next_set(&m_part_info->read_partitions, i))
@@ -8217,6 +8218,7 @@ int ha_partition::info(uint flag)
stats.delete_length+= file->stats.delete_length;
if (file->stats.check_time > stats.check_time)
stats.check_time= file->stats.check_time;
+ stats.checksum+= file->stats.checksum;
}
if (stats.records && stats.records < 2 &&
!(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT))
@@ -8372,10 +8374,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info,
stat_info->create_time= file->stats.create_time;
stat_info->update_time= file->stats.update_time;
stat_info->check_time= file->stats.check_time;
- stat_info->check_sum= 0;
- if (file->ha_table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM))
- stat_info->check_sum= file->checksum();
- return;
+ stat_info->check_sum= file->stats.checksum;
}
@@ -10563,27 +10562,6 @@ void ha_partition::init_table_handle_for_HANDLER()
}
-/**
- Return the checksum of the table (all partitions)
-*/
-
-uint ha_partition::checksum() const
-{
- ha_checksum sum= 0;
-
- DBUG_ENTER("ha_partition::checksum");
- if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM)))
- {
- handler **file= m_file;
- do
- {
- sum+= (*file)->checksum();
- } while (*(++file));
- }
- DBUG_RETURN(sum);
-}
-
-
/****************************************************************************
MODULE enable/disable indexes
****************************************************************************/