MDEV-25495 AUTO argument to specify max number of partitions
Example:
create table t1 (x int) with system versioning
partition by system_time interval 1 hour auto 25;
Keeps 24 history partitions (and 1 current partition).
Note, MAX_SYM cannot be used for syntax expansion as this is function
name (sql_functions[] in lex.h)
fast_alter_partition_table() changes:
Auto-add like auto-drop now goes through REBUILD branch. MDL_EXCLUSIVE
is taken before mysql_change_partitions() like ALTER_PARTITION_ADD
branch does.
ha_partition::change_partitions() changes:
ADD PARTITION and DROP PARTITION in one command (as well as any other
alter partition operations) is not supported by the original code. The
patch partially solves this problem: ha_partition::change_partitions()
now can accept both PART_TO_BE_DROPPED and PART_TO_BE_ADDED states in
the partitions list. Originally change_partitions() was not used for
arbitrary drop of partitions, only REORGANIZE and COALESCE could be
processed by this call.
For REORGANIZE m_part_info->partitions contains new partitions set and
m_part_info->temp_partitions contains PART_TO_BE_REORGED
partitions. But we cannot use temp_partitions for dropping partitions
because they go through copy_partitions() phase (see how
m_reorged_parts initialized).
For COALESCE m_part_info->partitions in the beginning of the list
contains normal partitions that will remain when alter finishes, the
end of the list contains PART_REORGED_DROPPED partitions, so Step 4
can ignore them.
Step 4 for new_file_array preparation didn't skip PART_TO_BE_DROPPED
partitions in m_file. Now we increment orig_count for them.
Step 5 now properly iterates new_file_array in respect of skipping
PART_TO_BE_DROPPED while iterating m_part_info->partitions.
For full ADD+DROP support it would be needed to rework
prep_alter_part_table() as well. Now PART_TO_BE_DROPPED state is set
in vers_create_partitions() after prep_alter_part_table().
MDEV-21921 Make transaction_isolation and transaction_read_only into system variables
In MariaDB, we have a confusing problem where:
* The transaction_isolation option can be set in a configuration file, but it cannot be set dynamically.
* The tx_isolation system variable can be set dynamically, but it cannot be set in a configuration file.
Therefore, we have two different names for the same thing in different contexts. This is needlessly confusing, and it complicates the documentation. The same thing applys for transaction_read_only.
MySQL 5.7 solved this problem by making them into system variables. https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-20.html
This commit takes a similar approach by adding new system variables and marking the original ones as deprecated. This commit also resolves some legacy problems related to SET STATEMENT and transaction_isolation.