mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 10:31:54 +01:00
parent
ac5eb9771e
commit
2442a81eff
3 changed files with 27 additions and 0 deletions
|
@ -230,6 +230,20 @@ partition by system_time limit 1 (
|
||||||
partition p0 versioning,
|
partition p0 versioning,
|
||||||
partition p1 versioning,
|
partition p1 versioning,
|
||||||
partition pn as of now);
|
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);
|
insert into t1 values (1), (2);
|
||||||
select * from t1 partition (pn);
|
select * from t1 partition (pn);
|
||||||
x
|
x
|
||||||
|
|
|
@ -145,6 +145,12 @@ partition by system_time limit 1 (
|
||||||
partition p1 versioning,
|
partition p1 versioning,
|
||||||
partition pn as of now);
|
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);
|
insert into t1 values (1), (2);
|
||||||
select * from t1 partition (pn);
|
select * from t1 partition (pn);
|
||||||
delete from t1;
|
delete from t1;
|
||||||
|
|
|
@ -3059,7 +3059,14 @@ ha_innopart::part_recs_slow(void *_part_elem)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), part_id));
|
DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), part_id));
|
||||||
set_partition(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();
|
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);
|
update_partition(part_id);
|
||||||
if (n == HA_POS_ERROR) {
|
if (n == HA_POS_ERROR) {
|
||||||
return HA_POS_ERROR;
|
return HA_POS_ERROR;
|
||||||
|
|
Loading…
Add table
Reference in a new issue