ganncamp
(G Ann Campbell)
September 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 Likes
ganncamp
(G Ann Campbell)
September 23, 2022, 6:18pm
2
It’s not just leading comments. It looks like it’s any comment with a ‘?’…?
2 Likes
fzngagan
(Faizaan Gagan)
September 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 Likes
tgxworld
(Alan Tan)
October 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.
discourse:main
← discourse:add_specs
opened 08:02AM - 07 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 Likes
tgxworld
(Alan Tan)
Closed
November 1, 2022, 12:00am
5
This topic was automatically closed after 21 days. New replies are no longer allowed.