Skip to content

rusqlite::Connection::execute successfully accepts multiple statements but only the first one is actually executed #397

@frp

Description

@frp

This reproduces with the following code:

let conn = ::rusqlite::Connection::open_in_memory().unwrap();
conn.execute(r#"
    CREATE TABLE t1 ( id integer primary key, f1 text );
    CREATE TABLE t2 ( id integer primary key, f1 text );
"#, &[]).unwrap();
conn.execute("SELECT * FROM t2;", &[]).unwrap();

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions