[MDEV-7482] VIEW containing INTERVAL(...) Created: 2015-01-20  Updated: 2015-02-22  Resolved: 2015-02-20

Status: Closed
Project: MariaDB Server
Component/s: Views
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5, 10.0
Fix Version/s: 10.0.17

Type: Bug Priority: Major
Reporter: Takuya Aoki (Inactive) Assignee: Sergei Golubchik
Resolution: Fixed Votes: 2
Labels: upstream-fixed, verified


 Description   

This bug is the same as below and was fixed in MySQL 5.7.0
http://bugs.mysql.com/bug.php?id=45346
http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-0.html

It still occurs in Maria though.

[root@kc1060 ~]# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 804
Server version: 10.0.15-MariaDB-log MariaDB Server
 
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [test]> SELECT INTERVAL(55,10) AS my_col;
+--------+
| my_col |
+--------+
|      1 |
+--------+
1 row in set (0.01 sec)
 
MariaDB [test]> CREATE OR REPLACE VIEW v1 AS SELECT INTERVAL(55,10) AS my_col;
Query OK, 0 rows affected (0.03 sec)
 
MariaDB [test]> SHOW CREATE VIEW v1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS `my_col`' at line 1
MariaDB [test]> SELECT * FROM v1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS `my_col`' at line 1



 Comments   
Comment by Takuya Aoki (Inactive) [ 2015-02-06 ]

Can this bug be fixed?
It is crucial since I have to write all INTERVALS in VIEWS as a CASE sentence.

Comment by Ed Jackson [ 2015-02-14 ]

I have the same error trying to restore a db in mariadb 10.0.16: is this related or is this a separate issue?:

server1:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 6085
Server version: 10.0.16-MariaDB-1~wheezy-log mariadb.org binary distribution

Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> mysql -e "source /data/disk/arch/sql/server1.domain.biz-150209-0008/xnlasocitgyabcom.sql.gz" xnlas
ocitgyabc_0 ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server ve
rsion for the right syntax to use near 'mysql -e "source /data/disk/arch/sql/server1.domain.biz-150209-0008/xnlasoci
tgy' at line 1
MariaDB [(none)]> mysql xnlasocitygyabc_0 < /data/disk/arch/sql/server1.domain.biz-150209-0008/xnlasocitgyabcom.sql.
gz
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server ve
rsion for the right syntax to use near 'mysql xnlasocitygyabc_0 < /data/disk/arch/sql/server1.domain.biz-150209-0008
/xn' at line 1
MariaDB [(none)]>

Generated at Thu Feb 08 07:19:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.