-
Notifications
You must be signed in to change notification settings - Fork 333
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
rusqlite::Connection::execute successfully accepts multiple statements but only the first one is actually executed #397
Comments
Right now, you should use
But |
Connection.execute Connection.execute_named Connection.quer_row Connection.quer_row_named
Could you please give this https://github.com/jgallagher/rusqlite/pull/399 PR a try ? |
@frp Would you mind replying ? |
Sorry, was busy. Tried, this produces error if I pass multiple statements, as expected. Thanks. |
Connection.execute Connection.execute_named Connection.quer_row Connection.quer_row_named
Check that only one statement is provided (#397)
Partially fixed in 0.21 |
I've hit a similar issue trying to create a database in an Maybe a warning box in the documentation of Also I didn't get any error, despite being on 0.27.0, is there a feature to enable or something? |
https://github.com/rusqlite/rusqlite/blob/master/src/statement.rs#L859-L874
There is no such method (like
https://docs.rs/rusqlite/latest/rusqlite/struct.Connection.html#method.execute
Are you really sure ? |
This reproduces with the following code:
The first execute succeeds, and the table t1 is created and is accessible. However, the table t2 is not, meaning the second statement was actually never executed. So the second execute fails with SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("no such table: t2"))
The correct outcome would be to either execute both statements or return an error when asked to do so.
The text was updated successfully, but these errors were encountered: