Commit e98f3bcf authored by Alexander Barkov's avatar Alexander Barkov

Adding the `override` keyword into all classes in the Type_handler hierarchy, for consistency.

parent 3f7659b8
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -346,9 +346,12 @@ class Field_geom :public Field_blob ...@@ -346,9 +346,12 @@ class Field_geom :public Field_blob
{ srid= field_srid; } { srid= field_srid; }
enum_conv_type rpl_conv_type_from(const Conv_source &source, enum_conv_type rpl_conv_type_from(const Conv_source &source,
const Relay_log_info *rli, const Relay_log_info *rli,
const Conv_param &param) const; const Conv_param &param) const override;
enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY2; } enum ha_base_keytype key_type() const override
const Type_handler *type_handler() const {
return HA_KEYTYPE_VARBINARY2;
}
const Type_handler *type_handler() const override
{ {
return m_type_handler; return m_type_handler;
} }
...@@ -360,28 +363,28 @@ class Field_geom :public Field_blob ...@@ -360,28 +363,28 @@ class Field_geom :public Field_blob
{ {
m_type_handler= th; m_type_handler= th;
} }
enum_field_types type() const enum_field_types type() const override
{ {
return MYSQL_TYPE_GEOMETRY; return MYSQL_TYPE_GEOMETRY;
} }
enum_field_types real_type() const enum_field_types real_type() const override
{ {
return MYSQL_TYPE_GEOMETRY; return MYSQL_TYPE_GEOMETRY;
} }
Information_schema_character_attributes Information_schema_character_attributes
information_schema_character_attributes() const information_schema_character_attributes() const override
{ {
return Information_schema_character_attributes(); return Information_schema_character_attributes();
} }
void make_send_field(Send_field *to) void make_send_field(Send_field *to) override
{ {
Field_longstr::make_send_field(to); Field_longstr::make_send_field(to);
} }
bool can_optimize_range(const Item_bool_func *cond, bool can_optimize_range(const Item_bool_func *cond,
const Item *item, const Item *item,
bool is_eq_func) const; bool is_eq_func) const override;
void sql_type(String &str) const; void sql_type(String &str) const override;
Copy_func *get_copy_func(const Field *from) const Copy_func *get_copy_func(const Field *from) const override
{ {
const Type_handler_geometry *fth= const Type_handler_geometry *fth=
dynamic_cast<const Type_handler_geometry*>(from->type_handler()); dynamic_cast<const Type_handler_geometry*>(from->type_handler());
...@@ -389,7 +392,7 @@ class Field_geom :public Field_blob ...@@ -389,7 +392,7 @@ class Field_geom :public Field_blob
return get_identical_copy_func(); return get_identical_copy_func();
return do_conv_blob; return do_conv_blob;
} }
bool memcpy_field_possible(const Field *from) const bool memcpy_field_possible(const Field *from) const override
{ {
const Type_handler_geometry *fth= const Type_handler_geometry *fth=
dynamic_cast<const Type_handler_geometry*>(from->type_handler()); dynamic_cast<const Type_handler_geometry*>(from->type_handler());
...@@ -397,17 +400,18 @@ class Field_geom :public Field_blob ...@@ -397,17 +400,18 @@ class Field_geom :public Field_blob
m_type_handler->is_binary_compatible_geom_super_type_for(fth) && m_type_handler->is_binary_compatible_geom_super_type_for(fth) &&
!table->copy_blobs; !table->copy_blobs;
} }
bool is_equal(const Column_definition &new_field) const; bool is_equal(const Column_definition &new_field) const override;
bool can_be_converted_by_engine(const Column_definition &new_type) const bool can_be_converted_by_engine(const Column_definition &new_type)
const override
{ {
return false; // Override the Field_blob behavior return false; // Override the Field_blob behavior
} }
int store(const char *to, size_t length, CHARSET_INFO *charset); int store(const char *to, size_t length, CHARSET_INFO *charset) override;
int store(double nr); int store(double nr) override;
int store(longlong nr, bool unsigned_val); int store(longlong nr, bool unsigned_val) override;
int store_decimal(const my_decimal *); int store_decimal(const my_decimal *) override;
uint size_of() const { return sizeof(*this); } uint size_of() const override{ return sizeof(*this); }
/** /**
Key length is provided only to support hash joins. (compared byte for byte) Key length is provided only to support hash joins. (compared byte for byte)
Ex: SELECT .. FROM t1,t2 WHERE t1.field_geom1=t2.field_geom2. Ex: SELECT .. FROM t1,t2 WHERE t1.field_geom1=t2.field_geom2.
...@@ -415,19 +419,19 @@ class Field_geom :public Field_blob ...@@ -415,19 +419,19 @@ class Field_geom :public Field_blob
The comparison is not very relevant, as identical geometry might be The comparison is not very relevant, as identical geometry might be
represented differently, but we need to support it either way. represented differently, but we need to support it either way.
*/ */
uint32 key_length() const { return packlength; } uint32 key_length() const override{ return packlength; }
uint get_key_image(uchar *buff,uint length, imagetype type_arg); uint get_key_image(uchar *buff,uint length, imagetype type_arg) override;
/** /**
Non-nullable GEOMETRY types cannot have defaults, Non-nullable GEOMETRY types cannot have defaults,
but the underlying blob must still be reset. but the underlying blob must still be reset.
*/ */
int reset(void) { return Field_blob::reset() || !maybe_null(); } int reset(void) override{ return Field_blob::reset() || !maybe_null(); }
bool load_data_set_null(THD *thd); bool load_data_set_null(THD *thd) override;
bool load_data_set_no_data(THD *thd, bool fixed_format); bool load_data_set_no_data(THD *thd, bool fixed_format) override;
uint get_srid() const { return srid; } uint get_srid() const { return srid; }
void print_key_value(String *out, uint32 length) void print_key_value(String *out, uint32 length) override
{ {
out->append(STRING_WITH_LEN("unprintable_geometry_value")); out->append(STRING_WITH_LEN("unprintable_geometry_value"));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment