php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51964 mssql_query "Query Processor Error"
Submitted: 2010-06-01 11:57 UTC Modified: 2013-02-18 00:34 UTC
From: ovendrell at oip dot jazztel dot es Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.3.2 OS: Ubuntu
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ovendrell at oip dot jazztel dot es
New email:
PHP Version: OS:

 

 [2010-06-01 11:57 UTC] ovendrell at oip dot jazztel dot es
Description:
------------
I generate a SQL statement dynamically in PHP script.
When I execute this SQL query, the system crash with error "Query Processor Error: The query processor could not produce a query plan".
If I execute the same query directly on SQL server, it works.

The SQL string is:
  $sql = "BEGIN TRY 
	  BEGIN TRANSACTION 
		DELETE FROM EEES_AprenAssigPE WHERE IdAssig like '200166' AND Curs=2009;
		INSERT INTO EEES_AprenAssigPE (IdPlaEst, IdAssig, CodiRes, Curs) VALUES ('GEL01', '200166', 'C2', 2009);
		INSERT INTO EEES_AprenAssigPE (IdPlaEst, IdAssig, CodiRes, Curs) VALUES ('GEL01', '200166', 'E23', 2009);
		INSERT INTO EEES_AprenAssigPE (IdPlaEst, IdAssig, CodiRes, Curs) VALUES ('GEL01', '200166', 'E23.7', 2009); 
		SELECT 1 AS OK; 
	COMMIT TRANSACTION; 
END TRY 
BEGIN CATCH 
	SELECT -1 AS OK; 
	ROLLBACK TRANSACTION; 
END CATCH";


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-04 10:47 UTC] ovendrell at oip dot jazztel dot es
I have more information about the problem. 
I have seen that the error occurs when you insert a record into the table EEES_AprenAssigPE. This table has a FK composed by 2 fields (IdPlaEst, CodiRes) to another table where CodiRes is a calculated field. If you delete the FK, the problem disappears.
 [2010-08-19 10:10 UTC] kalle@php.net
-Status: Open +Status: Feedback
 [2010-08-19 10:10 UTC] kalle@php.net
Hi

Are you using SQL Server 2000? Have you tried this work-a-around if so:
http://support.microsoft.com/kb/841404

For SQL Server 2005, I see there is an open bug at Microsoft Connect for this error:
https://connect.microsoft.com/SQLServer/feedback/details/228950
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC