Bug #44947 Allow Full View Alias Length
Submitted: 19 May 2009 8:30 Modified: 15 Jul 2009 17:28
Reporter: Frank Osterberg Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:5.1.30+ OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: alias, LENGTH, MAX, maximum, VIEW

[19 May 2009 8:30] Frank Osterberg
Description:
For some reason newer versions of MySQL no longer allow the full 256 Character Alias length as described on:
http://dev.mysql.com/doc/refman/5.1/en/identifiers.html

I found that the View restrictions limit aliases to 64 characters although it did not do that in the past and although that is not conform with the identifiers definition of aliases (see above).
http://dev.mysql.com/doc/refman/5.1/en/view-restrictions.html

How to repeat:
Works fine:
select 1 as '123456789 123456789 123456789 123456789 123456789 123456789 123456789';

Fails:
create view Test
select 1 as '123456789 123456789 123456789 123456789 123456789 123456789 123456789';

Suggested fix:
Allow the full 256 Character length Aliases in Views as defined in:
http://dev.mysql.com/doc/refman/5.1/en/identifiers.html
Please revert back to whatever to when it was working.
[9 Jun 2009 6:51] Valeriy Kravchuk
Assuming that changing limit to 64 was intended and for a good reason, we should at least mention this limit for column aliases used in CREATE VIEW explicitly in http://dev.mysql.com/doc/refman/5.1/en/identifiers.html.
[15 Jul 2009 17:28] Paul DuBois
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 products.

This change came about as a result of Bug#36287:

As of 5.0.52/5.1.23/6.0.4, aliases for column names in CREATE VIEW
statements are checked against the column length restriction of 64
characters.

I'll update http://dev.mysql.com/doc/refman/5.1/en/identifiers.html to note this restriction for views.