ID: 25585
Updated by: [EMAIL PROTECTED]
Reported By: snick at getart dot ru
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: Windows 2003 Server
PHP Version: 4.3.3
New Comment:
Does it crash without the mssql_get_last_message() line?
Previous Comments:
------------------------------------------------------------------------
[2003-09-18 07:39:06] snick at getart dot ru
Description:
------------
When I try to execute T-SQL query with advanced instructions PHP was
crash.
Tested with:
Apache v. 2.0.43
IIS v. 6.0
MSSQL v. 7.0
ntwdblib.dll v. 2000.80.194.0
Query must include:
- BEGIN TRAN and COMMIT / ROLLBACK TRAN;
- RAISEERROR() function call;
- Error in query before RAISERROR (eg. failed INSERT with 'Can not
insert NULL into bla-bla-bla' message (msg 515))
Reproduce code:
---------------
// you must create database called 'myDB' and table
// 'myTable' with columns myField1 INT NOT NULL, myField2 VARCHAR(50)
NOT NULL
/*
...db connection and selection
*/
$query = "BEGIN TRAN
DECLARE @Flag BIT
SET @Flag = 0
INSERT INTO myTable (myField2) VALUES ('akgfsjhdgf')
IF @Flag = 0
BEGIN
RAISERROR('Some error', 18, 10)
ROLLBACK TRAN
END
ELSE
COMMIT TRAN";
$result = mssql_query($query);
echo "Result is ".($result ? "true" : "false")."<br/>";
echo "DB Error is ".mssql_get_last_message()."<br/>";
Expected result:
----------------
PHP must return usual errors (if exists) and specified output:
Result is true
DB Error is Changed database context to 'myDB'
Actual result:
--------------
If PHP running as Apache module:
message box
"Apache.exe - Application Error
The instruction at '0x77f486f7' referenced memory at
'0x00000000'. The memory could not be 'read'"
If PHP running as standalone:
message box
"php.exe - Application Error
The instruction at '0x77f486f7' referenced memory at
'0x00000000'. The memory could not be 'read'"
If PHP running as ISAPI module:
IIS return in browser string "PHP has encountered an Access Violation
at 77F47931"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25585&edit=1