Skip to content
This repository

DB error like a constraint violation gives PHP error #1

Closed
yjeroen opened this Issue August 08, 2012 · 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
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 August 08, 2012
Jeroen den Haan yjeroen reopened this August 08, 2012
Jeroen den Haan
Owner

Fixed with commit 810f051

Jeroen den Haan yjeroen closed this August 08, 2012
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.