1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-16546 post-review fixes

* clarify the help text for --system-versioning-insert-history
* move the vers_write=false check from Item_field::fix_fields()
  next to other vers field checks in find_field_in_table()
* move row_start validation from handler::write_row() next to
  vers_update_fields()
* make secure_timestamp check to happen in one place only,
  extract it into a function is_set_timestamp_vorbidden().
* overwriting vers fields is an error, just like setting @@timestamp
* don't run vers_insert_history() for every row
This commit is contained in:
Sergei Golubchik
2022-09-06 19:28:42 +02:00
parent a2cda88631
commit 8d2ec37a40
16 changed files with 162 additions and 88 deletions

View File

@@ -3257,6 +3257,7 @@ delete from t partition (px);
ERROR HY000: Unknown partition 'px' in table 't'
unlock tables;
drop table t;
set timestamp= default;
#
# MDEV-28978 Assertion failure in THD::binlog_query or unexpected
# ER_ERROR_ON_WRITE with auto-partitioning
@@ -3266,4 +3267,24 @@ insert into t () values (),(),(),(),(),();
update t set a = 1;
update t set a = 2 limit 0;
drop table t;
#
# MDEV-16546 System versioning setting to allow history modification
#
create table t1 (a varchar(100)) with system versioning
partition by system_time interval 1 day
starts '2021-09-30 00:00:00' partitions 3;
set system_versioning_insert_history=1;
insert into t1 (a,row_start,row_end) values
('p0', '2021-09-30', '2021-09-30 10:00:00'),
('p1', '2021-09-30', '2021-10-01 10:00:00'),
('overflows, so also p1','2021-09-30', '2021-10-10 10:00:00'),
('pn, current', '2021-09-30', '2038-01-19 03:14:07.999999');
select table_name,partition_name,partition_ordinal_position,partition_method,partition_description,table_rows
from information_schema.partitions where table_schema='test';
table_name partition_name partition_ordinal_position partition_method partition_description table_rows
t1 p0 1 SYSTEM_TIME 2021-10-01 00:00:00 1
t1 p1 2 SYSTEM_TIME 2021-10-02 00:00:00 2
t1 pn 3 SYSTEM_TIME CURRENT 1
drop table t1;
set system_versioning_insert_history=0;
set global innodb_stats_persistent= @save_persistent;