summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-03-26 10:33:58 +0400
committerAlexander Barkov <bar@mariadb.com>2018-03-26 10:33:58 +0400
commit6aff5fa27ae863670608ae88b134453fe53c3e17 (patch)
tree8ecb57395fb375d71b1f8ec3df44ad3de5c27d28 /sql/item_strfunc.h
parenta2e47f8c41e60fb0eeaa01cdd41fc07b9c963768 (diff)
downloadmariadb-git-6aff5fa27ae863670608ae88b134453fe53c3e17.tar.gz
MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 12c348aa9fa..1213faeec5c 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -134,19 +134,30 @@ public:
};
-class Item_func_aes_encrypt :public Item_str_func
+class Item_aes_crypt :public Item_str_func
+{
+protected:
+ String tmp_value;
+public:
+ Item_aes_crypt(Item *a, Item *b)
+ :Item_str_func(a, b) {}
+};
+
+class Item_func_aes_encrypt :public Item_aes_crypt
{
public:
- Item_func_aes_encrypt(Item *a, Item *b) :Item_str_func(a,b) {}
+ Item_func_aes_encrypt(Item *a, Item *b):
+ Item_aes_crypt(a, b) {}
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "aes_encrypt"; }
};
-class Item_func_aes_decrypt :public Item_str_func
+class Item_func_aes_decrypt :public Item_aes_crypt
{
public:
- Item_func_aes_decrypt(Item *a, Item *b) :Item_str_func(a,b) {}
+ Item_func_aes_decrypt(Item *a, Item *b):
+ Item_aes_crypt(a,b) {}
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "aes_decrypt"; }