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
5d06edfb
Commit
5d06edfb
authored
Jun 08, 2019
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
Make it visible
parent
9b22354a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
0 deletions
+85
-0
mysql-test/r/subselect_no_semijoin.result
mysql-test/r/subselect_no_semijoin.result
+55
-0
mysql-test/t/subselect_no_semijoin.test
mysql-test/t/subselect_no_semijoin.test
+23
-0
sql/sql_explain.cc
sql/sql_explain.cc
+5
-0
sql/sql_explain.h
sql/sql_explain.h
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-0
No files found.
mysql-test/r/subselect_no_semijoin.result
View file @
5d06edfb
...
@@ -7291,5 +7291,60 @@ pk i c pk i c
...
@@ -7291,5 +7291,60 @@ pk i c pk i c
1 10 foo 1 10 foo
1 10 foo 1 10 foo
DROP TABLE t;
DROP TABLE t;
# End of 10.2 tests
# End of 10.2 tests
#
# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
#
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1),(5);
CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1);
CREATE TABLE t3 ( c INT );
INSERT INTO t3 VALUES (4),(5);
SET @tmp19714=@@optimizer_switch;
SET optimizer_switch='subquery_cache=off';
explain format=json
SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"subqueries": [
{
"query_block": {
"select_id": 2,
"pseudo_bits_condition": "1 = t1.a or <in_optimizer>(1,<exists>(subquery#3))",
"table": {
"table_name": "t2",
"access_type": "system",
"rows": 1,
"filtered": 100
},
"subqueries": [
{
"query_block": {
"select_id": 3,
"table": {
"table_name": "t3",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "1 = t3.c"
}
}
}
]
}
}
]
}
}
SET optimizer_switch=@tmp19714;
drop table t1,t2,t3;
set @optimizer_switch_for_subselect_test=null;
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
set @join_cache_level_for_subselect_test=NULL;
mysql-test/t/subselect_no_semijoin.test
View file @
5d06edfb
...
@@ -8,5 +8,28 @@ set @join_cache_level_for_subselect_test=@@join_cache_level;
...
@@ -8,5 +8,28 @@ set @join_cache_level_for_subselect_test=@@join_cache_level;
--
source
t
/
subselect
.
test
--
source
t
/
subselect
.
test
--
echo
#
--
echo
# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
5
);
# t2 must be MyISAM or Aria and contain 1 row
CREATE
TABLE
t2
(
b
INT
)
ENGINE
=
MyISAM
;
INSERT
INTO
t2
VALUES
(
1
);
CREATE
TABLE
t3
(
c
INT
);
INSERT
INTO
t3
VALUES
(
4
),(
5
);
SET
@
tmp19714
=@@
optimizer_switch
;
SET
optimizer_switch
=
'subquery_cache=off'
;
explain
format
=
json
SELECT
(
SELECT
b
FROM
t2
WHERE
b
=
a
OR
EXISTS
(
SELECT
c
FROM
t3
WHERE
c
=
b
)
)
FROM
t1
;
SET
optimizer_switch
=@
tmp19714
;
drop
table
t1
,
t2
,
t3
;
set
@
optimizer_switch_for_subselect_test
=
null
;
set
@
optimizer_switch_for_subselect_test
=
null
;
set
@
join_cache_level_for_subselect_test
=
NULL
;
set
@
join_cache_level_for_subselect_test
=
NULL
;
sql/sql_explain.cc
View file @
5d06edfb
...
@@ -857,6 +857,11 @@ void Explain_select::print_explain_json(Explain_query *query,
...
@@ -857,6 +857,11 @@ void Explain_select::print_explain_json(Explain_query *query,
writer
->
add_member
(
"outer_ref_condition"
);
writer
->
add_member
(
"outer_ref_condition"
);
write_item
(
writer
,
outer_ref_cond
);
write_item
(
writer
,
outer_ref_cond
);
}
}
if
(
pseudo_bits_cond
)
{
writer
->
add_member
(
"pseudo_bits_condition"
);
write_item
(
writer
,
pseudo_bits_cond
);
}
/* we do not print HAVING which always evaluates to TRUE */
/* we do not print HAVING which always evaluates to TRUE */
if
(
having
||
(
having_value
==
Item
::
COND_FALSE
))
if
(
having
||
(
having_value
==
Item
::
COND_FALSE
))
...
...
sql/sql_explain.h
View file @
5d06edfb
...
@@ -232,6 +232,7 @@ class Explain_select : public Explain_basic_join
...
@@ -232,6 +232,7 @@ class Explain_select : public Explain_basic_join
/* Expensive constant condition */
/* Expensive constant condition */
Item
*
exec_const_cond
;
Item
*
exec_const_cond
;
Item
*
outer_ref_cond
;
Item
*
outer_ref_cond
;
Item
*
pseudo_bits_cond
;
/* HAVING condition */
/* HAVING condition */
Item
*
having
;
Item
*
having
;
...
...
sql/sql_select.cc
View file @
5d06edfb
...
@@ -25025,6 +25025,7 @@ int JOIN::save_explain_data_intern(Explain_query *output,
...
@@ -25025,6 +25025,7 @@ int JOIN::save_explain_data_intern(Explain_query *output,
xpl_sel
->
exec_const_cond
=
exec_const_cond
;
xpl_sel
->
exec_const_cond
=
exec_const_cond
;
xpl_sel
->
outer_ref_cond
=
outer_ref_cond
;
xpl_sel
->
outer_ref_cond
=
outer_ref_cond
;
xpl_sel
->
pseudo_bits_cond
=
pseudo_bits_cond
;
if
(
tmp_having
)
if
(
tmp_having
)
xpl_sel
->
having
=
tmp_having
;
xpl_sel
->
having
=
tmp_having
;
else
else
...
...
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