From 4373b3a49b5bc8043c7aa762f36191388ca43e7e Mon Sep 17 00:00:00 2001 From: Chris Kolbu Date: Tue, 18 Aug 2026 16:06:50 +1000 Subject: [PATCH] Fix failing tests for INTEGER PRIMARY KEY in WITHOUT ROWID tables --- GRDB/Core/Database+Schema.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GRDB/Core/Database+Schema.swift b/GRDB/Core/Database+Schema.swift index d1e17ca49..1525912c3 100644 --- a/GRDB/Core/Database+Schema.swift +++ b/GRDB/Core/Database+Schema.swift @@ -511,11 +511,12 @@ extension Database { // > DESC" clause, it does not become an alias for the rowid [...] // // FIXME: We ignore the exception, and consider all INTEGER primary - // keys as aliases for the rowid: - if pkColumn.type.uppercased() == "INTEGER" { + // keys of rowid tables as aliases for the rowid: + let tableHasRowID = try fetchTableHasRowID(table) + if pkColumn.type.uppercased() == "INTEGER" && tableHasRowID { return .rowID(pkColumn) } else { - return try .regular([pkColumn], tableHasRowID: fetchTableHasRowID(table)) + return .regular([pkColumn], tableHasRowID: tableHasRowID) } default: