diff options
author | Georgi Kodinov <joro@sun.com> | 2009-04-17 19:18:00 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-04-17 19:18:00 +0300 |
commit | ed2d0035de4f1854f5cf3a0764f42ef2a0b0c591 (patch) | |
tree | 693db566fa15581a6e69948b79e1fecc4730dd39 /sql/item_strfunc.h | |
parent | bf2e29d3744e572147adf3bae1f702eb14b42cf6 (diff) | |
parent | 08044795697dfd588841f9bacf589a4eeeff2431 (diff) | |
download | mariadb-git-ed2d0035de4f1854f5cf3a0764f42ef2a0b0c591.tar.gz |
merged bug 35087 to 5.1-bugteam
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 81baf9a4c5f..5265f608344 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -293,13 +293,17 @@ public: class Item_func_des_encrypt :public Item_str_func { - String tmp_value; + String tmp_value,tmp_arg; public: Item_func_des_encrypt(Item *a) :Item_str_func(a) {} Item_func_des_encrypt(Item *a, Item *b): Item_str_func(a,b) {} String *val_str(String *); void fix_length_and_dec() - { maybe_null=1; max_length = args[0]->max_length+8; } + { + maybe_null=1; + /* 9 = MAX ((8- (arg_len % 8)) + 1) */ + max_length = args[0]->max_length + 9; + } const char *func_name() const { return "des_encrypt"; } }; @@ -310,7 +314,12 @@ public: Item_func_des_decrypt(Item *a) :Item_str_func(a) {} Item_func_des_decrypt(Item *a, Item *b): Item_str_func(a,b) {} String *val_str(String *); - void fix_length_and_dec() { maybe_null=1; max_length = args[0]->max_length; } + void fix_length_and_dec() + { + maybe_null=1; + /* 9 = MAX ((8- (arg_len % 8)) + 1) */ + max_length = args[0]->max_length - 9; + } const char *func_name() const { return "des_decrypt"; } }; |