[MDEV-10933] Syntax error when WITH clause is used in CREATE SELECT. Created: 2016-09-30  Updated: 2016-10-11  Resolved: 2016-10-11

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - CTE
Affects Version/s: 10.2.2
Fix Version/s: 10.2.3

Type: Bug Priority: Major
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None


 Description   

When a WITH clause is attached to the unit from CREATE ... SELECT and the unit with this clause are parenthesis then the parser returns a syntax error:

MariaDB [test]> create table my_ancestors ( with recursive ancestor_ids (id) as (   select father from folks where name = 'Me'   union   select mother from folks where name = 'Me'   union   select father from folks, ancestor_ids a  where folks.id = a.id   union   select mother from folks, ancestor_ids a  where folks.id = a.id ) select p.* from folks as p, ancestor_ids as a where p.id = a.id );
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 'recursive ancestor_ids (id) as (   select father from folks where name = 'Me'   ' at line 1



 Comments   
Comment by Igor Babaev [ 2016-10-11 ]

The fix for this bug was pushed into the 10.2 tree.

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