Translation update done using Pootle.
[phpmyadmin/crack.git] / libraries / Partition.class.php
blobc2b14a4e39bcd6912948f40cf28974a4be8d1cfc
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Library for extracting information about the partitions
6 * @package phpMyAdmin
7 */
10 /**
11 * base Partition Class
12 * @package phpMyAdmin
14 class PMA_Partition
16 /**
17 * returns array of partition names for a specific db/table
19 * @access public
20 * @uses PMA_DBI_fetch_result()
21 * @return array of partition names
23 static public function getPartitionNames($db, $table)
25 if (PMA_Partition::havePartitioning()) {
26 return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'");
27 } else {
28 return array();
32 /**
33 * checks if MySQL server supports partitioning
35 * @static
36 * @staticvar boolean $have_partitioning
37 * @staticvar boolean $already_checked
38 * @access public
39 * @uses PMA_DBI_fetch_result()
40 * @return boolean
42 static public function havePartitioning()
44 static $have_partitioning = false;
45 static $already_checked = false;
47 if (! $already_checked) {
48 $have_partitioning = PMA_MYSQL_INT_VERSION >= 50100 && PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'have_partitioning';");
49 $already_checked = true;
51 return $have_partitioning;