drop table if exists t1; SET SQL_WARNINGS=1; create table t1 (this int unsigned); insert into t1 values (1); insert ignore into t1 values (-1); Warnings: Warning 1264 Out of range value for column 'this' at row 1 insert ignore into t1 values ('5000000000'); Warnings: Warning 1264 Out of range value for column 'this' at row 1 select * from t1; this 1 0 4294967295 drop table t1; create table t1 (a bigint unsigned, b mediumint unsigned); insert t1 values (1,2),(0xffffffffffffffff,0xffffff); select coalesce(a,b), coalesce(b,a) from t1; coalesce(a,b) coalesce(b,a) 1 2 18446744073709551615 16777215 create table t2 as select a from t1 union select b from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci select * from t2; a 1 18446744073709551615 2 16777215 drop table t1, t2; # # Start of 10.0 tests # # # MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns # CREATE TABLE t1 (a DATE PRIMARY KEY); INSERT INTO t1 VALUES ('1999-01-01'); CREATE TABLE t2 (a INT UNSIGNED); INSERT INTO t2 VALUES (19990101); INSERT INTO t2 VALUES (990101); SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a; a 1999-01-01 1999-01-01 SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a=t2.a; a 1999-01-01 1999-01-01 ALTER TABLE t2 ADD PRIMARY KEY(a); SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a; a 1999-01-01 1999-01-01 SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a=t2.a; a 1999-01-01 1999-01-01 # t2 should NOT be eliminated EXPLAIN SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a=t2.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 1 SIMPLE t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index DROP TABLE t1,t2; # # End of 10.0 tests #