No need to grab all results to memory.

This commit is contained in:
Michal Čihař
2006-05-30 09:26:52 +00:00
parent 942357ec92
commit 51bc0252fa
3 changed files with 9 additions and 7 deletions

View File

@@ -11,6 +11,8 @@ $Source$
* libraries/plugin_interface.lib.php: Show that plugin has no option if it * libraries/plugin_interface.lib.php: Show that plugin has no option if it
has only hidden inputs. has only hidden inputs.
* sql.php: Do not compare db if not defined. * sql.php: Do not compare db if not defined.
* server_binlog.php, server_processlist.php: No need to grab all results
to memory.
2006-05-29 Michal Čihař <michal@cihar.com> 2006-05-29 Michal Čihař <michal@cihar.com>
* lang/galician: Update, thanks to Xosé Calvo - xosecalvo. * lang/galician: Update, thanks to Xosé Calvo - xosecalvo.

View File

@@ -55,9 +55,9 @@ if (!empty($log)) {
} }
/** /**
* Sends the query and buffers the result * Sends the query
*/ */
$serverProcesses = PMA_DBI_fetch_result($sql_query); $result = PMA_DBI_query($sql_query);
PMA_showMessage($GLOBALS['strSuccess']); PMA_showMessage($GLOBALS['strSuccess']);
@@ -85,7 +85,7 @@ PMA_showMessage($GLOBALS['strSuccess']);
</tr> </tr>
<?php <?php
$odd_row = true; $odd_row = true;
foreach ($serverProcesses as $value) { while($value = PMA_DBI_fetch_assoc($result)) {
if (empty($full) && PMA_strlen($value['Info']) > $GLOBALS['cfg']['LimitChars']) { if (empty($full) && PMA_strlen($value['Info']) > $GLOBALS['cfg']['LimitChars']) {
$value['Info'] = PMA_substr($value['Info'], 0, $GLOBALS['cfg']['LimitChars']) . '...'; $value['Info'] = PMA_substr($value['Info'], 0, $GLOBALS['cfg']['LimitChars']) . '...';
} }

View File

@@ -38,10 +38,10 @@ echo '<h2>' . "\n"
/** /**
* Sends the query and buffers the result * Sends the query
*/ */
$sql_query = 'SHOW' . ( empty( $full ) ? '' : ' FULL' ) . ' PROCESSLIST'; $sql_query = 'SHOW' . ( empty( $full ) ? '' : ' FULL' ) . ' PROCESSLIST';
$serverProcesses = PMA_DBI_fetch_result( $sql_query ); $result = PMA_DBI_query($sql_query);
PMA_showMessage( $GLOBALS['strSuccess'] ); PMA_showMessage( $GLOBALS['strSuccess'] );
@@ -70,7 +70,7 @@ PMA_showMessage( $GLOBALS['strSuccess'] );
<tbody> <tbody>
<?php <?php
$odd_row = true; $odd_row = true;
foreach ( $serverProcesses AS $process ) { while($process = PMA_DBI_fetch_assoc($result)) {
?> ?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>"> <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<td><a href="./server_processlist.php?<?php echo $url_query . '&amp;kill=' . $process['Id']; ?>"><?php echo $strKill; ?></a></td> <td><a href="./server_processlist.php?<?php echo $url_query . '&amp;kill=' . $process['Id']; ?>"><?php echo $strKill; ?></a></td>