Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Like mentioned before in earlier PRs, I wrote/maintain a MySQL proxy acting as a gateway between client and server. When a client connects with the
CLIENT_MULTI_STATEMENTS
capability, it could execute multiple queries at once, for instanceSELECT 1; INSERT INTO foo VALUES (1, "foo")
. When such a query is executed through the regularExecute()
function, the server will return multiple results, one for each query with theSERVER_MORE_RESULTS_EXISTS
flag set for all results except the last. The additional results are not handled properly in the current implementation.ExecuteMultiple
allows me to keep handling all results in a user-defined callback, for instance:ExecuteMultiple
returns an empty resultset with the new streamingtypeStreamingMulti
set, so when it bubbles fromHandleQuery
towardsWriteQuery
/writeResultSet
it doesn't send an additionalOK
orEOF
to the client.I have been running this in production for a while (about a year) and I was in the process of backporting my local changes to go-mysql to the repo so I can hopefully one day just use the upstream repo itself again 🤗