167
167
if (transaction_log == NULL)
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"),
174
177
/* Check to see if the log was not created properly */
175
178
if (transaction_log->hasError())
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());
184
187
transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
185
188
if (transaction_log_index == NULL)
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"),
192
198
/* Check to see if the index was not created properly */
193
199
if (transaction_log_index->hasError())
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());
205
211
static_cast<uint32_t>(sysvar_transaction_log_num_write_buffers));
206
212
if (transaction_log_applier == NULL)
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"),
211
220
context.add(transaction_log_applier);
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"));
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)."));
270
279
DRIZZLE_PLUGIN(init, NULL, init_options);