[MDEV-25539] Misleading error messages when using unsupported quantified comparison predicates of degree > 1 Created: 2021-04-27  Updated: 2021-04-28

Status: Open
Project: MariaDB Server
Component/s: Data Manipulation - Subquery
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Lukas Eder Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Run any of these queries:

select (1, 1) = all (select 1 as `a`, 1 as `b`) as a;
select (1, 1) < any (select 1 as `a`, 1 as `b`) as a;

To get this error:

SQL Error [1241] [21000]: Operand should contain 1 column(s)

This query works just fine:

select (1, 1) = any (select 1 as `a`, 1 as `b`) as a;
select (1, 1) != all (select 1 as `a`, 1 as `b`) as a;

It seems like the operands that map to IN or NOT IN are implemented, but not the others. If the correct implementation of the feature is not a high priority, I would at least suggest a fix in the error message, to hint at a missing implementation, rather than a syntax error.

For example this query here:

select 1 in (select 1 limit 1)

Offers a much more helpful error message:

SQL Error [1235] [42000]: (conn=5) This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'


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