1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +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

@ -1949,16 +1949,13 @@ protected:
bool is_end(const char *name) const;
bool is_start(const Create_field &f) const;
bool is_end(const Create_field &f) const;
bool fix_implicit(THD *thd, Alter_info *alter_info, int *added= NULL);
bool fix_implicit(THD *thd, Alter_info *alter_info);
operator bool() const
{
return as_row.start || as_row.end || system_time.start || system_time.end;
}
bool need_check(const Alter_info *alter_info) const;
bool check_conditions(const char *table_name, const LString &db) const;
bool check_sys_fields(const char *table_name, Alter_info *alter_info,
bool native);
bool check_conditions(const LString &table_name, const LString &db) const;
public:
static const LString_i default_start;
static const LString_i default_end;
@ -1967,6 +1964,8 @@ public:
HA_CREATE_INFO *create_info, TABLE *table);
bool fix_create_like(Alter_info &alter_info, HA_CREATE_INFO &create_info,
TABLE_LIST &src_table, TABLE_LIST &table);
bool check_sys_fields(const LString &table_name, const LString &db,
Alter_info *alter_info, bool native);
/**
At least one field was specified 'WITH/WITHOUT SYSTEM VERSIONING'.
@ -2054,9 +2053,10 @@ struct Table_scope_and_contents_source_st
bool vers_fix_system_fields(THD *thd, Alter_info *alter_info,
const TABLE_LIST &create_table,
const TABLE_LIST *select_table= NULL,
List<Item> *items= NULL,
bool *versioned_write= NULL);
bool create_select= false);
bool vers_check_system_fields(THD *thd, Alter_info *alter_info,
const TABLE_LIST &create_table);
bool vers_native(THD *thd) const;