ganncamp
(G Ann Campbell)
21 בספטמבר, 2022, 7:30pm
1
This is the second time I’ve encountered similar behavior. This time, I was able to narrow it down. If your query starts with a leading comment that includes a ‘?’, you get an error about missing parameters:
Actually add a parameter & the confusion clears and the query runs:
Or delete the question marks, and it runs.
4 לייקים
ganncamp
(G Ann Campbell)
23 בספטמבר, 2022, 6:18pm
2
It’s not just leading comments. It looks like it’s any comment with a ‘?’…?
2 לייקים
fzngagan
(Faizaan Gagan)
23 בספטמבר, 2022, 8:59pm
3
I’ve made a note of this one and we’re planning to look into improving this behavior. We’ll back to you once we’ve made some progess here.
4 לייקים
tgxworld
(Alan Tan)
7 באוקטובר, 2022, 8:03am
4
@ganncamp Thank you for the detailed report, dropping a note here to let you know we have a fix in the pipeline.
main ← add_specs
merged 01:03AM - 10 Oct 22 UTC
Before this fix, the use of PG template patterns containing ":" or the
use of "?… " in comments in the SQL will result in an error being raised
because `DB.param_encoder.encode` calls ActiveRecord's `sanitize_sql_array` which is
meant for SQL fragments and not an entire SQL string.
Instead we change data-explorer to use `MiniSql::InlineParamEncoder`
instead which takes into account of template patterns and does not trip
on `?` which is a special param encoding character used by ActiveRecord.
4 לייקים
tgxworld
(Alan Tan)
נסגר ב־
1 בנובמבר, 2022, 12:00am
5
This topic was automatically closed after 21 days. New replies are no longer allowed.