Merge branch 'QA_4_0'

This commit is contained in:
Madhura Jayaratne 2013-09-25 06:46:04 +05:30
commit 511a005281
2 changed files with 25 additions and 1 deletions

View File

@ -52,6 +52,7 @@ phpMyAdmin - ChangeLog
- bug #4098 Default table tab is ignored
- bug #4099 Server/library difference warning: setting is ignored
- bug #4100 table tree group strategy
- bug #4102 ALTER TABLE ORDER BY and InnoDB
4.0.7.0 (2013-09-23)
- bug #3993 Sorting in database overview with statistics doesn't work

View File

@ -236,7 +236,30 @@ $response->addHTML('<div id="boxContainer" data-box-width="300">');
/**
* Order the table
*/
$response->addHTML(PMA_getHtmlForOrderTheTable($columns));
require_once 'libraries/Index.class.php';
$indexes = PMA_Index::getFromTable($GLOBALS['table'], $GLOBALS['db']);
$hasNotNullUniqueIdx = false;
foreach ($indexes as $name => $idx) {
if ($name == 'PRIMARY') {
$hasNotNullUniqueIdx = true;
} elseif (! $idx->getNonUnique()) {
$hasNotNullUniqueIdx = true;
foreach ($idx->getColumns() as $column) {
if ($column->getNull()) {
$hasNotNullUniqueIdx = false;
}
}
}
if ($hasNotNullUniqueIdx) {
break;
}
}
// `ALTER TABLE ORDER BY` does not make sense for InnoDB tables that contain
// a user-defined clustered index (PRIMARY KEY or NOT NULL UNIQUE index).
// InnoDB always orders table rows according to such an index if one is present.
if (! ($tbl_storage_engine == 'INNODB' && $hasNotNullUniqueIdx)) {
$response->addHTML(PMA_getHtmlForOrderTheTable($columns));
}
/**
* Move table