~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/transaction_ms.cc

  • Committer: lbieber
  • Date: 2010-10-05 22:23:12 UTC
  • mfrom: (1813.1.4 build)
  • Revision ID: lbieber@orisndriz08-20101005222312-weuq0ardk3gcryau
Merge Travis - 621861 - convert structs to classes
Merge Billy - 621331 - Replace use of stringstream with boost::lexical_cast
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle
Merge Andrew - fix bug 653300 - Syntax error on inport of a SQL file produced by drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2009 PrimeBase Technologies GmbH, Germany
 
1
/* Copyright (c) 2009 PrimeBase Technologies GmbH, Germany
2
2
 *
3
3
 * PrimeBase Media Stream for MySQL
4
4
 *
28
28
 */
29
29
 
30
30
#include "cslib/CSConfig.h"
31
 
 
32
31
#include <inttypes.h>
33
32
 
34
 
#include "defs_ms.h"
35
 
 
36
33
#include "cslib/CSGlobal.h"
37
34
#include "cslib/CSStrUtil.h"
38
35
#include "cslib/CSLog.h"
39
36
 
 
37
#include "defs_ms.h"
40
38
#include "mysql_ms.h"
41
39
#include "open_table_ms.h"
42
40
#include "trans_log_ms.h"
179
177
 
180
178
void MSTransactionThread::dereference(MSTransPtr rec, MS_TxnState state)
181
179
{
 
180
        MSOpenTable             *otab;
182
181
        enter_();
183
182
        
184
183
        try_(a) {
185
 
                MSOpenTable             *otab;
186
184
                otab = MSTableList::getOpenTableByID(rec->tr_db_id, rec->tr_tab_id);
187
185
                frompool_(otab);
188
186
                otab->freeReference(rec->tr_blob_id, rec->tr_blob_ref_id);
199
197
 
200
198
void MSTransactionThread::commitReference(MSTransPtr rec, MS_TxnState state)
201
199
{
 
200
        MSOpenTable             *otab;
202
201
        enter_();
203
202
        
204
203
        try_(a) {
205
 
                MSOpenTable             *otab;
206
204
                otab = MSTableList::getOpenTableByID(rec->tr_db_id, rec->tr_tab_id);
207
205
                frompool_(otab);
208
206
                otab->commitReference(rec->tr_blob_id, rec->tr_blob_ref_id);
237
235
 
238
236
bool MSTransactionThread::doWork()
239
237
{
 
238
        MSTransRec rec = {0,0,0,0,0,0,0};
 
239
        MS_TxnState state;
240
240
        enter_();
241
241
        
242
242
        try_(a) {
243
 
                MSTransRec rec = {0,0,0,0,0,0,0};
244
 
                MS_TxnState state;
245
243
                while (!myMustQuit) {
246
244
                        // This will sleep while waiting for the next 
247
245
                        // completed transaction.
412
410
        exit_();
413
411
}
414
412
 
415
 
class MSTransactionCheckPoint: public CSString
 
413
class MSTransactionCheckPoint: public CSCString
416
414
{
417
415
        public:
418
 
        MSTransactionCheckPoint(const char *name, uint32_t stmtCount ):CSString(name)
 
416
        MSTransactionCheckPoint(const char *name, uint32_t stmtCount ):CSCString()
419
417
        {
 
418
                myCString = cs_strdup(name);
 
419
                myStrLen = strlen(name);
 
420
 
420
421
                position = stmtCount;
421
422
        }
422
423
        
441
442
void MSTransactionManager::releaseSavepoint(const char *savePoint)
442
443
{
443
444
        MSTransactionCheckPoint *checkPoint;
444
 
        CSString *name;
 
445
        CSCString *name;
445
446
        enter_();
446
447
        
447
 
        name = CSString::newString(savePoint);
 
448
        name = CSCString::newString(savePoint);
448
449
        push_(name);
449
450
 
450
451
        checkPoint = (MSTransactionCheckPoint*) self->mySavePoints.find(name);
459
460
void MSTransactionManager::rollbackTo(const char *savePoint)
460
461
{
461
462
        MSTransactionCheckPoint *checkPoint;
462
 
        CSString *name;
 
463
        CSCString *name;
463
464
        enter_();
464
465
        
465
 
        name = CSString::newString(savePoint);
 
466
        name = CSCString::newString(savePoint);
466
467
        push_(name);
467
468
 
468
469
        checkPoint = (MSTransactionCheckPoint*) self->mySavePoints.find(name);