Bug #82114 Mysql workbench validation error
Submitted: 5 Jul 2016 13:04 Modified: 11 Oct 2016 23:47
Reporter: austin woz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.3.7 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: case, Validation

[5 Jul 2016 13:04] austin woz
Description:
In a stored procedure, using case when statement, i get syntax error and unable to save. 

the following produces an error:

CASE
    WHEN search_condition THEN statement_list
    [WHEN search_condition THEN statement_list] ...
    [ELSE statement_list]
END CASE

the following is okay:

CASE case_value
    WHEN when_value THEN statement_list
    [WHEN when_value THEN statement_list] ...
    [ELSE statement_list]
END CASE

How to repeat:

I get a syntax error in stored procedure with the following

case
	when reportType IN(100,200) then set @dateFormat='%a %d/%m/%Y';
    when reportType IN(10,20) then set @dateFormat='%u %Y';
end case;
[6 Jul 2016 4:10] MySQL Verification Team
Hello Austin,

Thank you for the report.
Observed this with WB 6.3.7 on Win7.

Thanks,
Umesh
[26 Jul 2016 9:00] Lars Kristensen
Seems like a duplicate of
http://bugs.mysql.com/bug.php?id=81932

Regards
Lars
[11 Oct 2016 23:47] Christine Cole
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.8 release, and here's the changelog entry:

A CASE statement with WHEN clauses in a stored procedure emitted syntax errors.

Thank you for the bug report.