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
223483ae
Commit
223483ae
authored
Mar 12, 2012
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
4ac230e5
50ff30d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
0 deletions
+77
-0
mysql-test/r/subselect_mat.result
mysql-test/r/subselect_mat.result
+22
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+22
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+22
-0
sql/sql_base.cc
sql/sql_base.cc
+11
-0
No files found.
mysql-test/r/subselect_mat.result
View file @
223483ae
...
...
@@ -1964,6 +1964,28 @@ a c
SET optimizer_switch=@save_optimizer_switch;
SET join_cache_level=@save_join_cache_level;
DROP TABLE t1,t2;
#
# BUG#952297: Server crashes on 2nd execution of PS in Field::is_null with semijoin+materialization
#
CREATE TABLE t1 ( a VARCHAR(1) );
INSERT INTO t1 VALUES ('y'),('z');
CREATE TABLE t2 ( b VARCHAR(1), c VARCHAR(1) );
INSERT INTO t2 VALUES ('v','v'),('v','v');
CREATE VIEW v2 AS SELECT * FROM t2;
PREPARE ps FROM '
SELECT a FROM t1, v2
WHERE ( c, b ) IN ( SELECT b, b FROM t2 )
GROUP BY a ';
EXECUTE ps;
a
y
z
EXECUTE ps;
a
y
z
DROP VIEW v2;
DROP TABLE t1, t2;
# 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 @
223483ae
...
...
@@ -2004,6 +2004,28 @@ a c
SET optimizer_switch=@save_optimizer_switch;
SET join_cache_level=@save_join_cache_level;
DROP TABLE t1,t2;
#
# BUG#952297: Server crashes on 2nd execution of PS in Field::is_null with semijoin+materialization
#
CREATE TABLE t1 ( a VARCHAR(1) );
INSERT INTO t1 VALUES ('y'),('z');
CREATE TABLE t2 ( b VARCHAR(1), c VARCHAR(1) );
INSERT INTO t2 VALUES ('v','v'),('v','v');
CREATE VIEW v2 AS SELECT * FROM t2;
PREPARE ps FROM '
SELECT a FROM t1, v2
WHERE ( c, b ) IN ( SELECT b, b FROM t2 )
GROUP BY a ';
EXECUTE ps;
a
y
z
EXECUTE ps;
a
y
z
DROP VIEW v2;
DROP TABLE t1, t2;
# 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 @
223483ae
...
...
@@ -1642,6 +1642,28 @@ SET join_cache_level=@save_join_cache_level;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# BUG#952297: Server crashes on 2nd execution of PS in Field::is_null with semijoin+materialization
--
echo
#
CREATE
TABLE
t1
(
a
VARCHAR
(
1
)
);
INSERT
INTO
t1
VALUES
(
'y'
),(
'z'
);
CREATE
TABLE
t2
(
b
VARCHAR
(
1
),
c
VARCHAR
(
1
)
);
INSERT
INTO
t2
VALUES
(
'v'
,
'v'
),(
'v'
,
'v'
);
CREATE
VIEW
v2
AS
SELECT
*
FROM
t2
;
PREPARE
ps
FROM
'
SELECT a FROM t1, v2
WHERE ( c, b ) IN ( SELECT b, b FROM t2 )
GROUP BY a '
;
EXECUTE
ps
;
EXECUTE
ps
;
DROP
VIEW
v2
;
DROP
TABLE
t1
,
t2
;
--
echo
# This must be at the end:
set
optimizer_switch
=@
subselect_sj_mat_tmp
;
set
join_cache_level
=@
save_join_cache_level
;
...
...
sql/sql_base.cc
View file @
223483ae
...
...
@@ -8506,6 +8506,17 @@ int setup_conds(THD *thd, TABLE_LIST *tables, List<TABLE_LIST> &leaves,
goto
err_no_arena
;
select_lex
->
cond_count
++
;
}
/*
If it's a semi-join nest, fix its "left expression", as it is used by
the SJ-Materialization
*/
if
(
embedded
->
sj_subq_pred
)
{
Item
**
left_expr
=
&
embedded
->
sj_subq_pred
->
left_expr
;
if
(
!
(
*
left_expr
)
->
fixed
&&
(
*
left_expr
)
->
fix_fields
(
thd
,
left_expr
))
goto
err_no_arena
;
}
embedding
=
embedded
->
embedding
;
}
while
(
embedding
&&
...
...
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