Bug #102487 MySQL Error 1064 in MySQL Workbench 8.x when selecting part of query
Submitted: 5 Feb 2021 9:04 Modified: 23 Feb 2021 9:10
Reporter: Adam Marton Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.23 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[5 Feb 2021 9:04] Adam Marton
Description:
When querying a table while having a piece of the query selected (in this case: ORDER BY id DESC) will result in the following:

09:01:36 [ERR][SQL Editor Form]: Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY id DESC' at line 1 

How to repeat:
Perform a query while a piece of it has been highlighted/selected.
[10 Feb 2021 13:39] MySQL Verification Team
Hello Adam Marton,

Thank you for the bug report.
Please note that server MariaDB isn't supported by MySQL Workbench.

Regards,
Ashwini Patil
[11 Feb 2021 8:49] Adam Marton
Dear Ashwini,

Thank you for looking into this.

Unfortunately, I am able to reproduce this using MySQL Server 8.0.23. For me, this obviously seems a client error and it doesn't matter what server are you using.

Here is the result of the same using MySQL:

08:46:39	ORDER BY id DESC	Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY id DESC' at line 1	0.000 sec

Could you please confirm and fix this annoying issue?

Kind regards,
Adam Marton
[11 Feb 2021 12:54] MySQL Verification Team
Hello Adam Marton,

Thank you for the feedback.
I tried to reproduce your issue on windows 10 with workbench 8.0.23 but I am not seeing any issues at my end. 
Could you please share the sample query causing this issue? Thanks.

Regards,
Ashwini Patil
[11 Feb 2021 12:55] MySQL Verification Team
8.0.23 test results

Attachment: 102487_test_results.PNG (image/png, text), 52.63 KiB.

[11 Feb 2021 13:09] Adam Marton
Hi Ashwini,

Could you please highlight order by game_id desc; instead?
You'll see the issue immediately.

Your example works fine for me as well, because that's a valid query. Problem occurs when highlighted part of the query is not a valid SQL statement.

Hope this helps,
Adam
[11 Feb 2021 13:20] Adam Marton
illustrating the issue

Attachment: Screenshot 2021-02-11 131947.png (image/png, text), 20.60 KiB.

[11 Feb 2021 13:21] Adam Marton
Hi Ashwini,

Just uploaded a screencap to illustrate the issue. You can even see the problem in the Output pane.
[23 Feb 2021 9:10] Adam Marton
Hi Ashwini,

May I kindly ask if you have any update on this?

Thanks,
Adam