Bug #111433 Unexpected error on `ALL` operator
Submitted: 15 Jun 2023 9:55 Modified: 15 Jun 2023 13:52
Reporter: chi zhang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:last commit version in github OS:Any
Assigned to: CPU Architecture:Any

[15 Jun 2023 9:55] chi zhang
Description:
Consider the following program:
```
CREATE TABLE t1 (c0 INT);
SELECT * FROM t1 WHERE (NULL) != ALL (SELECT (NULL), (NULL));
```

The query triggers an error:

```
Operand should contain 1 column(s)
```

But if I remove a `NULL` value from the subquery like the following one, then it can execute without error:

```
SELECT * FROM t1 WHERE (NULL) != ALL (SELECT (NULL));
```

So I think this error is unexpected.

How to repeat:
I can reproduce this with the latest commit version in github https://github.com/mysql/mysql-server/commit/ea7087d885006918ad54458e7aad215b1650312c
[15 Jun 2023 13:52] MySQL Verification Team
Hi Mr. zhang,

Thank you for your bug report.

However, it is not a bug.

In the first query you compare a single value with a row of 2 columns. That is an error in SQL.

In the second query you compare a single value with a single value. That must work.

Please, refer to the SQL Standard 2016.

Not a bug.