修正子查询作为表名查询的问题

This commit is contained in:
thinkphp
2016-12-05 16:48:18 +08:00
parent 84f9ffab46
commit 32c2f5799b

View File

@@ -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])) {