php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71558 Wrong error returned by errorInfo
Submitted: 2016-02-09 08:56 UTC Modified: 2016-02-12 14:13 UTC
From: zucchetto dot christopher at gmail dot com Assigned:
Status: Closed Package: PDO DBlib
PHP Version: 5.6.18 OS: Linux CentOS 6.7
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: zucchetto dot christopher at gmail dot com
New email:
PHP Version: OS:

 

 [2016-02-09 08:56 UTC] zucchetto dot christopher at gmail dot com
Description:
------------
I use PDO with dblib (Freetds / Sybase) : when I try to execute a procedure that doesn't exists on the server (or something else that return an error) with PDO, I have not the correct error returned by errorInfo. However, with previous versions of PHP like 5.2.4 it's worked correctly.

Test script:
---------------
$pdo = new PDO("dblib:host=MY_SERVER", "MY_LOGIN", "MY_PWD");
$st = $pdo->prepare("EXEC A_UNKNOW_PROCEDURE");
$good = $st->execute();
if (!$good) {
    $error = $st->errorInfo();
    var_dump($error);
}

Expected result:
----------------
The error returned by the Sybase server like : Stored procedure 'A_UNKNOW_PROCEDURE' not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output)

Actual result:
--------------
General SQL Server error: Check messages from the SQL Server [2812] (severity 16)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-10 21:21 UTC] miracle at rpz dot name
freetds 0.95, with sqlserver actual result:

array(5) {
  [0] =>
  string(5) "HY000"
  [1] =>
  int(20018)
  [2] =>
  string(84) "Could not find stored procedure 'A_UNKNOW_PROCEDURE'. [20018] (severity 16) [(null)]"
  [3] =>
  int(-1)
  [4] =>
  int(16)
}
 [2016-02-12 14:13 UTC] zucchetto dot christopher at gmail dot com
-Status: Open +Status: Closed
 [2016-02-12 14:13 UTC] zucchetto dot christopher at gmail dot com
The problem is resolved updating freetds (from 0.91 to 0.95).

Thanks ^^
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 14:01:30 2024 UTC