2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Library for extracting information about the partitions
8 if (! defined('PHPMYADMIN')) {
13 * base Partition Class
20 * returns array of partition names for a specific db/table
22 * @param string $db database name
23 * @param string $table table name
26 * @return array of partition names
28 static public function getPartitionNames($db, $table)
30 if (PMA_Partition
::havePartitioning()) {
31 return $GLOBALS['dbi']->fetchResult(
32 "SELECT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`"
33 . " WHERE `TABLE_SCHEMA` = '" . $db
34 . "' AND `TABLE_NAME` = '" . $table . "'"
42 * checks if MySQL server supports partitioning
45 * @staticvar boolean $have_partitioning
46 * @staticvar boolean $already_checked
50 static public function havePartitioning()
52 static $have_partitioning = false;
53 static $already_checked = false;
55 if (! $already_checked) {
56 if (PMA_MYSQL_INT_VERSION
< 50600) {
57 if ($GLOBALS['dbi']->fetchValue(
58 "SHOW VARIABLES LIKE 'have_partitioning';"
60 $have_partitioning = true;
63 // see http://dev.mysql.com/doc/refman/5.6/en/partitioning.html
64 $plugins = $GLOBALS['dbi']->fetchResult("SHOW PLUGINS");
65 foreach ($plugins as $value) {
66 if ($value['Name'] == 'partition') {
67 $have_partitioning = true;
72 $already_checked = true;
74 return $have_partitioning;