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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
bd86e37e
Commit
bd86e37e
authored
Feb 20, 2012
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
3ef46370
fecad7c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
1 deletion
+52
-1
mysql-test/r/subselect_mat.result
mysql-test/r/subselect_mat.result
+13
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+13
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+13
-0
sql/sql_select.cc
sql/sql_select.cc
+13
-1
No files found.
mysql-test/r/subselect_mat.result
View file @
bd86e37e
...
...
@@ -1848,6 +1848,19 @@ a b
7 5
3 3
drop table t1,t2;
#
# BUG#933407: Valgrind warnings in mark_as_null_row with materialization+semijoin, STRAIGHT_JOIN, impossible WHERE
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0),(8);
SELECT STRAIGHT_JOIN MIN(a) FROM t1
WHERE a IN (
SELECT a FROM t1
WHERE 'condition'='impossible'
);
MIN(a)
NULL
DROP TABLE t1;
# This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
...
...
mysql-test/r/subselect_sj_mat.result
View file @
bd86e37e
...
...
@@ -1885,6 +1885,19 @@ a b
7 5
3 3
drop table t1,t2;
#
# BUG#933407: Valgrind warnings in mark_as_null_row with materialization+semijoin, STRAIGHT_JOIN, impossible WHERE
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0),(8);
SELECT STRAIGHT_JOIN MIN(a) FROM t1
WHERE a IN (
SELECT a FROM t1
WHERE 'condition'='impossible'
);
MIN(a)
NULL
DROP TABLE t1;
# This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
mysql-test/t/subselect_sj_mat.test
View file @
bd86e37e
...
...
@@ -1545,6 +1545,19 @@ select * from t1 where t1.a in (select a from t2 where t2.a=7 or t2.b<=1);
drop
table
t1
,
t2
;
--
echo
#
--
echo
# BUG#933407: Valgrind warnings in mark_as_null_row with materialization+semijoin, STRAIGHT_JOIN, impossible WHERE
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
0
),(
8
);
SELECT
STRAIGHT_JOIN
MIN
(
a
)
FROM
t1
WHERE
a
IN
(
SELECT
a
FROM
t1
WHERE
'condition'
=
'impossible'
);
DROP
TABLE
t1
;
--
echo
# This must be at the end:
set
optimizer_switch
=@
subselect_sj_mat_tmp
;
...
...
sql/sql_select.cc
View file @
bd86e37e
...
...
@@ -10442,10 +10442,22 @@ return_zero_rows(JOIN *join, select_result *result, List<TABLE_LIST> &tables,
if
(
send_row
)
{
/*
Set all tables to have NULL row. This is needed as we will be evaluating
HAVING condition.
*/
List_iterator
<
TABLE_LIST
>
ti
(
tables
);
TABLE_LIST
*
table
;
while
((
table
=
ti
++
))
mark_as_null_row
(
table
->
table
);
// All fields are NULL
{
/*
Don't touch semi-join materialization tables, as the above join_free()
call has freed them (and HAVING clause can't have references to them
anyway).
*/
if
(
!
table
->
is_jtbm
())
mark_as_null_row
(
table
->
table
);
// All fields are NULL
}
if
(
having
&&
!
having
->
walk
(
&
Item
::
clear_sum_processor
,
FALSE
,
NULL
)
&&
having
->
val_int
()
==
0
)
...
...
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