-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-statements are not supported #58
Comments
I'd like to support it as I'd find it useful too. But unless there's some feature to support it in the protocol itself, the library might have to implement an SQL parser (not necessarily out of the question, but might get complicated, especially just to support multiple statements). In some of my own projects, I have a whole database init script in SQL. For those, I just split the script on Maybe it would be good enough just detect |
Yeah there are a lot of cases where delimiting on semi-colons won't work, for example when using stored procedures: DELIMITER $$
CREATE PROCEDURE country_hos(IN con CHAR(20))
BEGIN
SELECT Name, HeadOfState FROM Country WHERE Continent = con;
END $$
DELIMITER ; Notice the delimiter changes. |
Sometimes it can be strange being maintainer of a codebase that was originally somebody else's. Every once in a while you find things even you had no idea were there. Case in point: Turns out there's already a feature for this, built into the MySQL communications protocol, and already exposed by mysql-native:
However, I've yet to actually try it out, and it's completely untested in the unittests, so no guarantees. Plus, it seems to be specifically excluded from the |
Thanks for the update. |
It seems multiple statements are not supported. These are multiple SQL statements in one string that can be executed in one call.
Here's an example which reports a false error:
output:
There is no error in the SQL. Are there plans to support multi statements?
The text was updated successfully, but these errors were encountered: