summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2003-04-30 13:10:53 +0200
committerunknown <pem@mysql.com>2003-04-30 13:10:53 +0200
commit4a506d6e23845bf5d8208da741bd85cdcb0d4270 (patch)
tree2fb8d0e37f1fe7be48b8f7dbc1cea4c1f3019f48 /sql
parent4ceb257849cca35b781cf4a3e8a65811efa878d7 (diff)
downloadmariadb-git-4a506d6e23845bf5d8208da741bd85cdcb0d4270.tar.gz
Fixed bug in Item_func_compress::val_str() on MacOS X (bigendian); the length
was not properly stored in the buffer. sql/item_strfunc.cc: Made it work on MacOS X (bigendian) where int4store is a macro that expands the arguments several times. It's possible this should be done differently, like not side-stepping the String methods the way it's done here, or fixing String::c_ptr(), but this simple fix was the quickest way.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_strfunc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index bba3799d398..e6bd969ad2f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2955,8 +2955,9 @@ String *Item_func_compress::val_str(String *str)
null_value= 1;
return 0;
}
-
- int4store(buffer.c_ptr(),res->length() & 0x3FFFFFFF);
+
+ char *tmp= buffer.c_ptr(); // int4store is a macro; avoid side effects
+ int4store(tmp, res->length() & 0x3FFFFFFF);
/* This is for the stupid char fields which trim ' ': */
char *last_char= ((char*)body)+new_size-1;