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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 16:01:29 2024 UTC