diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-09-23 18:58:33 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-09-23 18:58:33 +0400 |
commit | e33582d20d2a9f215dc4d0effa55886bbabdce3d (patch) | |
tree | eebea43211dfaefb954c40af5b72afe97019b572 /sql/item_create.cc | |
parent | 9cbd53bfb2e72376080a3951185e4780b0519718 (diff) | |
download | mariadb-git-e33582d20d2a9f215dc4d0effa55886bbabdce3d.tar.gz |
Merging TO_BASE64() and FROM_BASE64() from MySQL-5.6
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 3d0a2f58eb7..9842f88e904 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -1151,6 +1151,19 @@ protected: }; +class Create_func_from_base64 : public Create_func_arg1 +{ +public: + virtual Item *create_1_arg(THD *thd, Item *arg1); + + static Create_func_from_base64 s_singleton; + +protected: + Create_func_from_base64() {} + virtual ~Create_func_from_base64() {} +}; + + class Create_func_from_days : public Create_func_arg1 { public: @@ -2357,6 +2370,19 @@ protected: }; +class Create_func_to_base64 : public Create_func_arg1 +{ +public: + virtual Item *create_1_arg(THD *thd, Item *arg1); + + static Create_func_to_base64 s_singleton; + +protected: + Create_func_to_base64() {} + virtual ~Create_func_to_base64() {} +}; + + class Create_func_to_days : public Create_func_arg1 { public: @@ -3812,6 +3838,16 @@ Create_func_format::create_native(THD *thd, LEX_STRING name, } +Create_func_from_base64 Create_func_from_base64::s_singleton; + + +Item * +Create_func_from_base64::create_1_arg(THD *thd, Item *arg1) +{ + return new (thd->mem_root) Item_func_from_base64(arg1); +} + + Create_func_found_rows Create_func_found_rows::s_singleton; Item* @@ -5040,6 +5076,15 @@ Create_func_timediff::create_2_arg(THD *thd, Item *arg1, Item *arg2) } +Create_func_to_base64 Create_func_to_base64::s_singleton; + +Item* +Create_func_to_base64::create_1_arg(THD *thd, Item *arg1) +{ + return new (thd->mem_root) Item_func_to_base64(arg1); +} + + Create_func_to_days Create_func_to_days::s_singleton; Item* @@ -5393,6 +5438,7 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("FLOOR") }, BUILDER(Create_func_floor)}, { { C_STRING_WITH_LEN("FORMAT") }, BUILDER(Create_func_format)}, { { C_STRING_WITH_LEN("FOUND_ROWS") }, BUILDER(Create_func_found_rows)}, + { { C_STRING_WITH_LEN("FROM_BASE64") }, BUILDER(Create_func_from_base64)}, { { C_STRING_WITH_LEN("FROM_DAYS") }, BUILDER(Create_func_from_days)}, { { C_STRING_WITH_LEN("FROM_UNIXTIME") }, BUILDER(Create_func_from_unixtime)}, { { C_STRING_WITH_LEN("GEOMCOLLFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)}, @@ -5576,6 +5622,7 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("TIME_FORMAT") }, BUILDER(Create_func_time_format)}, { { C_STRING_WITH_LEN("TIME_TO_SEC") }, BUILDER(Create_func_time_to_sec)}, { { C_STRING_WITH_LEN("TOUCHES") }, GEOM_BUILDER(Create_func_touches)}, + { { C_STRING_WITH_LEN("TO_BASE64") }, BUILDER(Create_func_to_base64)}, { { C_STRING_WITH_LEN("TO_DAYS") }, BUILDER(Create_func_to_days)}, { { C_STRING_WITH_LEN("TO_SECONDS") }, BUILDER(Create_func_to_seconds)}, { { C_STRING_WITH_LEN("UCASE") }, BUILDER(Create_func_ucase)}, |