Optimized a bit and started to work on feature #444767 (Other cases for display=simple)
This commit is contained in:
@@ -6,8 +6,8 @@ $Id$
|
||||
$Source$
|
||||
|
||||
2001-08-20 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* config.inc.php3: $cfgProtectBlob is now TRUE by default, to help
|
||||
against the blob data corruption of some browsers
|
||||
* config.inc.php3: $cfgProtectBlob is now TRUE by default, to help against
|
||||
the blob data corruption of some browsers.
|
||||
|
||||
2001-08-20 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* db_details.php3; tbl_properties.php3; tbl_dump.php3; lib.inc.php3;
|
||||
@@ -16,6 +16,8 @@ $Source$
|
||||
choice (because we know Excel does not support <cr> in data). Thanks to
|
||||
Fran<61>ois <outils@altern.org>.
|
||||
- added an extended inserts option for dumps of data.
|
||||
* lib.inc.php3; sql.php3: optimized a bit and started to work on feature
|
||||
#444767 (Other cases for display=simple).
|
||||
|
||||
2001-08-19 Olivier M<>ller <om@omnis.ch>
|
||||
* db_readdump.php3: if file contains mutiple queries, only show this line:
|
||||
|
16
lib.inc.php3
16
lib.inc.php3
@@ -539,12 +539,16 @@ window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
|
||||
echo ' ' . $query_base;
|
||||
// If a 'LIMIT' clause has been programatically added to the query
|
||||
// displays it
|
||||
$is_append_limit = (isset($GLOBALS['pos'])
|
||||
&& eregi('^SELECT', $GLOBALS['sql_query'])
|
||||
&& !eregi('LIMIT[ 0-9,]+$', $GLOBALS['sql_query']));
|
||||
if ($is_append_limit) {
|
||||
echo ' LIMIT ' . $GLOBALS['pos'] . ', ' . $GLOBALS['cfgMaxRows'];
|
||||
if (!empty($GLOBALS['sql_limit_to_append'])) {
|
||||
echo $GLOBALS['sql_limit_to_append'];
|
||||
}
|
||||
// loic1 : this was far to be optimal
|
||||
// $is_append_limit = (isset($GLOBALS['pos'])
|
||||
// && (eregi('^SELECT', $GLOBALS['sql_query']) && !eregi('^SELECT COUNT\((.*\.+)?\*\) FROM ', $GLOBALS['sql_query']))
|
||||
// && !eregi('LIMIT[ 0-9,]+$', $GLOBALS['sql_query']));
|
||||
// if ($is_append_limit) {
|
||||
// echo ' LIMIT ' . $GLOBALS['pos'] . ', ' . $GLOBALS['cfgMaxRows'];
|
||||
// }
|
||||
echo "\n";
|
||||
?>
|
||||
</td>
|
||||
@@ -939,7 +943,7 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
||||
if (!$is_simple) {
|
||||
show_table_navigation($pos_next, $pos_prev, $dt_result);
|
||||
} else {
|
||||
echo '<br /><br /><br /><br />';
|
||||
echo "\n" . '<br /><br />' . "\n";
|
||||
}
|
||||
|
||||
// Displays the results
|
||||
|
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