1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

fixed bug of derived table in subselect

fixed bug in error handling
This commit is contained in:
bell@sanja.is.com.ua
2002-11-13 11:59:03 +02:00
parent e3d78f0bd4
commit d8f1d74fe5
6 changed files with 36 additions and 16 deletions

View File

@ -256,4 +256,12 @@ UNIQUE KEY `maxnumrep` (`maxnumrep`)
INSERT INTO forumconthardwarefr7 (numeropost,maxnumrep) VALUES (1,0),(2,1);
select numeropost as a FROM forumconthardwarefr7 GROUP BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
Subselect returns more than 1 record
select numeropost as a FROM forumconthardwarefr7 ORDER BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
Subselect returns more than 1 record
drop table if exists forumconthardwarefr7;
drop table if exists iftest;
CREATE TABLE iftest (field char(1) NOT NULL DEFAULT 'b');
INSERT INTO iftest VALUES ();
SELECT field FROM iftest WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) HAVING field='b');
Subselect returns more than 1 record
drop table iftest;

View File

@ -152,4 +152,13 @@ CREATE TABLE `forumconthardwarefr7` (
INSERT INTO forumconthardwarefr7 (numeropost,maxnumrep) VALUES (1,0),(2,1);
-- error 1240
select numeropost as a FROM forumconthardwarefr7 GROUP BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
drop table if exists forumconthardwarefr7;
-- error 1240
select numeropost as a FROM forumconthardwarefr7 ORDER BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
drop table if exists forumconthardwarefr7;
drop table if exists iftest;
CREATE TABLE iftest (field char(1) NOT NULL DEFAULT 'b');
INSERT INTO iftest VALUES ();
-- error 1240
SELECT field FROM iftest WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) HAVING field='b');
drop table iftest;