diff options
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 193c7deb207..fa8249c3321 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; @@ -5209,26 +5235,7 @@ Create_func_space Create_func_space::s_singleton; Item* Create_func_space::create_1_arg(THD *thd, Item *arg1) { - /** - TODO: Fix Bug#23637 - The parsed item tree should not depend on - <code>thd->variables.collation_connection</code>. - */ - CHARSET_INFO *cs= thd->variables.collation_connection; - Item *sp; - - if (cs->mbminlen > 1) - { - uint dummy_errors; - sp= new (thd->mem_root) Item_string("", 0, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); - sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); - } - else - { - sp= new (thd->mem_root) Item_string(" ", 1, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); - } - - return new (thd->mem_root) Item_func_repeat(sp, arg1); + return new (thd->mem_root) Item_func_space(arg1); } @@ -5854,6 +5861,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)}, |