~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/module.cc

  • Committer: Jay Pipes
  • Date: 2010-04-12 19:15:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1464.
  • Revision ID: jpipes@serialcoder-20100412191500-7cauknc203ttkqsq
TransactionLogApplier now manages (frees) memory for TransactionLog and TransactionLogIndex

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
        return 1;
134
134
      }
135
135
    }
 
136
 
 
137
    /* Create and initialize the transaction log index */
 
138
    transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
 
139
    if (transaction_log_index == NULL)
 
140
    {
 
141
      errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the TransactionLogIndex instance.  Got error: %s\n"), 
 
142
                    strerror(errno));
 
143
      return 1;
 
144
    }
 
145
    else
 
146
    {
 
147
      /* Check to see if the index was not created properly */
 
148
      if (transaction_log_index->hasError())
 
149
      {
 
150
        errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize the Transaction Log Index.  Got error: %s\n"), 
 
151
                      transaction_log_index->getErrorMessage().c_str());
 
152
        return 1;
 
153
      }
 
154
    }
 
155
 
136
156
    /* Create the applier plugin and register it */
137
157
    transaction_log_applier= new (nothrow) TransactionLogApplier("transaction_log_applier",
138
158
                                                                 transaction_log, 
 
159
                                                                 transaction_log_index, 
139
160
                                                                 sysvar_transaction_log_num_write_buffers);
140
161
    if (transaction_log_applier == NULL)
141
162
    {
166
187
      new plugin::Create_function<HexdumpTransactionMessageFunction>("hexdump_transaction_message");
167
188
    context.add(hexdump_transaction_message_func_factory);
168
189
 
169
 
    /* Create and initialize the transaction log index */
170
 
    transaction_log_index= new (nothrow) TransactionLogIndex(*transaction_log);
171
 
    if (transaction_log_index == NULL)
172
 
    {
173
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to allocate the TransactionLogIndex instance.  Got error: %s\n"), 
174
 
                    strerror(errno));
175
 
      return 1;
176
 
    }
177
 
    else
178
 
    {
179
 
      /* Check to see if the index was not created properly */
180
 
      if (transaction_log_index->hasError())
181
 
      {
182
 
        errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize the Transaction Log Index.  Got error: %s\n"), 
183
 
                      transaction_log_index->getErrorMessage().c_str());
184
 
        return 1;
185
 
      }
186
 
    }
187
 
 
188
190
    /* 
189
191
     * Setup the background worker thread which maintains
190
192
     * summary information about the transaction log.