[MDEV-15125] view is created, but can't be used Created: 2018-01-30  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Alice Sherepa Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

CREATE VIEW vv AS SELECT 1 AS i1 FROM dual GROUP BY i1;
select * from vv;

MariaDB [test]> SELECT 1 AS i1 FROM dual GROUP BY i1;
+----+
| i1 |
+----+
|  1 |
+----+
1 row in set (0.00 sec)
 
MariaDB [test]> CREATE VIEW vv AS SELECT 1 AS i1 FROM dual GROUP BY i1;
Query OK, 0 rows affected (0.06 sec)
 
MariaDB [test]> show tables;
+----------------+
| Tables_in_test |
+----------------+
| vv             |
+----------------+
1 row in set (0.00 sec)
 
MariaDB [test]> select * from vv;
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 'group by ''' at line 1

Also view is created incorrect, from vv.frm:

view_body_utf8=select 1 AS `i1` group by \'\'
mariadb-version=100131



 Comments   
Comment by Alice Sherepa [ 2019-03-18 ]

Reproducible on 10.1-10.3, no error on 10.4, works as expected.

10.3 4f410473ed360963

CREATE VIEW vv AS SELECT 1 AS i1 FROM dual GROUP BY i1;
show tables;
Tables_in_test
vv
select * from vv;
main.1_my 'innodb'                       [ fail ]
        Test ended at 2019-03-18 12:13:25
 
CURRENT_TEST: main.1_my
mysqltest: At line 18: query 'select * from vv' failed: 1064: 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 'group by ''' at line 1

Generated at Thu Feb 08 08:18:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.