Do not support multiple statements for security and API reasons #51
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.
This PR disables the (broken) support for multiple statements for security and API reasons. Sending multiple statements as a single query could allow for possible SQL injection attacks if the input is not properly escaped. Also, the current API has no (sane) way of exposing multiple results (such as multiple independent result sets).
I do not consider this to be a BC break because the current API has no sane way of exposing multiple results in the first place and the test suite does not contain any mention of this. This PR adds a test to ensure queries with multiple statements are now properly rejected.
We will likely look into this again for a future version, once the current API issues have been worked out. Possible future implementation ideas: Exposing numbered sets à la https://github.com/mysqljs/mysql#multiple-statement-queries or discarding additional sets à la go-sql-driver/mysql#411