You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I work with queries written on backend, it works fine. But when call stored procedures from 'client.query' and run using restClient, it first gives result set and at second run gives{affectedRows:0,lastInsetId:0} .What is the problem? Is there a specific way to call stored procedure different from nodejs?
The text was updated successfully, but these errors were encountered:
Hey just encountered the same problem. The reason this happens is that a stored procedure can select rows as well as update rows at the same time so you need to read two packets because the server will return:
the selected rows
the affected rows
Here's a cheap and hacky work around util this is fixed:
As of MySQL 5.7.5, the resultset is followed by an OK_Packet, and this OK_Packet has the SERVER_MORE_RESULTS_EXISTS flag set to start processing the next resultset.
The client has to announce that it wants multi-resultsets by either setting the CLIENT_MULTI_RESULTS or CLIENT_PS_MULTI_RESULTS capability.
I would guess that multi-resultset aren't handled correctly since I didn't see any handling of the server status flags in received packets which would normaly indicate a trailing OK_Packet.
When I work with queries written on backend, it works fine. But when call stored procedures from 'client.query' and run using restClient, it first gives result set and at second run gives{affectedRows:0,lastInsetId:0} .What is the problem? Is there a specific way to call stored procedure different from nodejs?
The text was updated successfully, but these errors were encountered: