Skip to content

Commit

Permalink
tmpl
Browse files Browse the repository at this point in the history
  • Loading branch information
pirosiki197 committed Jan 26, 2025
1 parent 8d6ead2 commit 0156cd3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions template/stmt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,8 @@ func (c *cacheConn) execUpdate(ctx context.Context, queryInfo domains.CachePlanQ
return inner.ExecContext(ctx, queryInfo.Query, args)
}

uniqueValue := args[queryInfo.Update.Conditions[0].Placeholder.Index]

for _, cache := range cacheByTable[table] {
if cache.uniqueOnly && usedBySelectQuery(cache.info.Targets, queryInfo.Update.Targets) {
// we should forget the cache
cache.cache.Forget(cacheKey([]driver.Value{uniqueValue.Value}))
} else {
if !usedBySelectQuery(cache.info.Targets, queryInfo.Update.Targets) {
// no need to purge because the cache does not contain the updated column
continue
}
cache.cache.Purge()
}
cache.cache.Purge()
}

return inner.ExecContext(ctx, queryInfo.Query, args)
Expand Down

0 comments on commit 0156cd3

Please sign in to comment.