List:General Discussion« Previous MessageNext Message »
From:Victoria Reznichenko Date:February 2 2004 12:15pm
Subject:Re: ORDER BY may remove result rows
View as plain text  
lknecht@stripped wrote:
>>Description:
> Instead of ordering rows, ORDER BY may remove rows
>>How-To-Repeat:
> CREATE TABLE T (
>  Id INTEGER NOT NULL,
>  Id2 INTEGER NOT NULL,
>  Val FLOAT NOT NULL,
>  Id3 INTEGER NOT NULL,
>  KEY Key2 (Id2, Val),
>  KEY Key3 (Id3)
> );
> 
> INSERT INTO T VALUES(1,3,-12,4);
> INSERT INTO T VALUES(2,2,-27.5,4);
> INSERT INTO T VALUES(3,2,18.4,3);
> 
> mysql> SELECT Id3 FROM T WHERE Id2=2 AND Val BETWEEN -30 AND 20;
> +-----+
> | Id3 |
> +-----+
> |   4 |
> |   3 |
> +-----+
> 2 rows in set (0.00 sec)
> 
> mysql> SELECT Id3 FROM T WHERE Id2=2 AND Val BETWEEN -30 AND 20 ORDER BY Id3;
> +-----+
> | Id3 |
> +-----+
> |   3 |
> +-----+
> 1 row in set (0.01 sec)
> 
> Note: both indices Key2 and Key3 must be present for the bug to occur.
> 

This bug is entered to the bug database:
	http://bugs.mysql.com/bug.php?id=2419

Not fixed yet.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   Victoria.Reznichenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




Thread
ORDER BY may remove result rowslknecht30 Jan
  • Re: ORDER BY may remove result rowsDan Nelson31 Jan
  • Re: ORDER BY may remove result rowsVictoria Reznichenko2 Feb