Bug #121066 comment entry is not working with DELIMITER in mysql client via cli command
Submitted: 7 Aug 12:41
Reporter: Zafar Malik Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.4.4 (Any) OS:Any
Assigned to: CPU Architecture:Any
Tags: Command Line Client, MYSQL SERVER, stored procedure

[7 Aug 12:41] Zafar Malik
Description:
Mysql Client is incorrectly handling the / character inside a C-style comment when parsing input before a DELIMITER command.

Note: Same issue with "*" while working fine with other keywords like "+" etc.

How to repeat:
Case 1 : Getting error if parsing comment like /* a/b */

#command
mysql --login-path=admin <<EOF
/* a/b */ 
DELIMITER $$ SELECT 42$$ DELIMITER ;
SELECT 'PASSED' as 'status';
EOF

#output
ERROR 1064 (42000) at line 1: 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 'DELIMITER 1022549 SELECT 421022549 DELIMITER' at line 2

Case 2 : Working fine if parsing comment like -- a/b

#command
 mysql --login-path=admin <<EOF
-- a/b 
DELIMITER $$ SELECT 42$$ DELIMITER ;
SELECT 'PASSED' as 'status';
EOF

#output
status
PASSED

Case 3 : same style comment is working other than "/" in comment.

#command
mysql --login-path=admin <<EOF
/* a+b */ 
DELIMITER $$ SELECT 42$$ DELIMITER ;
SELECT 'PASSED' as 'status';
EOF

#output
status
PASSED

Suggested fix:
any character under comment should be treated as comment entry and not special character.