Bug #57759 Strange parsing error bug
Submitted: 27 Oct 2010 3:37 Modified: 28 Oct 2010 0:26
Reporter: Roel Van de Paar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.0.77, 5.0.90, 5.1, 5.5.6rc OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[27 Oct 2010 3:37] Roel Van de Paar
Description:
As per 'how to repeat'. Some fail, some work. This may or may not be limited to CREATE VIEW. Possible regression (will check). Possibly quite serious.

How to repeat:
DROP TABLE IF EXISTS `test`;
DROP TABLE IF EXISTS `t1`;
DROP VIEW IF EXISTS `test`; 
CREATE VIEW `test` AS select 1 AS `REPLACE(REPLACE(A.``FFFFFFFFFFFFFFFFFFFFFFFFFF``,'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `test`; 
CREATE VIEW `test` AS select 1 AS `REPLACE(REPLACE(A.``FFFFFFFFFFFFFFFFFFFFFFFFF`` ,'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `test`; 
CREATE VIEW `test` AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFFF``,'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `test`; 
CREATE VIEW `test` AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFF`` ,'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `t1`; 
CREATE VIEW `t1`   AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFF`` ,'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `test`; 
CREATE VIEW `test` AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFF``, 'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `t1`; 
CREATE VIEW `t1`   AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFF``, 'a','b'),'c', 'd')`; /* Fails */
DROP VIEW IF EXISTS `test`; 
CREATE VIEW `test` AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFF``,'a','b'),'c', 'd')`;  /* Works */
DROP VIEW IF EXISTS `t1`; 
CREATE VIEW `t1`   AS select 1 AS `REPLACE(REPLACE(T.``FFFFFFFFFFFFFFFFFFFFFFFFF``,'a','b'),'c', 'd')`;  /* Works */
[27 Oct 2010 3:48] Roel Van de Paar
Regression. Not present in 5.0.45, though present in 5.0.77 and in 5.1.23a.
[27 Oct 2010 16:31] Davi Arnaut
There are length and format restrictions on column names/alias, specially in views. Have you verified?
[28 Oct 2010 0:26] Roel Van de Paar
Thanks Davi, that clarifies:

"As of MySQL 5.0.52, aliases for column names in CREATE VIEW statements are checked against the maximum column length of 64 characters (not the maximum alias length of 256 characters)."
http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

"As of MySQL 5.1.23, aliases for column names in CREATE VIEW statements are checked against the maximum column length of 64 characters (not the maximum alias length of 256 characters)."
http://dev.mysql.com/doc/refman/5.1/en/identifiers.html

Marking as not a bug.