php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45918 Mssql_init randomly returns a warning or a resource
Submitted: 2008-08-26 09:19 UTC Modified: 2016-10-15 23:12 UTC
Votes:10
Avg. Score:4.9 ± 0.3
Reproduced:7 of 9 (77.8%)
Same Version:1 (14.3%)
Same OS:-9842 (-140600.0%)
From: dennis at pascolo dot nl Assigned:
Status: Wont fix Package: MSSQL related
PHP Version: 5.2.6 OS: Fedora Core 8
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-08-26 09:19 UTC] dennis at pascolo dot nl
Description:
------------
When i try to connect to Mssql I randomly encounter warnings with "unable to init stored procedure".

Whenever i try to run the query seperatly in Microsoft SQL Server Management Studio Express the query never fails, so i don't think this is an SQL-server problem. 

When i refresh the website often i can see one time it returns a resource (which is good) 'resource(92, mssql statement)'
or a warning 'Warning: mssql_init() [function.mssql-init]: unable to init stored procedure in /var/www/html/test/app/controllers/TestController.php on line 40'

That TestController sets up a persistent connection and initializes a stored procedure. That's it, nothing more nothing less.

The expected result en the actual result keep randomly appearing

Reproduce code:
---------------
$a = mssql_pconnect($server, $username, $password);
var_dump($a);
var_dump(is_resource($a));
$b = mssql_init("dbo.$procedure") or die(mssql_get_last_message());
var_dump($b);

Expected result:
----------------
resource(91, mssql link persistent)
boolean true
resource(92, mssql statement) 

Actual result:
--------------
resource(91, mssql link persistent)
boolean true
Warning: mssql_init() [function.mssql-init]: unable to init stored procedure in /var/www/html/test/app/controllers/TestController.php on line 40 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-07 08:14 UTC] igor dot kalashnikov at gmail dot com
Just reproduced a problem.
I found that error is returned when the procedure is initialized second time without execution of first (in my case). In other cases all is normal.
 [2016-10-15 23:12 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-10-15 23:13 UTC] kalle@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC