-
Notifications
You must be signed in to change notification settings - Fork 20
RandomQueryGeneratorPartitioning
It is possible to generate partitioned tables from a .ZZ file, as follows:
$fields = { types => [ 'int' ], indexes => [undef, 'key'] };
When the tables are generated, the PARTITION BY clause will be wrapped in /*!50100 */ comments. This allows for comparison tests, where one of the servers is a 5.0. The tables will be created without partitions on such a server.
It is possible to compare the result set returned by a query on a partitioned table against the result set returned by a non-partitioned table having the same structure. For example:
perl runall.pl \ --grammar=conf/partitions-ddl.yy \ --basedir1=/path/to/mysql-with-partitions \ --basedir2=/path/to/mysql-without-partitions \ --threads=1
The conf/partitions-ddl.yy grammar contains a wide range of partitioning-related DDL statements, along with operations on the key cache and assigning a particular key cache to a particular partition.
No Validator is available to go along with this grammar (except a possible comparison between two servers), so this test would catch mostly deadlocks and crashes/assertions.
When using partitions-ddl.yy for comparison tests, please note that this grammar includes DROP PARTITION and TRUNCATE PARTITION which have no corresponding query against a non-partition table, and thus will cause the two servers to diverge if one does not support partitions.
A specific test is TBD for testing the accuracy of partition pruning. Such a test would target complex/creative WHERE clauses.