Re: Bug in subselect using UNION

Re: Bug in subselect using UNION

am 27.10.2002 20:42:29 von Sanja Byelkin

Hi!

On Sat, Oct 26, 2002 at 03:29:31AM +0200, Jocelyn Fournier wrote:
> Hi,
>
> How-to-repeat :
>
> Using the same table than for the distinct bug :
>
> CREATE TABLE `searchconthardwarefr3` (
> `topic` mediumint(8) unsigned NOT NULL default '0',
> `date` date NOT NULL default '0000-00-00',
> `pseudo` varchar(35) character set latin1 NOT NULL default '',
> PRIMARY KEY (`pseudo`,`date`,`topic`),
> KEY `topic` (`topic`)
> ) TYPE=MyISAM ROW_FORMAT=DYNAMIC
>
> INSERT INTO searchconthardwarefr3 (topic,date,pseudo) VALUES
> ('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
>
>
> mysql> EXPLAIN SELECT * FROM searchconthardwarefr3 WHERE pseudo='joce' AND
> date >=(SELECT DISTINCT date FROM searchconthardwarefr3 WHERE
> date='2002-08-03' UNION SELECT DISTINCT date FROM searchconthardwarefr3
> WHERE date='2002-08-03');
> ERROR 1240: Subselect returns more than 1 record
>
> Wrong, as SELECT DISTINCT date FROM searchconthardwarefr3 WHERE
> date='2002-08-03' UNION SELECT DISTINCT date FROM searchconthardwarefr3
> WHERE date='2002-08-03' returns only one row :)

This bug gone with SELECT (SELECT (SELECT 0 UNION SELECT 0)) bug fix.

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12866@lists.mysql.com
To unsubscribe, e-mail