1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-19908 Add class Type_collection

This commit is contained in:
Alexander Barkov
2019-06-29 09:48:54 +04:00
parent 5de9dd7b47
commit cccfa9dcfe
4 changed files with 225 additions and 138 deletions

View File

@ -87,6 +87,7 @@ class Vers_history_point;
class Virtual_column_info;
class Conv_source;
class ST_FIELD_INFO;
class Type_collection;
#define my_charset_numeric my_charset_latin1
@ -3281,12 +3282,10 @@ public:
DBUG_ASSERT(type != TIME_RESULT);
return get_handler_by_cmp_type(type);
}
virtual const Type_collection *type_collection() const;
static const
Type_handler *aggregate_for_result_traditional(const Type_handler *h1,
const Type_handler *h2);
static const
Type_handler *aggregate_for_num_op_traditional(const Type_handler *h1,
const Type_handler *h2);
virtual const Name name() const= 0;
virtual const Name version() const { return m_version_default; }
@ -6372,6 +6371,7 @@ public:
bool is_param_long_data_type() const { return true; }
uint32 max_display_length_for_field(const Conv_source &src) const;
uint32 calc_pack_length(uint32 length) const;
const Type_collection *type_collection() const override;
const Type_handler *type_handler_for_comparison() const;
bool type_can_have_key_part() const
{
@ -6570,6 +6570,24 @@ public:
};
class Type_collection
{
public:
virtual ~Type_collection() {}
virtual const Type_handler *aggregate_for_result(const Type_handler *h1,
const Type_handler *h2)
const= 0;
virtual const Type_handler *aggregate_for_comparison(const Type_handler *h1,
const Type_handler *h2)
const= 0;
virtual const Type_handler *aggregate_for_min_max(const Type_handler *h1,
const Type_handler *h2)
const= 0;
virtual const Type_handler *aggregate_for_num_op(const Type_handler *h1,
const Type_handler *h2)
const= 0;
};
/**
A handler for hybrid type functions, e.g.