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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5790b17e
Commit
5790b17e
authored
Jun 17, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a test case (Bug #4102 Crash with a DBUG window after a request)
parent
6b8222d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+9
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+12
-0
No files found.
mysql-test/r/subselect.result
View file @
5790b17e
...
@@ -1831,3 +1831,12 @@ Warnings:
...
@@ -1831,3 +1831,12 @@ Warnings:
Note 1276 Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1
Note 1003 select test.up.a AS `a`,test.up.b AS `b` from test.t1 up where exists(select 1 AS `Not_used` from test.t1 where (test.t1.a = test.up.a))
Note 1003 select test.up.a AS `a`,test.up.b AS `b` from test.t1 up where exists(select 1 AS `Not_used` from test.t1 where (test.t1.a = test.up.a))
drop table t1;
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b));
INSERT INTO t2 VALUES (1, 1), (1, 2);
SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1
HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a);
t1_a t2_a t2_b
1 1 2
DROP TABLE t1, t2;
mysql-test/t/subselect.test
View file @
5790b17e
...
@@ -1167,3 +1167,15 @@ insert into t1 values (1,2),(3,4);
...
@@ -1167,3 +1167,15 @@ insert into t1 values (1,2),(3,4);
select
*
from
t1
up
where
exists
(
select
*
from
t1
where
t1
.
a
=
up
.
a
);
select
*
from
t1
up
where
exists
(
select
*
from
t1
where
t1
.
a
=
up
.
a
);
explain
extended
select
*
from
t1
up
where
exists
(
select
*
from
t1
where
t1
.
a
=
up
.
a
);
explain
extended
select
*
from
t1
up
where
exists
(
select
*
from
t1
where
t1
.
a
=
up
.
a
);
drop
table
t1
;
drop
table
t1
;
#
# Bug #4102: subselect in HAVING
#
CREATE
TABLE
t1
(
t1_a
int
);
INSERT
INTO
t1
VALUES
(
1
);
CREATE
TABLE
t2
(
t2_a
int
,
t2_b
int
,
PRIMARY
KEY
(
t2_a
,
t2_b
));
INSERT
INTO
t2
VALUES
(
1
,
1
),
(
1
,
2
);
SELECT
*
FROM
t1
,
t2
table2
WHERE
t1_a
=
1
AND
table2
.
t2_a
=
1
HAVING
table2
.
t2_b
=
(
SELECT
MAX
(
t2_b
)
FROM
t2
WHERE
t2_a
=
table2
.
t2_a
);
DROP
TABLE
t1
,
t2
;
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