Bug #3914 Problem with whitespace at end of column name
Submitted: 27 May 2004 16:02 Modified: 9 Jun 2004 11:38
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.20 OS:Linux (Red Hat Enterprise Linux 3)
Assigned to: Victor Vagin CPU Architecture:Any

[27 May 2004 16:02] [ name withheld ]
Description:
MySQL 4.0.20 doesn't accept CREATE TABLE with a column name containing a whitespace at the end of a column name. 

Version 4.0.18 accepts the columns just fine.

The problem:

If you have such table dumped with "mysqldump" from 4.0.18, you can't import it back with the "mysql" command under 4.0.20.

I'm sure this is related to the fixes from bug #2985. 

How to repeat:
MySQL 4.0.20:

mysql> CREATE TABLE test (`test column ` TINYTEXT);
ERROR 1166: Incorrect column name 'test column '

MySQL 4.0.18:

mysql> CREATE TABLE test (`test column ` TINYTEXT);
Query OK, 0 rows affected (0.00 sec)

Suggested fix:
I don't see why space at the end columns shouldn't be allowed.
[27 May 2004 16:46] Dean Ellis
Verified.  Thank you for reporting it.
[9 Jun 2004 11:38] Victor Vagin
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Whitespaces at the end of column names can cause problems in mysql (take a look at http://bugs.mysql.com/bug.php?id=2985 for instance) because mysql stores such names in 'CHAR' fields which trim them.

So, we forbade such names in mysql-4.0.19 but we were late to update manual.

you can read this rule here:
http://dev.mysql.com/doc/mysql/en/Legal_names.html:
"Database, table, and column names should not end with space characters"
[11 Jun 2004 12:38] [ name withheld ]
What happens if we upgrade from 4.0.18 -> 4.0.20 without re-importing databases? Will 4.0.20 handle whitespace at the end of a column name in existing MyISAM tables?