Re: "strange" EXPLAIN result of a subselect ?
am 18.11.2002 17:39:18 von Sinisa Milivojevic
Jocelyn Fournier writes:
> Hi,
>
> I've just hit another problem with your latest patch applied :
>
> EXPLAIN SELECT numreponse FROM threadhardwarefr7 WHERE numeropost='1' AND
> numreponse=(SELECT 1 FROM threadhardwarefr7 WHERE numeropost='1');
>
> => it freezes mysql monitor
>
> (BTW no mailing list seems to work right now ?)
>
> Regards,
> Jocelyn
Sorry,
But I was not able to reproduce this error.
Here is what I did :
mysql telcent -e "explain select title from titles where number = 1 and number = (select 1 from titles where number = 1)"
+----+-------------+--------+-------+---------------+------- --+---------+-------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------+-------+---------------+------- --+---------+-------+------+-------+
| 1 | PRIMARY | titles | const | PRIMARY | PRIMARY | 4 | const | 1 | |
| 2 | SUBSELECT | titles | const | PRIMARY | PRIMARY | 4 | const | 1 | |
+----+-------------+--------+-------+---------------+------- --+---------+-------+------+-------+
I guess it does not matter that I did not use your table.
In my table number is int and title is char(20).
And it is MyISAM table.
What should I change in order to repeat a bug ??
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ 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-thread13023@lists.mysql.com
To unsubscribe, e-mail
Re: "strange" EXPLAIN result of a subselect ?
am 18.11.2002 17:43:10 von Jocelyn Fournier
Hi,
Peharps try to use my table ;), or try to add a row in titles table so that
"select 1 from titles where number = 1" returns more than one row.
Without EXPLAIN, the query should return :
SELECT numreponse FROM threadhardwarefr7 WHERE numeropost='1' AND
numreponse=(SELECT 1 FROM threadhardwarefr7 WHERE numeropost='1');
ERROR 1240: Subselect returns more than 1 record
Here is my table :
CREATE TABLE `threadhardwarefr7` (
`numeropost` mediumint(8) unsigned NOT NULL default '0',
`numreponse` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`numeropost`,`numreponse`),
UNIQUE KEY `numreponse` (`numreponse`)
) TYPE=MyISAM
INSERT INTO threadhardwarefr7 VALUES (1,1),(1,2);
Regards,
Jocelyn
----- Original Message -----
From: "Sinisa Milivojevic"
To:
Cc: ;
Sent: Monday, November 18, 2002 4:39 PM
Subject: Re: "strange" EXPLAIN result of a subselect ?
> Jocelyn Fournier writes:
> > Hi,
> >
> > I've just hit another problem with your latest patch applied :
> >
> > EXPLAIN SELECT numreponse FROM threadhardwarefr7 WHERE numeropost='1'
AND
> > numreponse=(SELECT 1 FROM threadhardwarefr7 WHERE numeropost='1');
> >
> > => it freezes mysql monitor
> >
> > (BTW no mailing list seems to work right now ?)
> >
> > Regards,
> > Jocelyn
>
> Sorry,
>
> But I was not able to reproduce this error.
>
> Here is what I did :
>
> mysql telcent -e "explain select title from titles where number = 1 and
number = (select 1 from titles where number = 1)"
>
+----+-------------+--------+-------+---------------+------- --+---------+---
----+------+-------+
> | id | select_type | table | type | possible_keys | key | key_len |
ref | rows | Extra |
>
+----+-------------+--------+-------+---------------+------- --+---------+---
----+------+-------+
> | 1 | PRIMARY | titles | const | PRIMARY | PRIMARY | 4 |
const | 1 | |
> | 2 | SUBSELECT | titles | const | PRIMARY | PRIMARY | 4 |
const | 1 | |
>
+----+-------------+--------+-------+---------------+------- --+---------+---
----+------+-------+
>
> I guess it does not matter that I did not use your table.
>
> In my table number is int and title is char(20).
>
> And it is MyISAM table.
>
> What should I change in order to repeat a bug ??
>
> --
> Regards,
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
> /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
> <___/ 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-thread13024@lists.mysql.com
To unsubscribe, e-mail