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>
This commit is contained in:
parent
7d2760cec5
commit
9ceb237dd6
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user