From 01c9e9e1e13dd2bf7cd4ca7143baf2984af3f7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 3 Oct 2018 13:50:40 +0200 Subject: [PATCH] Failing test for #424 --- Tests/GRDBTests/DatabaseWriterTests.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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() + } }