~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.cc

  • Committer: Brian Aker
  • Date: 2010-09-15 19:44:18 UTC
  • mfrom: (1760.2.2 bug626566)
  • Revision ID: brian@tangent.org-20100915194418-u71po7gx1kdccu2x
Merge in Schrews, transaction message fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1072
1072
     * attach it to the transaction, and push it to replicators.
1073
1073
     */
1074
1074
    transaction->Clear();
1075
 
    initTransactionMessage(*transaction, in_session, true);
 
1075
    initTransactionMessage(*transaction, in_session, false);
1076
1076
 
1077
1077
    message::Statement *statement= transaction->add_statement();
1078
1078
 
1107
1107
  } 
1108
1108
  else if (statement != NULL)
1109
1109
  {
 
1110
    transaction= getActiveTransactionMessage(in_session);
 
1111
 
1110
1112
    /*
1111
1113
     * If we've passed our threshold for the statement size (possible for
1112
1114
     * a bulk insert), we'll finalize the Statement and Transaction (doing
1113
1115
     * the Transaction will keep it from getting huge).
1114
1116
     */
1115
 
    if (static_cast<size_t>(statement->ByteSize()) >= trx_msg_threshold)
 
1117
    if (static_cast<size_t>(transaction->ByteSize()) >= trx_msg_threshold)
1116
1118
    {
1117
1119
      message::InsertData *current_data= statement->mutable_insert_data();
1118
1120
 
1143
1145
     
1144
1146
      string current_table_name;
1145
1147
      (void) in_table->getShare()->getTableName(current_table_name);
 
1148
 
1146
1149
      if (current_table_name.compare(old_table_name))
1147
1150
      {
1148
1151
        finalizeStatementMessage(*statement, in_session);
1149
1152
        statement= in_session->getStatementMessage();
1150
1153
      }
 
1154
      else
 
1155
      {
 
1156
        /* carry forward the existing segment id */
 
1157
        const message::InsertData &current_data= statement->insert_data();
 
1158
        *next_segment_id= current_data.segment_id();
 
1159
      }
1151
1160
    }
1152
1161
  } 
1153
1162
 
1288
1297
  }
1289
1298
  else if (statement != NULL)
1290
1299
  {
 
1300
    transaction= getActiveTransactionMessage(in_session);
 
1301
 
1291
1302
    /*
1292
1303
     * If we've passed our threshold for the statement size (possible for
1293
1304
     * a bulk insert), we'll finalize the Statement and Transaction (doing
1294
1305
     * the Transaction will keep it from getting huge).
1295
1306
     */
1296
 
    if (static_cast<size_t>(statement->ByteSize()) >= trx_msg_threshold)
 
1307
    if (static_cast<size_t>(transaction->ByteSize()) >= trx_msg_threshold)
1297
1308
    {
1298
1309
      message::UpdateData *current_data= statement->mutable_update_data();
1299
1310
 
1329
1340
        finalizeStatementMessage(*statement, in_session);
1330
1341
        statement= in_session->getStatementMessage();
1331
1342
      }
 
1343
      else
 
1344
      {
 
1345
        /* carry forward the existing segment id */
 
1346
        const message::UpdateData &current_data= statement->update_data();
 
1347
        *next_segment_id= current_data.segment_id();
 
1348
      }
1332
1349
    }
1333
1350
  }
1334
1351
 
1535
1552
  }
1536
1553
  else if (statement != NULL)
1537
1554
  {
 
1555
    transaction= getActiveTransactionMessage(in_session);
 
1556
 
1538
1557
    /*
1539
1558
     * If we've passed our threshold for the statement size (possible for
1540
1559
     * a bulk insert), we'll finalize the Statement and Transaction (doing
1541
1560
     * the Transaction will keep it from getting huge).
1542
1561
     */
1543
 
    if (static_cast<size_t>(statement->ByteSize()) >= trx_msg_threshold)
 
1562
    if (static_cast<size_t>(transaction->ByteSize()) >= trx_msg_threshold)
1544
1563
    {
1545
1564
      message::DeleteData *current_data= statement->mutable_delete_data();
1546
1565
 
1576
1595
        finalizeStatementMessage(*statement, in_session);
1577
1596
        statement= in_session->getStatementMessage();
1578
1597
      }
 
1598
      else
 
1599
      {
 
1600
        /* carry forward the existing segment id */
 
1601
        const message::DeleteData &current_data= statement->delete_data();
 
1602
        *next_segment_id= current_data.segment_id();
 
1603
      }
1579
1604
    }
1580
1605
  }
1581
1606