Bug #115362 Incorrect result in simple query with condition false
Submitted: 17 Jun 2024 14:58 Modified: 17 Jun 2024 15:39
Reporter: Fernando Hartmann Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0.37 OS:Any
Assigned to: CPU Architecture:Any

[17 Jun 2024 14:58] Fernando Hartmann
Description:
The simple query below returns "true", but it should result in empty result

Execute

> select true where false;

Returns 

> true

How to repeat:
Execute

> select true where false;

Returns 

> true

The same happens for query 

> select true where 1 != 1;

Returns

> true 

The same happens when reading from table, in my example Field has no null values but

> select true from Table where  Field is null 

Returns 

> true 

Suggested fix:
Should return empty result set when condition on where cause result in false
[17 Jun 2024 15:23] MySQL Verification Team
Hi Mr. Hartmann,

Thank you for your bug report.

We do not know which product have you tested, but our official 8.0.37 binaries work like a charm:

mysql> select true where false;
Empty set (0.00 sec)

mysql> select 1 where 0;
Empty set (0.00 sec)

mysql> select true where 1 != 1;
Empty set (0.00 sec)

Can't repeat.
[17 Jun 2024 15:39] Fernando Hartmann
You are correct
Is my build problem, thanks for you quick response
[18 Jun 2024 10:04] MySQL Verification Team
You are truly welcome.