diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2014-07-01 00:30:24 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2014-07-01 00:30:24 +0500 |
commit | 80a02037df1e65168a150b4dcd21822bfc14b71a (patch) | |
tree | 0b085ce90a49f95ffc83e9ba6d52b8423497164b /sql | |
parent | 439f75f849b9ab63fc65e2bd37af5c3429ffc1da (diff) | |
download | mariadb-git-80a02037df1e65168a150b4dcd21822bfc14b71a.tar.gz |
MDEV-6073 Merge gis test cases form 5.6.
Tests were merged.
As the implementation is different, the 'internal debugging' part
was not merged, only a stub for it created.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_create.cc | 29 | ||||
-rw-r--r-- | sql/item_geofunc.cc | 8 | ||||
-rw-r--r-- | sql/item_geofunc.h | 12 |
3 files changed, 49 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 193c7deb207..532654910e2 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -1264,6 +1264,21 @@ protected: }; +#if defined(HAVE_SPATIAL) && !defined(DBUG_OFF) +class Create_func_gis_debug : public Create_func_arg1 +{ + public: + virtual Item *create_1_arg(THD *thd, Item *arg1); + + static Create_func_gis_debug s_singleton; + + protected: + Create_func_gis_debug() {} + virtual ~Create_func_gis_debug() {} +}; +#endif + + #ifdef HAVE_SPATIAL class Create_func_glength : public Create_func_arg1 { @@ -4159,6 +4174,17 @@ Create_func_get_lock::create_2_arg(THD *thd, Item *arg1, Item *arg2) } +#if defined(HAVE_SPATIAL) && !defined(DBUG_OFF) +Create_func_gis_debug Create_func_gis_debug::s_singleton; + +Item* +Create_func_gis_debug::create_1_arg(THD *thd, Item *arg1) +{ + return new (thd->mem_root) Item_func_gis_debug(arg1); +} +#endif + + #ifdef HAVE_SPATIAL Create_func_glength Create_func_glength::s_singleton; @@ -5854,6 +5880,9 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("ST_GEOMETRYTYPE") }, GEOM_BUILDER(Create_func_geometry_type)}, { { C_STRING_WITH_LEN("ST_GEOMFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, { { C_STRING_WITH_LEN("ST_GEOMFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)}, +#ifndef DBUG_OFF + { { C_STRING_WITH_LEN("ST_GIS_DEBUG") }, GEOM_BUILDER(Create_func_gis_debug)}, +#endif { { C_STRING_WITH_LEN("ST_EQUALS") }, GEOM_BUILDER(Create_func_equals)}, { { C_STRING_WITH_LEN("ST_INTERIORRINGN") }, GEOM_BUILDER(Create_func_interiorringn)}, { { C_STRING_WITH_LEN("ST_INTERSECTS") }, GEOM_BUILDER(Create_func_intersects)}, diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 1deda83907c..d9200b3e8d3 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -1739,4 +1739,12 @@ mem_error: } +#ifndef DBUG_OFF +longlong Item_func_gis_debug::val_int() +{ + /* For now this is just a stub. TODO: implement the internal GIS debuggign */ + return 0; +} +#endif + #endif /*HAVE_SPATIAL*/ diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index 2d715dc8765..6d52661e5c9 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -496,6 +496,18 @@ public: const char *func_name() const { return "st_distance"; } }; + +#ifndef DBUG_OFF +class Item_func_gis_debug: public Item_int_func +{ + public: + Item_func_gis_debug(Item *a) :Item_int_func(a) { null_value= false; } + const char *func_name() const { return "st_gis_debug"; } + longlong val_int(); +}; +#endif + + #define GEOM_NEW(thd, obj_constructor) new (thd->mem_root) obj_constructor #else /*HAVE_SPATIAL*/ |