summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-03-09 20:57:03 +0200
committerGeorgi Kodinov <joro@sun.com>2009-03-09 20:57:03 +0200
commit5b9a33aafec1d193f494a0168518c5556184299a (patch)
tree00e35a3675d99f6ecdede0e62ce24e379186aed2 /sql
parentf01890898b55ba309c1de8eb3bde70b353651e03 (diff)
downloadmariadb-git-5b9a33aafec1d193f494a0168518c5556184299a.tar.gz
Bug #42434: license of mysys MD5 implementation is not GPL-compatible
Took the Xfree implementation (based on the same rewrite as the NDB one) and added it instead of the current implementation. Added a macro to make the calls to MD5 more streamlined.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_strfunc.cc5
-rw-r--r--sql/table.cc5
2 files changed, 2 insertions, 8 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 34f974042a5..158eb8e3bb0 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -101,13 +101,10 @@ String *Item_func_md5::val_str(String *str)
str->set_charset(&my_charset_bin);
if (sptr)
{
- my_MD5_CTX context;
unsigned char digest[16];
null_value=0;
- my_MD5Init (&context);
- my_MD5Update (&context,(unsigned char *) sptr->ptr(), sptr->length());
- my_MD5Final (digest, &context);
+ MY_MD5_HASH(digest,(unsigned char *) sptr->ptr(), sptr->length());
if (str->alloc(32)) // Ensure that memory is free
{
null_value=1;
diff --git a/sql/table.cc b/sql/table.cc
index 3abd2c24c94..6dc1f3ab99e 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1792,11 +1792,8 @@ void st_table::reset_item_list(List<Item> *item_list) const
void TABLE_LIST::calc_md5(char *buffer)
{
- my_MD5_CTX context;
uchar digest[16];
- my_MD5Init(&context);
- my_MD5Update(&context,(uchar *) query.str, query.length);
- my_MD5Final(digest, &context);
+ MY_MD5_HASH(digest, (uchar *) query.str, query.length);
sprintf((char *) buffer,
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
digest[0], digest[1], digest[2], digest[3],