1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2021-11-09 08:50:33 +02:00
46 changed files with 1536 additions and 55 deletions

View File

@ -7937,15 +7937,16 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
if (!vers_info.need_check(alter_info))
return false;
if (!vers_info.versioned_fields && vers_info.unversioned_fields &&
!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING))
const bool add_versioning= alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING;
if (!vers_info.versioned_fields && vers_info.unversioned_fields && !add_versioning)
{
// All is correct but this table is not versioned.
options&= ~HA_VERSIONED_TABLE;
return false;
}
if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING) && vers_info)
if (!add_versioning && vers_info && !vers_info.versioned_fields)
{
my_error(ER_MISSING, MYF(0), create_table.table_name.str,
"WITH SYSTEM VERSIONING");
@ -7955,8 +7956,7 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
List_iterator<Create_field> it(alter_info->create_list);
while (Create_field *f= it++)
{
if ((f->versioning == Column_definition::VERSIONING_NOT_SET &&
!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING)) ||
if ((f->versioning == Column_definition::VERSIONING_NOT_SET && !add_versioning) ||
f->versioning == Column_definition::WITHOUT_VERSIONING)
{
f->flags|= VERS_UPDATE_UNVERSIONED_FLAG;