Bug #45346 VIEW containing INTERVAL(...) can be created but does not work
Submitted: 5 Jun 2009 10:00 Modified: 26 Sep 2012 14:16
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Views Severity:S3 (Non-critical)
Version:6.0, 5.4, 5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: interval
Triage: Triaged: D2 (Serious)

[5 Jun 2009 10:00] Matthias Leich
Description:
I found this bug when playing a bit with "--view-protocol".
CREATE OR REPLACE VIEW v1 AS
SELECT INTERVAL(55,10) AS my_col;
SHOW TABLES;
Tables_in_test
v1
   <--- ok, so the VIEW was really created
SELECT INTERVAL(55,10) AS my_col;
my_col
1
   <--- ok, the SELECT has correct syntax
SHOW CREATE VIEW v1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `my_col`' at line 1
   <--- Why this?
SELECT * FROM v1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `my_col`' at line 1
   <--- Why this?

My environment:
- mysql-5.1-bugteam, mysql-azalea End of May 2009
  ./BUILD/compile-pentium64-debug-max
- Linux OpenSuSE 11.0 (64 Bit)
- Inetl Core2Duo (64 Bit)

How to repeat:
Please use the statements above or use the
attached files.
[5 Jun 2009 10:13] Matthias Leich
test script

Attachment: ml020.test (application/octet-stream, text), 686 bytes.

[5 Jun 2009 10:13] Matthias Leich
Expected results

Attachment: ml020.result (application/octet-stream, text), 235 bytes.

[26 Sep 2012 14:16] Jon Stephens
Fixed in trunk, currently tagged 5.7.0.