~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/module.cc

Merge Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
extern plugin::Create_function<PrintTransactionMessageFunction> *print_transaction_message_func_factory;
94
94
extern plugin::Create_function<HexdumpTransactionMessageFunction> *hexdump_transaction_message_func_factory;
95
95
 
96
 
static int init(drizzled::plugin::Registry &registry)
 
96
static int init(drizzled::plugin::Context &context)
97
97
{
98
98
  /* Create and initialize the transaction log itself */
99
99
  if (sysvar_transaction_log_enabled)
127
127
                    strerror(errno));
128
128
      return 1;
129
129
    }
130
 
    registry.add(transaction_log_applier);
 
130
    context.add(transaction_log_applier);
131
131
 
132
132
    /* Setup DATA_DICTIONARY views */
133
133
 
134
134
    transaction_log_tool= new (nothrow) TransactionLogTool;
135
 
    registry.add(transaction_log_tool);
 
135
    context.add(transaction_log_tool);
136
136
    transaction_log_entries_tool= new (nothrow) TransactionLogEntriesTool;
137
 
    registry.add(transaction_log_entries_tool);
 
137
    context.add(transaction_log_entries_tool);
138
138
    transaction_log_transactions_tool= new (nothrow) TransactionLogTransactionsTool;
139
 
    registry.add(transaction_log_transactions_tool);
 
139
    context.add(transaction_log_transactions_tool);
140
140
 
141
141
    /* Setup the module's UDFs */
142
142
    print_transaction_message_func_factory=
143
143
      new plugin::Create_function<PrintTransactionMessageFunction>("print_transaction_message");
144
 
    registry.add(print_transaction_message_func_factory);
 
144
    context.add(print_transaction_message_func_factory);
145
145
 
146
146
    hexdump_transaction_message_func_factory=
147
147
      new plugin::Create_function<HexdumpTransactionMessageFunction>("hexdump_transaction_message");
148
 
    registry.add(hexdump_transaction_message_func_factory);
 
148
    context.add(hexdump_transaction_message_func_factory);
149
149
 
150
150
    /* Create and initialize the transaction log index */
151
151
    transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
176
176
  return 0;
177
177
}
178
178
 
179
 
static int deinit(drizzled::plugin::Registry &registry)
180
 
{
181
 
  /* Cleanup the transaction log itself */
182
 
  if (transaction_log)
183
 
  {
184
 
    registry.remove(transaction_log_applier);
185
 
    delete transaction_log_applier;
186
 
    delete transaction_log;
187
 
    delete transaction_log_index;
188
 
 
189
 
    /* Cleanup the DATA_DICTIONARY views */
190
 
    registry.remove(transaction_log_tool);
191
 
    delete transaction_log_tool;
192
 
    registry.remove(transaction_log_entries_tool);
193
 
    delete transaction_log_entries_tool;
194
 
    registry.remove(transaction_log_transactions_tool);
195
 
    delete transaction_log_transactions_tool;
196
 
 
197
 
    /* Cleanup module UDFs */
198
 
    registry.remove(print_transaction_message_func_factory);
199
 
    delete print_transaction_message_func_factory;
200
 
    registry.remove(hexdump_transaction_message_func_factory);
201
 
    delete hexdump_transaction_message_func_factory;
202
 
  }
203
 
 
204
 
  return 0;
205
 
}
206
179
 
207
180
static void set_truncate_debug(Session *,
208
181
                               drizzle_sys_var *, 
277
250
  NULL
278
251
};
279
252
 
280
 
DRIZZLE_PLUGIN(init, deinit, sys_variables);
 
253
DRIZZLE_PLUGIN(init, sys_variables);