summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorserg@serg.mylan <>2003-08-21 18:30:43 +0200
committerserg@serg.mylan <>2003-08-21 18:30:43 +0200
commit58bdc6f5e18671812942f4599d8bd99f4991f668 (patch)
tree73d6e3458f0aef120d5c361fde234488c2b99242 /sql/item_strfunc.cc
parent08d7f298eee94368ea2f704a3897a0cc9054fd6a (diff)
downloadmariadb-git-58bdc6f5e18671812942f4599d8bd99f4991f668.tar.gz
use crc32() from bundled zlib if system zlib is unavailable
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 7c6e6e0686c..cb24fb0f027 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2561,9 +2561,6 @@ longlong Item_func_uncompressed_length::val_int()
return uint4korr(res->c_ptr()) & 0x3FFFFFFF;
}
-#ifdef HAVE_COMPRESS
-#include "zlib.h"
-
longlong Item_func_crc32::val_int()
{
String *res=args[0]->val_str(&value);
@@ -2573,21 +2570,11 @@ longlong Item_func_crc32::val_int()
return 0; /* purecov: inspected */
}
null_value=0;
- return (longlong) crc32(0L, (Bytef*)res->ptr(), res->length());
+ return (longlong) crc32(0L, (uchar*)res->ptr(), res->length());
}
-longlong Item_func_uncompressed_length::val_int()
-{
- String *res= args[0]->val_str(&value);
- if (!res)
- {
- null_value=1;
- return 0; /* purecov: inspected */
- }
- null_value=0;
- if (res->is_empty()) return 0;
- return uint4korr(res->c_ptr()) & 0x3FFFFFFF;
-}
+#ifdef HAVE_COMPRESS
+#include "zlib.h"
String *Item_func_compress::val_str(String *str)
{