mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge sanja.is.com.ua:/home/bell/mysql/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/work-explain-4.1 sql/sql_select.cc: Auto merged
This commit is contained in:
commit
3a21e244a0
3 changed files with 14 additions and 7 deletions
|
|
@ -279,6 +279,8 @@ UNIQUE KEY `numreponse` (`numreponse`),
|
|||
KEY `pseudo` (`pseudo`,`numeropost`)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO threadhardwarefr7 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test');
|
||||
EXPLAIN SELECT numreponse FROM threadhardwarefr7 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM threadhardwarefr7 WHERE numeropost='1');
|
||||
Subselect returns more than 1 record
|
||||
EXPLAIN SELECT MAX(numreponse) FROM threadhardwarefr7 WHERE numeropost='1';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE Select tables optimized away
|
||||
|
|
|
|||
|
|
@ -177,7 +177,8 @@ CREATE TABLE `threadhardwarefr7` (
|
|||
KEY `pseudo` (`pseudo`,`numeropost`)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO threadhardwarefr7 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test');
|
||||
|
||||
-- error 1240
|
||||
EXPLAIN SELECT numreponse FROM threadhardwarefr7 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM threadhardwarefr7 WHERE numeropost='1');
|
||||
EXPLAIN SELECT MAX(numreponse) FROM threadhardwarefr7 WHERE numeropost='1';
|
||||
EXPLAIN SELECT numreponse FROM threadhardwarefr7 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM threadhardwarefr7 WHERE numeropost='1');
|
||||
drop table if exists threadhardwarefrtest7;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue