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 ...@@ -176,13 +176,6 @@ class Type_collection_mysql_json: public Type_collection
{ {
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
......
...@@ -31,11 +31,6 @@ class Type_collection_local: public Type_collection ...@@ -31,11 +31,6 @@ class Type_collection_local: public Type_collection
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
......
...@@ -26,10 +26,6 @@ class Type_collection_test: public Type_collection ...@@ -26,10 +26,6 @@ class Type_collection_test: public Type_collection
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;
......
...@@ -94,10 +94,6 @@ Vers_type_trx vers_type_trx; ...@@ -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 @@ class Type_collection_row: public Type_collection ...@@ -137,10 +133,6 @@ class Type_collection_row: public Type_collection
{ {
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) ...@@ -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
......
...@@ -7415,7 +7415,6 @@ class Type_collection ...@@ -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;
......
...@@ -1892,13 +1892,6 @@ class FixedBinTypeBundle ...@@ -1892,13 +1892,6 @@ class FixedBinTypeBundle
{ {
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()
{ {
......
...@@ -67,7 +67,7 @@ Type_handler_geometry::type_handler_geom_by_type(uint type) ...@@ -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;
......
...@@ -297,7 +297,6 @@ class Type_collection_geometry: public Type_collection ...@@ -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 @@ class Type_collection_geometry: public Type_collection ...@@ -316,6 +315,8 @@ class Type_collection_geometry: public Type_collection
}; };
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"
......
...@@ -233,20 +233,6 @@ class Type_collection_json: public Type_collection ...@@ -233,20 +233,6 @@ class Type_collection_json: public Type_collection
*/ */
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;
}
}; };
......
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