Bug #64979 WB allows any character in identifiers (table names, column names, FK names etc)
Submitted: 14 Apr 2012 7:38 Modified: 22 Jan 2013 10:21
Reporter: Karsten Wutzke Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.2.x OS:Any
Assigned to: CPU Architecture:Any
Tags: column name, foreign key name, identifier, table name

[14 Apr 2012 7:38] Karsten Wutzke
Description:
It's hard to believe, but WB allows *any* characters for its identifiers, e.g. table names, column names, foreign key names, index names etc., that is basically anything that actually has a naming restriction bound to it due to SQL.

The invalid identifiers are propagated to Forward Engineering to produce invalid SQL code. Other tools are also affected. It's very bad to not be able to rely on identifiers to be correct.

This is extremely ridiculous behavior of an application in the year 2012!

How to repeat:
see above

Suggested fix:
Immediately display an error message that the name is invalid. Still keep the old invalid string for editing though.
[14 Apr 2012 7:49] Peter Laursen
MySQL from 5.1 allows any Unicode character (except for the NULL character) in identifiers. Actually also SQL standards require identifiers to be Unicode.  They are not restricted to any natural language (like English) or a reduced computer character set (like ASCII).

So as the server allows for use of full Unicode then of course clients also should. 

Peter
(not a MySQL person -
- but one of those who has ridiculed early WB for supporting only ASCII in identifiers)
[14 Apr 2012 7:55] Karsten Wutzke
Well, okay I kind of give up on that one, but the policy of basically allowing any character does not make sense to me. Maybe WB can introduce an option to "Restrict identifiers to common characters" and show an error if this is set.

Still riddled who actually makes use of that. This can only have migration reasons.
[14 Apr 2012 7:58] Karsten Wutzke
And yes, +1 for your discovery of WB only allowing ASCII, but then allowing any special characters. WB -1 for that.
[14 Apr 2012 8:26] Valeriy Kravchuk
This option suggested, "Restrict identifiers to common characters", makes sense, especially when somebody tries to work with MySQL server 5.0.x. So, let's say this is a reasonable enough feature request.
[14 Apr 2012 10:30] Karsten Wutzke
It also makes sense for people writing WB code generators ;-), where the target language restricts identifiers to the regex pattern [A-Za-z][A-Za-z0-9_]+ , like almost any language...

Can you change this to such a feature request? Otherwise I'd have to inspect the model to look for invalid identifiers, which would be pretty... um... redundant.
[14 Apr 2012 10:49] Peter Laursen
In my opinion 'common characters' include the letters of any current natural language (Chinese, Russian, Hindi .. whatever). The idea that non-English people should English in their computer life is 20 years outdated. 

The restriction to 'common characters' makes sense only for symbols, non-printable characters (such as ASCII range 1-32) etc.
[14 Apr 2012 10:59] Peter Laursen
(excurse: 

I will consider posting a request for the MySQL SQL dialect to be localized,  it can easily be done like this: http://www.webyog.com/blog/2011/10/17/how-to-localize-sqlyog/

I am serious acutally. It is only a matter of enabling ínterchangeability of a few dozens of keywords, the error messages etc. and one programmer can write code in Chinese and another read the same code in English.  They may even contribute to a project in their native languages.

It started with ALGOL68 45 years back actually! 
http://en.wikipedia.org/wiki/Non-English-based_programming_languages)
[14 Apr 2012 11:04] Karsten Wutzke
Admitted, my regex example was incomplete. Common characters would definitely be international characters, too. But I think special chars should be considered uncommon.
[22 Jan 2013 10:21] Mike Lischke
This request makes no sense at all. Unicode identifiers are allowed since 5.0 (http://dev.mysql.com/doc/refman/5.0/en/identifiers.html). We won't keep people from using the characters they want for their identifers.