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
f5e7c56e
Commit
f5e7c56e
authored
May 04, 2023
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-31181 Server crash in subselect_uniquesubquery_engine::print upon EXPLAIN EXTENDED DELETE
Temporary fix to avoid the server crash.
parent
62ec258f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
mysql-test/main/explain_innodb.result
mysql-test/main/explain_innodb.result
+18
-0
mysql-test/main/explain_innodb.test
mysql-test/main/explain_innodb.test
+19
-0
sql/item_subselect.cc
sql/item_subselect.cc
+6
-0
No files found.
mysql-test/main/explain_innodb.result
View file @
f5e7c56e
...
...
@@ -18,3 +18,21 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 index NULL id 53 NULL 1 Using index
SET GLOBAL slow_query_log = @sql_tmp;
drop table t1;
#
# MDEV-31181: Server crash in subselect_uniquesubquery_engine::print
# upon EXPLAIN EXTENDED DELETE
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (pk INT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2);
EXPLAIN EXTENDED DELETE FROM t1 WHERE a IN (SELECT pk FROM t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
Note 1003 /* select#1 */ delete from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`))))
drop table t1, t2;
#
# End of 10.4 tests
#
mysql-test/main/explain_innodb.test
View file @
f5e7c56e
...
...
@@ -18,3 +18,22 @@ SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0;
SET
GLOBAL
slow_query_log
=
@
sql_tmp
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-31181: Server crash in subselect_uniquesubquery_engine::print
--
echo
# upon EXPLAIN EXTENDED DELETE
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
CREATE
TABLE
t2
(
pk
INT
PRIMARY
KEY
);
INSERT
INTO
t2
VALUES
(
1
),(
2
);
EXPLAIN
EXTENDED
DELETE
FROM
t1
WHERE
a
IN
(
SELECT
pk
FROM
t2
);
drop
table
t1
,
t2
;
--
echo
#
--
echo
# End of 10.4 tests
--
echo
#
sql/item_subselect.cc
View file @
f5e7c56e
...
...
@@ -4538,6 +4538,12 @@ void subselect_uniquesubquery_engine::print(String *str,
{
str
->
append
(
STRING_WITH_LEN
(
"<primary_index_lookup>("
));
tab
->
ref
.
items
[
0
]
->
print
(
str
,
query_type
);
if
(
!
tab
->
table
)
{
// table is not opened so unknown
str
->
append
(
')'
);
return
;
}
str
->
append
(
STRING_WITH_LEN
(
" in "
));
if
(
tab
->
table
->
s
->
table_category
==
TABLE_CATEGORY_TEMPORARY
)
{
...
...
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