Commit 5bf80af0 authored by Sergei Golubchik's avatar Sergei Golubchik

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.
parent a4817e15
......@@ -176,13 +176,6 @@ class Type_collection_mysql_json: public Type_collection
{
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
......
......@@ -31,11 +31,6 @@ class Type_collection_local: public Type_collection
return NULL;
}
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 *h2)
const override
......
......@@ -26,10 +26,6 @@ class Type_collection_test: public Type_collection
const Type_handler *aggregate_common(const Type_handler *h1,
const Type_handler *h2) const;
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 *h2)
const override;
......
......@@ -94,10 +94,6 @@ Vers_type_trx vers_type_trx;
class Type_collection_std: public Type_collection
{
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 *b)
const override
......@@ -137,10 +133,6 @@ class Type_collection_row: public Type_collection
{
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 *b)
const override
......@@ -212,7 +204,7 @@ Type_handler::handler_by_name(THD *thd, const LEX_CSTRING &name)
}
#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)
return ha;
#endif
......
......@@ -7415,7 +7415,6 @@ class Type_collection
public:
virtual ~Type_collection() = default;
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,
const Type_handler *h2)
const= 0;
......
......@@ -1892,13 +1892,6 @@ class FixedBinTypeBundle
{
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()
{
......
......@@ -67,7 +67,7 @@ Type_handler_geometry::type_handler_geom_by_type(uint type)
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))
return &type_handler_point;
......
......@@ -297,7 +297,6 @@ class Type_collection_geometry: public Type_collection
#endif
public:
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 *b)
const override;
......@@ -316,6 +315,8 @@ class Type_collection_geometry: public Type_collection
};
extern Type_collection_geometry type_collection_geometry;
const Type_handler *
Type_collection_geometry_handler_by_name(const LEX_CSTRING &name);
#include "field.h"
......
......@@ -233,20 +233,6 @@ class Type_collection_json: public Type_collection
*/
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;
}
};
......
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