1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-15951 system versioning by trx id doesn't work with partitioning

Fix partitioning for trx_id-versioned tables.
`partition by hash`, `range` and others now work.
`partition by system_time` is forbidden.
Currently we cannot use row_start and row_end in `partition by`, because
insertion of versioned field is done by engine's handler, as well as
row_start/row_end's value set up, which is a transaction id -- so it's
also forbidden.

The drawback is that it's now impossible to use `partition by key()`
without parameters for such tables, because it references row_start and
row_end implicitly.

* add handler::vers_can_native()
* drop Table_scope_and_contents_source_st::vers_native()
* drop partition_element::find_engine_flag as unused
* forbid versioning partitioning for trx_id as not supported
* adopt vers tests for trx_id partitioning
* forbid any row_end referencing in `partition by` clauses,
  including implicit `by key()`
This commit is contained in:
Nikita Malyavin
2019-02-22 22:17:41 +10:00
committed by Sergei Golubchik
parent f6ee132491
commit e6230e844c
12 changed files with 244 additions and 66 deletions

View File

@ -1993,7 +1993,7 @@ public:
TABLE_LIST &src_table, TABLE_LIST &table);
bool check_sys_fields(const Lex_table_name &table_name,
const Lex_table_name &db,
Alter_info *alter_info, bool native);
Alter_info *alter_info);
/**
At least one field was specified 'WITH/WITHOUT SYSTEM VERSIONING'.
@ -2077,8 +2077,6 @@ struct Table_scope_and_contents_source_pod_st // For trivial members
bool table_was_deleted;
sequence_definition *seq_create_info;
bool vers_native(THD *thd) const;
void init()
{
bzero(this, sizeof(*this));
@ -3456,6 +3454,10 @@ public:
ha_pre_index_end() :
pre_inited == RND ? ha_pre_rnd_end() : 0 );
}
virtual bool vers_can_native(THD *thd)
{
return ht->flags & HTON_NATIVE_SYS_VERSIONING;
}
/**
@brief