Thanks for the responses. Is there a fix or a workaround? Is a fix
planned? I'm a bit new to MySQL. Should I use version 4.0, or are
there more bugs in that version?
I am in the middle of a large project, and I was hoping to depend on
max() working for numbers. I'm sorry to say it, but I'm a bit
surprised that MySQL has been around so long, and such basic
functionality is still broken.
Should I use another database engine? Another database server?
Thanks,
Frederik
On Mon, Jul 10, 2006 at 07:40:23PM -0700, Rick James wrote:
> Ditto for 4.1.14; ok for 4.0.26, but note that it is important that you said
> <= an existing value:
> ==============
> 4.1.14
> mysql> select max(keyval) from nodes where keyval <= 0.6158;
> Empty set (0.00 sec)
>
> mysql> select max(keyval) from nodes where keyval <= 0.615;
> +------------------+
> | max(keyval) |
> +------------------+
> | 0.38449999690056 |
> +------------------+
> 1 row in set (0.00 sec)
>
> mysql> select max(keyval) from nodes where keyval <= 0.6159;
> +------------------+
> | max(keyval) |
> +------------------+
> | 0.61580002307892 |
> +------------------+
> 1 row in set (0.00 sec)
>
> ==============
> 4.0.26:
> mysql> select max(keyval) from nodes where keyval <= 0.6158;
> +------------------+
> | max(keyval) |
> +------------------+
> | 0.38449999690056 |
> +------------------+
> 1 row in set (0.00 sec)
>
> mysql> select max(keyval) from nodes where keyval <= 0.61580002307892;
> +------------------+
> | max(keyval) |
> +------------------+
> | 0.61580002307892 |
> +------------------+
> 1 row in set (0.00 sec)
>
> > -----Original Message-----
> > From: Konstantin Osipov [mailto:konstantin@stripped]
> > Sent: Monday, July 10, 2006 3:58 PM
> > To: frederik@stripped
> > Cc: internals@stripped
> > Subject: Re: bug with max()
> >
> > * Frederik Eaton <frederik@stripped> [06/07/11 00:43]:
> >
> >
> > > mysql Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (i486)
> > using readline 5.1
> > >
> > > mysql> select avg(keyval) from nodes where keyval <= 0.6158;
> > > +------------------+
> > > | avg(keyval) |
> > > +------------------+
> > > | 0.38034999370575 |
> > > +------------------+
> > > 1 row in set (0.00 sec)
> > >
> > > mysql> select max(keyval) from nodes where keyval <= 0.6158;
> > > Empty set (0.00 sec)
> >
> > This is repeatable in 5.0 as well.
> >
> > Reported as Bug#20954 "avg(keyval) retuns 0.38 but max(keyval)
> > returns an empty set"
> >
> > --
> > Konstantin Osipov, Software Developer
> > MySQL AB, www.mysql.com
> >
> > --
> > MySQL Internals Mailing List
> > For list archives: http://lists.mysql.com/internals
> > To unsubscribe:
> > http://lists.mysql.com/internals?unsub=1
> >
> >
>
>
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe: http://lists.mysql.com/internals?unsub=1
>
--
http://ofb.net/~frederik/