Skip to content

Fix bug in sqltemplate cache path around args order#1243

Merged
brandur merged 1 commit intomasterfrom
brandur-named-args-fix
May 8, 2026
Merged

Fix bug in sqltemplate cache path around args order#1243
brandur merged 1 commit intomasterfrom
brandur-named-args-fix

Conversation

@brandur
Copy link
Copy Markdown
Contributor

@brandur brandur commented May 8, 2026

Related to #1242. Activating caching everywhere revealed a bug in that
we were adding named args using maputil.Values. The problem with this
is that maputil.Values returns values in an arbitrary order, resulting
in all kinds of odd things potentially happening during a query as args
are switched around.

Here, fix the problem by appending args in the same order as incoming
map keys.

Related to #1242. Activating caching everywhere revealed a bug in that
we were adding named args using `maputil.Values`. The problem with this
is that `maputil.Values` returns values in an arbitrary order, resulting
in all kinds of odd things potentially happening during a query as args
are switched around.

Here, fix the problem by appending args in the same order as incoming
map keys.
@brandur
Copy link
Copy Markdown
Contributor Author

brandur commented May 8, 2026

@bgentry Mind taking a look at this one? Small bug fix.

@brandur brandur merged commit d8c3909 into master May 8, 2026
15 checks passed
@brandur brandur deleted the brandur-named-args-fix branch May 8, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants