~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/transaction_reader.cc

MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <unistd.h>
36
36
#include <drizzled/message/transaction.pb.h>
37
37
#include <drizzled/message/statement_transform.h>
 
38
#include <drizzled/util/convert.h>
38
39
 
39
40
#include <google/protobuf/io/coded_stream.h>
40
41
#include <google/protobuf/io/zero_copy_stream_impl.h>
189
190
    {
190
191
      fprintf(stderr, _("Could not read transaction message.\n"));
191
192
      fprintf(stderr, _("GPB ERROR: %s.\n"), strerror(errno));
192
 
      fprintf(stderr, _("Raw buffer read: %s.\n"), buffer);
 
193
      string hexdump;
 
194
      hexdump.reserve(length * 4);
 
195
      bytesToHexdumpFormat(hexdump, reinterpret_cast<const unsigned char *>(buffer), length);
 
196
      fprintf(stderr, _("HEXDUMP:\n\n%s\n"), hexdump.c_str());
193
197
      break;
194
198
    }
195
199
 
198
202
    {
199
203
      fprintf(stderr, _("Unable to parse command. Got error: %s.\n"), transaction.InitializationErrorString().c_str());
200
204
      if (buffer != NULL)
201
 
        fprintf(stderr, _("BUFFER: %s\n"), buffer);
 
205
      {
 
206
        string hexdump;
 
207
        hexdump.reserve(length * 4);
 
208
        bytesToHexdumpFormat(hexdump, reinterpret_cast<const unsigned char *>(buffer), length);
 
209
        fprintf(stderr, _("HEXDUMP:\n\n%s\n"), hexdump.c_str());
 
210
      }
202
211
      break;
203
212
    }
204
213