~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log.cc

  • Committer: Brian Aker
  • Date: 2008-12-08 06:44:37 UTC
  • Revision ID: brian@tangent.org-20081208064437-cxc5pfg0vu9f13rd
Partial fix (more of replication flushed out)

Show diffs side-by-side

added added

removed removed

Lines of Context:
456
456
 
457
457
    Otherwise, we accumulate the statement
458
458
  */
 
459
 
459
460
  uint64_t const in_transaction=
460
461
    session->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN);
 
462
 
 
463
 
461
464
  if ((in_transaction && (all || (!trx_data->at_least_one_stmt && session->transaction.stmt.modified_non_trans_table))) || (!in_transaction && !all))
462
465
  {
463
466
    Query_log_event qev(session, STRING_WITH_LEN("COMMIT"), true, false);
464
467
    qev.error_code= 0; // see comment in DRIZZLE_LOG::write(Session, IO_CACHE)
465
468
    /* TODO: Fix return type */
 
469
    int error= binlog_end_trans(session, trx_data, &qev, all);
466
470
    (void)replicator_end_transaction(session, all, true);
467
 
    int error= binlog_end_trans(session, trx_data, &qev, all);
468
471
    return(error);
469
472
  }
470
473
  return(0);
491
494
  binlog_trx_data *const trx_data=
492
495
    (binlog_trx_data*) session_get_ha_data(session, binlog_hton);
493
496
 
494
 
  if (trx_data->empty()) {
 
497
  /* TODO: Fix return type */
 
498
  (void)replicator_end_transaction(session, all, false);
 
499
 
 
500
  if (trx_data->empty()) 
 
501
  {
495
502
    trx_data->reset();
 
503
 
496
504
    return(0);
497
505
  }
498
506
 
523
531
    error= binlog_end_trans(session, trx_data, 0, all);
524
532
  }
525
533
 
526
 
  /* TODO: Fix return type */
527
 
  (void)replicator_end_transaction(session, all, false);
528
 
 
529
534
  return(error);
530
535
}
531
536