BLOB streaming documentation
[phpmyadmin/crack.git] / libraries / Partition.class.php
blobbf6209093b440b28fb34c1af37388c3a560311de
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 */
10 /**
11 * base Partition Class
13 class PMA_Partition
15 /**
16 * returns array of partition names for a specific db/table
18 * @access public
19 * @uses PMA_DBI_fetch_result()
20 * @return array of partition names
22 static public function getPartitionNames($db, $table)
24 if (PMA_Partition::havePartitioning()) {
25 return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'");
26 } else {
27 return array();
31 /**
32 * checks if MySQL server supports partitioning
34 * @static
35 * @staticvar boolean $have_partitioning
36 * @staticvar boolean $already_checked
37 * @access public
38 * @uses PMA_DBI_fetch_result()
39 * @return boolean
41 static public function havePartitioning()
43 static $have_partitioning = false;
44 static $already_checked = false;
46 if (! $already_checked) {
47 $have_partitioning = PMA_MYSQL_INT_VERSION >= 50100 && PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'have_partitioning';");
48 $already_checked = true;
50 return $have_partitioning;