Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Mar 29, 2020
2 parents e831c64 + 66989f2 commit f4c763d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:

#### 4.x Releases

- `4.12.x` Releases - [4.12.0](#4120)
- `4.12.x` Releases - [4.12.0](#4120) | [4.12.1](#4121)
- `4.11.x` Releases - [4.11.0](#4110)
- `4.10.x` Releases - [4.10.0](#4100)
- `4.9.x` Releases - [4.9.0](#490)
Expand Down Expand Up @@ -69,6 +69,15 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
## Next Release
-->

## 4.12.1

Released March 29, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.12.0...v4.12.1)

**Fixed**

- [#744](https://github.com/groue/GRDB.swift/pull/744): Fix DatabaseMigrator deadlock with serial target queues


## 4.12.0

Released March 21, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v4.11.0...v4.12.0)
Expand Down
2 changes: 1 addition & 1 deletion GRDB.swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
s.version = '4.12.0'
s.version = '4.12.1'

s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
Expand Down
4 changes: 3 additions & 1 deletion GRDB/Migration/DatabaseMigrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public struct DatabaseMigrator {
//
// Create a temporary witness database (on disk, just in case
// migrations would involve a lot of data).
let witness = try DatabaseQueue(path: "", configuration: writer.configuration)
var witnessConfiguration = writer.configuration
witnessConfiguration.targetQueue = nil // Avoid deadlocks
let witness = try DatabaseQueue(path: "", configuration: witnessConfiguration)

// Grab schema of migrated witness database
let witnessSchema: SchemaInfo = try witness.writeWithoutTransaction { db in
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ ifdef JAZZY
--author 'Gwendal Roué' \
--author_url https://github.com/groue \
--github_url https://github.com/groue/GRDB.swift \
--github-file-prefix https://github.com/groue/GRDB.swift/tree/v4.12.0 \
--module-version 4.12.0 \
--github-file-prefix https://github.com/groue/GRDB.swift/tree/v4.12.1 \
--module-version 4.12.1 \
--module GRDB \
--root-url http://groue.github.io/GRDB.swift/docs/4.12/ \
--output Documentation/Reference \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

---

**Latest release**: March 21, 2020 • version 4.12.0 • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 3 to GRDB 4](Documentation/GRDB3MigrationGuide.md)
**Latest release**: March 29, 2020 • version 4.12.1 • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 3 to GRDB 4](Documentation/GRDB3MigrationGuide.md)

**Requirements**: iOS 9.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+ • Swift 4.2+ / Xcode 10.0+

| Swift version | GRDB version |
| ------------- | ----------------------------------------------------------- |
| **Swift 5** | **v4.12.0** |
| **Swift 4.2** | **v4.12.0** |
| **Swift 5** | **v4.12.1** |
| **Swift 4.2** | **v4.12.1** |
| Swift 4.1 | [v3.7.0](https://github.com/groue/GRDB.swift/tree/v3.7.0) |
| Swift 4 | [v2.10.0](https://github.com/groue/GRDB.swift/tree/v2.10.0) |
| Swift 3.2 | [v1.3.0](https://github.com/groue/GRDB.swift/tree/v1.3.0) |
Expand Down
2 changes: 1 addition & 1 deletion Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.12.0</string>
<string>4.12.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
14 changes: 14 additions & 0 deletions Tests/GRDBTests/DatabaseMigratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,20 @@ class DatabaseMigratorTests : GRDBTestCase {
try XCTAssertTrue(dbQueue.read(newMigrator.hasCompletedMigrations))
}

// Regression test for https://github.com/groue/GRDB.swift/issues/741
func testEraseDatabaseOnSchemaChangeDoesNotDeadLock() throws {
dbConfiguration.targetQueue = DispatchQueue(label: "target")
let dbQueue = try makeDatabaseQueue()

var migrator = DatabaseMigrator()
migrator.eraseDatabaseOnSchemaChange = true
migrator.registerMigration("1", migrate: { _ in })
try migrator.migrate(dbQueue)

migrator.registerMigration("2", migrate: { _ in })
try migrator.migrate(dbQueue)
}

func testEraseDatabaseOnSchemaChange() throws {
// 1st version of the migrator
var migrator1 = DatabaseMigrator()
Expand Down

0 comments on commit f4c763d

Please sign in to comment.