Bug #119720 Inconsistant result while executing functionally equivalent queries
Submitted: 19 Jan 17:37 Modified: 20 Jan 8:29
Reporter: Jiyuan Li Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version: 9.3.0-cluster OS:Ubuntu
Assigned to: CPU Architecture:Any

[19 Jan 17:37] Jiyuan Li
Description:
I executed two queries having same function, but got different results. 

How to repeat:
CREATE TABLE t0(c0 SMALLINT  UNIQUE PRIMARY KEY COMMENT 'asdf' , c1 INT(113) ZEROFILL  STORAGE MEMORY COMMENT 'asdf'  COLUMN_FORMAT DYNAMIC UNIQUE KEY) ;

INSERT DELAYED IGNORE INTO t0(c1, c0) VALUES(1606750385, -1.116030409E9), (0.5946388923197623, "-1068919557"), (1879501504, 0.8023517227087235);
INSERT LOW_PRIORITY IGNORE INTO t0(c0) VALUES(NULL);
UPDATE t0 SET c1=DEFAULT, c0='';

ALTER TABLE t0 FORCE, INSERT_METHOD FIRST, ROW_FORMAT DYNAMIC, STATS_PERSISTENT DEFAULT, RENAME AS t2, DELAY_KEY_WRITE 0;

SELECT ALL t2.c0 AS ref0, t2.c1 AS ref1 FROM t2;
+--------+-------------------------------------------------------------------------------------------------------------------+
| ref0   | ref1                                                                                                              |
+--------+-------------------------------------------------------------------------------------------------------------------+
|      0 |                                                                                                              NULL |
| -32768 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001606750385 |
|      1 | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001879501504 |
+--------+-------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

SELECT t2.c0 AS ref0, t2.c1 AS ref1 FROM t2 WHERE (GREATEST(5.863155804588516E-4, 0.18159833148037463)) NOT IN (t2.c0) UNION ALL SELECT ALL t2.c0 AS ref0, t2.c1 AS ref1 FROM t2 WHERE (! ((GREATEST(5.863155804588516E-4, 0.18159833148037463)) NOT IN (t2.c0))) UNION ALL SELECT t2.c0 AS ref0, t2.c1 AS ref1 FROM t2 WHERE ((GREATEST(5.863155804588516E-4, 0.18159833148037463)) NOT IN (t2.c0)) IS NULL;
+--------+------------+
| ref0   | ref1       |
+--------+------------+
|      0 |       NULL |
| -32768 | 1606750385 |
|      1 | 1879501504 |
+--------+------------+
3 rows in set, 1 warning (0.00 sec)
[20 Jan 7:54] Roy Lyseng
This is not a bug.
The ZEROFILL property is not carried through an expression, such as a UNION.
But why is this filed with the Cluster category?
[20 Jan 8:29] Jiyuan Li
Thanks for reply, I found this inconsistency on a MySQL NDB Cluster, so I added it to Cluter category.