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
2442a81e
Commit
2442a81e
authored
Jun 20, 2017
by
Eugene Kosov
Committed by
Aleksey Midenkov
Jun 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IB: read lock on partitioned table read [closes #200]
Closes #204
parent
ac5eb977
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+14
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+6
-0
storage/innobase/handler/ha_innopart.cc
storage/innobase/handler/ha_innopart.cc
+7
-0
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
2442a81e
...
...
@@ -230,6 +230,20 @@ partition by system_time limit 1 (
partition p0 versioning,
partition p1 versioning,
partition pn as of now);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL,
`sys_trx_start` ${SYS_TRX_TYPE} GENERATED ALWAYS AS ROW START,
`sys_trx_end` ${SYS_TRX_TYPE} GENERATED ALWAYS AS ROW END,
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
) ENGINE=${INNODB_OR_MYISAM} DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME LIMIT 1
(PARTITION p0 VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION p1 VERSIONING ENGINE = ${INNODB_OR_MYISAM},
PARTITION pn AS OF NOW ENGINE = ${INNODB_OR_MYISAM})
alter table t1 drop partition non_existent;
ERROR HY000: Error in list of partitions to DROP
insert into t1 values (1), (2);
select * from t1 partition (pn);
x
...
...
mysql-test/suite/versioning/t/partition.test
View file @
2442a81e
...
...
@@ -145,6 +145,12 @@ partition by system_time limit 1 (
partition
p1
versioning
,
partition
pn
as
of
now
);
--
replace_result
InnoDB
$
{
INNODB_OR_MYISAM
}
MyISAM
$
{
INNODB_OR_MYISAM
}
"bigint(20) unsigned"
$
{
SYS_TRX_TYPE
}
timestamp
(
6
)
$
{
SYS_TRX_TYPE
}
show
create
table
t1
;
--
error
ER_DROP_PARTITION_NON_EXISTENT
alter
table
t1
drop
partition
non_existent
;
insert
into
t1
values
(
1
),
(
2
);
select
*
from
t1
partition
(
pn
);
delete
from
t1
;
...
...
storage/innobase/handler/ha_innopart.cc
View file @
2442a81e
...
...
@@ -3059,7 +3059,14 @@ ha_innopart::part_recs_slow(void *_part_elem)
{
DBUG_ASSERT
(
bitmap_is_set
(
&
(
m_part_info
->
read_partitions
),
part_id
));
set_partition
(
part_id
);
bool
read_lock_needed
=
get_lock_type
()
==
F_UNLCK
;
if
(
read_lock_needed
)
ha_external_lock
(
ha_thd
(),
F_RDLCK
);
ha_rows
n
=
ha_innobase
::
records_new
();
if
(
read_lock_needed
)
{
ha_external_lock
(
ha_thd
(),
F_UNLCK
);
ha_commit_one_phase
(
ha_thd
(),
false
);
}
update_partition
(
part_id
);
if
(
n
==
HA_POS_ERROR
)
{
return
HA_POS_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