From 9ceb237dd6779e58047d112d051ab28b1002eb92 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 5 Oct 2016 17:38:23 +0530 Subject: [PATCH 1/2] Don't append FROM clause for replacing in UNION statements If global statement has atleast one union, it should not have a FROM. Fix #12619 Signed-off-by: Deven Bansod --- tbl_export.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tbl_export.php b/tbl_export.php index 542dfd9c84..740e2249fa 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -67,7 +67,9 @@ if (! empty($sql_query)) { } // Rebuilding the SELECT and FROM clauses. - if (count($parser->statements[0]->from) > 0) { + if (count($parser->statements[0]->from) > 0 + && count($parser->statements[0]->union) === 0 + ) { $replaces = array( array( 'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build( From 0de5f6099f60544bbd3e5d385f2b3e8072f0ccec Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 5 Oct 2016 17:41:54 +0530 Subject: [PATCH 2/2] ChangeLog entry for #12619 Signed-off-by: Deven Bansod --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 5b61529d0c..2e2cd2917d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,7 @@ phpMyAdmin - ChangeLog - issue #12615 Fixed regexp for matching browser versions - issue #12569 Avoid showing import errors twice - issue #12362 prefs_manage.php can leave an orphaned temporary file +- issue #12619 Unable to export csv when using union select 4.6.4 (2016-08-16) - issue [security] Weaknesses with cookie encryption, see PMASA-2016-29