234
234
* Order the table
236
$response->addHTML(PMA_getHtmlForOrderTheTable($columns));
236
$hideOrderTable = false;
237
// `ALTER TABLE ORDER BY` does not make sense for InnoDB tables that contain
238
// a user-defined clustered index (PRIMARY KEY or NOT NULL UNIQUE index).
239
// InnoDB always orders table rows according to such an index if one is present.
240
if ($tbl_storage_engine == 'INNODB') {
241
include_once 'libraries/Index.class.php';
242
$indexes = PMA_Index::getFromTable($GLOBALS['table'], $GLOBALS['db']);
243
foreach ($indexes as $name => $idx) {
244
if ($name == 'PRIMARY') {
245
$hideOrderTable = true;
247
} elseif (! $idx->getNonUnique()) {
249
foreach ($idx->getColumns() as $column) {
250
if ($column->getNull()) {
256
$hideOrderTable = true;
262
if (! $hideOrderTable) {
263
$response->addHTML(PMA_getHtmlForOrderTheTable($columns));