Bug #97281 Histogram creation and removal staments with syntax errors in Workbench
Submitted: 18 Oct 2019 7:40 Modified: 14 Jan 2020 7:32
Reporter: Georgi Sotirov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.18 OS:Microsoft Windows
Assigned to: CPU Architecture:x86

[18 Oct 2019 7:40] Georgi Sotirov
Description:
ANALYZE TABLE stamens for update and removal of histogram show syntax error '"UPDATE" is not valid at this position; expecting: EOF, ";"' and '"DROP" is not valid at this position; expecting: EOF, ";"' in MySQL Workbench's SQL editor (see attached screenshot). Histogram support was added in MySQL 8.0.3 RC that was released more than 2 years ago and I'm using MySQL Workbench 8.0.18, connected to MySQL Community server 8.0.18 that were released on Monday.

How to repeat:
1. Write the following or similar statements in MySQL Workbench's SQL editor:

ANALYZE TABLE emp UPDATE HISTOGRAM ON job WITH 5 BUCKETS;

ANALYZE TABLE emp DROP HISTOGRAM ON job;

2. The statements show syntax error on UPDATE and DROP keywords although they could be executed successfully.

Suggested fix:
No syntax error since the syntax is correct and possible since MYSQL 8.0.3
[18 Oct 2019 7:45] Georgi Sotirov
ANALYZE TABLE with UPDATE or DROP shows syntax error in Workbench

Attachment: wb_analyze_table_histogram_error.png (image/png, text), 12.61 KiB.

[22 Oct 2019 6:22] MySQL Verification Team
Hello Georgi Sotirov,

Thank you for the report.
Verified as described.

Regards,
Ashwini Patil
[22 Oct 2019 6:26] MySQL Verification Team
8.0.18 test results

Attachment: 97281_results.docx (application/vnd.openxmlformats-officedocument.wordprocessingml.document, text), 383.35 KiB.

[28 Oct 2019 19:05] Christine Cole
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 8.0.19 release, and here's the changelog entry:

A syntax error was generated for valid ANALYZE TABLE statements with
either the UPDATE HISTOGRAM or DROP HISTOGRAM clause.

Thank you for the bug report.
[14 Jan 2020 7:32] Georgi Sotirov
Verified fixed in Workbench 8.0.19 released yesterday.