diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 987fa9d5685..2a461942853 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -70,6 +70,12 @@ select min(a) from t1; min(a) -0.010 drop table t1; +create table t1 (a float); +insert into t1 values (1); +select max(a),min(a),avg(a) from t1; +max(a) min(a) avg(a) +1 1 1 +drop table t1; create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6)); show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index f6281ca6c21..caccf31b32a 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -31,6 +31,15 @@ select a from t1 order by a; select min(a) from t1; drop table t1; +# Bug #1022: When a table contains a 'float' field, +# and one of the functions MAX, MIN, or AVG is used on that field, +# the system crashes. + +create table t1 (a float); +insert into t1 values (1); +select max(a),min(a),avg(a) from t1; +drop table t1; + # # FLOAT/DOUBLE/DECIMAL handling #