Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d0cc0355
Commit
d0cc0355
authored
Mar 06, 2007
by
kostja@bodhi.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-merge fixes.
parent
92b44016
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
12 deletions
+54
-12
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+52
-10
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-2
No files found.
mysql-test/r/subselect.result
View file @
d0cc0355
...
@@ -3095,7 +3095,7 @@ SELECT a FROM t1 GROUP BY a
...
@@ -3095,7 +3095,7 @@ SELECT a FROM t1 GROUP BY a
HAVING IFNULL((SELECT b FROM t2 WHERE b > 4),
HAVING IFNULL((SELECT b FROM t2 WHERE b > 4),
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)) > 3;
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)) > 3;
ERROR 21000: Subquery returns more than 1 row
ERROR 21000: Subquery returns more than 1 row
SELECT a FROM t1
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 2),
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 2),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
a
a
...
@@ -3103,11 +3103,11 @@ a
...
@@ -3103,11 +3103,11 @@ a
4
4
1
1
3
3
SELECT a FROM t1
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 1),
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 1),
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
ERROR 21000: Subquery returns more than 1 row
ERROR 21000: Subquery returns more than 1 row
SELECT a FROM t1
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b));
a
a
...
@@ -3115,7 +3115,7 @@ a
...
@@ -3115,7 +3115,7 @@ a
1
1
3
3
4
4
SELECT a FROM t1
SELECT a FROM t1
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4),
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b));
ERROR 21000: Subquery returns more than 1 row
ERROR 21000: Subquery returns more than 1 row
...
@@ -3683,16 +3683,16 @@ CREATE TABLE t1 (id char(4) PRIMARY KEY, c int);
...
@@ -3683,16 +3683,16 @@ CREATE TABLE t1 (id char(4) PRIMARY KEY, c int);
CREATE TABLE t2 (c int);
CREATE TABLE t2 (c int);
INSERT INTO t1 VALUES ('aa', 1);
INSERT INTO t1 VALUES ('aa', 1);
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (1);
SELECT * FROM t1
SELECT * FROM t1
WHERE EXISTS (SELECT c FROM t2 WHERE c=1
WHERE EXISTS (SELECT c FROM t2 WHERE c=1
UNION
UNION
SELECT c from t2 WHERE c=t1.c);
SELECT c from t2 WHERE c=t1.c);
id c
id c
aa 1
aa 1
INSERT INTO t1 VALUES ('bb', 2), ('cc', 3), ('dd',1);
INSERT INTO t1 VALUES ('bb', 2), ('cc', 3), ('dd',1);
SELECT * FROM t1
SELECT * FROM t1
WHERE EXISTS (SELECT c FROM t2 WHERE c=1
WHERE EXISTS (SELECT c FROM t2 WHERE c=1
UNION
UNION
SELECT c from t2 WHERE c=t1.c);
SELECT c from t2 WHERE c=t1.c);
id c
id c
aa 1
aa 1
...
@@ -3702,9 +3702,9 @@ dd 1
...
@@ -3702,9 +3702,9 @@ dd 1
INSERT INTO t2 VALUES (2);
INSERT INTO t2 VALUES (2);
CREATE TABLE t3 (c int);
CREATE TABLE t3 (c int);
INSERT INTO t3 VALUES (1);
INSERT INTO t3 VALUES (1);
SELECT * FROM t1
SELECT * FROM t1
WHERE EXISTS (SELECT t2.c FROM t2 JOIN t3 ON t2.c=t3.c WHERE t2.c=1
WHERE EXISTS (SELECT t2.c FROM t2 JOIN t3 ON t2.c=t3.c WHERE t2.c=1
UNION
UNION
SELECT c from t2 WHERE c=t1.c);
SELECT c from t2 WHERE c=t1.c);
id c
id c
aa 1
aa 1
...
@@ -3718,6 +3718,48 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
...
@@ -3718,6 +3718,48 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
s1
s1
a
a
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 int);
CREATE TABLE t2(f2 int, f21 int, f3 timestamp);
INSERT INTO t1 VALUES (1),(1),(2),(2);
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11"), (2,2,"2004-02-29 11:11:11");
SELECT ((SELECT f2 FROM t2 WHERE f21=f1 LIMIT 1) * COUNT(f1)) AS sq FROM t1 GROUP BY f1;
sq
2
4
SELECT (SELECT SUM(1) FROM t2 ttt GROUP BY t2.f3 LIMIT 1) AS tt FROM t2;
tt
2
2
PREPARE stmt1 FROM 'SELECT ((SELECT f2 FROM t2 WHERE f21=f1 LIMIT 1) * COUNT(f1)) AS sq FROM t1 GROUP BY f1';
EXECUTE stmt1;
sq
2
4
EXECUTE stmt1;
sq
2
4
DEALLOCATE PREPARE stmt1;
SELECT f2, AVG(f21),
(SELECT t.f3 FROM t2 AS t WHERE t2.f2=t.f2 AND t.f3=MAX(t2.f3)) AS test
FROM t2 GROUP BY f2;
f2 AVG(f21) test
1 1.0000 2004-02-29 11:11:11
2 2.0000 2004-02-29 11:11:11
DROP TABLE t1,t2;
CREATE TABLE t1 (a int, b INT, c CHAR(10) NOT NULL);
INSERT INTO t1 VALUES
(1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'),
(2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'), (3,3,'j'),
(3,2,'k'), (3,1,'l'), (1,9,'m');
SELECT a, MAX(b),
(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) AS test
FROM t1 GROUP BY a;
a MAX(b) test
1 9 m
2 3 h
3 4 i
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t1xt2;
DROP TABLE IF EXISTS t1xt2;
...
...
sql/sql_yacc.yy
View file @
d0cc0355
...
@@ -422,10 +422,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
...
@@ -422,10 +422,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%pure_parser /* We have threads */
%pure_parser /* We have threads */
/*
/*
Currently there is 2
51
shift/reduce conflict. We should not introduce
Currently there is 2
87
shift/reduce conflict. We should not introduce
new conflicts any more.
new conflicts any more.
*/
*/
%expect 2
51
%expect 2
87
/*
/*
Comments for TOKENS.
Comments for TOKENS.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment