Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.1, 6.0
-
None
-
Ubuntu 20.04
Postgresql 12
Qt 5.15.1
-
-
e532933a2 (dev)
Description
When trying to prepare a query that uses the '@?' jsonb operator, Qt confuses that operator for a query parameter (because of the '?').
Here is a fiddle that demonstrates the behavior:
https://www.db-fiddle.com/f/4jyoMCicNSZpjMt4jFYoz5/2444
And in case the fiddle goes down, here are the commands it runs:
CREATE TABLE my_table (my_column jsonb);
INSERT INTO my_table (my_column) VALUES ('
{"a":[1, 2]}');
– Trying to prepare something of the form
– SELECT * FROM my_table WHERE my_column @? :condition;
– Doesn't work in Qt. The '?' in the '@?' operator is mistaken for a parameter.
SELECT * FROM my_table WHERE my_column @? '$.a[*] ? (@ == 1)';
– Works. The '@@' operator can't be a parameter
SELECT * FROM my_table WHERE my_column @@ '$.a[*] == 1';
Attachments
Issue Links
- relates to
-
QTBUG-120548 QSqlQuery::positionalBindingEnabled improvements
- Closed
For Gerrit Dashboard: QTBUG-96636 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
462869,14 | SQL/PSQL: Handle jsonb operators in prepared queries | dev | qt/qtbase | Status: MERGED | +2 | 0 |