1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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)
This commit is contained in:
Mattias Jonsson
2008-07-07 22:42:19 +02:00
parent 50853ac31a
commit d11d5cfca8
8 changed files with 111 additions and 82 deletions

View File

@ -1131,7 +1131,7 @@ NULL
2
explain partitions select * from t1 where a is null or a < 0 or a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 4 Using where
drop table t1;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20))
ENGINE=MyISAM DEFAULT CHARSET=latin1