diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2020-04-03 23:55:48 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2020-04-03 23:55:48 +0300 |
commit | 76063c2a13ff0a9aebf071d24a740f96882c4339 (patch) | |
tree | 2fb37ac8186bdc8684c90be78a582e4c1852ba6d /sql/field.cc | |
parent | a21900663626647a7b6f4904fa564f05df38ff5f (diff) | |
download | mariadb-git-76063c2a13ff0a9aebf071d24a740f96882c4339.tar.gz |
MDEV-20494 ER_NOT_FORM_FILE or assertion upon adding partition to period table
- Fixed mysql_prepare_create_table() constraint duplicate checking;
- Refactored period constraint handling in mysql_prepare_alter_table():
* No need to allocate new objects;
* Keep old constraint name but exclude it from dup checking by automatic_name;
- Some minor memory leaks fixed;
- Some conceptual TODOs.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc index ace70c178bc..a9bd97d9844 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -11387,3 +11387,20 @@ void Field::print_key_value_binary(String *out, const uchar* key, uint32 length) { out->append_semi_hex((const char*)key, length, charset()); } + + +Virtual_column_info* Virtual_column_info::clone(THD *thd) +{ + Virtual_column_info* dst= new (thd->mem_root) Virtual_column_info(*this); + if (!dst) + return NULL; + if (expr) + { + dst->expr= expr->get_copy(thd); + if (!dst->expr) + return NULL; + } + if (!thd->make_lex_string(&dst->name, name.str, name.length)) + return NULL; + return dst; +}; |