~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/print_transaction_message.cc

  • Committer: Brian Aker
  • Date: 2011-02-01 02:51:01 UTC
  • mto: (2132.1.1 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2134.
  • Revision ID: brian@tangent.org-20110201025101-yaj5kkdk2towo6ou
Merge in error message rework. Many error messages are fixed in this patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
  int log_file= open(filename.c_str(), O_RDONLY);
102
102
  if (log_file == -1)
103
103
  {
104
 
    char errmsg[STRERROR_MAX];
105
 
    strerror_r(errno, errmsg, sizeof(errmsg));
106
 
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to open transaction log file %s.  Got error: %s\n"), 
107
 
                  filename.c_str(), 
108
 
                  errmsg);
 
104
    sql_perror(_("Failed to open transaction log file"), filename);
109
105
    null_value= true;
 
106
 
110
107
    return NULL;
111
108
  }
112
109
 
164
161
  bool result= coded_input->ReadRaw(buffer, message_size);
165
162
  if (result == false)
166
163
  {
167
 
    char errmsg[STRERROR_MAX];
168
 
    strerror_r(errno, errmsg, sizeof(errmsg));
169
 
    fprintf(stderr, _("Could not read transaction message.\n"));
170
 
    fprintf(stderr, _("GPB ERROR: %s.\n"), errmsg);
171
 
    fprintf(stderr, _("Raw buffer read: %s.\n"), buffer);
 
164
    // 120 was arbitrary
 
165
    sql_perror(_("Could not read transaction message. Raw buffer read "), std::string((const char *)buffer, std::min(message_size, 120U)));
172
166
  }
173
167
 
174
168
  result= transaction_message.ParseFromArray(buffer, static_cast<int32_t>(message_size));