[Gambas-user] MySQL stored procedures execution problem

Leandro Anthonioz Blanc leandro_anthonioz at ...43...
Thu May 31 04:18:16 CEST 2007


Hi Benoit, thanks for you reply. I update to "HEAD" Gambas project version from subversion repository and recompile it. Error "Query failed: Commands out of sync; you can't run this command now" does not occurs anymore. 
However, if I execute same stored procedure several times rapidly, now appears error "Query failed: Lost connection to MySQL server during query". I mean, if i execute the stored procedure dozens of times but waiting at least one second between every execution, no error occurs (never). But, if I execute the stored procedure rapidly (without pause), this error raise inmediately. I test this several times and the behaviour is consistent. Thank you very much.

>From: Benoit Minisini <gambas at ...362...> - 2007-05-30 21:01
On mardi 29 mai 2007, Leandro Anthonioz Blanc wrote:
> Hi, I have a problem with MySQL stored procedures that returns results.
> FIRST time I execute a line like this: hResult =3D hConn.Exec(=93CALL
> MyStoredProcedure()=94) =85 line works OK. However, NEXT time I try to e=
xecute
> same line, this error occurs: =93Query failed: Commands out of sync; you
> can=92t run this command now=94 I found this information in MySQL
> documentation: If you get Commands out of sync; you can't run this command
> now in your client code, you are calling client functions in the wrong
> order. This can happen, for example, if you are using mysql_use_result()
> and try to execute a new query before you have called mysql_free_result().
> It can also happen if you try to execute two queries that return data
> without calling mysql_use_result() or mysql_store_result() in between. To
> avoid this problem, I close and reopen connection before execute a stored
> procedure, and works, but is not a good workaround. I edit =93do_query=94
> function in gb.db.mysql/src/main.c file, attempting to include a
> =93mysql_free_result(res);=94 instruction that solves the problem, but I
> couldn=92t solve it. Anybody can help me please? Thank you very much.
>

Can you try my fix in the latest development SVN revision ?

=2D-=20
Benoit Minisini 

 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.



More information about the User mailing list