~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/module.cc

  • Committer: Monty Taylor
  • Date: 2010-12-26 03:15:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101226031544-1cf3raipu53fnmyj
Through page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
 
167
167
    if (transaction_log == NULL)
168
168
    {
169
 
      sql_perror(_("Failed to allocate the TransactionLog instance"), sysvar_transaction_log_file);
 
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);
170
173
      return 1;
171
174
    }
172
175
    else
174
177
      /* Check to see if the log was not created properly */
175
178
      if (transaction_log->hasError())
176
179
      {
177
 
        errmsg_printf(error::ERROR, _("Failed to initialize the Transaction Log.  Got error: %s\n"), 
 
180
        errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize the Transaction Log.  Got error: %s\n"), 
178
181
                      transaction_log->getErrorMessage().c_str());
179
182
        return 1;
180
183
      }
184
187
    transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
185
188
    if (transaction_log_index == NULL)
186
189
    {
187
 
      sql_perror(_("Failed to allocate the TransactionLogIndex instance"), sysvar_transaction_log_file);
 
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);
188
194
      return 1;
189
195
    }
190
196
    else
192
198
      /* Check to see if the index was not created properly */
193
199
      if (transaction_log_index->hasError())
194
200
      {
195
 
        errmsg_printf(error::ERROR, _("Failed to initialize the Transaction Log Index.  Got error: %s\n"), 
 
201
        errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize the Transaction Log Index.  Got error: %s\n"), 
196
202
                      transaction_log_index->getErrorMessage().c_str());
197
203
        return 1;
198
204
      }
205
211
                                                                 static_cast<uint32_t>(sysvar_transaction_log_num_write_buffers));
206
212
    if (transaction_log_applier == NULL)
207
213
    {
208
 
      sql_perror(_("Failed to allocate the TransactionLogApplier instance"), sysvar_transaction_log_file);
 
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);
209
218
      return 1;
210
219
    }
211
220
    context.add(transaction_log_applier);
246
255
{
247
256
  context("truncate-debug",
248
257
          po::value<bool>(&sysvar_transaction_log_truncate_debug)->default_value(false)->zero_tokens(),
249
 
          _("DEBUGGING - Truncate transaction log"));
 
258
          N_("DEBUGGING - Truncate transaction log"));
250
259
  context("enable-checksum",
251
260
          po::value<bool>(&sysvar_transaction_log_checksum_enabled)->default_value(false)->zero_tokens(),
252
 
          _("Enable CRC32 Checksumming of each written transaction log entry"));  
 
261
          N_("Enable CRC32 Checksumming of each written transaction log entry"));  
253
262
  context("enable",
254
263
          po::value<bool>(&sysvar_transaction_log_enabled)->default_value(false)->zero_tokens(),
255
 
          _("Enable transaction log"));
 
264
          N_("Enable transaction log"));
256
265
  context("file",
257
266
          po::value<string>(&sysvar_transaction_log_file)->default_value(DEFAULT_LOG_FILE_PATH),
258
 
          _("Path to the file to use for transaction log"));
 
267
          N_("Path to the file to use for transaction log"));
259
268
  context("use-replicator",
260
269
          po::value<string>(&sysvar_transaction_log_use_replicator)->default_value(DEFAULT_USE_REPLICATOR),
261
 
          _("Name of the replicator plugin to use (default='default_replicator')")); 
 
270
          N_("Name of the replicator plugin to use (default='default_replicator')")); 
262
271
  context("flush-frequency",
263
272
          po::value<flush_constraint>(&sysvar_transaction_log_flush_frequency)->default_value(0),
264
 
          _("0 == rely on operating system to sync log file (default), 1 == sync file at each transaction write, 2 == sync log file once per second"));
 
273
          N_("0 == rely on operating system to sync log file (default), 1 == sync file at each transaction write, 2 == sync log file once per second"));
265
274
  context("num-write-buffers",
266
275
          po::value<write_buffers_constraint>(&sysvar_transaction_log_num_write_buffers)->default_value(8),
267
 
          _("Number of slots for in-memory write buffers (default=8)."));
 
276
          N_("Number of slots for in-memory write buffers (default=8)."));
268
277
}
269
278
 
270
279
DRIZZLE_PLUGIN(init, NULL, init_options);