From d11d5cfca87f25cad0f5b0af90616afe9290dece Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 7 Jul 2008 22:42:19 +0200 Subject: Bug#35745: SELECT COUNT(*) is not correct for some partitioned tables. problem was that ha_partition::records was not implemented, thus using the default handler::records, which is not correct if the engine does not support HA_STATS_RECORDS_IS_EXACT. Solution was to implement ha_partition::records as a wrapper around the underlying partitions records. The rows column in explain partitions will now include the total number of records in the partitioned table. (recommit after removing out-commented code) --- sql/ha_partition.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/ha_partition.h') diff --git a/sql/ha_partition.h b/sql/ha_partition.h index ac00581fae0..2ec700978bc 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -531,6 +531,7 @@ public: underlying handlers must have the same implementation for it to work. */ virtual uint8 table_cache_type(); + virtual ha_rows records(); /* ------------------------------------------------------------------------- -- cgit v1.2.1