Failing test for #758

This commit is contained in:
Gwendal Roué committed 2020-04-14 12:51:24 +02:00
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)