Description:
When using the Visual Studio query designer with MySQL Connector NET IF statements are automatically quoted with ` since it is considered as a column.
This can be resolved by adding IF at the reserved words of the MySQL Driver in strings.resx under "MySQL.Data.MySqlClient".
By adding the CASE WHEN THEN ELSE END words also in reserved words it will also allow the CASE statement to work in the designer.
I actually download the source code and recompile it with these changes every time I update my projects with the new driver I thought it would be nice to include it at the public release!
How to repeat:
Open the visual studio query designer at any datatable or query and add an IF statement (e.g. IF(col1 = 1,0,1) ).
Close the query designer and reopen it.
You'll notice that the IF clause is enclosed in quotes (`IF`) and the query is erroneous.
Suggested fix:
Add IF CASE WHEN THEN ELSE END reserved words of the MySQL Driver in strings.resx under "MySQL.Data.MySqlClient".
I think CASE WHEN THEN ELSE are already there!