Description
If you use both the Update and UpdateColumns functions, they should generate different SQL statements depending on the column filter used. This seems to work, but the update query appears to be cached so a call to UpdateColumns followed by a call to Update results in the first update query being reused. This is obviously the wrong query and many fields are missing from the update.
I believe the problem is in the bindUpdate() function. Line 175 of table_bindings.go reads
plan := t.updatePlan
if plan.query == "" {
s := bytes.Buffer{}
... generate the sql query ...
plan.query = s.String()
t.updatePlan = plan
}
The first time this is called, it generates a query. The next time it's called it appears to use the first query regardless of the column filter passed. Unless, I'm mistaken, the first query generated is used for all subsequent Updates.
My current workaround is to always use Update(), but this is pretty inefficient so I'm hoping for a fix.
Thanks,
Scott