php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56461 PDO MSSQL errorInfo()
Submitted: 2005-07-22 14:28 UTC Modified: 2006-02-27 07:23 UTC
From: mlmoura at fitec dot org dot br Assigned:
Status: No Feedback Package: PDO (PECL)
PHP Version: 5_0 CVS-2005-07-22 (dev) OS: Windows Xp
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mlmoura at fitec dot org dot br
New email:
PHP Version: OS:

 

 [2005-07-22 14:28 UTC] mlmoura at fitec dot org dot br
Description:
------------
I?m trying to use the PDO package with php_pdo.dll and php_pdo_mssql.dll, the files have been downloaded today from the PECL?s site.
The extensions was correctlly enabled in the php.ini.
The bug is: when a sql error occurs and the error info is required.

Reproduce code:
---------------
<?php
$dsn = 'mssql:dbname=test;host=localhost';
$user = 'sa';
$password = 'sa';
try {
   $dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
}
/* Provoke an error -- the BONES table does not exist */
$err = $dbh->prepare('SELECT skull FROM bones');
$err->execute();
echo "\nPDO::errorInfo():\n";
print_r($err->errorInfo());
?> 

Expected result:
----------------
Example was extract from manual of the php.net

Something like that, except that I?m using the Sql Server and example show an error of DB2:

PDO::errorInfo():
Array
(
    [0] => 42S02
    [1] => -204
    [2] => [IBM][CLI Driver][DB2/LINUX] SQL0204N  "DANIELS.BONES" is an undefined name.  SQLSTATE=42704
)


Actual result:
--------------
The Apache crashes with the Windows message: 
"Apache HTTP Server has encountered a problem and needs to close.  We are sorry for the inconvenience."
Terminates without any response from the browser.

The tests was executed using more then one version of Apache and Php.

Obs: If I use the errorCode() method instead of errorInfo() the browser returns with this code: HY000. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-30 23:28 UTC] wez@php.net
Please try a 5.1 snapshot from http://snaps.php.net
 [2006-02-27 07:23 UTC] mike@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC