From:             cjbj at hotmail dot com
Operating system: Windows 2000
PHP version:      4.3.3
PHP Bug Type:     Documentation problem
Bug description:  OCIError documentation incorrect about "last error"

Description:
------------
This is similar to http://bugs.php.net/bug.php?id=9510, which was
closed two years ago saying the docs need to be updated.  However the
docs have still not been updated.  Also there are no real useful
user-supplied notes in the manual entry despite them being referred to
in http://bugs.php.net/bug.php?id=8993

How do we get the OCIError documentation updated? Will
it help if I write something to cut-and-paste?

Re-description of the problem:

The OCIError documentation
http://www.php.net/manual/en/function.ocierror.php says that if no
parameter is given, then the most recent error is displayed:

        "If the optional stmt|conn|global is not provided, the last
        error encountered is returned"

I am not seeing this with OCIParse or OCIExecute.  I am seeing
OCIError return false.  This is consistent with the comment in
http://bugs.php.net/bug.php?id=9510 :

        "the documentation needs to be updated - ocierror always
        stores the error in the most appropiate (parent-)handle. "


Reproduce code:
---------------

        <?php

        // Display OCI error
        function PrintOCIError($t, $err)
        {
          echo "<pre>$t: ".$err['message']."</pre>\n";
        }

        echo "<p>Connecting . . . </p>";
        $con = @OCILogon("scott", "tiger", "T920");
        if (!$con) {
          PrintOCIError(@OCIError());
        }

        // Deliberate syntax error: missing a single quote
        $stid = @OCIParse($con, "select 'x from dual");

        if (!$stid) {
          $e = OCIError();
          PrintOCIError("First error ", $e);

          // The correct error is displayed when $con is passed to OCIError
          $e = OCIError($con);
          PrintOCIError("Second error ", $e);
        }

        ?>

Expected result:
----------------

    According to the documentation the testcase should give:

        Connecting . . . 

        First error : ORA-01756: quoted string not properly terminated

        Second error : ORA-01756: quoted string not properly terminated


Actual result:
--------------

    The testcase gives:

        Connecting . . . 

        First error : 

        Second error : ORA-01756: quoted string not properly terminated



-- 
Edit bug report at http://bugs.php.net/?id=25773&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25773&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25773&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25773&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25773&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25773&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25773&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25773&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25773&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25773&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25773&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25773&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25773&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25773&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25773&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25773&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25773&r=float

Reply via email to