diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_partition.cc | 36 | ||||
-rw-r--r-- | sql/ha_partition.h | 11 |
2 files changed, 46 insertions, 1 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index bcd419562b1..53bcd4df5c5 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2005, 2019, Oracle and/or its affiliates. - Copyright (c) 2009, 2019, MariaDB + Copyright (c) 2009, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11799,6 +11799,40 @@ void ha_partition::clear_top_table_fields() DBUG_VOID_RETURN; } +bool +ha_partition::can_convert_string(const Field_string* field, + const Column_definition& new_type) const +{ + for (uint index= 0; index < m_tot_parts; index++) + { + if (!m_file[index]->can_convert_string(field, new_type)) + return false; + } + return true; +} + +bool +ha_partition::can_convert_varstring(const Field_varstring* field, + const Column_definition& new_type) const{ + for (uint index= 0; index < m_tot_parts; index++) + { + if (!m_file[index]->can_convert_varstring(field, new_type)) + return false; + } + return true; +} + +bool +ha_partition::can_convert_blob(const Field_blob* field, + const Column_definition& new_type) const +{ + for (uint index= 0; index < m_tot_parts; index++) + { + if (!m_file[index]->can_convert_blob(field, new_type)) + return false; + } + return true; +} struct st_mysql_storage_engine partition_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 5b8718cd3ae..78561d0ec27 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1640,5 +1640,16 @@ public: friend int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2); friend int cmp_key_part_id(void *key_p, uchar *ref1, uchar *ref2); + bool can_convert_string( + const Field_string* field, + const Column_definition& new_field) const override; + + bool can_convert_varstring( + const Field_varstring* field, + const Column_definition& new_field) const override; + + bool can_convert_blob( + const Field_blob* field, + const Column_definition& new_field) const override; }; #endif /* HA_PARTITION_INCLUDED */ |