1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-27452 TIMESTAMP(0) system field is allowed for certain creation of system-versioned table

First, we do not add VERS_UPDATE_UNVERSIONED_FLAG for system field and
that fixes SHOW CREATE result.

Second, we have to call check_sys_fields() for any CREATE TABLE and
there correct type is checked for system fields.

Third, we update system_time like as_row structures for ALTER TABLE
and that makes check_sys_fields() happy for ALTER TABLE when we make
system fields hidden.
This commit is contained in:
Aleksey Midenkov
2022-01-13 23:35:17 +03:00
parent 241ac79e49
commit 585cb18ed1
4 changed files with 67 additions and 6 deletions

View File

@ -8230,9 +8230,14 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
def->invisible= INVISIBLE_SYSTEM;
alter_info->flags|= ALTER_CHANGE_COLUMN;
if (field->flags & VERS_ROW_START)
create_info->vers_info.as_row.start= def->field_name= Vers_parse_info::default_start;
create_info->vers_info.system_time.start=
create_info->vers_info.as_row.start=
def->field_name= Vers_parse_info::default_start;
else
create_info->vers_info.as_row.end= def->field_name= Vers_parse_info::default_end;
create_info->vers_info.system_time.end=
create_info->vers_info.as_row.end=
def->field_name= Vers_parse_info::default_end;
new_create_list.push_back(def, thd->mem_root);
dropped_sys_vers_fields|= field->flags;
drop_it.remove();