From 32c2f5799baf19455dbd47ae2247a27d2bfdc839 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 5 Dec 2016 16:48:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AD=90=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BD=9C=E4=B8=BA=E8=A1=A8=E5=90=8D=E6=9F=A5=E8=AF=A2=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index a2c0f211..6b6b5d10 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1449,6 +1449,11 @@ class Query $tableName = $this->parseSqlTable($tableName); } + // 修正子查询作为表名的问题 + if (strpos($tableName, ')')) { + return []; + } + list($guid) = explode(' ', $tableName); $db = $this->getConfig('database'); if (!isset(self::$info[$db . '.' . $guid])) {