Try to show sorting by indexes only if it makes sense (bug #829594).

This commit is contained in:
Michal Čihař
2003-10-24 14:48:19 +00:00
parent d9a00e613b
commit f76766995a
2 changed files with 80 additions and 74 deletions

View File

@@ -10,6 +10,8 @@ $Source$
* lang/lithuanian: Updated, thanks to Vilius Zigmantas (viliusz).
* lang/serbian: utf-8 translations contained no strings, regenerated.
* lang/other: Added missing strings.
* libraries/display_tbl.lib.php3: Try to show sorting by indexes only if
it makes sense (bug #829594).
2003-10-20 Michal Cihar <nijel@users.sourceforge.net>
* libraries/export/sql.php3: Fix undefined variable for MySQL < 3.23.20

View File

@@ -482,7 +482,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
$unsorted_sql_query = $sql_query;
}
// sorting by indexes
// sorting by indexes, only if it makes sense
if (isset($analyzed_sql) && isset($analyzed_sql[0]) &&
isset($analyzed_sql[0]['querytype']) && $analyzed_sql[0]['querytype'] == 'SELECT' &&
isset($analyzed_sql[0]['table_ref']) && count($analyzed_sql[0]['table_ref']) == 1) {
// grab indexes data:
$local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
@@ -571,6 +574,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
<?php
}
}
}
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {