[MDEV-9971] SUBSELECT does not always work as a row element Created: 2016-04-22  Updated: 2017-10-05  Resolved: 2017-10-05

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

This query works fine and returns 1:

SELECT (1,1)=(SELECT 1,1);

This query returns an error:

SELECT (1,1)=(1,SELECT 1);

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 'SELECT 1)' at line 1



 Comments   
Comment by Alexander Barkov [ 2017-10-05 ]

Not a bug. The correct syntax is:

SELECT (1,1)=(1,(SELECT 1));

and this works fine.

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