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.