mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Failing test for #758
This commit is contained in:
1 parent
f4e2645e13
commit
07609e8a3f
1 file changed
+10
@@ -432,6 +432,16 @@ class MutablePersistableRecordUpdateTests: GRDBTestCase {
|
||||
JOIN "team" ON "team"."id" = "player"."teamId")
|
||||
""")
|
||||
}
|
||||
do {
|
||||
// Regression test for https://github.com/groue/GRDB.swift/issues/758
|
||||
try Player.including(required: Player.team.filter(Column("active") == 1)).updateAll(db, Column("score") <- 0)
|
||||
XCTAssertEqual(self.lastSQLQuery, """
|
||||
UPDATE "player" SET "score" = 0 WHERE rowid IN (\
|
||||
SELECT "player"."rowid" \
|
||||
FROM "player" \
|
||||
JOIN "team" ON ("team"."id" = "player"."teamId") AND ("team"."active" = 1))
|
||||
""")
|
||||
}
|
||||
do {
|
||||
let alias = TableAlias(name: "p")
|
||||
try Player.aliased(alias).including(required: Player.team).updateAll(db, Column("score") <- 0)
|
||||
|
||||
Reference in new issue
Block a user