Bug #71558 [Opn->Csd]: Wrong error returned by errorInfo

From: Date: Fri, 12 Feb 2016 14:14:00 +0000
Subject: Bug #71558 [Opn->Csd]: Wrong error returned by errorInfo
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199176@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71558&edit=1 ID: 71558 User updated by: zucchetto dot christopher at gmail dot com Reported by: zucchetto dot christopher at gmail dot com Summary: Wrong error returned by errorInfo -Status: Open +Status: Closed Type: Bug Package: PDO DBlib Operating System: Linux CentOS 6.7 PHP Version: 5.6.18 Block user comment: N Private report: N New Comment: The problem is resolved updating freetds (from 0.91 to 0.95). Thanks ^^ Previous Comments: ------------------------------------------------------------------------ [2016-02-10 21:21:35] 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-09 08:56:19] 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) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71558&edit=1

« previous php.bugs (#199176) next »