MDEV-27293 Allow converting a versioned table from implicit

to explicit row_start/row_end columns

In case of adding both system fields of same type (length, unsigned
flag) as old implicit system fields do the rename of implicit system
fields to the ones specified in ALTER, remove SYSTEM_INVISIBLE flag in
that case. Correct PERIOD clause must be specified in ALTER as well.

MDEV-34904 Inplace alter for implicit to explicit versioning is broken

Whether ALTER goes inplace and how it goes inplace depends on
handler_flags which goes from alter_info->flags by this logic:

  ha_alter_info->handler_flags|= (alter_info->flags & ~flags_to_remove);

ALTER_VERS_EXPLICIT was not in flags_to_remove and its value (1ULL <<
35) clashed with ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX.

ALTER_VERS_EXPLICIT must not affect inplace, it is SQL-only so we
remove it from handler_flags.
This commit is contained in:
Aleksey Midenkov 2024-10-29 14:18:38 +03:00
commit cc183489da
10 changed files with 170 additions and 45 deletions

View file

@ -6033,6 +6033,12 @@ ulonglong TABLE::vers_start_id() const
return static_cast<ulonglong>(vers_start_field()->val_int());
}
inline
bool TABLE::vers_implicit() const
{
return vers_end_field()->invisible == INVISIBLE_SYSTEM;
}
double pos_in_interval_for_string(CHARSET_INFO *cset,
const uchar *midp_val, uint32 midp_len,
const uchar *min_val, uint32 min_len,