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+
I am not 100% sure, but 5.1 documentation says:


  PARTITION_DESCRIPTION: This column is used for RANGE and LIST
  partitions. For a RANGE partition, it contains the value set in the
  partition's VALUES LESS THAN clause, which can be either an integer or
  MAXVALUE. For a LIST partition, this column contains the values
  defined in the partition's VALUES IN clause, which is a
  comma-separated list of integer values.
  
  For partitions whose PARTITION_METHOD is other than RANGE or LIST,
  this column is always NULL.


In my 5.6 installation I can get:

mysql&gt; SELECT PARTITION_NAME, PARTITION_DESCRIPTION FROM information_schema.partitions WHERE table_schema = database() AND table_name = 'foo';
+----------------+-----------------------+
| PARTITION_NAME | PARTITION_DESCRIPTION |
+----------------+-----------------------+
| p0             | 1                     |
| p1             | MAXVALUE              |
+----------------+-----------------------+
2 rows in set (0.00 sec)


Please note than your original ALTER TABLE syntax had a problem, and it should be written as:

mysql&gt; ALTER TABLE foo PARTITION BY RANGE (is_archive) (
         PARTITION p0 VALUES LESS THAN (1),
         PARTITION p1 VALUES LESS THAN (MAXVALUE)
       );
Query OK, 0 rows affected (0.12 sec)
Records: 0  Duplicates: 0  Warnings: 0