~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/uncompress/uncompressudf.cc

  • Committer: Monty Taylor
  • Date: 2008-11-18 22:12:56 UTC
  • mto: (589.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081118221256-ap2kmj073pdw7uap
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. 

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>
18
19
#include <drizzled/error.h>
19
20
#include <drizzled/item/strfunc.h>
20
21
 
48
49
  if (res->length() <= 4)
49
50
  {
50
51
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
51
 
                        ER_ZLIB_Z_DATA_ERROR,
52
 
                        ER(ER_ZLIB_Z_DATA_ERROR));
 
52
                        ER_ZLIB_Z_DATA_ERROR,
 
53
                        ER(ER_ZLIB_Z_DATA_ERROR));
53
54
    goto err;
54
55
  }
55
56
 
58
59
  if (new_size > current_session->variables.max_allowed_packet)
59
60
  {
60
61
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
61
 
                        ER_TOO_BIG_FOR_UNCOMPRESS,
62
 
                        ER(ER_TOO_BIG_FOR_UNCOMPRESS),
 
62
                        ER_TOO_BIG_FOR_UNCOMPRESS,
 
63
                        ER(ER_TOO_BIG_FOR_UNCOMPRESS),
63
64
                        current_session->variables.max_allowed_packet);
64
65
    goto err;
65
66
  }
67
68
    goto err;
68
69
 
69
70
  if ((err= uncompress((Byte*)buffer.ptr(), &new_size,
70
 
                       ((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
 
71
                       ((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
71
72
  {
72
73
    buffer.length((uint32_t) new_size);
73
74
    return &buffer;