diff options
author | Deven Bansod <devenbansod.bits@gmail.com> | 2016-09-28 16:53:12 +0300 |
---|---|---|
committer | Deven Bansod <devenbansod.bits@gmail.com> | 2016-09-28 16:57:35 +0300 |
commit | 59cd9bf3a1b6cf292e4d3700301d7d0328977e8d (patch) | |
tree | 8d37e0c09d247ad4b70d254a745da42903ba480a /tbl_export.php | |
parent | a1c27b957c319efcdd341134d2c63ad00f11f5e8 (diff) |
Replace FROM clause aliases only if FROM clause is present
Fix #12579
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
Diffstat (limited to 'tbl_export.php')
-rw-r--r-- | tbl_export.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tbl_export.php b/tbl_export.php index 8c703f0197..542dfd9c84 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -67,13 +67,15 @@ if (! empty($sql_query)) { } // Rebuilding the SELECT and FROM clauses. - $replaces = array( - array( - 'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build( - $parser->statements[0]->from + if (count($parser->statements[0]->from) > 0) { + $replaces = array( + array( + 'FROM', 'FROM ' . SqlParser\Components\ExpressionArray::build( + $parser->statements[0]->from + ), ), - ), - ); + ); + } // Checking if the WHERE clause has to be replaced. if ((!empty($where_clause)) && (is_array($where_clause))) { |