Optimized a bit and started to work on feature #444767 (Other cases for display=simple)
This commit is contained in:
10
sql.php3
10
sql.php3
@@ -116,10 +116,12 @@ else {
|
||||
if (isset($sessionMaxRows)) {
|
||||
$cfgMaxRows = $sessionMaxRows;
|
||||
}
|
||||
$sql_limit_to_append = (isset($pos) && $is_select && !eregi(' LIMIT[ 0-9,]+$', $sql_query))
|
||||
$sql_limit_to_append = (isset($pos)
|
||||
&& ($is_select && !eregi('^SELECT COUNT\((.*\.+)?\*\) FROM ', $sql_query))
|
||||
&& !eregi(' LIMIT[ 0-9,]+$', $sql_query))
|
||||
? " LIMIT $pos, $cfgMaxRows"
|
||||
: '';
|
||||
if (eregi('(.*)( PROCEDURE (.*)| FOR UPDATE| LOCK IN SHARE MODE)', $sql_query, $regs)) {
|
||||
if (eregi('(.*)( PROCEDURE (.*)| FOR UPDATE| LOCK IN SHARE MODE)$', $sql_query, $regs)) {
|
||||
$full_sql_query = $regs[1] . $sql_limit_to_append . $regs[2];
|
||||
} else {
|
||||
$full_sql_query = $sql_query . $sql_limit_to_append;
|
||||
@@ -199,6 +201,10 @@ else {
|
||||
$display = 'bkmOnly';
|
||||
}
|
||||
}
|
||||
if ($display != 'simple'
|
||||
&& (isset($SelectNumRows) && $SelectNumRows <= $cfgMaxRows)) {
|
||||
$display = 'simple';
|
||||
}
|
||||
|
||||
// Displays the results in a table
|
||||
display_table($result, ($display == 'simple' || $display == 'bkmOnly'));
|
||||
|
Reference in New Issue
Block a user