diff --git a/GRDB/QueryInterface/FTS5+QueryInterface.swift b/GRDB/QueryInterface/FTS5+QueryInterface.swift index e6c2c72b2..dcf0272ee 100644 --- a/GRDB/QueryInterface/FTS5+QueryInterface.swift +++ b/GRDB/QueryInterface/FTS5+QueryInterface.swift @@ -48,11 +48,8 @@ extension ColumnExpression { /// /// // content MATCH '...' /// Column("content").match(pattern) - /// - /// If the search pattern is nil, SQLite will evaluate the expression - /// to false. - public func match(_ pattern: FTS5Pattern?) -> SQLExpression { - .binary(.match, sqlExpression, pattern?.sqlExpression ?? .null) + public func match(_ pattern: FTS5Pattern) -> SQLExpression { + .binary(.match, sqlExpression, pattern.sqlExpression) } } #endif diff --git a/Tests/GRDBTests/FTS5RecordTests.swift b/Tests/GRDBTests/FTS5RecordTests.swift index f854c9fdf..fd1fcd26c 100644 --- a/Tests/GRDBTests/FTS5RecordTests.swift +++ b/Tests/GRDBTests/FTS5RecordTests.swift @@ -89,9 +89,6 @@ class FTS5RecordTests: GRDBTestCase { let pattern = FTS5Pattern(matchingAllTokensIn: "") XCTAssertTrue(pattern == nil) XCTAssertEqual(try Book.matching(pattern).fetchCount(db), 0) - XCTAssertEqual(try Book.filter(Column("books").match(pattern)).fetchCount(db), 0) - XCTAssertEqual(try Book.filter(Column("author").match(pattern)).fetchCount(db), 0) - XCTAssertEqual(try Book.filter(Column("title").match(pattern)).fetchCount(db), 0) } }