~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/slave/queue_producer.cc

  • Committer: Mark Atwood
  • Date: 2011-05-02 23:26:54 UTC
  • mfrom: (2290.1.9 server_uuid_repl)
  • Revision ID: me@mark.atwood.name-20110502232654-hd1ufzm7o4mtrutf
mergeĀ lp:~skinny.moey/drizzle/server_uuid_repl

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
bool QueueProducer::queueInsert(const char *trx_id,
292
292
                                const char *seg_id,
293
293
                                const char *commit_id,
 
294
                                const char *originating_server_uuid,
 
295
                                const char *originating_commit_id,
294
296
                                const char *msg,
295
297
                                const char *msg_length)
296
298
{
302
304
   * The SQL to insert our results into the local queue.
303
305
   */
304
306
  string sql= "INSERT INTO `sys_replication`.`queue`"
305
 
              " (`trx_id`, `seg_id`, `commit_order`, `msg`) VALUES (";
 
307
              " (`trx_id`, `seg_id`, `commit_order`,"
 
308
              "  `originating_server_uuid`, `originating_commit_id`, `msg`) VALUES (";
306
309
  sql.append(trx_id);
307
310
  sql.append(", ", 2);
308
311
  sql.append(seg_id);
309
312
  sql.append(", ", 2);
310
313
  sql.append(commit_id);
311
314
  sql.append(", '", 3);
 
315
  sql.append(originating_server_uuid);
 
316
  sql.append("' , ", 4);
 
317
  sql.append(originating_commit_id);
 
318
  sql.append(", '", 3);
312
319
 
313
320
  /*
314
321
   * Ideally we would store the Transaction message in binary form, as it
388
395
  /*
389
396
   * The SQL to pull everything we need from the master.
390
397
   */
391
 
  string sql= "SELECT `id`, `segid`, `commit_id`, `message`, `message_len` "
 
398
  string sql= "SELECT `id`, `segid`, `commit_id`, `originating_server_uuid`,"
 
399
              " `originating_commit_id`, `message`, `message_len` "
392
400
              " FROM `data_dictionary`.`sys_replication_log` WHERE `id` IN (";
393
401
 
394
402
  for (size_t x= 0; x < trx_id_list.size(); x++)
433
441
 
434
442
  while ((row= drizzle_row_next(&result)) != NULL)
435
443
  {
436
 
    if (not queueInsert(row[0], row[1], row[2], row[3], row[4]))
 
444
    if (not queueInsert(row[0], row[1], row[2], row[3], row[4], row[5], row[6]))
437
445
    {
438
446
      errmsg_printf(error::ERROR,
439
447
                    _("Replication slave: Unable to insert into queue."));