mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Add failing test for "DROP TABLE t" executed from a prepared statement.
This commit is contained in:
1 parent
1578dfe26b
commit
fc88acc782
1 file changed
+16
@@ -307,4 +307,20 @@ class UpdateStatementTests : GRDBTestCase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testDropTablePreparedStatement() throws {
|
||||
// In v2.0.1...
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
try dbQueue.inDatabase { db in
|
||||
XCTAssertFalse(try db.tableExists("t"))
|
||||
try db.execute("CREATE TABLE t(a)")
|
||||
XCTAssertTrue(try db.tableExists("t"))
|
||||
try db.execute("DROP TABLE t") // ... this would drop the table
|
||||
XCTAssertFalse(try db.tableExists("t"))
|
||||
try db.execute("CREATE TABLE t(a)")
|
||||
XCTAssertTrue(try db.tableExists("t"))
|
||||
try db.makeUpdateStatement("DROP TABLE t").execute() // ... but this would not. WTF??? Hence this regression test.
|
||||
XCTAssertFalse(try db.tableExists("t"))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user