1
0
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:
Sergei Golubchik
2018-04-02 19:35:27 +02:00
parent 72dd813f7e
commit 9bd3af97df
10 changed files with 114 additions and 191 deletions

View File

@ -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);