From 7a628bf23fa049f2e7e4df8b1d29d87b68f457d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 4 Oct 2018 08:35:02 +0200 Subject: [PATCH] Add minimal failing test for #424 --- Tests/GRDBTests/DatabaseWriterTests.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index ae5e8a5c4..757453dc4 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -105,4 +105,18 @@ class DatabaseWriterTests : GRDBTestCase { } try dbQueue.erase() } + + // See https://github.com/groue/GRDB.swift/issues/424 + func testIssue424Minimal() throws { + let dbQueue = try makeDatabaseQueue() + try dbQueue.inDatabase { db in + try db.execute(""" + CREATE TABLE t(a); + INSERT INTO t VALUES (1); + PRAGMA query_only = 1; + """) + _ = try Row.fetchCursor(db.cachedSelectStatement("SELECT * FROM t")).next() + } + try DatabaseQueue().backup(to: dbQueue) + } }