Fix failing tests for INTEGER PRIMARY KEY in WITHOUT ROWID tables

This commit is contained in:
Chris Kolbu committed 2026-08-18 19:55:41 +10:00
1 parent d4713c1fa8
commit 4373b3a49b
1 file changed
+4 -3
+4 -3
View File
@@ -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: