From 8b4513e16a65f2d068fe7cd3b2a36e521ca37485 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 Sep 2004 17:47:40 +0000 Subject: [PATCH] bug #1030644 importing when last table exported was empty --- ChangeLog | 6 +++++- libraries/read_dump.lib.php | 4 +++- read_dump.php | 11 +++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f79e58567..3f1c59770 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-09-20 Marc Delisle + * read_dump.php, libraries/read_dump.lib.php: bug #1030644, + error importing when last table exported was empty + 2004-09-20 Michal Čihař - * Documentation.html: Add info about theme generations. + * Documentation.html: Add info about theme generations. 2004-09-19 Alexander M. Turek * Documentation.html: Clarification. diff --git a/libraries/read_dump.lib.php b/libraries/read_dump.lib.php index f5a425530..f8a97ea1f 100644 --- a/libraries/read_dump.lib.php +++ b/libraries/read_dump.lib.php @@ -18,7 +18,9 @@ */ function PMA_splitSqlFile(&$ret, $sql, $release) { - $sql = trim($sql); + // do not trim, see bug #1030644 + //$sql = trim($sql); + $sql = rtrim($sql, "\n\r"); $sql_len = strlen($sql); $char = ''; $string_start = ''; diff --git a/read_dump.php b/read_dump.php index a1bd251f8..5883bfa17 100644 --- a/read_dump.php +++ b/read_dump.php @@ -130,13 +130,16 @@ if ($sql_file != 'none') { // Kanji convert SQL textfile 2002/1/4 by Y.Kawada if (@function_exists('PMA_kanji_str_conv')) { - $sql_tmp = trim($sql_query); + // do not trim here: see bug #1030644 + //$sql_tmp = trim($sql_query); + $sql_tmp = $sql_query; PMA_change_enc_order(); $sql_query = PMA_kanji_str_conv($sql_tmp, $knjenc, isset($xkana) ? $xkana : ''); PMA_change_enc_order(); -} else { - $sql_query = trim($sql_query); -} +} //else { + // do not trim here: see bug #1030644 + //$sql_query = trim($sql_query); +//} // $sql_query come from the query textarea, if it's a reposted query gets its // 'true' value