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
775aa554
Commit
775aa554
authored
Jan 29, 2018
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed mdev-15017 Server crashes in in st_join_table::fix_splitting
Do not apply splitting for constant tables.
parent
4808996b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
8 deletions
+32
-8
mysql-test/r/derived_cond_pushdown.result
mysql-test/r/derived_cond_pushdown.result
+11
-0
mysql-test/t/derived_cond_pushdown.test
mysql-test/t/derived_cond_pushdown.test
+16
-0
sql/opt_split.cc
sql/opt_split.cc
+2
-2
sql/sql_select.cc
sql/sql_select.cc
+3
-6
No files found.
mysql-test/r/derived_cond_pushdown.result
View file @
775aa554
...
...
@@ -14917,3 +14917,14 @@ EXPLAIN
}
DROP VIEW v2;
DROP TABLE t1,t2;
#
# MDEV-15017: splittable table is constant table
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
CREATE TABLE t2 (pk INT, b INT, PRIMARY KEY (pk)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2),(3,4);
CREATE VIEW v2 AS SELECT pk, MIN(b) FROM t2 GROUP BY pk;
SELECT * FROM t1 LEFT JOIN v2 ON (a = pk);
a pk MIN(b)
DROP VIEW v2;
DROP TABLE t1,t2;
mysql-test/t/derived_cond_pushdown.test
View file @
775aa554
...
...
@@ -2582,3 +2582,19 @@ eval EXPLAIN FORMAT=JSON $q;
DROP
VIEW
v2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# MDEV-15017: splittable table is constant table
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t2
(
pk
INT
,
b
INT
,
PRIMARY
KEY
(
pk
))
ENGINE
=
MyISAM
;
INSERT
INTO
t2
VALUES
(
1
,
2
),(
3
,
4
);
CREATE
VIEW
v2
AS
SELECT
pk
,
MIN
(
b
)
FROM
t2
GROUP
BY
pk
;
SELECT
*
FROM
t1
LEFT
JOIN
v2
ON
(
a
=
pk
);
DROP
VIEW
v2
;
DROP
TABLE
t1
,
t2
;
sql/opt_split.cc
View file @
775aa554
...
...
@@ -1118,11 +1118,11 @@ bool JOIN::fix_all_splittings_in_plan()
{
table_map
prev_tables
=
0
;
table_map
all_tables
=
(
1
<<
table_count
)
-
1
;
for
(
uint
tablenr
=
0
;
tablenr
<
table_count
;
tablenr
++
)
for
(
uint
tablenr
=
0
;
tablenr
<
table_count
;
tablenr
++
)
{
POSITION
*
cur_pos
=
&
best_positions
[
tablenr
];
JOIN_TAB
*
tab
=
cur_pos
->
table
;
if
(
tab
->
table
->
is_splittable
())
if
(
tab
lenr
>=
const_tables
&&
tab
->
table
->
is_splittable
())
{
SplM_plan_info
*
spl_plan
=
cur_pos
->
spl_plan
;
if
(
tab
->
fix_splitting
(
spl_plan
,
all_tables
&
~
prev_tables
))
...
...
sql/sql_select.cc
View file @
775aa554
...
...
@@ -4565,12 +4565,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
DBUG_EXECUTE
(
"opt"
,
print_keyuse_array
(
keyuse_array
););
}
for
(
s
=
stat
;
s
<
stat_end
;
s
++
)
{
if
(
s
->
table
->
is_splittable
())
s
->
add_keyuses_for_splitting
();
}
join
->
const_table_map
=
no_rows_const_tables
;
join
->
const_tables
=
const_count
;
eliminate_tables
(
join
);
...
...
@@ -4877,6 +4871,9 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
s
->
scan_time
();
}
if
(
s
->
table
->
is_splittable
())
s
->
add_keyuses_for_splitting
();
/*
Set a max range of how many seeks we can expect when using keys
This is can't be to high as otherwise we are likely to use
...
...
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