remove todo, after upgrade PHPExcel
[phpmyadmin/arisferyanto.git] / libraries / Partition.class.php
blobcd696338a646bf63a083b63f9a298f9d10564960
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Library for extracting information about the partitions
6 * @version $Id$
7 * @package phpMyAdmin
8 */
11 /**
12 * base Partition Class
13 * @package phpMyAdmin
15 class PMA_Partition
17 /**
18 * returns array of partition names for a specific db/table
20 * @access public
21 * @uses PMA_DBI_fetch_result()
22 * @return array of partition names
24 static public function getPartitionNames($db, $table)
26 if (PMA_Partition::havePartitioning()) {
27 return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'");
28 } else {
29 return array();
33 /**
34 * checks if MySQL server supports partitioning
36 * @static
37 * @staticvar boolean $have_partitioning
38 * @staticvar boolean $already_checked
39 * @access public
40 * @uses PMA_DBI_fetch_result()
41 * @return boolean
43 static public function havePartitioning()
45 static $have_partitioning = false;
46 static $already_checked = false;
48 if (! $already_checked) {
49 $have_partitioning = PMA_MYSQL_INT_VERSION >= 50100 && PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'have_partitioning';");
50 $already_checked = true;
52 return $have_partitioning;