Bug #18429: mssql_query() crashes on stored procedure using a cursor on query that contains
| From: | hujbanan at yahoo dot com | Date: | Fri, 19 Jul 2002 06:16:44 +0000 |
| Subject: | Bug #18429: mssql_query() crashes on stored procedure using a cursor on query that contains | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-14597@lists.php.net to get a copy of this message | ||
From: hujbanan@yahoo.com
Operating system: Win2000
PHP version: 4CVS-2002-07-19
PHP Bug Type: MSSQL related
Bug description: mssql_query() crashes on stored procedure using a cursor on query that contains
I use PHP statement mssql_query( "EXEC db_proc 1, 2, 3" ) {query B} to call
stored procedure on MSSQL 2000 server, which produces output using cursor.
Before it, I create global cursor using mssql_query( "DECLARE rowset
CURSOR GLOBAL SCROLL FOR $query" ) {query A}. I need dynamically choose
executed query, so I can't declare cursor in stored procedure. Statement
{A} creates global cursor which is fetched and dropped in SP db_proc {B}.
When I use as $query SQL command 'SELECT id FROM store', it works fine.
But if I use something like 'SELECT id+1 AS col FROM store', PHP function
mssql_query crashes. However, both of sequences of SQL queries run without
problems in SQL Query Analyzer (SQL 2k).
I found this problem on PHP version 4.2.0 for win32. I try latest version
of PHP from http://snaps.php.net/win32/ (both, stable
v4.2.2-dev and
unstable v4.3.0-dev) but problem persists. I'm using Apache 1.3.20/PHP
4.2.0 on Win2k advanced server. I have step by step tryed Apache 2.0.39
with PHP v4.2.1, 4.2.2-dev and 4.3.0-dev, but with the same result.
Can you tell me, what is wrong? Is it PHP bug or mistake in PHP/Apache
configuration? I used default settings of PHP and Apache, PHP extensions:
dba, mssql & gd.
--
Edit bug report at http://bugs.php.net/?id=18429&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18429&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18429&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18429&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18429&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18429&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18429&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18429&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18429&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18429&r=globals