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
674e3388
Commit
674e3388
authored
Nov 29, 2016
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the test case for bug mdev-10836.
The bug was fixed by the patch for mdev-10882.
parent
b2c63d2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
0 deletions
+98
-0
mysql-test/r/derived_cond_pushdown.result
mysql-test/r/derived_cond_pushdown.result
+78
-0
mysql-test/t/derived_cond_pushdown.test
mysql-test/t/derived_cond_pushdown.test
+20
-0
No files found.
mysql-test/r/derived_cond_pushdown.result
View file @
674e3388
...
...
@@ -7688,3 +7688,81 @@ EXPLAIN
}
DROP VIEW v1;
DROP TABLE t1,t2;
#
# MDEV-10836: pushdown of the predicate with cached value
#
CREATE TABLE t (pk INT PRIMARY KEY, f INT) ENGINE=MyISAM;
CREATE ALGORITHM=TEMPTABLE VIEW v AS SELECT * FROM t;
INSERT INTO t VALUES (1,1),(3,2);
SELECT * FROM v AS v1, v AS v2
WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t );
pk f pk f
3 2 3 2
EXPLAIN FORMAT=JSON
SELECT * FROM v AS v1, v AS v2
WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t );
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<subquery2>",
"access_type": "system",
"rows": 1,
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
"table": {
"message": "Select tables optimized away"
}
}
}
},
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "(v1.f = 2)",
"materialized": {
"query_block": {
"select_id": 3,
"table": {
"table_name": "t",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "(t.f = 2)"
}
}
}
},
"block-nl-join": {
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "(v2.pk > 2)"
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"materialized": {
"query_block": {
"select_id": 4,
"table": {
"table_name": "t",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
}
}
}
}
DROP VIEW v;
DROP TABLE t;
mysql-test/t/derived_cond_pushdown.test
View file @
674e3388
...
...
@@ -1147,3 +1147,23 @@ SELECT a, GROUP_CONCAT(b) FROM v1
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# MDEV-10836: pushdown of the predicate with cached value
--
echo
#
CREATE
TABLE
t
(
pk
INT
PRIMARY
KEY
,
f
INT
)
ENGINE
=
MyISAM
;
CREATE
ALGORITHM
=
TEMPTABLE
VIEW
v
AS
SELECT
*
FROM
t
;
INSERT
INTO
t
VALUES
(
1
,
1
),(
3
,
2
);
SELECT
*
FROM
v
AS
v1
,
v
AS
v2
WHERE
v2
.
pk
>
v1
.
f
AND
v1
.
f
IN
(
SELECT
COUNT
(
pk
)
FROM
t
);
EXPLAIN
FORMAT
=
JSON
SELECT
*
FROM
v
AS
v1
,
v
AS
v2
WHERE
v2
.
pk
>
v1
.
f
AND
v1
.
f
IN
(
SELECT
COUNT
(
pk
)
FROM
t
);
DROP
VIEW
v
;
DROP
TABLE
t
;
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