Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

DB error like a constraint violation gives PHP error #1

Closed
yjeroen opened this Issue · 2 comments

1 participant

@yjeroen
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.

@yjeroen yjeroen was assigned
@yjeroen
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']);
    }
@yjeroen yjeroen closed this
@yjeroen yjeroen reopened this
@yjeroen
Owner

Fixed with commit 810f051

@yjeroen 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.