diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index 5da0ac94b22a..811a8e430916 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -2266,24 +2266,23 @@ function PMA_executeQueryAndSendQueryResponse($analyzed_sql_results, include 'libraries/DisplayResults.class.php'; - $displayResultsObject = new PMA_DisplayResults( - $GLOBALS['db'], $GLOBALS['table'], $GLOBALS['goto'], $GLOBALS['sql_query'] - ); - - $displayResultsObject->setConfigParamsForDisplayTable(); - - // assign default full_sql_query - $full_sql_query = $sql_query; - // Handle remembered sorting order, only for single table query // Handling is not required when it's a union query // (the parser never sets the 'union' key to 0) if (PMA_isRememberSortingOrder($analyzed_sql_results) && ! isset($analyzed_sql_results['analyzed_sql'][0]['queryflags']['union']) ) { - PMA_handleSortOrder($db, $table, $analyzed_sql_results, $full_sql_query); + PMA_handleSortOrder($db, $table, $analyzed_sql_results, $sql_query); } + $displayResultsObject = new PMA_DisplayResults( + $GLOBALS['db'], $GLOBALS['table'], $GLOBALS['goto'], $sql_query + ); + $displayResultsObject->setConfigParamsForDisplayTable(); + + // assign default full_sql_query + $full_sql_query = $sql_query; + // Do append a "LIMIT" clause? if (PMA_isAppendLimitClause($analyzed_sql_results)) { list($sql_limit_to_append,