~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/module.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:
166
166
 
167
167
    if (transaction_log == NULL)
168
168
    {
169
 
      char errmsg[STRERROR_MAX];
170
 
      strerror_r(errno, errmsg, sizeof(errmsg));
171
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the TransactionLog instance.  Got error: %s\n"), 
172
 
                    errmsg);
 
169
      sql_perror(_("Failed to allocate the TransactionLog instance"), sysvar_transaction_log_file);
173
170
      return 1;
174
171
    }
175
172
    else
177
174
      /* Check to see if the log was not created properly */
178
175
      if (transaction_log->hasError())
179
176
      {
180
 
        errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize the Transaction Log.  Got error: %s\n"), 
 
177
        errmsg_printf(error::ERROR, _("Failed to initialize the Transaction Log.  Got error: %s\n"), 
181
178
                      transaction_log->getErrorMessage().c_str());
182
179
        return 1;
183
180
      }
187
184
    transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
188
185
    if (transaction_log_index == NULL)
189
186
    {
190
 
      char errmsg[STRERROR_MAX];
191
 
      strerror_r(errno, errmsg, sizeof(errmsg));
192
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the TransactionLogIndex instance.  Got error: %s\n"), 
193
 
                    errmsg);
 
187
      sql_perror(_("Failed to allocate the TransactionLogIndex instance"), sysvar_transaction_log_file);
194
188
      return 1;
195
189
    }
196
190
    else
198
192
      /* Check to see if the index was not created properly */
199
193
      if (transaction_log_index->hasError())
200
194
      {
201
 
        errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize the Transaction Log Index.  Got error: %s\n"), 
 
195
        errmsg_printf(error::ERROR, _("Failed to initialize the Transaction Log Index.  Got error: %s\n"), 
202
196
                      transaction_log_index->getErrorMessage().c_str());
203
197
        return 1;
204
198
      }
211
205
                                                                 static_cast<uint32_t>(sysvar_transaction_log_num_write_buffers));
212
206
    if (transaction_log_applier == NULL)
213
207
    {
214
 
      char errmsg[STRERROR_MAX];
215
 
      strerror_r(errno, errmsg, sizeof(errmsg));
216
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the TransactionLogApplier instance.  Got error: %s\n"), 
217
 
                    errmsg);
 
208
      sql_perror(_("Failed to allocate the TransactionLogApplier instance"), sysvar_transaction_log_file);
218
209
      return 1;
219
210
    }
220
211
    context.add(transaction_log_applier);