~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.cc

  • Committer: Jay Pipes
  • Date: 2009-04-10 18:16:15 UTC
  • mto: (971.1.47 mordred)
  • mto: This revision was merged to the branch mainline in revision 990.
  • Revision ID: jpipes@serialcoder-20090410181615-k04cbtva3nwfpjz9
Removed old protobuf_replicator plugin, fixed up db.cc and other files to use new
TransactionServices interface, and put in a guard in the TransactionServices call
interfaces to do a no-op when either no replicators or appliers.

Next step: merge in the new filtered_replicator and transaction_log_writer plugins
from the other trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
{
142
142
  using namespace drizzled::message;
143
143
  
 
144
  if (replicators.size() == 0 || appliers.size() == 0)
 
145
    return;
 
146
  
144
147
  Command command;
145
148
  command.set_type(Command::START_TRANSACTION);
146
149
  command.set_timestamp(in_session->getCurrentTimestamp());
154
157
{
155
158
  using namespace drizzled::message;
156
159
  
 
160
  if (replicators.size() == 0 || appliers.size() == 0)
 
161
    return;
 
162
  
157
163
  Command command;
158
164
  command.set_type(Command::COMMIT);
159
165
  command.set_timestamp(in_session->getCurrentTimestamp());
167
173
{
168
174
  using namespace drizzled::message;
169
175
  
 
176
  if (replicators.size() == 0 || appliers.size() == 0)
 
177
    return;
 
178
  
170
179
  Command command;
171
180
  command.set_type(Command::ROLLBACK);
172
181
  command.set_timestamp(in_session->getCurrentTimestamp());
180
189
{
181
190
  using namespace drizzled::message;
182
191
  
 
192
  if (replicators.size() == 0 || appliers.size() == 0)
 
193
    return;
 
194
 
183
195
  Command command;
184
196
  command.set_type(Command::INSERT);
185
197
  command.set_timestamp(in_session->getCurrentTimestamp());
214
226
    change_record->add_insert_value(std::string(string_value->c_ptr()));
215
227
    string_value->free(); /* I wish there was a clear() method... */
216
228
  }
 
229
 
 
230
  if (string_value)
 
231
    delete string_value; /* Is this needed with memroot allocation? */
217
232
  
218
233
  push(&command);
219
234
}
222
237
{
223
238
  using namespace drizzled::message;
224
239
  
 
240
  if (replicators.size() == 0 || appliers.size() == 0)
 
241
    return;
 
242
  
225
243
  Command command;
226
244
  command.set_type(Command::UPDATE);
227
245
  command.set_timestamp(in_session->getCurrentTimestamp());
247
265
{
248
266
  using namespace drizzled::message;
249
267
  
 
268
  if (replicators.size() == 0 || appliers.size() == 0)
 
269
    return;
 
270
  
250
271
  Command command;
251
272
  command.set_type(Command::DELETE);
252
273
  command.set_timestamp(in_session->getCurrentTimestamp());
272
293
{
273
294
  using namespace drizzled::message;
274
295
  
 
296
  if (replicators.size() == 0 || appliers.size() == 0)
 
297
    return;
 
298
  
275
299
  Command command;
276
300
  command.set_type(Command::RAW_SQL);
277
301
  command.set_timestamp(in_session->getCurrentTimestamp());