php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53993 "Command out of sync" after CALL
Submitted: 2011-02-11 09:51 UTC Modified: 2011-05-10 17:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: doqnach at miraizou dot net Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.3.5 OS: WinXP SP3 & Win Server 2003 R2
Private report: No CVE-ID: None
 [2011-02-11 09:51 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-09 15:05 UTC] uw@php.net
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.
 [2011-05-10 17:15 UTC] uw@php.net
-Status: Open +Status: Bogus
 [2011-05-10 17:15 UTC] uw@php.net
Sorry, but that's how it is. Check the docs and fetch all result sets before running new statement.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 05 05:01:27 2024 UTC