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
98758b52
Commit
98758b52
authored
Jul 16, 2019
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20068 History partition rotation is not done under LOCK TABLES
Wrong value F_WRLCK for thr_lock_type.
parent
cdbac54d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+12
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+11
-0
sql/ha_partition.cc
sql/ha_partition.cc
+15
-2
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
98758b52
...
...
@@ -557,6 +557,18 @@ insert into t1 values (1), (2);
explain select max(pk) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
#
# MDEV-20068 History partition rotation is not done under LOCK TABLES
#
create or replace table t1 (x int) with system versioning partition by system_time limit 1
(partition p1 history, partition pn current);
lock tables t1 write;
insert into t1 values (0), (1), (2), (3);
delete from t1 where x < 3;
delete from t1;
Warnings:
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
unlock tables;
# Test cleanup
drop database test;
create database test;
mysql-test/suite/versioning/t/partition.test
View file @
98758b52
...
...
@@ -518,6 +518,17 @@ explain select max(pk) from t1;
set
default_storage_engine
=
@
saved_storage_engine
;
--
enable_query_log
--
echo
#
--
echo
# MDEV-20068 History partition rotation is not done under LOCK TABLES
--
echo
#
create
or
replace
table
t1
(
x
int
)
with
system
versioning
partition
by
system_time
limit
1
(
partition
p1
history
,
partition
pn
current
);
lock
tables
t1
write
;
insert
into
t1
values
(
0
),
(
1
),
(
2
),
(
3
);
delete
from
t1
where
x
<
3
;
delete
from
t1
;
unlock
tables
;
--
echo
# Test cleanup
drop
database
test
;
create
database
test
;
sql/ha_partition.cc
View file @
98758b52
...
...
@@ -4093,8 +4093,21 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
/* Add partition to be called in reset(). */
bitmap_set_bit
(
&
m_partitions_to_reset
,
i
);
}
if
(
lock_type
==
F_WRLCK
&&
m_part_info
->
part_expr
)
m_part_info
->
part_expr
->
walk
(
&
Item
::
register_field_in_read_map
,
1
,
0
);
switch
(
lock_type
)
{
case
TL_WRITE_ALLOW_WRITE
:
case
TL_WRITE_CONCURRENT_INSERT
:
case
TL_WRITE_DELAYED
:
case
TL_WRITE_DEFAULT
:
case
TL_WRITE_LOW_PRIORITY
:
case
TL_WRITE
:
case
TL_WRITE_ONLY
:
if
(
m_part_info
->
part_expr
)
m_part_info
->
part_expr
->
walk
(
&
Item
::
register_field_in_read_map
,
1
,
0
);
if
(
m_part_info
->
part_type
==
VERSIONING_PARTITION
)
m_part_info
->
vers_set_hist_part
(
thd
);
default:
;
}
DBUG_RETURN
(
error
);
}
...
...
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