改进对存储过程exec的支持

This commit is contained in:
thinkphp
2016-08-22 18:54:08 +08:00
parent f8b8462aa7
commit 17201e9954

View File

@@ -351,7 +351,10 @@ abstract class Connection
$result = $this->PDOStatement->execute();
// 调试结束
$this->debug(false);
$procedure = 0 === strpos(strtolower(substr(trim($sql), 0, 4)), 'call');
$call = strtolower(substr(trim($sql), 0, 4));
if (in_array($call, ['call', 'exec'])) {
$procedure = true;
}
return $this->getResult($class, $procedure);
} catch (\PDOException $e) {
throw new PDOException($e, $this->config, $this->queryStr);