Bug #54097 Right click "Create Schema..." creates invalid SQL for collation
Submitted: 31 May 2010 8:40 Modified: 11 Jun 2010 14:49
Reporter: Anders Stalheim Øfsdahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.21 OS:Windows (Windows 7)
Assigned to: Alexander Musienko CPU Architecture:Any
Tags: collation

[31 May 2010 8:40] Anders Stalheim Øfsdahl
Description:
When trying to create a new schema with collation 'utf8 - default collation' by right clicking in SQL Editor view, the generated SQL failes when applying.

How to repeat:
Open an SQL Editor view, right click "Create Schema...", select a name and choose collation = 'utf8 - default collation'.

The generated SQL is:
CREATE SCHEMA IF NOT EXISTS `TableName` DEFAULT CHARACTER SET utf8 COLLATE default collation ;

This failes with the following error:
Error Code: 1064
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 'collation' at line 1)

Suggested fix:
Create correct SQL for the CREATE SCHEMA query.
[31 May 2010 12:44] MySQL Verification Team
Thank you for the bug report.
[9 Jun 2010 19:47] Johannes Taxacher
fix confirmed in repository
[11 Jun 2010 14:49] Tony Bedford
An entry has been added to the 5.2.23 changelog:

In the SQL Editor, when attempting to create a new schema using Create Schema, with a server collation of utf8 - default collation, the generated SQL resulted in an error when applied.