zim32 / mysql.dart

MySQL client for Dart written in Dart
BSD 3-Clause "New" or "Revised" License
64 stars 17 forks source link

execute: do not give valid result #49

Open leamlidara opened 1 year ago

leamlidara commented 1 year ago

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

Marcone-zz commented 1 year ago

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?