~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/compression/compress.cc

  • Committer: Mark Atwood
  • Date: 2011-08-21 06:56:57 UTC
  • mfrom: (2385.3.34 rf)
  • Revision ID: me@mark.atwood.name-20110821065657-vk2at03z9u17mf1d
mergeĀ lp:~olafvdspek/drizzle/refactor7

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
String *Item_func_compress::val_str(String *str)
32
32
{
33
 
  int err= Z_OK;
34
 
  drizzled::error_t code;
35
33
  ulong new_size;
36
34
  String *res;
37
35
  Byte *body;
68
66
  body= ((Byte*)buffer.ptr()) + 4;
69
67
 
70
68
  // As far as we have checked res->empty() we can use ptr()
71
 
  if ((err= compress(body, &new_size, (const Bytef*)res->ptr(), res->length())) != Z_OK)
 
69
  int err= compress(body, &new_size, (const Bytef*)res->ptr(), res->length());
 
70
  if (err != Z_OK)
72
71
  {
73
 
    code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
 
72
    drizzled::error_t code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
74
73
    push_warning(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, code, ER(code));
75
74
    null_value= 1;
76
75
    return 0;
90
89
  buffer.length((uint32_t)new_size + 4);
91
90
  return &buffer;
92
91
}
93
 
 
94