cleanup: remove Type_collection::handler_by_name()

it's a hard-coded geometry-specific method, move it into
geometry-specific function. Will go away in the future.
This commit is contained in:
Sergei Golubchik 2023-05-16 22:26:57 +02:00
parent a4817e1520
commit 5bf80af06e
9 changed files with 4 additions and 49 deletions

View File

@ -176,13 +176,6 @@ public:
{ {
return NULL; return NULL;
} }
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
if (type_handler_mysql_json.name().eq(name))
return &type_handler_mysql_json;
return NULL;
}
}; };
const Type_collection *Type_handler_mysql_json::type_collection() const const Type_collection *Type_handler_mysql_json::type_collection() const

View File

@ -31,11 +31,6 @@ protected:
return NULL; return NULL;
} }
public: public:
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
return NULL;
}
const Type_handler *aggregate_for_result(const Type_handler *h1, const Type_handler *aggregate_for_result(const Type_handler *h1,
const Type_handler *h2) const Type_handler *h2)
const override const override

View File

@ -26,10 +26,6 @@ protected:
const Type_handler *aggregate_common(const Type_handler *h1, const Type_handler *aggregate_common(const Type_handler *h1,
const Type_handler *h2) const; const Type_handler *h2) const;
public: public:
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
return NULL;
}
const Type_handler *aggregate_for_result(const Type_handler *h1, const Type_handler *aggregate_for_result(const Type_handler *h1,
const Type_handler *h2) const Type_handler *h2)
const override; const override;

View File

@ -94,10 +94,6 @@ Vers_type_trx vers_type_trx;
class Type_collection_std: public Type_collection class Type_collection_std: public Type_collection
{ {
public: public:
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
return NULL;
}
const Type_handler *aggregate_for_result(const Type_handler *a, const Type_handler *aggregate_for_result(const Type_handler *a,
const Type_handler *b) const Type_handler *b)
const override const override
@ -137,10 +133,6 @@ public:
{ {
return false; return false;
} }
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
return NULL;
}
const Type_handler *aggregate_for_result(const Type_handler *a, const Type_handler *aggregate_for_result(const Type_handler *a,
const Type_handler *b) const Type_handler *b)
const override const override
@ -212,7 +204,7 @@ Type_handler::handler_by_name(THD *thd, const LEX_CSTRING &name)
} }
#ifdef HAVE_SPATIAL #ifdef HAVE_SPATIAL
const Type_handler *ha= type_collection_geometry.handler_by_name(name); const Type_handler *ha= Type_collection_geometry_handler_by_name(name);
if (ha) if (ha)
return ha; return ha;
#endif #endif

View File

@ -7415,7 +7415,6 @@ class Type_collection
public: public:
virtual ~Type_collection() = default; virtual ~Type_collection() = default;
virtual bool init(Type_handler_data *) { return false; } virtual bool init(Type_handler_data *) { return false; }
virtual const Type_handler *handler_by_name(const LEX_CSTRING &name) const= 0;
virtual const Type_handler *aggregate_for_result(const Type_handler *h1, virtual const Type_handler *aggregate_for_result(const Type_handler *h1,
const Type_handler *h2) const Type_handler *h2)
const= 0; const= 0;

View File

@ -1892,13 +1892,6 @@ public:
{ {
return NULL; return NULL;
} }
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
if (type_handler_fbt()->name().eq(name))
return type_handler_fbt();
return NULL;
}
}; };
static Type_handler_fbt *type_handler_fbt() static Type_handler_fbt *type_handler_fbt()
{ {

View File

@ -67,7 +67,7 @@ Type_handler_geometry::type_handler_geom_by_type(uint type)
const Type_handler * const Type_handler *
Type_collection_geometry::handler_by_name(const LEX_CSTRING &name) const Type_collection_geometry_handler_by_name(const LEX_CSTRING &name)
{ {
if (type_handler_point.name().eq(name)) if (type_handler_point.name().eq(name))
return &type_handler_point; return &type_handler_point;

View File

@ -297,7 +297,6 @@ class Type_collection_geometry: public Type_collection
#endif #endif
public: public:
bool init(Type_handler_data *data) override; bool init(Type_handler_data *data) override;
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override;
const Type_handler *aggregate_for_result(const Type_handler *a, const Type_handler *aggregate_for_result(const Type_handler *a,
const Type_handler *b) const Type_handler *b)
const override; const override;
@ -316,6 +315,8 @@ public:
}; };
extern Type_collection_geometry type_collection_geometry; extern Type_collection_geometry type_collection_geometry;
const Type_handler *
Type_collection_geometry_handler_by_name(const LEX_CSTRING &name);
#include "field.h" #include "field.h"

View File

@ -233,20 +233,6 @@ public:
*/ */
return NULL; return NULL;
} }
const Type_handler *handler_by_name(const LEX_CSTRING &name) const override
{
/*
Name resolution is not needed yet.
JSON is not fully pluggable at the moment:
- It is parsed using a hard-coded rule in sql_yacc.yy
- It does not store extended data type information into
FRM file yet. JSON is detected by CHECK(JSON_VALID(col))
and this detection is also hard-coded.
This will change in the future.
*/
return NULL;
}
}; };