mardi 24 février 2015

mysql RANGE partitioning - how do I find partition boundaries?


I am implementing partitioning support for mysql in eludia engine


I need to compare partitioning description in model with actual database contents and alter table, if necessary. To extract all partition info about table I use information_schema.partitions



ALTER TABLE foo PARTITION BY RANGE (is_archive)
(
PARTITION p0 VALUES LESS THAN 1,
PARTITION p1 VALUES LESS THAN MAXVALUE
);
SELECT * FROM information_schema.partitions WHERE table_schema = database() AND table_name = 'foo';


I've inspected information_schema.partitions, it has partition_method, partition_expression but not ranges (LESS THAN 1, LESS THAN MAXVALUE parts)


I know I can extract this from SHOW CREATE TABLE. It is hard way:(


How should I programmatically retrieve partition boundaries in mysql?


Enviroment: mysql 5.1+





Aucun commentaire:

Enregistrer un commentaire