diff options
author | Deven Bansod <devenbansod.bits@gmail.com> | 2016-10-05 15:08:23 +0300 |
---|---|---|
committer | Deven Bansod <devenbansod.bits@gmail.com> | 2016-10-05 15:08:23 +0300 |
commit | 9ceb237dd6779e58047d112d051ab28b1002eb92 (patch) | |
tree | 5348d44f046c9a8adaf54fc7d5306912f453b623 /tbl_export.php | |
parent | 7d2760cec55410762ef6689a4aa314492b305fed (diff) |
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 <devenbansod.bits@gmail.com>
Diffstat (limited to 'tbl_export.php')
-rw-r--r-- | tbl_export.php | 4 |
1 files changed, 3 insertions, 1 deletions
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( |