Bug #51932 [Opn->Wfx]: mssql_execute() returns TRUE even when RAISERROR() raises error in SP
| From: | kalle@php.net | Date: | Sat, 15 Oct 2016 23:15:50 +0000 |
| Subject: | Bug #51932 [Opn->Wfx]: mssql_execute() returns TRUE even when RAISERROR() raises error in SP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204807@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51932&edit=1
ID: 51932
Updated by: kalle@php.net
Reported by: niklas at eventusmedia dot fi
Summary: mssql_execute() returns TRUE even when RAISERROR()
raises error in SP
-Status: Open
+Status: Wont fix
Type: Bug
Package: MSSQL related
Operating System: Debian
PHP Version: 5.2.13
Block user comment: N
Private report: N
New Comment:
With MSSQL being removed from PHP as of PHP7.0, and ext/mssql not having a maintainer, I'm
gonna close this report as a Won't fix, until maybe one day it will find a new maintainer.
Alternatively you can use sqlsrv from Microsoft if you are on Windows, or pdo_dblib if you are on
Unix.
Previous Comments:
------------------------------------------------------------------------
[2013-10-29 22:58:31] nick dot rawlins at gmail dot com
I am experiencing this too, very urgent! causing me problems.
------------------------------------------------------------------------
[2010-05-27 15:56:35] niklas at eventusmedia dot fi
Description:
------------
I think mssql_execute() should return FALSE (or throw an ErrorException) when RAISERROR() raises
error with severity >= mssql_min_error_severity().
Now it returns TRUE if query is run with success, no matter if error is risen.
Test script:
---------------
CREATE PROCEDURE MySP
BEGIN
RAISERROR('Error happened', 18, 1)
END
<?php
$conn = mssql_connect(...);
mssql_min_error_severity(10);
$stmt = mssql_init('MySP', $conn);
if (($ret = mssql_execute($stmt)) == false)
{
echo "Error!";
}
else
{
echo "OK!";
}
?>
Expected result:
----------------
I expect the script to output "Error!".
Actual result:
--------------
That would output "OK!".
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51932&edit=1