mirror of
https://github.com/MariaDB/server.git
synced 2025-07-05 12:42:17 +03:00
MDEV-15413 Unexpected errors upon CREATE TABLE .. WITH SYSTEM VERSIONING AS SELECT ...
numerous fixes for CREATE ... SELECT with system versioning: In CREATE ... SELECT the table is created based on the result set, field properties do not count. That is * field invisibility is *not* copied over * AS ROW START/END is *not* copied over * the history is *not* copied over * system row_start/row_end fields can *not* be created from the SELECT part
This commit is contained in:
@ -3439,8 +3439,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
select_field_pos= alter_info->create_list.elements - select_field_count;
|
||||
|
||||
for (field_no=0; (sql_field=it++) ; field_no++)
|
||||
{
|
||||
/*
|
||||
@ -3483,7 +3481,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
If this was a CREATE ... SELECT statement, accept a field
|
||||
redefinition if we are changing a field in the SELECT part
|
||||
*/
|
||||
if (field_no < select_field_pos || dup_no >= select_field_pos)
|
||||
if (field_no < select_field_pos || dup_no >= select_field_pos ||
|
||||
dup_field->invisible >= INVISIBLE_SYSTEM)
|
||||
{
|
||||
my_error(ER_DUP_FIELDNAME, MYF(0), sql_field->field_name.str);
|
||||
DBUG_RETURN(TRUE);
|
||||
|
Reference in New Issue
Block a user