[MDEV-20507] Fix history fields data types diagnostics for partition Created: 2019-09-05  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Versioned Tables
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Nikita Malyavin Assignee: Nikita Malyavin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Background

The initial work has been done in MDEV-15408 by bringing the comprehensive error reports:

create or replace table t1 (
a int,
row_start bigint as row start,
row_end bigint as row end,
period for system_time (row_start, row_end)
) engine=innodb with system versioning;
ERROR HY000: `row_start` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`

Here, it is guessed that the data type is meant BIGINT(20) , not TIMESTAMP(6). It is only possible for engines that support trx_id (i.e. native) versioning.

create or replace table t1 (
a int,
row_start bigint as row start,
row_end bigint as row end,
period for system_time (row_start, row_end)
) engine=myisam with system versioning;
ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1`

The bug

It is not handled for partitions correctly

create or replace table t1 (
a int,
row_start bigint as row start,
row_end bigint as row end,
period for system_time (row_start, row_end)
) engine=myisam with system versioning
partition by hash(a);
ERROR HY000: `row_start` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`

This is because native flag is determined from the handlerton. Instead, the partitioning structure should be taken in mind. The correct determination of nativeness was done in MDEV-15951, but it probably needs some revisiting, e.g. move the check in Create_info/Alter_info layer


Generated at Thu Feb 08 09:00:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.