From:             karel dot miarka at issa dot cz
Operating system: Windows NT
PHP version:      4.3.3RC3
PHP Bug Type:     OCI8 related
Bug description:  ocierror() returns always ORA-24315 illegal attribute type

Description:
------------
ocierror() function:
1) returns ORA-24315 illegal attribute type
 after any error. For example ociexcute() prints the valid error in
notice, but calling ocierror returns always ORA-24315 illegal attribute
type:

Warning: OCIStmtExecute: ORA-00942: table or view does not exist in
c:\www\ocierror_bug.php on line 20

ocierror($stmt): Array ( [code] => 24315 [message] => ORA-24315: illegal
attribute type [offset] => 17 [sqltext] => ) 1
 
2) doesn't return the sqltext item in the error array

The bug is in all PHP 4.3.x Windows versions.

3) invalid error offset returned

Reproduce code:
---------------
<?php

  echo '<h1>PHP ocierror() bug</h1>';

  $conn = ocilogon('user', 'passwd', 'host');

  // execute error BEGIN
  $stmt = ociparse($conn, "SELECT xyz12345 FROM no_table123");
  ociexecute($stmt);
echo 'ocierror($stmt): ', print_r(ocierror($stmt)), '<br />';
  ocifreestatement($stmt);
  // execute error END

  ocilogoff($conn);

?>

Expected result:
----------------
Warning: OCIStmtExecute: ORA-00942: table or view does not exist in
c:\www\ocierror_bug.php on line 20

ocierror($stmt): Array ( [code] => 942 [message] => ORA-00942: table or
view does not exist [offset] => 22 [sqltext] => SELECT xyz12345 FROM
no_table123) 1

Actual result:
--------------
Warning: OCIStmtExecute: ORA-00942: table or view does not exist in
c:\www\ocierror_bug.php on line 20

ocierror($stmt): Array ( [code] => 24315 [message] => ORA-24315: illegal
attribute type [offset] => 17 [sqltext] => ) 1

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

Reply via email to