Feature Request #3163355 - Skip dumping data comment if table is empty.
This commit is contained in:

committed by
Michal Čihař

parent
0ac18e564a
commit
6adfdb3b44
@@ -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
|
||||
|
Reference in New Issue
Block a user