Commit 5d4ae987 authored by unknown's avatar unknown

Test for bug #1022

Description: When a table contains a 'float' field, and one of the functions
MAX, MIN, or AVG is used on that field, the system crashes.


parent fbc376e3
...@@ -70,6 +70,12 @@ select min(a) from t1; ...@@ -70,6 +70,12 @@ select min(a) from t1;
min(a) min(a)
-0.010 -0.010
drop table t1; 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)); 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; show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment Field Type Collation Null Key Default Extra Privileges Comment
......
...@@ -31,6 +31,15 @@ select a from t1 order by a; ...@@ -31,6 +31,15 @@ select a from t1 order by a;
select min(a) from t1; select min(a) from t1;
drop table 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 # FLOAT/DOUBLE/DECIMAL handling
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment