From 3368571ee877deebc967016799c68e4ac7b06936 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 20 Jan 2006 12:24:16 +0000 Subject: [PATCH] bug #1410078, error exporting query ending with semicolon --- ChangeLog | 3 +++ export.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index b02558053..e86efb3fe 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2006-01-20 Marc Delisle + * export.php: bug #1410078, error exporting query ending with semicolon + 2006-01-19 Marc Delisle * main.php: already defined constant * libraries/display_create_table.lib.php: bug #1376314, I remove diff --git a/export.php b/export.php index a9d03fc5c..cebe6b4dd 100644 --- a/export.php +++ b/export.php @@ -492,6 +492,11 @@ if ($export_type == 'server') { } if (!empty($sql_query)) { + // only preg_replace if needed + if (!empty($add_query)) { + // remove trailing semicolon before adding a LIMIT + $sql_query = preg_replace('%;\s*$%', '', $sql_query); + } $local_query = $sql_query . $add_query; PMA_DBI_select_db($db); } else {