From:
Operating system: Debian
PHP version: 5.2.13
Package: MSSQL related
Bug Type: Bug
Bug description:mssql_execute() returns TRUE even when RAISERROR() raises error
in SP
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 bug report at http://bugs.php.net/bug.php?id=51932&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51932&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51932&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=51932&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=51932&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51932&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51932&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51932&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51932&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51932&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51932&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51932&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51932&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51932&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51932&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51932&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51932&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51932&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51932&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51932&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51932&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51932&r=mysqlcfg