Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't return a result set in the given context

When ever I try to call store procedure in mysql that sends back a result set, it keeps saying me that "can't return a result set in the given context".

I've google it and some said it's mysql bug, some said you should change your mysqli driver and ....

Situation :

Using mysqli driver Client API library version 5.0.51a , PHP Version 5.2.4-2ubuntu5.6, Using Zend 1.9 RC 1 Mysqli adapter.

What should I do!?

like image 547
Farid Avatar asked Jul 29 '09 13:07

Farid


2 Answers

The answer is to upgrade your php, I've just upgraded mine to 5.3.0, and it's works likes Candy!

like image 72
Farid Avatar answered Nov 15 '22 17:11

Farid


Not sure this is the solution to your problem, but what about trying with a more recent version of PHP ?
PHP 5.2.4 is definitly quite old -- so, if it's a bug in PHP's mysqli driver, it might have been corrected since...

Actually, after a quick search, it seems a problem like the one you are witnessing has been introduced between PHP 5.2.3 and PHP 5.2.4 (and was still here in PHP 5.2.5).
See bug #42548 : PROCEDURE xxx can't return a result set in the given context (works in 5.2.3!!)

Are you able to test with something like PHP 5.2.9 or 5.2.10 ?
I know these are not provided by Ubuntu, even in the last Ubuntu stable version :-( You might have to compile from sources :-(


Yet another idea would be to try mith PDO_MySql adapter : maybe it would work with that one ?
It might be possible to change Adapter without causing too much trouble / without taking hours to test ?


As you are working with Zend Framework 1.9, here's another post that might interest you, and might be easier to test : stored procedure error after upgrade to 1.8

An easy solution to try that would be to go back to Zend Framework 1.7 ; would it be possible for you, just to test ?


Anyway... Good luck !
And, if you find the solution, don't forget to indicate what the problem was, and how you solved it ;-)

like image 31
Pascal MARTIN Avatar answered Nov 15 '22 16:11

Pascal MARTIN