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
2cae58f8
Commit
2cae58f8
authored
Jul 17, 2020
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18371 Server crashes in ha_innobase::cmp_ref upon UPDATE with PARTITION clause.
m_file[0] not always is a good sample.
parent
73aa31fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
3 deletions
+34
-3
mysql-test/main/partition_explicit_prune.result
mysql-test/main/partition_explicit_prune.result
+18
-0
mysql-test/main/partition_explicit_prune.test
mysql-test/main/partition_explicit_prune.test
+12
-0
sql/ha_partition.cc
sql/ha_partition.cc
+4
-3
No files found.
mysql-test/main/partition_explicit_prune.result
View file @
2cae58f8
...
...
@@ -1888,4 +1888,22 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
SELECT * FROM t1 PARTITION (p0);
i
UNLOCK TABLES;
DROP TABLE t1;
#
# MDEV-18371 Server crashes in ha_innobase::cmp_ref upon UPDATE with PARTITION clause.
#
CREATE TABLE t1 (a INT, b INT, KEY (a)) ENGINE=InnoDB PARTITION BY KEY(b) PARTITIONS 4;
INSERT INTO t1 VALUES (3,0),(8,2),(7,8),(3,4),(2,4),(0,7),(4,3),(3,6);
FLUSH TABLES;
UPDATE t1 PARTITION (p3,p1) SET a = 2 WHERE a = 3;
SELECT * FROM t1;
a b
2 0
7 8
2 4
2 4
0 7
4 3
8 2
2 6
DROP TABLE t1, t2;
mysql-test/main/partition_explicit_prune.test
View file @
2cae58f8
...
...
@@ -874,6 +874,18 @@ SELECT * FROM t1 PARTITION (p0);
ALTER
TABLE
t1
EXCHANGE
PARTITION
p0
WITH
TABLE
t2
;
SELECT
*
FROM
t1
PARTITION
(
p0
);
UNLOCK
TABLES
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-18371 Server crashes in ha_innobase::cmp_ref upon UPDATE with PARTITION clause.
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
KEY
(
a
))
ENGINE
=
InnoDB
PARTITION
BY
KEY
(
b
)
PARTITIONS
4
;
INSERT
INTO
t1
VALUES
(
3
,
0
),(
8
,
2
),(
7
,
8
),(
3
,
4
),(
2
,
4
),(
0
,
7
),(
4
,
3
),(
3
,
6
);
FLUSH
TABLES
;
UPDATE
t1
PARTITION
(
p3
,
p1
)
SET
a
=
2
WHERE
a
=
3
;
SELECT
*
FROM
t1
;
# Cleanup
DROP
TABLE
t1
,
t2
;
sql/ha_partition.cc
View file @
2cae58f8
...
...
@@ -5580,8 +5580,9 @@ extern "C" int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2)
{
return
res
;
}
if
((
res
=
file
->
m_file
[
0
]
->
cmp_ref
(
ref1
+
PARTITION_BYTES_IN_POS
+
file
->
m_rec_length
,
ref2
+
PARTITION_BYTES_IN_POS
+
file
->
m_rec_length
)))
if
((
res
=
file
->
get_open_file_sample
()
->
cmp_ref
(
ref1
+
PARTITION_BYTES_IN_POS
+
file
->
m_rec_length
,
ref2
+
PARTITION_BYTES_IN_POS
+
file
->
m_rec_length
)))
{
return
res
;
}
...
...
@@ -9577,7 +9578,7 @@ uint8 ha_partition::table_cache_type()
{
DBUG_ENTER
(
"ha_partition::table_cache_type"
);
DBUG_RETURN
(
m_file
[
0
]
->
table_cache_type
());
DBUG_RETURN
(
get_open_file_sample
()
->
table_cache_type
());
}
...
...
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