Bug #53993 [Opn]: "Command out of sync" after CALL
| From: | uw@php.net | Date: | Mon, 09 May 2011 13:05:53 +0000 |
| Subject: | Bug #53993 [Opn]: "Command out of sync" after CALL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-160612@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53993&edit=1
ID: 53993
Updated by: uw@php.net
Reported by: doqnach at miraizou dot net
Summary: "Command out of sync" after CALL
Status: Open
Type: Bug
Package: MySQLi related
Operating System: WinXP SP3 & Win Server 2003 R2
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
This is somewhat beyond the scope of the PHP drivers. The PHP drivers
follow MySQL Client Server protocol. Given you don't like the protocol
and its handling of certain queries - with the need to fetch result sets
in some cases - you should direct your request to the database vendor
but not to php.net and the PHP drivers. This is not a PHP driver
specific issue.
Previous Comments:
------------------------------------------------------------------------
[2011-02-11 09:51:02] doqnach at miraizou dot net
Description:
------------
I'm having problems doing a SELECT query after having done a CALL to a
stored procedure.
see bug #48065 and bug #35203
The statement by schwern at pobox dot com at bug #48065 clearly states
my view on this as well.
This 'issue' is not bogus and it's strange that you have to handle a
CALL completely different from a normal SELECT even though the rest of
the logic is exactly the same.
I have made a post at the mysql support forum when trying to figure out
what was going wrong which contains a working test script.
multi query should not have to be the only solution for this.
Test script:
---------------
http://forums.mysql.com/read.php?52,407069,407203#msg-407203
Expected result:
----------------
array(1) {
[0]=>
array(1) {
["VERSION()"]=>
string(16) "5.1.51-community"
}
}
array(1) {
[0]=>
array(1) {
["VERSION()"]=>
string(16) "5.1.51-community"
}
}
Actual result:
--------------
array(1) {
[0]=>
array(1) {
["VERSION()"]=>
string(16) "5.1.51-community"
}
}
object(mysqli)#1 (17) {
["affected_rows"]=>
int(1)
["client_info"]=>
string(48) "mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $"
["client_version"]=>
int(50007)
["connect_errno"]=>
int(0)
["connect_error"]=>
NULL
["errno"]=>
int(2014)
["error"]=>
string(52) "Commands out of sync; you can't run this command now"
["field_count"]=>
int(1)
["host_info"]=>
string(20) "localhost via TCP/IP"
["info"]=>
NULL
["insert_id"]=>
int(0)
["server_info"]=>
string(16) "5.1.51-community"
["server_version"]=>
int(50151)
["sqlstate"]=>
string(5) "HY000"
["protocol_version"]=>
int(10)
["thread_id"]=>
int(12)
["warning_count"]=>
int(0)
}
Fatal error: Call to a member function fetch_assoc() on a non-object in
<path>\test_call.php on line 21
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53993&edit=1