~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/uncompress/uncompressudf.cc

  • Committer: Brian Aker
  • Date: 2008-10-29 13:46:43 UTC
  • Revision ID: brian@tangent.org-20081029134643-z6jcwjvyruhk2vlu
Updates for ignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#define DRIZZLE_SERVER 1 /* for session variable max_allowed_packet */
17
17
#include <drizzled/server_includes.h>
18
 
#include <drizzled/session.h>
19
18
#include <drizzled/error.h>
20
 
#include <drizzled/item/strfunc.h>
21
19
 
22
20
#include <zlib.h>
23
21
 
49
47
  if (res->length() <= 4)
50
48
  {
51
49
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
52
 
                        ER_ZLIB_Z_DATA_ERROR,
53
 
                        ER(ER_ZLIB_Z_DATA_ERROR));
 
50
                        ER_ZLIB_Z_DATA_ERROR,
 
51
                        ER(ER_ZLIB_Z_DATA_ERROR));
54
52
    goto err;
55
53
  }
56
54
 
59
57
  if (new_size > current_session->variables.max_allowed_packet)
60
58
  {
61
59
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
62
 
                        ER_TOO_BIG_FOR_UNCOMPRESS,
63
 
                        ER(ER_TOO_BIG_FOR_UNCOMPRESS),
 
60
                        ER_TOO_BIG_FOR_UNCOMPRESS,
 
61
                        ER(ER_TOO_BIG_FOR_UNCOMPRESS),
64
62
                        current_session->variables.max_allowed_packet);
65
63
    goto err;
66
64
  }
68
66
    goto err;
69
67
 
70
68
  if ((err= uncompress((Byte*)buffer.ptr(), &new_size,
71
 
                       ((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
 
69
                       ((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
72
70
  {
73
71
    buffer.length((uint32_t) new_size);
74
72
    return &buffer;