summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2018-06-22 23:26:43 +1000
committerNikita Malyavin <nikitamalyavin@gmail.com>2019-09-09 20:14:47 +0300
commitf6a7730c4505c14c8b63b00623917ddaf90c60ae (patch)
tree09a0fb8dfc60e63826f34f57085367246bd8b17a /sql/sql_insert.cc
parent604f80e77c054758aa449064cdc29dfa13a71922 (diff)
downloadmariadb-git-f6a7730c4505c14c8b63b00623917ddaf90c60ae.tar.gz
MDEV-16490: It's possible to make a system versioned table without any versioning field
* do not allow versioned table to be without versioned (non-system) fields * prohibit changing field versioning, when removing table versioning * handle CREATE...SELECT as well
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 2a7fca591c2..7913ea2b2ec 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4185,8 +4185,7 @@ TABLE *select_create::create_table_from_items(THD *thd,
if (!opt_explicit_defaults_for_timestamp)
promote_first_timestamp_column(&alter_info->create_list);
- if (create_info->vers_fix_system_fields(thd, alter_info, *create_table,
- true))
+ if (create_info->vers_fix_system_fields(thd, alter_info, *create_table))
DBUG_RETURN(NULL);
while ((item=it++))
@@ -4225,7 +4224,10 @@ TABLE *select_create::create_table_from_items(THD *thd,
alter_info->create_list.push_back(cr_field, thd->mem_root);
}
- if (create_info->vers_check_system_fields(thd, alter_info, *create_table))
+ if (create_info->vers_check_system_fields(thd, alter_info,
+ create_table->table_name,
+ create_table->db,
+ select_field_count))
DBUG_RETURN(NULL);
DEBUG_SYNC(thd,"create_table_select_before_create");