From a11bf5f2df7daa9266aeb2384c95447b7db1b1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 22 Apr 2004 13:12:32 +0000 Subject: [PATCH] Invalid SQL on empty table export (bug #939918). --- ChangeLog | 4 ++++ libraries/export/sql.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 896968967..28023e0b3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-04-22 Michal Cihar + * libraries/export/sql.php: Invalid SQL on empty table export (bug + #939918). + 2004-04-21 Marc Delisle ### 2.6.0-alpha1 released * (after the release) user_password.php: undefined offset in blowfish.php diff --git a/libraries/export/sql.php b/libraries/export/sql.php index d205f0ae8..2fb6e0567 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -567,7 +567,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) if (!PMA_exportOutputHandler(($current_row == 1 ? '' : $separator . $crlf) . $insert_line)) return FALSE; } // end while - if (!PMA_exportOutputHandler(';' . $crlf)) return FALSE; + if ($current_row > 0) { + if (!PMA_exportOutputHandler(';' . $crlf)) return FALSE; + } } // end if ($result != FALSE) PMA_DBI_free_result($result);