SET STORAGE_ENGINE = Falcon;
*** Bug #22125 ***
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
f1 double,
f2 char(5),
f3 double,
f4 int
);
INSERT INTO t1 VALUES (0,'zero',0,1);
INSERT INTO t1 VALUES (1e308*2,'max',0,3);
Warnings:
Warning	1264	Out of range value for column 'f1' at row 1
INSERT INTO t1 VALUES (1e308*2,'min',0,4);
Warnings:
Warning	1264	Out of range value for column 'f1' at row 1
UPDATE t1 SET f1 = 1 / f1 WHERE f2 = 'min';
INSERT INTO t1 VALUES (1e308*2,'nan',0,5);
Warnings:
Warning	1264	Out of range value for column 'f1' at row 1
INSERT INTO t1 VALUES (1e308*2,'inf',0,6);
Warnings:
Warning	1264	Out of range value for column 'f1' at row 1
INSERT INTO t1 SELECT -f1,concat('-',f2),f3,-f4 FROM t1;
UPDATE t1 SET f3 = -f3 WHERE f2 = '-nan';
CREATE INDEX it1 on t1 (f1);
SELECT * FROM t1 ORDER BY f1,f2,f3,f4;
f1	f2	f3	f4
-1.79769313486232e+308	-inf	0	-6
-1.79769313486232e+308	-max	0	-3
-1.79769313486232e+308	-nan	-0	-5
-5.562684646268e-309	-min	0	-4
-0	-zero	0	-1
0	zero	0	1
5.562684646268e-309	min	0	4
1.79769313486232e+308	inf	0	6
1.79769313486232e+308	max	0	3
1.79769313486232e+308	nan	0	5
SELECT count(*) FROM t1 where f1 = 0;
count(*)
2
SELECT count(*) FROM t1 where f1 < 1;
count(*)
7
DROP INDEX it1 ON t1;
SELECT count(*) FROM t1 where f1 = 0;
count(*)
2
SELECT count(*) FROM t1 where f1 < 1;
count(*)
7
DROP TABLE t1;
