36 char *tmp, *last_char;
39 if (!(res= args[0]->
val_str(str)))
45 if (res->empty())
return res;
56 new_size= res->length() + res->length() / 5 + 12;
59 if ((uint32_t) (new_size+5) <= res->length())
64 buffer.realloc((uint32_t) new_size + 4 + 1);
66 body= ((Byte*)buffer.ptr()) + 4;
69 int err= compress(body, &new_size, (
const Bytef*)res->ptr(), res->length());
72 drizzled::error_t code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
73 push_warning(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, code, ER(code));
79 int4store(tmp, res->length() & 0x3FFFFFFF);
82 last_char= ((
char*)body)+new_size-1;
83 if (*last_char ==
' ')
89 buffer.length((uint32_t)new_size + 4);