mysql.dart icon indicating copy to clipboard operation
mysql.dart copied to clipboard

execute: do not give valid result

Open leamlidara opened this issue 2 years ago • 1 comments

This problem is occurred when I am trying to execute Store Procedure using CALL procedureName(:p1, :p2).

leamlidara avatar Feb 17 '23 07:02 leamlidara

I faced the same problem. I found in the code where this happened. When we execute a procedure, the result of the statusFlag is 10, as there is a binary comparison between the statusFlag and mysqlServerFlagMoreResultsExists (which is 8 at the end of the execution) the result of the comparison gives a value != 0 and therefore the values are zeroed.

In the file https://github.com/zim32/mysql.dart/blob/main/lib/src/mysql_client/connection.dart on line 574 you can see the comparison. In my case I added the following (&& eofPayload.statusFlags != 10). Not sure this will result in issues, but it was a momentary solution that did the trick for me.

@zim32 Could you say if this is a risk?

Marcone-zz avatar Apr 16 '23 23:04 Marcone-zz