Commit 84b4baef authored by Eugene Kosov's avatar Eugene Kosov Committed by Aleksey Midenkov

SQL: SHOW CREATE for GENERATED ALWAYS AS ROW

Test is main.mysqldump
parent 45f6acd2
......@@ -167,7 +167,7 @@ show create table mysql.vtmd_template;
Table Create Table
vtmd_template CREATE TABLE `vtmd_template` (
`start` bigint(20) unsigned GENERATED ALWAYS AS ROW START COMMENT 'TRX_ID of table lifetime start',
`end` bigint(20) unsigned NOT NULL GENERATED ALWAYS AS ROW END COMMENT 'TRX_ID of table lifetime end',
`end` bigint(20) unsigned GENERATED ALWAYS AS ROW END NOT NULL COMMENT 'TRX_ID of table lifetime end',
`name` varchar(64) COLLATE utf8_bin NOT NULL COMMENT 'Table name during period [start, end)',
`frm_image` blob NOT NULL COMMENT 'Table structure during period [start, end)',
`col_renames` blob DEFAULT NULL COMMENT 'Column name mapping from previous lifetime',
......
......@@ -2112,6 +2112,15 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
}
else
{
if (field->flags & VERS_SYS_START_FLAG)
{
packet->append(STRING_WITH_LEN(" GENERATED ALWAYS AS ROW START"));
}
else if (field->flags & VERS_SYS_END_FLAG)
{
packet->append(STRING_WITH_LEN(" GENERATED ALWAYS AS ROW END"));
}
if (flags & NOT_NULL_FLAG)
packet->append(STRING_WITH_LEN(" NOT NULL"));
else if (field->type() == MYSQL_TYPE_TIMESTAMP && !field->vers_sys_field())
......@@ -2129,14 +2138,6 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN(" DEFAULT "));
packet->append(def_value.ptr(), def_value.length(), system_charset_info);
}
else if (field->flags & VERS_SYS_START_FLAG)
{
packet->append(STRING_WITH_LEN(" GENERATED ALWAYS AS ROW START"));
}
else if (field->flags & VERS_SYS_END_FLAG)
{
packet->append(STRING_WITH_LEN(" GENERATED ALWAYS AS ROW END"));
}
if (field->flags & VERS_OPTIMIZED_UPDATE_FLAG)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment