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
145f7b29
Commit
145f7b29
authored
May 09, 2005
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug #9246 Condition pushdown and left join, wrong result
parent
b2fc8304
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
mysql-test/r/ndb_condition_pushdown.result
mysql-test/r/ndb_condition_pushdown.result
+5
-0
mysql-test/t/ndb_condition_pushdown.test
mysql-test/t/ndb_condition_pushdown.test
+2
-0
sql/sql_select.cc
sql/sql_select.cc
+3
-1
No files found.
mysql-test/r/ndb_condition_pushdown.result
View file @
145f7b29
...
@@ -1139,5 +1139,10 @@ explain
...
@@ -1139,5 +1139,10 @@ explain
select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using filesort
explain
select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.attr3 < 5 or t4.attr1 is null order by t4.pk1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
1 SIMPLE t4 ALL NULL NULL NULL NULL 6 Using where
set engine_condition_pushdown = @old_ecpd;
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4;
DROP TABLE t1,t2,t3,t4;
mysql-test/t/ndb_condition_pushdown.test
View file @
145f7b29
...
@@ -1044,6 +1044,8 @@ explain
...
@@ -1044,6 +1044,8 @@ explain
select
auto
from
t1
where
string
=
"aaaa"
collate
latin1_general_ci
order
by
auto
;
select
auto
from
t1
where
string
=
"aaaa"
collate
latin1_general_ci
order
by
auto
;
explain
explain
select
*
from
t2
where
(
attr1
<
2
)
=
(
attr2
<
2
)
order
by
pk1
;
select
*
from
t2
where
(
attr1
<
2
)
=
(
attr2
<
2
)
order
by
pk1
;
explain
select
*
from
t3
left
join
t4
on
t4
.
attr2
=
t3
.
attr2
where
t4
.
attr1
>
1
and
t4
.
attr3
<
5
or
t4
.
attr1
is
null
order
by
t4
.
pk1
;
set
engine_condition_pushdown
=
@
old_ecpd
;
set
engine_condition_pushdown
=
@
old_ecpd
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
sql/sql_select.cc
View file @
145f7b29
...
@@ -5401,10 +5401,12 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
...
@@ -5401,10 +5401,12 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
if
(
!
(
tmp
=
add_found_match_trig_cond
(
first_inner_tab
,
tmp
,
0
)))
if
(
!
(
tmp
=
add_found_match_trig_cond
(
first_inner_tab
,
tmp
,
0
)))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
tab
->
select_cond
=
sel
->
cond
=
tmp
;
tab
->
select_cond
=
sel
->
cond
=
tmp
;
/* Push condition to storage engine if this is enabled
and the condition is not guarded */
if
(
thd
->
variables
.
engine_condition_pushdown
)
if
(
thd
->
variables
.
engine_condition_pushdown
)
{
{
COND
*
push_cond
=
COND
*
push_cond
=
make_cond_for_table
(
cond
,
current_map
,
current_map
);
make_cond_for_table
(
tmp
,
current_map
,
current_map
);
tab
->
table
->
file
->
pushed_cond
=
NULL
;
tab
->
table
->
file
->
pushed_cond
=
NULL
;
if
(
push_cond
)
if
(
push_cond
)
{
{
...
...
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