diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-09-23 00:55:28 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-09-23 00:55:28 +0400 |
commit | 884bd1d61b333f3f016269e8710c3fc4ce0469b4 (patch) | |
tree | 8d0322d3bfae9fed99e49f649ffc91302c3581a3 /sql/item_create.cc | |
parent | c39a744616d0d36d061b9895809a7c016dc43b5f (diff) | |
download | mariadb-git-884bd1d61b333f3f016269e8710c3fc4ce0469b4.tar.gz |
MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index e0bfe7a4402..b0b33041383 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -623,6 +623,19 @@ protected: }; +class Create_func_decode_oracle : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list); + + static Create_func_decode_oracle s_singleton; + +protected: + Create_func_decode_oracle() {} + virtual ~Create_func_decode_oracle() {} +}; + + class Create_func_concat_ws : public Create_native_func { public: @@ -3894,6 +3907,21 @@ Create_func_decode_histogram::create_2_arg(THD *thd, Item *arg1, Item *arg2) return new (thd->mem_root) Item_func_decode_histogram(thd, arg1, arg2); } +Create_func_decode_oracle Create_func_decode_oracle::s_singleton; + +Item* +Create_func_decode_oracle::create_native(THD *thd, LEX_CSTRING *name, + List<Item> *item_list) +{ + uint arg_count= item_list ? item_list->elements : 0; + if (arg_count < 3) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str); + return NULL; + } + return new (thd->mem_root) Item_func_decode_oracle(thd, *item_list); +} + Create_func_concat_ws Create_func_concat_ws::s_singleton; Item* @@ -6851,6 +6879,7 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("DAYOFYEAR") }, BUILDER(Create_func_dayofyear)}, { { C_STRING_WITH_LEN("DEGREES") }, BUILDER(Create_func_degrees)}, { { C_STRING_WITH_LEN("DECODE_HISTOGRAM") }, BUILDER(Create_func_decode_histogram)}, + { { C_STRING_WITH_LEN("DECODE_ORACLE") }, BUILDER(Create_func_decode_oracle)}, { { C_STRING_WITH_LEN("DES_DECRYPT") }, BUILDER(Create_func_des_decrypt)}, { { C_STRING_WITH_LEN("DES_ENCRYPT") }, BUILDER(Create_func_des_encrypt)}, { { C_STRING_WITH_LEN("DIMENSION") }, GEOM_BUILDER(Create_func_dimension)}, |