Bug #51932 [Com]: mssql_execute() returns TRUE even when RAISERROR() raises error in SP

From: Date: Tue, 29 Oct 2013 22:58:32 +0000
Subject: Bug #51932 [Com]: 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-182482@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 Comment by: nick dot rawlins at gmail dot com Reported by: niklas at eventusmedia dot fi Summary: mssql_execute() returns TRUE even when RAISERROR() raises error in SP Status: Open Type: Bug Package: MSSQL related Operating System: Debian PHP Version: 5.2.13 Block user comment: N Private report: N New Comment: I am experiencing this too, very urgent! causing me problems. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#182482) next »