Skip to content

Commit 8d6ead2

Browse files
committed
fix
1 parent e15821e commit 8d6ead2

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

template/stmt.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,8 @@ func (c *cacheConn) execUpdate(ctx context.Context, queryInfo domains.CachePlanQ
272272
return inner.ExecContext(ctx, queryInfo.Query, args)
273273
}
274274

275-
uniqueValue := args[queryInfo.Update.Conditions[0].Placeholder.Index]
276-
277275
for _, cache := range cacheByTable[table] {
278-
if cache.uniqueOnly && usedBySelectQuery(cache.info.Targets, queryInfo.Update.Targets) {
279-
// we should forget the cache
280-
cache.cache.Forget(cacheKey([]driver.Value{uniqueValue.Value}))
281-
} else {
282-
if !usedBySelectQuery(cache.info.Targets, queryInfo.Update.Targets) {
283-
// no need to purge because the cache does not contain the updated column
284-
continue
285-
}
286-
cache.cache.Purge()
287-
}
276+
cache.cache.Purge()
288277
}
289278

290279
return inner.ExecContext(ctx, queryInfo.Query, args)

0 commit comments

Comments
 (0)