mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
54
html/phpmyad/libraries/Partition.class.php
Normal file
54
html/phpmyad/libraries/Partition.class.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Library for extracting information about the partitions
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* base Partition Class
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class PMA_Partition
|
||||
{
|
||||
/**
|
||||
* returns array of partition names for a specific db/table
|
||||
*
|
||||
* @access public
|
||||
* @return array of partition names
|
||||
*/
|
||||
static public function getPartitionNames($db, $table)
|
||||
{
|
||||
if (PMA_Partition::havePartitioning()) {
|
||||
return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'");
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* checks if MySQL server supports partitioning
|
||||
*
|
||||
* @static
|
||||
* @staticvar boolean $have_partitioning
|
||||
* @staticvar boolean $already_checked
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
static public function havePartitioning()
|
||||
{
|
||||
static $have_partitioning = false;
|
||||
static $already_checked = false;
|
||||
|
||||
if (! $already_checked) {
|
||||
$have_partitioning = PMA_MYSQL_INT_VERSION >= 50100 && PMA_DBI_fetch_value("SHOW VARIABLES LIKE 'have_partitioning';");
|
||||
$already_checked = true;
|
||||
}
|
||||
return $have_partitioning;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user