~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.cc

  • Committer: lbieber
  • Date: 2010-09-21 21:31:00 UTC
  • mfrom: (1782.1.3 build)
  • Revision ID: lbieber@orisndriz08-20100921213100-b48hhnvgsb1qu35m
Merge Stewart - fix bug 578645 - file_io_threads is deprecated but still exists (and does no
thing)
Merge Shrews - fix bug 643905 -  Transaction ID gets set incorrectly with concurrent session
s
Merge Andrew - Enable boost filesystem requirement and fix linking requirements for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
967
967
 
968
968
  if (should_inc_trx_id)
969
969
    trx->set_transaction_id(getNextTransactionId());
970
 
  else
971
 
    trx->set_transaction_id(getCurrentTransactionId());
972
970
 
973
971
  trx->set_start_timestamp(in_session->getCurrentTimestamp());
974
972
}
1058
1056
   */
1059
1057
  if (unlikely(message::transactionContainsBulkSegment(*transaction)))
1060
1058
  {
 
1059
    /* Remember the transaction ID so we can re-use it */
 
1060
    uint64_t trx_id= transaction->transaction_context().transaction_id();
 
1061
 
1061
1062
    /*
1062
1063
     * Clear the transaction, create a Rollback statement message, 
1063
1064
     * attach it to the transaction, and push it to replicators.
1065
1066
    transaction->Clear();
1066
1067
    initTransactionMessage(*transaction, in_session, false);
1067
1068
 
 
1069
    /* Set the transaction ID to match the previous messages */
 
1070
    transaction->mutable_transaction_context()->set_transaction_id(trx_id);
 
1071
 
1068
1072
    message::Statement *statement= transaction->add_statement();
1069
1073
 
1070
1074
    initStatementMessage(*statement, message::Statement::ROLLBACK, in_session);
1107
1111
     */
1108
1112
    if (static_cast<size_t>(transaction->ByteSize()) >= trx_msg_threshold)
1109
1113
    {
 
1114
      /* Remember the transaction ID so we can re-use it */
 
1115
      uint64_t trx_id= transaction->transaction_context().transaction_id();
 
1116
 
1110
1117
      message::InsertData *current_data= statement->mutable_insert_data();
1111
1118
 
1112
1119
      /* Caller should use this value when adding a new record */
1128
1135
       */
1129
1136
      statement= in_session->getStatementMessage();
1130
1137
      transaction= getActiveTransactionMessage(in_session, false);
 
1138
      assert(transaction != NULL);
 
1139
 
 
1140
      /* Set the transaction ID to match the previous messages */
 
1141
      transaction->mutable_transaction_context()->set_transaction_id(trx_id);
1131
1142
    }
1132
1143
    else
1133
1144
    {
1297
1308
     */
1298
1309
    if (static_cast<size_t>(transaction->ByteSize()) >= trx_msg_threshold)
1299
1310
    {
 
1311
      /* Remember the transaction ID so we can re-use it */
 
1312
      uint64_t trx_id= transaction->transaction_context().transaction_id();
 
1313
 
1300
1314
      message::UpdateData *current_data= statement->mutable_update_data();
1301
1315
 
1302
1316
      /* Caller should use this value when adding a new record */
1318
1332
       */
1319
1333
      statement= in_session->getStatementMessage();
1320
1334
      transaction= getActiveTransactionMessage(in_session, false);
 
1335
      assert(transaction != NULL);
 
1336
 
 
1337
      /* Set the transaction ID to match the previous messages */
 
1338
      transaction->mutable_transaction_context()->set_transaction_id(trx_id);
1321
1339
    }
1322
1340
    else
1323
1341
    {
1552
1570
     */
1553
1571
    if (static_cast<size_t>(transaction->ByteSize()) >= trx_msg_threshold)
1554
1572
    {
 
1573
      /* Remember the transaction ID so we can re-use it */
 
1574
      uint64_t trx_id= transaction->transaction_context().transaction_id();
 
1575
 
1555
1576
      message::DeleteData *current_data= statement->mutable_delete_data();
1556
1577
 
1557
1578
      /* Caller should use this value when adding a new record */
1573
1594
       */
1574
1595
      statement= in_session->getStatementMessage();
1575
1596
      transaction= getActiveTransactionMessage(in_session, false);
 
1597
      assert(transaction != NULL);
 
1598
 
 
1599
      /* Set the transaction ID to match the previous messages */
 
1600
      transaction->mutable_transaction_context()->set_transaction_id(trx_id);
1576
1601
    }
1577
1602
    else
1578
1603
    {