diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index ea085368a..ae5e8a5c4 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -90,4 +90,19 @@ class DatabaseWriterTests : GRDBTestCase { try XCTAssertNil(Row.fetchOne(db, "SELECT * FROM sqlite_master")) } } + + // See https://github.com/groue/GRDB.swift/issues/424 + func testIssue424() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.write { db in + try db.execute(""" + CREATE TABLE t(a); + INSERT INTO t VALUES (1) + """) + } + try dbQueue.read { db in + _ = try Row.fetchCursor(db.cachedSelectStatement("SELECT * FROM t")).next() + } + try dbQueue.erase() + } }