[MDEV-20730] Syntax error on SELECT INTO @variable with CTE Created: 2019-10-02  Updated: 2019-10-18  Resolved: 2019-10-18

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.4
Fix Version/s: 10.4.9

Type: Bug Priority: Critical
Reporter: Jacob Williams Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: regression, sql
Environment:

Official Docker images 10.4.0-10.4.8



 Description   

This worked in 10.2 and 10.3 but has syntax error in 10.4. I couldn't find any documentation of the change.

with data as (select 1 as id)
select id into @myid from data;

ERROR 1064 (42000) at line 1: 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 'from data' at line 1



 Comments   
Comment by Elena Stepanova [ 2019-10-02 ]

Thanks for the report.

Comment by Oleksandr Byelkin [ 2019-10-17 ]

Workaround is a deprecated syntax:

with data as (select 1 as id)
select id from data into @myid;

Generated at Thu Feb 08 09:01:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.