The branch, master has been updated
via 6adfdb3b440b9757d97f3d3c3ef49777656ba347 (commit)
from 0ac18e564a78f4de9262473e26f5672ae1bcb19f (commit)
- Log -----------------------------------------------------------------
commit 6adfdb3b440b9757d97f3d3c3ef49777656ba347
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sun Mar 27 12:40:55 2011 +0100
Feature Request #3163355 - Skip dumping data comment if table is empty.
-----------------------------------------------------------------------
Summary of changes:
libraries/export/sql.php | 26 ++++++++++----------------
1 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/libraries/export/sql.php b/libraries/export/sql.php
index 778662c..acfdf11 100644
--- a/libraries/export/sql.php
+++ b/libraries/export/sql.php
@@ -953,15 +953,6 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
}
// it's not a VIEW
- $head = PMA_possibleCRLF()
- . PMA_exportComment()
- . PMA_exportComment(__('Dumping data for table') . ' ' .
$formatted_table_name)
- . PMA_exportComment();
-
- if (! PMA_exportOutputHandler($head)) {
- return FALSE;
- }
-
$buffer = '';
// analyze the query to get the true column names, not the aliases
@@ -977,13 +968,6 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
}
if ($result != FALSE) {
- // emit a single CRLF before the first data statement (produces
- // an unintended CRLF when there is no data, but I don't see how it
- // can be avoided, as we are in UNBUFFERED mode)
- if (! PMA_exportOutputHandler($crlf)) {
- return FALSE;
- }
-
$fields_cnt = PMA_DBI_num_fields($result);
// Get field information
@@ -1053,6 +1037,16 @@ function PMA_exportData($db, $table, $crlf, $error_url,
$sql_query)
}
while ($row = PMA_DBI_fetch_row($result)) {
+ if ($current_row == 0) {
+ $head = PMA_possibleCRLF()
+ . PMA_exportComment()
+ . PMA_exportComment(__('Dumping data for table') . '
' . $formatted_table_name)
+ . PMA_exportComment()
+ . $crlf;
+ if (! PMA_exportOutputHandler($head)) {
+ return FALSE;
+ }
+ }
$current_row++;
for ($j = 0; $j < $fields_cnt; $j++) {
// NULL
hooks/post-receive
--
phpMyAdmin