Bug #104053 Can't create stored procedures with hexstring bit operations from Workbench
Submitted: 18 Jun 2021 5:32 Modified: 18 Jun 2021 6:35
Reporter: David personal Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.25 OS:Windows
Assigned to: CPU Architecture:x86

[18 Jun 2021 5:32] David personal
Description:
The sql docs provide an example of how to perform bit operations using hex literals: SELECT X'7F' | X'80', X'80' << 2, BIT_COUNT(X'0F').  Pasting that code into a workbench sql tab puts a red wavy line under the '|' operator and a big red x next to the line, but it does run.

However attempt to put that same line into a stored procedure, and the procedure refuses to save: "The object's DDL statement contains syntax errors."

Creating the procedure "manually" via the mysql executable works correctly, but is awkward.  Note that attempting to edit the manually created procedures back in workbench doesn't work right either:  "Error Parsing DDL for showbug"

In case it matters, that sample SELECT was from https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html

How to repeat:
From within a workbench "create stored procedure" window:

CREATE PROCEDURE `showbug` ()
BEGIN
SELECT X'7F' | X'80', X'80' << 2, BIT_COUNT(X'0F');
END

Suggested fix:
Apparently workbench does some additional parsing/verification before sending the command the the server, and it wasn't updated to support 8.0's enhancement to this feature.
[18 Jun 2021 6:35] MySQL Verification Team
Hello David personal,

Thank you for the report and feedback.

regards,
Umesh