Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DB error like a constraint violation gives PHP error #1

Closed
yjeroen opened this Issue · 2 comments

1 participant

Jeroen den Haan
Jeroen den Haan
Owner

If the database returns an error (eg. constraint violation), then oci_execute creates a PHP error.

This is unexpected for a PDO behavior, since it should raise an exception.

Jeroen den Haan yjeroen was assigned
Jeroen den Haan
Owner

Fixed.

Changed Oci8PDO_Statement, line 104.

<?php
    return oci_execute($this->_sth, $mode);

To:

<?php
    if(@oci_execute($this->_sth, $mode)) {
        return true;
    } else {
        $e = oci_error($this->_sth);
        throw new PDOException($e['message']);
    }
Jeroen den Haan yjeroen closed this
Jeroen den Haan yjeroen reopened this
Jeroen den Haan
Owner

Fixed with commit 810f051

Jeroen den Haan yjeroen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.