1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-17 19:37:13 +02:00

drivers implementing IDibiDriver and IDibiResultDriver together do not use $resultSet in IDibiDriver part

This commit is contained in:
David Grudl
2010-11-02 14:11:03 +01:00
parent 32baabdeac
commit 087734fb23
11 changed files with 75 additions and 51 deletions

View File

@@ -99,19 +99,20 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
*/
public function query($sql)
{
$this->resultSet = oci_parse($this->connection, $sql);
if ($this->resultSet) {
oci_execute($this->resultSet, $this->autocommit ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT);
$err = oci_error($this->resultSet);
$res = oci_parse($this->connection, $sql);
if ($res) {
oci_execute($res, $this->autocommit ? OCI_COMMIT_ON_SUCCESS : OCI_DEFAULT);
$err = oci_error($res);
if ($err) {
throw new DibiDriverException($err['message'], $err['code'], $sql);
} elseif (is_resource($res)) {
return $this->createResultDriver($res);
}
} else {
$err = oci_error($this->connection);
throw new DibiDriverException($err['message'], $err['code'], $sql);
}
return is_resource($this->resultSet) ? $this->createResultDriver($this->resultSet) : NULL;
}