From 72132b2e747f380971eac9c39ef796736b727af5 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 26 Jan 2022 17:03:35 +0900 Subject: [PATCH] Fix #1864 support table alias if provided in all types of queries --- common/framework/db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/framework/db.php b/common/framework/db.php index 25a31e9c6..f42d862c7 100644 --- a/common/framework/db.php +++ b/common/framework/db.php @@ -1046,7 +1046,7 @@ class DB } else { - return sprintf('`%s%s`', $this->_prefix, $m[1]); + return isset($m[2]) ? sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[2]) : sprintf('`%s%s`', $this->_prefix, $m[1]); } }, trim($str)); }, explode(',', $m[2]));