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
2cd8292f
Commit
2cd8292f
authored
Oct 20, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test case for LP bug #873263 fixed by the patch for bug 874006.
parent
5b2b6bef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
mysql-test/r/derived_view.result
mysql-test/r/derived_view.result
+20
-0
mysql-test/t/derived_view.test
mysql-test/t/derived_view.test
+20
-0
No files found.
mysql-test/r/derived_view.result
View file @
2cd8292f
...
...
@@ -1505,6 +1505,26 @@ a b c
DROP VIEW v1;
DROP TABLE t1,t2,t3;
#
# LP bug #873263: materialized view used in correlated IN subquery
#
CREATE TABLE t1 (a int, b int) ;
INSERT INTO t1 VALUES (5,4), (9,8);
CREATE TABLE t2 (a int, b int) ;
INSERT INTO t2 VALUES (4,5), (5,1);
CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
SET SESSION optimizer_switch='derived_with_keys=on';
EXPLAIN
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 2 Using where
3 DERIVED t2 ALL NULL NULL NULL NULL 2
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
a b
5 4
DROP VIEW v2;
DROP TABLE t1,t2;
#
# LP bug #877316: query over a view with correlated subquery in WHERE
#
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a)) ;
...
...
mysql-test/t/derived_view.test
View file @
2cd8292f
...
...
@@ -946,6 +946,26 @@ SELECT * FROM t3
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
# LP bug #873263: materialized view used in correlated IN subquery
--
echo
#
CREATE
TABLE
t1
(
a
int
,
b
int
)
;
INSERT
INTO
t1
VALUES
(
5
,
4
),
(
9
,
8
);
CREATE
TABLE
t2
(
a
int
,
b
int
)
;
INSERT
INTO
t2
VALUES
(
4
,
5
),
(
5
,
1
);
CREATE
ALGORITHM
=
TEMPTABLE
VIEW
v2
AS
SELECT
*
FROM
t2
;
SET
SESSION
optimizer_switch
=
'derived_with_keys=on'
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
t1
.
b
IN
(
SELECT
v2
.
a
FROM
v2
WHERE
v2
.
b
=
t1
.
a
);
SELECT
*
FROM
t1
WHERE
t1
.
b
IN
(
SELECT
v2
.
a
FROM
v2
WHERE
v2
.
b
=
t1
.
a
);
DROP
VIEW
v2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# LP bug #877316: query over a view with correlated subquery in WHERE
--
echo
#
...
...
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