Bug #120670 Incorrect result for `NOT(...) && GREATEST(...) AND literal`
Submitted: 13 Jun 17:30
Reporter: mu mu Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:9.6.0 OS:Ubuntu
Assigned to: CPU Architecture:Any

[13 Jun 17:30] mu mu
Description:
On identical table data, `WHERE NOT((NOT(c0)) && GREATEST(c0, ...) AND 0.42641949642449517)` should return **3** rows, but MySQL 9.6.0 returns **4** rows.

How to repeat:
DROP TABLE IF EXISTS `t0`;

CREATE TABLE `t0` (
  `c0` int(146) unsigned zerofill DEFAULT NULL COMMENT 'asdf',
  UNIQUE KEY `c0` (`c0`),
  UNIQUE KEY `i1` (`c0`),
  UNIQUE KEY `i0` ((least(1.25936934E8,NULL))) 
);

INSERT INTO `t0` (`c0`) VALUES (NULL);
INSERT INTO `t0` (`c0`) VALUES (NULL);
INSERT INTO `t0` (`c0`) VALUES (NULL);
INSERT INTO `t0` (`c0`) VALUES (NULL);
INSERT INTO `t0` (`c0`) VALUES (NULL);
INSERT INTO `t0` (`c0`) VALUES (0);
INSERT INTO `t0` (`c0`) VALUES (153934357);
INSERT INTO `t0` (`c0`) VALUES (396613325);
INSERT INTO `t0` (`c0`) VALUES (1185140620);

SELECT ALL t0.c0 AS ref0 FROM t0 WHERE (! ((((! (t0.c0))) && (GREATEST(t0.c0, 0.7678046017515187, -875150723, ''))) AND (0.42641949642449517)));