bug #623185
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2002-10-14 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||||
|
* libraries/display_tbl.lib.php3: Fixed bug #623185 (Ordering by
|
||||||
|
FUNCTION(`field`) fails).
|
||||||
|
|
||||||
2002-10-14 Marc Delisle <lem9@users.sourceforge.net>
|
2002-10-14 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* Documentation.html: clarification about pmadb when you are not
|
* Documentation.html: clarification about pmadb when you are not
|
||||||
the superuser
|
the superuser
|
||||||
|
@@ -586,22 +586,30 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
|||||||
} else {
|
} else {
|
||||||
$sort_tbl = '';
|
$sort_tbl = '';
|
||||||
}
|
}
|
||||||
// 2.1.4 Do define the sorting url
|
// 2.1.4 Check the field name for backquotes.
|
||||||
|
// If it contains some, it's probably a function column
|
||||||
|
// like 'COUNT(`field`)'
|
||||||
|
if (strpos(' ' . $fields_meta[$i]->name, '`') > 0) {
|
||||||
|
$sort_order = ' ORDER BY \'' . $fields_meta[$i]->name . '\' ';
|
||||||
|
} else {
|
||||||
|
$sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ';
|
||||||
|
}
|
||||||
|
// 2.1.5 Do define the sorting url
|
||||||
if (!$is_in_sort) {
|
if (!$is_in_sort) {
|
||||||
// loic1: patch #455484 ("Smart" order)
|
// loic1: patch #455484 ("Smart" order)
|
||||||
$cfg['Order'] = strtoupper($GLOBALS['cfg']['Order']);
|
$cfg['Order'] = strtoupper($GLOBALS['cfg']['Order']);
|
||||||
if ($cfg['Order'] == 'SMART') {
|
if ($cfg['Order'] == 'SMART') {
|
||||||
$cfg['Order'] = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC';
|
$cfg['Order'] = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC';
|
||||||
}
|
}
|
||||||
$sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ' . $cfg['Order'];
|
$sort_order .= $cfg['Order'];
|
||||||
$order_img = '';
|
$order_img = '';
|
||||||
}
|
}
|
||||||
else if (eregi('[[:space:]]ASC$', $sql_order)) {
|
else if (eregi('[[:space:]]ASC$', $sql_order)) {
|
||||||
$sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' DESC';
|
$sort_order .= ' DESC';
|
||||||
$order_img = ' <img src="./images/asc_order.gif" border="0" width="7" height="7" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" />';
|
$order_img = ' <img src="./images/asc_order.gif" border="0" width="7" height="7" alt="'. $GLOBALS['strAscending'] . '" title="'. $GLOBALS['strAscending'] . '" />';
|
||||||
}
|
}
|
||||||
else if (eregi('[[:space:]]DESC$', $sql_order)) {
|
else if (eregi('[[:space:]]DESC$', $sql_order)) {
|
||||||
$sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ASC';
|
$sort_order .= ' ASC';
|
||||||
$order_img = ' <img src="./images/desc_order.gif" border="0" width="7" height="7" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" />';
|
$order_img = ' <img src="./images/desc_order.gif" border="0" width="7" height="7" alt="'. $GLOBALS['strDescending'] . '" title="'. $GLOBALS['strDescending'] . '" />';
|
||||||
}
|
}
|
||||||
if (eregi('(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))', $unsorted_sql_query, $regs3)) {
|
if (eregi('(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))', $unsorted_sql_query, $regs3)) {
|
||||||
|
Reference in New Issue
Block a user