Bug #32496 In "traditional, ansi" an identifier is not more accepted, that formerly was.
Submitted: 19 Nov 2007 15:05 Modified: 9 Jan 2008 14:55
Reporter: Horst Hunger Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.0.52 OS:Linux (Suse 10.2)
Assigned to: Horst Hunger
Triage: D3 (Medium)

[19 Nov 2007 15:05] Horst Hunger
Description:
The following SQl statement fails with error 1166: Incorrect column name 'pure column f3: ' though it is and was valid:
CREATE OR REPLACE VIEW v1 AS
SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ",
3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ",
'->' || CAST(f3 AS CHAR) || '<-'
         AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): "
FROM t1 WHERE f1 = 2;
SELECT * FROM v1;

How to repeat:
run the attached test.
[19 Nov 2007 16:34] Joerg Bruehe
Effect starts in 5.0,
is a consequence of the fix for bug#27695
which extends the rules for table column names to also apply to view column names.
[22 Nov 2007 14:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38276

ChangeSet@1.2625, 2007-11-22 15:05:04+01:00, hhunger@hh-nb.hhunger +6 -0
  Modifications due to bug#32496.
[26 Nov 2007 20:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38571

ChangeSet@1.2586, 2007-11-26 21:28:01+01:00, hhunger@hh-nb.hhunger +5 -0
  patch for bug#32496 (2nd) with ansi conformant and Mysql test case.
[26 Nov 2007 21:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38578

ChangeSet@1.2615, 2007-11-26 22:50:12+01:00, hhunger@hh-nb.hhunger +2 -0
  post merge fix for bug#32496.
[27 Nov 2007 10:20] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38605

ChangeSet@1.2694, 2007-11-27 11:22:25+01:00, hhunger@hh-nb.hhunger +5 -0
  post merge fix for bug#32496
[29 Nov 2007 12:53] Bugs System
Pushed into 6.0.4-alpha
[11 Dec 2007 14:50] Bugs System
Pushed into 5.0.52
[11 Dec 2007 14:51] Bugs System
Pushed into 5.1.23-rc
[9 Jan 2008 14:55] Paul Dubois
Noted in 5.0.54, 5.1.23, 6.0.4 changelogs.

The rules for valid column names were being applied differently for
base tables and views.