修正Oracle驱动

This commit is contained in:
thinkphp
2016-06-12 17:26:36 +08:00
parent a09cf8d3a1
commit 4d9a4bcaae

View File

@@ -51,7 +51,7 @@ class Oracle extends Connection
* @throws \Exception * @throws \Exception
* @throws \think\Exception * @throws \think\Exception
*/ */
public function execute($sql, $bind = [], $fetch = false) public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false, $sequence = null)
{ {
$this->initConnect(true); $this->initConnect(true);
if (!$this->linkID) { if (!$this->linkID) {
@@ -85,6 +85,9 @@ class Oracle extends Connection
$this->numRows = $this->PDOStatement->rowCount(); $this->numRows = $this->PDOStatement->rowCount();
if ($flag || preg_match("/^\s*(INSERT\s+INTO|REPLACE\s+INTO)\s+/i", $sql)) { if ($flag || preg_match("/^\s*(INSERT\s+INTO|REPLACE\s+INTO)\s+/i", $sql)) {
$this->lastInsID = $this->linkID->lastInsertId(); $this->lastInsID = $this->linkID->lastInsertId();
if ($getLastInsID) {
return $this->lastInsID;
}
} }
return $this->numRows; return $this->numRows;
} catch (\PDOException $e) { } catch (\PDOException $e) {