Description:
A join between a DOUBLE column and a BIGINT column returns an empty set
when a UNIQUE index exists. After dropping the index, a matching row is
returned.
SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1;
empty set;
drop index c1 on t0;
SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1;(2098885691505768900,209888569150576900)
How to repeat:
DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
USE test;
CREATE TABLE `t0` (
`c1` bigint,
UNIQUE KEY `c1` (`c1`)
) ENGINE=MEMORY;
CREATE TABLE `t1` (
`c0` double ,
`c1` bigint ,
`c2` float
) ENGINE=MEMORY;
INSERT INTO t1(c0) VALUES(209888569150576900);
INSERT INTO t0(c1) VALUES("209888569150576900");
INSERT INTO t0(c1) VALUES(NULL);
SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1;
drop index c1 on t0;
SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1;
Description: A join between a DOUBLE column and a BIGINT column returns an empty set when a UNIQUE index exists. After dropping the index, a matching row is returned. SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1; empty set; drop index c1 on t0; SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1;(2098885691505768900,209888569150576900) How to repeat: DROP DATABASE IF EXISTS test; CREATE DATABASE test; USE test; CREATE TABLE `t0` ( `c1` bigint, UNIQUE KEY `c1` (`c1`) ) ENGINE=MEMORY; CREATE TABLE `t1` ( `c0` double , `c1` bigint , `c2` float ) ENGINE=MEMORY; INSERT INTO t1(c0) VALUES(209888569150576900); INSERT INTO t0(c1) VALUES("209888569150576900"); INSERT INTO t0(c1) VALUES(NULL); SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1; drop index c1 on t0; SELECT t1.c0, t0.c1 FROM t1 STRAIGHT_JOIN t0 WHERE t1.c0 = t0.c1;