Bug #113286 Using unquoted JSON extraction operator throws invalid syntax error
Submitted: 29 Nov 2023 17:12 Modified: 8 Jan 2024 19:16
Reporter: Aaron Mercier Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.29 OS:MacOS
Assigned to: CPU Architecture:x86

[29 Nov 2023 17:12] Aaron Mercier
Description:
When I try to use "->>" in workbench 8.0.29 connecting to mysql server 5.7.12, I get ">" is not valid at this position syntax error highlighted on the last >. I know it is valid and can run the query successfully. Am I missing a configuration setting somewhere in workbench?

https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_json-inline-pa...

How to repeat:
Connect to a mysql server and paste the following query in the editor

SELECT 
    definition->>'$.myProp1' as myProp1,
    definition->'$.myProp2' as myProp2
FROM customdata;

Note the syntax error on the second line under "->>"

Suggested fix:
Not show a syntax error for valid mysql.
[29 Nov 2023 19:08] Aaron Mercier
The link I put in the ticket is for MySQL 8.0, but it seems to still valid for 5.7 docs here.

https://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#operator_json-inline-pa...
[26 Dec 2023 6:00] MySQL Verification Team
Hello Aaron Mercier,

Thank you for the bug report.
We tried to reproduce your issue on MacOS with workbench 8.0.34 using simple example but we are not seeing any issues at our end. Please see the screenshot attached.

Regards,
Ashwini Patil
[26 Dec 2023 6:02] MySQL Verification Team
8.0.34 test results

Attachment: 113286.png (image/png, text), 68.71 KiB.

[8 Jan 2024 19:16] Aaron Mercier
Note my mysql server version is 5.7.12 and yours is 5.7.44 in the screenshot.

Copying your examples in the screenshot into my workbench editor shows an error on `SELECT a->>"$[3]..."

The query is valid for 5.7.12 though and executes without error