Optimized a bit and started to work on feature #444767 (Other cases for display=simple)

This commit is contained in:
Loïc Chapeaux
2001-08-20 14:22:06 +00:00
parent 7b5e0de828
commit 75e7497367
3 changed files with 22 additions and 10 deletions

View File

@@ -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'));