summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-03-15 12:51:23 +0100
committerSergei Golubchik <sergii@pisem.net>2010-03-15 12:51:23 +0100
commitf09ca00e088b316441bb76e97ba097bc9f3da7d3 (patch)
tree1a557d74018ed9cd073b5aa960bd62421962e73d /sql/item_strfunc.h
parent2ceaffc4672c62a772890da7761d11f13d3f5ee4 (diff)
parent71b3e46b0160936596195682a731703900fb4fff (diff)
downloadmariadb-git-f09ca00e088b316441bb76e97ba097bc9f3da7d3.tar.gz
merged
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 6b424989c58..85cc4b07231 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -355,12 +355,22 @@ public:
class Item_func_encode :public Item_str_func
{
+private:
+ /** Whether the PRNG has already been seeded. */
+ bool seeded;
+protected:
+ SQL_CRYPT sql_crypt;
public:
Item_func_encode(Item *a, Item *seed):
Item_str_func(a, seed) {}
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "encode"; }
+protected:
+ virtual void crypto_transform(String *);
+private:
+ /** Provide a seed for the PRNG sequence. */
+ bool seed();
};
@@ -368,8 +378,9 @@ class Item_func_decode :public Item_func_encode
{
public:
Item_func_decode(Item *a, Item *seed): Item_func_encode(a, seed) {}
- String *val_str(String *);
const char *func_name() const { return "decode"; }
+protected:
+ void crypto_transform(String *);
};