2 messages in com.mysql.lists.bugsRe: Wrong grouping function results f...
FromSent OnAttachments
Dmitriy Goldobin07 Nov 2000 07:55 
sin...@mysql.com07 Nov 2000 08:12 
Subject:Re: Wrong grouping function results for double(x,x) fields
From:sin...@mysql.com (sin@mysql.com)
Date:11/07/2000 08:12:38 AM
List:com.mysql.lists.bugs

Dmitriy Goldobin writes:

Description:

functions avg(), sum(), min(), max() at select statement returns wrong results for fields with type double(x,x). But not always.

How-To-Repeat:

# MySQL dump 7.1 # # Host: localhost Database: test2 #-------------------------------------------------------- # Server version 3.23.12c-alpha

# # Table structure for table 'test' # CREATE TABLE test ( id int(11) NOT NULL auto_increment, f double(10,8), PRIMARY KEY (id) );

# # Dumping data for table 'test' #

INSERT INTO test VALUES (1,4.00000000); INSERT INTO test VALUES (2,3.00000000); INSERT INTO test VALUES (3,2.00000000); INSERT INTO test VALUES (4,1.00000000);

select * from test; id f 1 4.00000000 2 3.00000000 3 2.00000000 4 1.00000000

select avg(f) from test; avg(f) 0.000000000000

select sum(f) from test; sum(f) 0.00000000

select min(f) from test; min(f) 0.00000000

select max(f) from test; max(f) 0.00000000

select avg(f),sum(f), min(f), max(f) from test; avg(f) sum(f) min(f) max(f) 0.000000000000 10.00000000 1.00000000 4.00000000

Fix:

1. Use other type instead of double. Decimal for example. 2. Use fake function call at first field.

Submitter-Id: unknown Originator: dmitriy Organization: Integral Solutions Corporation MySQL support: none Synopsis: Wrong grouping function results for double(x,x) fields Severity: serious Priority: high Category: mysql Class: sw-bug Release: mysql-3.22.32 (Source distribution)

Environment:

<machine, os, target, libraries (multiple lines)> System: Linux gold 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i686 unknown Architecture: i686

Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs gcc version 2.95.2 20000220 (Debian GNU/Linux) Compilation info: CC='gcc' CFLAGS='-O2 -fomit-frame-pointer' CXX='g++' CXXFLAGS='-O2 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno -rtti' LDFLAGS='' Configure command: ./configure --enable-shared --without-readline --enable-assembler --with-my sqld-user=mysql --with-unix-socket-path=/var/run/mysqld/mysqld.sock --prefix =/usr --exec-prefix=/usr --libexecdir=/usr/sbin --sysconfdir=/etc/mysql --da tadir=/usr/share --localstatedir=/var/lib/mysql --infodir=/usr/share/info -- includedir=/usr/include --mandir=/usr/share/man Perl: This is perl, version 5.005_03 built for i386-linux:

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail bugs@lists.mysql.com instead.

Hi!

I have tested your bug, and it all works like a charm to me on my 3.23.27 on Linux.

You should try our binary versions and especially 3.23.

Regards,

Sinisa